Extra code to prevent infinite loop (part of #70)

This commit is contained in:
Jitse Boonstra 2020-04-18 10:22:06 +02:00
parent 4024312706
commit 0c8e6dc4a8
1 changed files with 5 additions and 1 deletions

View File

@ -65,7 +65,11 @@ public class PlayerListener implements Listener {
new BukkitRunnable() {
@Override
public void run() {
if (player.isOnline() && player.getLocation().equals(respawn)) {
if (!player.isOnline()) {
this.cancel();
return;
}
if (player.getLocation().equals(respawn)) {
handleMove(player);
this.cancel();
}