mirror of
https://github.com/TotalFreedomMC/TF-EssentialsX.git
synced 2025-02-11 11:49:12 +00: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:
parent
b7924d8b87
commit
bc485b5b78
1 changed files with 6 additions and 1 deletions
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue