浏览代码

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.

nossr50 14 年之前
父节点
当前提交
10896d4b16
共有 1 个文件被更改,包括 2 次插入1 次删除
  1. 2 1
      vMinecraftListener.java

+ 2 - 1
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");