From 5ca8381482f26f93a9d3ee9f4a5b316ead87c725 Mon Sep 17 00:00:00 2001 From: yoyosource Date: Sat, 8 Apr 2023 15:17:15 +0200 Subject: [PATCH] Hotfix GhostJumpAndRun --- src/de/steamwar/lobby/jumpandrun/GhostJumpAndRun.java | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/de/steamwar/lobby/jumpandrun/GhostJumpAndRun.java b/src/de/steamwar/lobby/jumpandrun/GhostJumpAndRun.java index f937c20..e448f89 100644 --- a/src/de/steamwar/lobby/jumpandrun/GhostJumpAndRun.java +++ b/src/de/steamwar/lobby/jumpandrun/GhostJumpAndRun.java @@ -124,7 +124,7 @@ public class GhostJumpAndRun implements Listener { replayRunnable = new BukkitRunnable() { @Override public void run() { - if (!iterator.hasNext()) { + if (!iterator.hasNext() || entityPlayer == null) { replayRunnable.cancel(); replayRunnable = null; entityServer.close(); @@ -132,9 +132,7 @@ public class GhostJumpAndRun implements Listener { entityPlayer = null; return; } - if (entityPlayer != null) { - entityPlayer.move(iterator.next().toLocation(player.getWorld())); - } + entityPlayer.move(iterator.next().toLocation(player.getWorld())); } }; replayRunnable.runTaskTimer(LobbySystem.getPlugin(), 1, 2);