From bd8fe521cd07d4fb60fd973fce30db4ec41463fc Mon Sep 17 00:00:00 2001 From: KHobbits Date: Sat, 24 Sep 2011 03:31:20 +0100 Subject: [PATCH] Adjusting behavior of 'spawn-if-no-home'. --- .../earth2me/essentials/commands/Commandhome.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandhome.java b/Essentials/src/com/earth2me/essentials/commands/Commandhome.java index 2ee2661e6..16b9fca2a 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandhome.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandhome.java @@ -45,18 +45,18 @@ public class Commandhome extends EssentialsCommand catch (NotEnoughArgumentsException e) { List homes = u.getHomes(); - if (homes.isEmpty()) + if (homes.isEmpty() && u.equals(user) && ess.getSettings().spawnIfNoHome()) + { + user.getTeleport().respawn(ess.getSpawn(), charge); + } + else if (homes.isEmpty()) { throw new Exception(u == user ? Util.i18n("noHomeSet") : Util.i18n("noHomeSetPlayer")); } - else if ((homes.size() == 1) && u == user) + else if (homes.size() == 1 && u.equals(user)) { user.getTeleport().home(u, homes.get(0), charge); } - else if (ess.getSettings().spawnIfNoHome()) - { - user.getTeleport().respawn(ess.getSpawn(), charge); - } else { user.sendMessage(Util.format("homes", Util.joinList(homes)));