diff options
author | ementalo <suror@gmx.co.uk> | 2012-01-24 22:43:33 +0000 |
---|---|---|
committer | ementalo <suror@gmx.co.uk> | 2012-01-24 22:43:33 +0000 |
commit | 593cb8d56ef9b942d0b2664653f0e3ec0a01a69c (patch) | |
tree | 025861036ddd31094ad0a24450cd91aae41686e4 /EssentialsSpawn/src | |
parent | 0ea41d9169208b897c82b5ec45e641a9e1f9aaf1 (diff) | |
download | Essentials-593cb8d56ef9b942d0b2664653f0e3ec0a01a69c.tar Essentials-593cb8d56ef9b942d0b2664653f0e3ec0a01a69c.tar.gz Essentials-593cb8d56ef9b942d0b2664653f0e3ec0a01a69c.tar.lz Essentials-593cb8d56ef9b942d0b2664653f0e3ec0a01a69c.tar.xz Essentials-593cb8d56ef9b942d0b2664653f0e3ec0a01a69c.zip |
Don't try to spawn users who have disconnected before we have a chance to spawn them
Diffstat (limited to 'EssentialsSpawn/src')
-rw-r--r-- | EssentialsSpawn/src/com/earth2me/essentials/spawn/EssentialsSpawnPlayerListener.java | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/EssentialsSpawn/src/com/earth2me/essentials/spawn/EssentialsSpawnPlayerListener.java b/EssentialsSpawn/src/com/earth2me/essentials/spawn/EssentialsSpawnPlayerListener.java index 2814714a2..7ec9ee043 100644 --- a/EssentialsSpawn/src/com/earth2me/essentials/spawn/EssentialsSpawnPlayerListener.java +++ b/EssentialsSpawn/src/com/earth2me/essentials/spawn/EssentialsSpawnPlayerListener.java @@ -2,6 +2,7 @@ package com.earth2me.essentials.spawn; import static com.earth2me.essentials.I18n._; import com.earth2me.essentials.IEssentials; +import com.earth2me.essentials.OfflinePlayer; import com.earth2me.essentials.User; import java.util.logging.Level; import java.util.logging.Logger; @@ -27,7 +28,7 @@ public class EssentialsSpawnPlayerListener implements Listener } public void onPlayerRespawn(final PlayerRespawnEvent event) - { + { final User user = ess.getUser(event.getPlayer()); if (ess.getSettings().getRespawnAtHome()) @@ -58,7 +59,7 @@ public class EssentialsSpawnPlayerListener implements Listener { LOGGER.log(Level.FINE, "Old player join"); return; - } + } if (!"none".equalsIgnoreCase(ess.getSettings().getNewbieSpawn())) { ess.scheduleSyncDelayedTask(new NewPlayerTeleport(user), 1L); @@ -68,7 +69,7 @@ public class EssentialsSpawnPlayerListener implements Listener { ess.broadcastMessage(user, ess.getSettings().getAnnounceNewPlayerFormat(user)); } - + LOGGER.log(Level.FINE, "New player join"); } @@ -85,6 +86,11 @@ public class EssentialsSpawnPlayerListener implements Listener @Override public void run() { + if (user.getBase() instanceof OfflinePlayer) + { + return; + } + try { Location spawn = spawns.getSpawn(ess.getSettings().getNewbieSpawn()); |