From eb165ec8d51cf7071675b92cebafcf6c9bef0eec Mon Sep 17 00:00:00 2001 From: sovdee <10354869+sovdeeth@users.noreply.github.com> Date: Tue, 31 Oct 2023 18:50:42 -0700 Subject: [PATCH] Update EffPush.java --- src/main/java/ch/njol/skript/effects/EffPush.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/main/java/ch/njol/skript/effects/EffPush.java b/src/main/java/ch/njol/skript/effects/EffPush.java index c248a51acf4..8cda4d62ffe 100644 --- a/src/main/java/ch/njol/skript/effects/EffPush.java +++ b/src/main/java/ch/njol/skript/effects/EffPush.java @@ -77,6 +77,10 @@ protected void execute(final Event e) { final Vector mod = d.getDirection(en); if (v != null) mod.normalize().multiply(v.doubleValue()); + if (!(Double.isFinite(mod.getX()) && Double.isFinite(mod.getY()) && Double.isFinite(mod.getZ()))) { + // Some component of the mod vector is not finite, so just stop + return; + } en.setVelocity(en.getVelocity().add(mod)); // REMIND add NoCheatPlus exception to players } }