Fixed raid

This commit is contained in:
Auxilor 2022-10-17 12:42:03 +01:00
parent 22d2ab3e37
commit e51941f430
2 changed files with 8 additions and 3 deletions

View File

@ -8,6 +8,7 @@ import org.bukkit.event.EventHandler
import org.bukkit.event.EventPriority import org.bukkit.event.EventPriority
import org.bukkit.event.Listener import org.bukkit.event.Listener
import org.bukkit.event.entity.EntityShootBowEvent import org.bukkit.event.entity.EntityShootBowEvent
import kotlin.math.min
class EnchantmentRapid( class EnchantmentRapid(
plugin: EcoEnchantsPlugin plugin: EcoEnchantsPlugin
@ -38,8 +39,12 @@ class EnchantmentRapid(
return return
} }
val force = 1 / event.force val force = min(1.0 / event.force, Double.MAX_VALUE)
event.projectile.velocity = event.projectile.velocity.multiply(force) var velocity = event.projectile.velocity.multiply(force)
if (velocity.length() > 3) {
velocity = velocity.normalize().multiply(3)
}
event.projectile.velocity = velocity
} }
} }
} }

View File

@ -1,4 +1,4 @@
#libreforge-updater #libreforge-updater
#Sun Oct 16 23:28:02 BST 2022 #Sun Oct 16 23:28:02 BST 2022
version=9.0.0 version=9.0.1
plugin-name=EcoEnchants plugin-name=EcoEnchants