1
0
mirror of https://github.com/essentials/Essentials.git synced 2025-02-24 08:22:56 +01:00

Don't try to spawn users who have disconnected before we have a chance to spawn them

This commit is contained in:
ementalo 2012-01-24 22:43:33 +00:00
parent 08b4b9f0b5
commit 0a05cda9bc

View File

@ -2,6 +2,7 @@ package com.earth2me.essentials.spawn;
import static com.earth2me.essentials.I18n._; import static com.earth2me.essentials.I18n._;
import com.earth2me.essentials.IEssentials; import com.earth2me.essentials.IEssentials;
import com.earth2me.essentials.OfflinePlayer;
import com.earth2me.essentials.User; import com.earth2me.essentials.User;
import java.util.logging.Level; import java.util.logging.Level;
import java.util.logging.Logger; import java.util.logging.Logger;
@ -27,7 +28,7 @@ public class EssentialsSpawnPlayerListener implements Listener
} }
public void onPlayerRespawn(final PlayerRespawnEvent event) public void onPlayerRespawn(final PlayerRespawnEvent event)
{ {
final User user = ess.getUser(event.getPlayer()); final User user = ess.getUser(event.getPlayer());
if (ess.getSettings().getRespawnAtHome()) if (ess.getSettings().getRespawnAtHome())
@ -58,7 +59,7 @@ public class EssentialsSpawnPlayerListener implements Listener
{ {
LOGGER.log(Level.FINE, "Old player join"); LOGGER.log(Level.FINE, "Old player join");
return; return;
} }
if (!"none".equalsIgnoreCase(ess.getSettings().getNewbieSpawn())) if (!"none".equalsIgnoreCase(ess.getSettings().getNewbieSpawn()))
{ {
ess.scheduleSyncDelayedTask(new NewPlayerTeleport(user), 1L); ess.scheduleSyncDelayedTask(new NewPlayerTeleport(user), 1L);
@ -68,7 +69,7 @@ public class EssentialsSpawnPlayerListener implements Listener
{ {
ess.broadcastMessage(user, ess.getSettings().getAnnounceNewPlayerFormat(user)); ess.broadcastMessage(user, ess.getSettings().getAnnounceNewPlayerFormat(user));
} }
LOGGER.log(Level.FINE, "New player join"); LOGGER.log(Level.FINE, "New player join");
} }
@ -85,6 +86,11 @@ public class EssentialsSpawnPlayerListener implements Listener
@Override @Override
public void run() public void run()
{ {
if (user.getBase() instanceof OfflinePlayer)
{
return;
}
try try
{ {
Location spawn = spawns.getSpawn(ess.getSettings().getNewbieSpawn()); Location spawn = spawns.getSpawn(ess.getSettings().getNewbieSpawn());