diff options
author | snowleo <snowleo@e251c2fe-e539-e718-e476-b85c1f46cddb> | 2011-05-13 09:18:25 +0000 |
---|---|---|
committer | snowleo <snowleo@e251c2fe-e539-e718-e476-b85c1f46cddb> | 2011-05-13 09:18:25 +0000 |
commit | bc485b5b78a0ce9945d299a3a42e0ae0e8d4cd8c (patch) | |
tree | e47b3b3f876f62210c20c10bf35eb9033a075844 /EssentialsSpawn | |
parent | b7924d8b87d4f56c07712e072c4edc1b25b7e72a (diff) | |
download | Essentials-bc485b5b78a0ce9945d299a3a42e0ae0e8d4cd8c.tar Essentials-bc485b5b78a0ce9945d299a3a42e0ae0e8d4cd8c.tar.gz Essentials-bc485b5b78a0ce9945d299a3a42e0ae0e8d4cd8c.tar.lz Essentials-bc485b5b78a0ce9945d299a3a42e0ae0e8d4cd8c.tar.xz Essentials-bc485b5b78a0ce9945d299a3a42e0ae0e8d4cd8c.zip |
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
Diffstat (limited to 'EssentialsSpawn')
-rw-r--r-- | EssentialsSpawn/src/com/earth2me/essentials/spawn/EssentialsSpawnPlayerListener.java | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/EssentialsSpawn/src/com/earth2me/essentials/spawn/EssentialsSpawnPlayerListener.java b/EssentialsSpawn/src/com/earth2me/essentials/spawn/EssentialsSpawnPlayerListener.java index 1ec1ffcaa..1531f4220 100644 --- a/EssentialsSpawn/src/com/earth2me/essentials/spawn/EssentialsSpawnPlayerListener.java +++ b/EssentialsSpawn/src/com/earth2me/essentials/spawn/EssentialsSpawnPlayerListener.java @@ -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; } } |