Added checks when moving a player to their home to make sure they even have a home first. This should take care of some onHealthChange error hooks I got earlier.

This commit is contained in:
nossr50 2010-12-31 10:45:31 -08:00
parent 3e076d3951
commit 10896d4b16

View File

@ -95,9 +95,10 @@ public class vMinecraftListener extends PluginListener {
if(vMinecraftSettings.getInstance().playerspawn())
{
Warp home = null;
if (etc.getDataSource().getHome(player.getName()) != null){
home = etc.getDataSource().getHome(player.getName());
if(home.Location != null)
player.teleportTo(home.Location);
}
//Makes sure the player has a custom home before telling them about /myspawn
if(etc.getServer().getSpawnLocation() != etc.getDataSource().getHome(player.getName()).Location){
vMinecraftChat.sendMessage(player, Colors.DarkPurple + "Return here with /myspawn, the penalty for returning is the complete loss of inventory");