9
0
mirror of https://github.com/Auxilor/EcoSkills.git synced 2026-01-01 21:36:34 +00:00

Hopefully fixed speed bug

This commit is contained in:
Auxilor
2021-08-27 16:31:19 +01:00
parent 8da5eee425
commit 3c0b33b09f

View File

@@ -13,13 +13,13 @@ class StatSpeed : Stat(
val modifier = AttributeModifier(
this.uuid,
this.name,
(this.config.getDouble("percent-faster-per-level") * player.getStatLevel(this)) / 100,
(this.config.getDouble("percent-faster-per-level") * player.getStatLevel(this)) / 100.0,
AttributeModifier.Operation.MULTIPLY_SCALAR_1
)
val instance = player.getAttribute(Attribute.GENERIC_MOVEMENT_SPEED) ?: return
instance.removeModifier(modifier)
plugin.scheduler.runLater({
plugin.scheduler.run {
val instance = player.getAttribute(Attribute.GENERIC_MOVEMENT_SPEED) ?: return@run
instance.removeModifier(modifier)
instance.addModifier(modifier)
}, 1)
}
}
}