diff --git a/eco-core/core-plugin/src/main/kotlin/com/willfp/ecoenchants/enchants/impl/EnchantmentRapid.kt b/eco-core/core-plugin/src/main/kotlin/com/willfp/ecoenchants/enchants/impl/EnchantmentRapid.kt index 167a69ec..f8c48d5f 100644 --- a/eco-core/core-plugin/src/main/kotlin/com/willfp/ecoenchants/enchants/impl/EnchantmentRapid.kt +++ b/eco-core/core-plugin/src/main/kotlin/com/willfp/ecoenchants/enchants/impl/EnchantmentRapid.kt @@ -8,6 +8,7 @@ import org.bukkit.event.EventHandler import org.bukkit.event.EventPriority import org.bukkit.event.Listener import org.bukkit.event.entity.EntityShootBowEvent +import kotlin.math.min class EnchantmentRapid( plugin: EcoEnchantsPlugin @@ -38,8 +39,12 @@ class EnchantmentRapid( return } - val force = 1 / event.force - event.projectile.velocity = event.projectile.velocity.multiply(force) + val force = min(1.0 / event.force, Double.MAX_VALUE) + var velocity = event.projectile.velocity.multiply(force) + if (velocity.length() > 3) { + velocity = velocity.normalize().multiply(3) + } + event.projectile.velocity = velocity } } } diff --git a/gradle.properties b/gradle.properties index c7e7f8a4..895f59f8 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,4 +1,4 @@ #libreforge-updater #Sun Oct 16 23:28:02 BST 2022 -version=9.0.0 +version=9.0.1 plugin-name=EcoEnchants