9
0
mirror of https://github.com/Auxilor/Reforges.git synced 2025-12-28 19:39:22 +00:00

Fixed several bugs

This commit is contained in:
Auxilor
2021-10-05 11:31:46 +01:00
parent c4cb75eb50
commit 6b2e7ea0e9
4 changed files with 10 additions and 3 deletions

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -11,6 +11,7 @@ depend:
softdepend:
- Vault
- EcoSkills
- Talismans
libraries:
- 'org.jetbrains.kotlin:kotlin-stdlib:1.5.21'