diff --git a/eco-core/core-plugin/src/main/kotlin/com/willfp/reforges/effects/effects/EffectAttackSpeedMultiplier.kt b/eco-core/core-plugin/src/main/kotlin/com/willfp/reforges/effects/effects/EffectAttackSpeedMultiplier.kt index f66c255..4197d17 100644 --- a/eco-core/core-plugin/src/main/kotlin/com/willfp/reforges/effects/effects/EffectAttackSpeedMultiplier.kt +++ b/eco-core/core-plugin/src/main/kotlin/com/willfp/reforges/effects/effects/EffectAttackSpeedMultiplier.kt @@ -10,9 +10,11 @@ import org.bukkit.entity.Player class EffectAttackSpeedMultiplier : Effect("attack_speed_multiplier") { override fun handleEnable(player: Player, config: JSONConfig) { val attribute = player.getAttribute(Attribute.GENERIC_ATTACK_SPEED) ?: return + val uuid = this.getUUID(player.getEffectAmount(this)) + attribute.removeModifier(AttributeModifier(uuid, this.id, 0.0, AttributeModifier.Operation.MULTIPLY_SCALAR_1)) attribute.addModifier( AttributeModifier( - this.getUUID(player.getEffectAmount(this)), + uuid, this.id, config.getDouble("multiplier") - 1, AttributeModifier.Operation.MULTIPLY_SCALAR_1 diff --git a/eco-core/core-plugin/src/main/kotlin/com/willfp/reforges/effects/effects/EffectKnockbackMultiplier.kt b/eco-core/core-plugin/src/main/kotlin/com/willfp/reforges/effects/effects/EffectKnockbackMultiplier.kt index 0f67c7a..0cea420 100644 --- a/eco-core/core-plugin/src/main/kotlin/com/willfp/reforges/effects/effects/EffectKnockbackMultiplier.kt +++ b/eco-core/core-plugin/src/main/kotlin/com/willfp/reforges/effects/effects/EffectKnockbackMultiplier.kt @@ -13,9 +13,11 @@ class EffectKnockbackMultiplier : Effect("knockback_multiplier") { config: JSONConfig ) { val attribute = player.getAttribute(Attribute.GENERIC_ATTACK_KNOCKBACK) ?: return + val uuid = this.getUUID(player.getEffectAmount(this)) + attribute.removeModifier(AttributeModifier(uuid, this.id, 0.0, AttributeModifier.Operation.MULTIPLY_SCALAR_1)) attribute.addModifier( AttributeModifier( - this.getUUID(player.getEffectAmount(this)), + uuid, this.id, config.getDouble("multiplier") - 1, AttributeModifier.Operation.MULTIPLY_SCALAR_1 diff --git a/eco-core/core-plugin/src/main/kotlin/com/willfp/reforges/effects/effects/EffectMovementSpeedMultiplier.kt b/eco-core/core-plugin/src/main/kotlin/com/willfp/reforges/effects/effects/EffectMovementSpeedMultiplier.kt index a64132f..2f40ded 100644 --- a/eco-core/core-plugin/src/main/kotlin/com/willfp/reforges/effects/effects/EffectMovementSpeedMultiplier.kt +++ b/eco-core/core-plugin/src/main/kotlin/com/willfp/reforges/effects/effects/EffectMovementSpeedMultiplier.kt @@ -13,9 +13,11 @@ class EffectMovementSpeedMultiplier : Effect("movement_speed_multiplier") { config: JSONConfig ) { val attribute = player.getAttribute(Attribute.GENERIC_MOVEMENT_SPEED) ?: return + val uuid = this.getUUID(player.getEffectAmount(this)) + attribute.removeModifier(AttributeModifier(uuid, this.id, 0.0, AttributeModifier.Operation.MULTIPLY_SCALAR_1)) attribute.addModifier( AttributeModifier( - this.getUUID(player.getEffectAmount(this)), + uuid, this.id, config.getDouble("multiplier") - 1, AttributeModifier.Operation.MULTIPLY_SCALAR_1 diff --git a/eco-core/core-plugin/src/main/resources/plugin.yml b/eco-core/core-plugin/src/main/resources/plugin.yml index 678ec8c..7ec3514 100644 --- a/eco-core/core-plugin/src/main/resources/plugin.yml +++ b/eco-core/core-plugin/src/main/resources/plugin.yml @@ -11,6 +11,7 @@ depend: softdepend: - Vault - EcoSkills + - Talismans libraries: - 'org.jetbrains.kotlin:kotlin-stdlib:1.5.21'