From cfc0fd075d636043f3b0e6e79ec1413906def2a0 Mon Sep 17 00:00:00 2001 From: Auxilor Date: Fri, 2 Apr 2021 11:12:54 +0100 Subject: [PATCH] Added follow range --- .../main/java/com/willfp/ecobosses/bosses/EcoBoss.java | 8 ++++++++ .../java/com/willfp/ecobosses/bosses/LivingEcoBoss.java | 4 ++++ .../core-plugin/src/main/resources/bosses/alpha_wolf.yml | 1 + .../core-plugin/src/main/resources/bosses/illusioner.yml | 1 + .../core-plugin/src/main/resources/bosses/steel_golem.yml | 1 + .../core-plugin/src/main/resources/bosses/tarantula.yml | 1 + 6 files changed, 16 insertions(+) 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 30d3d23..f04c81c 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 @@ -97,6 +97,13 @@ public class EcoBoss extends PluginDependent { @Getter private final int attackDamage; + + /** + * The follow range. + */ + @Getter + private final double followRange; + /** * The movement speed multiplier. */ @@ -269,6 +276,7 @@ public class EcoBoss extends PluginDependent { // Attributes this.attackDamage = this.getConfig().getInt("attack-damage"); this.maxHealth = this.getConfig().getInt("max-health"); + this.followRange = this.getConfig().getInt("follow-range"); this.movementSpeedMultiplier = this.getConfig().getInt("movement-speed"); // Spawn Totem diff --git a/eco-core/core-plugin/src/main/java/com/willfp/ecobosses/bosses/LivingEcoBoss.java b/eco-core/core-plugin/src/main/java/com/willfp/ecobosses/bosses/LivingEcoBoss.java index c1433b2..9ee4d0c 100644 --- a/eco-core/core-plugin/src/main/java/com/willfp/ecobosses/bosses/LivingEcoBoss.java +++ b/eco-core/core-plugin/src/main/java/com/willfp/ecobosses/bosses/LivingEcoBoss.java @@ -111,6 +111,10 @@ public class LivingEcoBoss extends PluginDependent { entity.setHealth(maxHealth.getValue()); + AttributeInstance followRange = entity.getAttribute(Attribute.GENERIC_FOLLOW_RANGE); + assert followRange != null; + followRange.setBaseValue(boss.getFollowRange()); + AttributeInstance attackDamage = entity.getAttribute(Attribute.GENERIC_ATTACK_DAMAGE); assert attackDamage != null; attackDamage.setBaseValue(boss.getAttackDamage()); diff --git a/eco-core/core-plugin/src/main/resources/bosses/alpha_wolf.yml b/eco-core/core-plugin/src/main/resources/bosses/alpha_wolf.yml index 5fe7f57..44a27d6 100644 --- a/eco-core/core-plugin/src/main/resources/bosses/alpha_wolf.yml +++ b/eco-core/core-plugin/src/main/resources/bosses/alpha_wolf.yml @@ -11,6 +11,7 @@ bossbar: max-health: 900 attack-damage: 60 movement-speed: 2 +follow-range: 15 spawn-totem: enabled: true 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 83c599c..dcc451a 100644 --- a/eco-core/core-plugin/src/main/resources/bosses/illusioner.yml +++ b/eco-core/core-plugin/src/main/resources/bosses/illusioner.yml @@ -11,6 +11,7 @@ bossbar: max-health: 600 attack-damage: 50 movement-speed: 1.2 +follow-range: 20 spawn-totem: enabled: true diff --git a/eco-core/core-plugin/src/main/resources/bosses/steel_golem.yml b/eco-core/core-plugin/src/main/resources/bosses/steel_golem.yml index 44a416e..086084b 100644 --- a/eco-core/core-plugin/src/main/resources/bosses/steel_golem.yml +++ b/eco-core/core-plugin/src/main/resources/bosses/steel_golem.yml @@ -11,6 +11,7 @@ bossbar: max-health: 2400 attack-damage: 120 movement-speed: 1.5 +follow-range: 16 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 e332a75..c7608b7 100644 --- a/eco-core/core-plugin/src/main/resources/bosses/tarantula.yml +++ b/eco-core/core-plugin/src/main/resources/bosses/tarantula.yml @@ -11,6 +11,7 @@ bossbar: max-health: 1200 attack-damage: 80 movement-speed: 1.3 +follow-range: 15 spawn-totem: enabled: true