9
0
mirror of https://github.com/Auxilor/EcoMobs.git synced 2025-12-21 16:09:24 +00:00

Changed movement speed to multiplier

This commit is contained in:
Auxilor
2021-04-01 14:18:02 +01:00
parent 7eb7e7926c
commit f7276003d4
6 changed files with 9 additions and 8 deletions

View File

@@ -98,10 +98,10 @@ public class EcoBoss extends PluginDependent {
private final int attackDamage; private final int attackDamage;
/** /**
* The movement speed. * The movement speed multiplier.
*/ */
@Getter @Getter
private final int movementSpeed; private final double movementSpeedMultiplier;
/** /**
* The immunity options. * The immunity options.
@@ -257,7 +257,7 @@ public class EcoBoss extends PluginDependent {
// Attributes // Attributes
this.attackDamage = this.getConfig().getInt("attack-damage"); this.attackDamage = this.getConfig().getInt("attack-damage");
this.maxHealth = this.getConfig().getInt("max-health"); this.maxHealth = this.getConfig().getInt("max-health");
this.movementSpeed = this.getConfig().getInt("movement-speed"); this.movementSpeedMultiplier = this.getConfig().getInt("movement-speed");
// Spawn Totem // Spawn Totem
this.spawnTotemEnabled = this.getConfig().getBool("spawn-totem.enabled"); this.spawnTotemEnabled = this.getConfig().getBool("spawn-totem.enabled");

View File

@@ -18,6 +18,7 @@ import org.bukkit.Material;
import org.bukkit.Sound; import org.bukkit.Sound;
import org.bukkit.attribute.Attribute; import org.bukkit.attribute.Attribute;
import org.bukkit.attribute.AttributeInstance; import org.bukkit.attribute.AttributeInstance;
import org.bukkit.attribute.AttributeModifier;
import org.bukkit.boss.BarFlag; import org.bukkit.boss.BarFlag;
import org.bukkit.entity.Entity; import org.bukkit.entity.Entity;
import org.bukkit.entity.LivingEntity; import org.bukkit.entity.LivingEntity;
@@ -102,7 +103,7 @@ public class LivingEcoBoss extends PluginDependent {
AttributeInstance movementSpeed = entity.getAttribute(Attribute.GENERIC_MOVEMENT_SPEED); AttributeInstance movementSpeed = entity.getAttribute(Attribute.GENERIC_MOVEMENT_SPEED);
assert movementSpeed != null; assert movementSpeed != null;
movementSpeed.setBaseValue(boss.getMovementSpeed()); movementSpeed.addModifier(new AttributeModifier(entity.getUniqueId(), "ecobosses-movement-multiplier", boss.getMovementSpeedMultiplier() - 1, AttributeModifier.Operation.MULTIPLY_SCALAR_1));
AttributeInstance maxHealth = entity.getAttribute(Attribute.GENERIC_MAX_HEALTH); AttributeInstance maxHealth = entity.getAttribute(Attribute.GENERIC_MAX_HEALTH);
assert maxHealth != null; assert maxHealth != null;

View File

@@ -10,7 +10,7 @@ bossbar:
max-health: 900 max-health: 900
attack-damage: 60 attack-damage: 60
movement-speed: 1.1 movement-speed: 2
spawn-totem: spawn-totem:
enabled: true enabled: true

View File

@@ -10,7 +10,7 @@ bossbar:
max-health: 600 max-health: 600
attack-damage: 50 attack-damage: 50
movement-speed: 0.6 movement-speed: 1.2
spawn-totem: spawn-totem:
enabled: true enabled: true

View File

@@ -10,7 +10,7 @@ bossbar:
max-health: 2400 max-health: 2400
attack-damage: 120 attack-damage: 120
movement-speed: 0.2 movement-speed: 1.5
spawn-totem: spawn-totem:
enabled: true enabled: true

View File

@@ -10,7 +10,7 @@ bossbar:
max-health: 1200 max-health: 1200
attack-damage: 80 attack-damage: 80
movement-speed: 0.9 movement-speed: 1.3
spawn-totem: spawn-totem:
enabled: true enabled: true