mirror of
https://github.com/Auxilor/EcoEnchants.git
synced 2024-11-25 15:35:11 +01:00
Fixed raid
This commit is contained in:
parent
22d2ab3e37
commit
e51941f430
@ -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
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -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
|
||||||
|
Loading…
Reference in New Issue
Block a user