diff --git a/Plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/normal/Hook.java b/Plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/normal/Hook.java index 67cc92b1..7ab55967 100644 --- a/Plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/normal/Hook.java +++ b/Plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/normal/Hook.java @@ -5,6 +5,7 @@ import com.willfp.ecoenchants.enchantments.EcoEnchantBuilder; import com.willfp.ecoenchants.enchantments.EcoEnchants; import com.willfp.ecoenchants.enchantments.util.checks.EnchantChecks; import com.willfp.ecoenchants.integrations.antigrief.AntigriefManager; +import com.willfp.ecoenchants.util.VectorUtils; import org.bukkit.entity.Arrow; import org.bukkit.entity.LivingEntity; import org.bukkit.entity.Player; @@ -45,6 +46,8 @@ public class Hook extends EcoEnchant { double baseMultiplier = this.getConfig().getDouble(EcoEnchants.CONFIG_LOCATION + "velocity-multiplier"); Vector vector = player.getLocation().toVector().clone().subtract(victim.getLocation().toVector()).normalize().multiply(level * baseMultiplier); - victim.setVelocity(vector); + if(VectorUtils.isFinite(vector)) { + victim.setVelocity(vector); + } } } diff --git a/Plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/normal/Reel.java b/Plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/normal/Reel.java index 0377f314..4d4bc9e3 100644 --- a/Plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/normal/Reel.java +++ b/Plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/normal/Reel.java @@ -5,6 +5,7 @@ import com.willfp.ecoenchants.enchantments.EcoEnchantBuilder; import com.willfp.ecoenchants.enchantments.EcoEnchants; import com.willfp.ecoenchants.enchantments.util.checks.EnchantChecks; import com.willfp.ecoenchants.integrations.antigrief.AntigriefManager; +import com.willfp.ecoenchants.util.VectorUtils; import org.bukkit.entity.LivingEntity; import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; @@ -41,6 +42,8 @@ public class Reel extends EcoEnchant { double baseMultiplier = this.getConfig().getDouble(EcoEnchants.CONFIG_LOCATION + "velocity-multiplier"); Vector vector = player.getLocation().toVector().clone().subtract(victim.getLocation().toVector()).normalize().multiply(level * baseMultiplier); - victim.setVelocity(vector); + if(VectorUtils.isFinite(vector)) { + victim.setVelocity(vector); + } } }