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);