From 10896d4b16e809e0cfdf27318d55497564e434e2 Mon Sep 17 00:00:00 2001 From: nossr50 Date: Fri, 31 Dec 2010 10:45:31 -0800 Subject: [PATCH] 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. --- vMinecraftListener.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/vMinecraftListener.java b/vMinecraftListener.java index 254cf33f5..851c5b39c 100644 --- a/vMinecraftListener.java +++ b/vMinecraftListener.java @@ -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");