From 0b057d8e29a7f91e1ab27d99d9c9d4aaa53bdebf Mon Sep 17 00:00:00 2001 From: KHobbits Date: Fri, 9 Sep 2011 14:23:42 +0100 Subject: Move 'spawnifnospawn' check to home decision tree. --- Essentials/src/com/earth2me/essentials/Teleport.java | 9 +-------- Essentials/src/com/earth2me/essentials/commands/Commandhome.java | 4 ++++ 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/Essentials/src/com/earth2me/essentials/Teleport.java b/Essentials/src/com/earth2me/essentials/Teleport.java index 14574b83c..608663561 100644 --- a/Essentials/src/com/earth2me/essentials/Teleport.java +++ b/Essentials/src/com/earth2me/essentials/Teleport.java @@ -264,14 +264,7 @@ public class Teleport implements Runnable final Location loc = user.getHome(home); if (loc == null) { - if (ess.getSettings().spawnIfNoHome()) - { - respawn(ess.getSpawn(), chargeFor); - } - else - { - throw new NotEnoughArgumentsException(); - } + throw new NotEnoughArgumentsException(); } teleport(new Target(loc), chargeFor); } diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandhome.java b/Essentials/src/com/earth2me/essentials/commands/Commandhome.java index fbcaa555d..2ee2661e6 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandhome.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandhome.java @@ -53,6 +53,10 @@ public class Commandhome extends EssentialsCommand { 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))); -- cgit v1.2.3