mirror of
https://github.com/essentials/Essentials.git
synced 2025-08-09 16:17:37 +02:00
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:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user