9
0
mirror of https://github.com/Auxilor/EcoMobs.git synced 2025-12-20 23:49:22 +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;
/**
* The movement speed.
* The movement speed multiplier.
*/
@Getter
private final int movementSpeed;
private final double movementSpeedMultiplier;
/**
* The immunity options.
@@ -257,7 +257,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");
this.movementSpeedMultiplier = this.getConfig().getInt("movement-speed");
// Spawn Totem
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.attribute.Attribute;
import org.bukkit.attribute.AttributeInstance;
import org.bukkit.attribute.AttributeModifier;
import org.bukkit.boss.BarFlag;
import org.bukkit.entity.Entity;
import org.bukkit.entity.LivingEntity;
@@ -102,7 +103,7 @@ public class LivingEcoBoss extends PluginDependent {
AttributeInstance movementSpeed = entity.getAttribute(Attribute.GENERIC_MOVEMENT_SPEED);
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);
assert maxHealth != null;

View File

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

View File

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

View File

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

View File

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