From 01cd2cdbef63367c5089e53902ce19c776f664fc Mon Sep 17 00:00:00 2001 From: Auxilor Date: Sat, 13 Mar 2021 14:25:26 +0000 Subject: [PATCH] Added movement speed options --- .../java/com/willfp/ecobosses/bosses/EcoBoss.java | 11 +++++++++++ .../src/main/resources/bosses/illusioner.yml | 1 + .../src/main/resources/bosses/tarantula.yml | 3 ++- 3 files changed, 14 insertions(+), 1 deletion(-) diff --git a/eco-core/core-plugin/src/main/java/com/willfp/ecobosses/bosses/EcoBoss.java b/eco-core/core-plugin/src/main/java/com/willfp/ecobosses/bosses/EcoBoss.java index c3cee49..f05dee8 100644 --- a/eco-core/core-plugin/src/main/java/com/willfp/ecobosses/bosses/EcoBoss.java +++ b/eco-core/core-plugin/src/main/java/com/willfp/ecobosses/bosses/EcoBoss.java @@ -116,6 +116,12 @@ public class EcoBoss extends PluginDependent { @Getter private final int attackDamage; + /** + * The movement speed. + */ + @Getter + private final int movementSpeed; + /** * The immunity options. */ @@ -253,6 +259,7 @@ public class EcoBoss extends PluginDependent { // Attributes this.attackDamage = this.getConfig().getInt("attack-damage"); this.maxHealth = this.getConfig().getInt("max-health"); + this.movementSpeed = this.getConfig().getInt("movement-speed"); // Spawn Totem this.spawnTotemEnabled = this.getConfig().getBool("spawn-totem.enabled"); @@ -450,6 +457,10 @@ public class EcoBoss extends PluginDependent { entity.setCustomName(this.getDisplayName()); entity.setCustomNameVisible(true); + AttributeInstance movementSpeed = entity.getAttribute(Attribute.GENERIC_MOVEMENT_SPEED); + assert movementSpeed != null; + movementSpeed.setBaseValue(this.getMovementSpeed()); + AttributeInstance maxHealth = entity.getAttribute(Attribute.GENERIC_MAX_HEALTH); assert maxHealth != null; maxHealth.setBaseValue(this.getMaxHealth()); diff --git a/eco-core/core-plugin/src/main/resources/bosses/illusioner.yml b/eco-core/core-plugin/src/main/resources/bosses/illusioner.yml index c91cc4e..fa1a1b7 100644 --- a/eco-core/core-plugin/src/main/resources/bosses/illusioner.yml +++ b/eco-core/core-plugin/src/main/resources/bosses/illusioner.yml @@ -10,6 +10,7 @@ bossbar: max-health: 600 attack-damage: 50 +movement-speed: 0.6 spawn-totem: enabled: true diff --git a/eco-core/core-plugin/src/main/resources/bosses/tarantula.yml b/eco-core/core-plugin/src/main/resources/bosses/tarantula.yml index 6031c3e..b6c23b4 100644 --- a/eco-core/core-plugin/src/main/resources/bosses/tarantula.yml +++ b/eco-core/core-plugin/src/main/resources/bosses/tarantula.yml @@ -8,8 +8,9 @@ bossbar: color: RED # Choose from: BLUE, GREEN, PINK, PURPLE, RED, WHITE, YELLOW style: SOLID # Choose from: SOLID, SEGMENTED_6, SEGMENTED_10, SEGMENTED_12, SEGMENTED_20 -max-health: 900 +max-health: 1200 attack-damage: 80 +movement-speed: 0.8 spawn-totem: enabled: true