Fix player kick if home is not set on respawn.

git-svn-id: https://svn.java.net/svn/essentials~svn/trunk@1427 e251c2fe-e539-e718-e476-b85c1f46cddb
This commit is contained in:
snowleo 2011-05-13 09:18:25 +00:00
parent b7924d8b87
commit bc485b5b78
1 changed files with 6 additions and 1 deletions

View File

@ -5,6 +5,7 @@ import com.earth2me.essentials.User;
import com.earth2me.essentials.Util;
import java.util.logging.Level;
import java.util.logging.Logger;
import org.bukkit.Location;
import org.bukkit.event.player.PlayerJoinEvent;
import org.bukkit.event.player.PlayerListener;
import org.bukkit.event.player.PlayerRespawnEvent;
@ -21,7 +22,11 @@ public class EssentialsSpawnPlayerListener extends PlayerListener
{
if (Essentials.getStatic().getSettings().getRespawnAtHome())
{
event.setRespawnLocation(user.getHome());
Location home = user.getHome();
if (home == null) {
throw new Exception();
}
event.setRespawnLocation(home);
return;
}
}