From 2a816cef7b289c550a8c80cda53e67bfbd10a2e0 Mon Sep 17 00:00:00 2001 From: Necrodoom Date: Thu, 7 Feb 2013 08:43:07 +0200 Subject: [PATCH] try improve bed spawn handle dont act as if bed doesnt exist if its missing --- .../earth2me/essentials/commands/Commandhome.java | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandhome.java b/Essentials/src/com/earth2me/essentials/commands/Commandhome.java index c7a5dcd87..c2a796857 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandhome.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandhome.java @@ -52,6 +52,10 @@ public class Commandhome extends EssentialsCommand user.getTeleport().teleport(bed, charge, TeleportCause.COMMAND); throw new NoChargeException(); } + else + { + throw new Exception(_("bedmissing")); + } } goHome(user, player, homeName.toLowerCase(Locale.ENGLISH), charge); } @@ -73,9 +77,16 @@ public class Commandhome extends EssentialsCommand } else { - if (bed != null && user.isAuthorized("essentials.home.bed")) + if (user.isAuthorized("essentials.home.bed")) { - homes.add(_("bed")); + if (bed != null) + { + homes.add(_("bed")); + } + else + { + homes.add(_("bednull")); + } } user.sendMessage(_("homes", Util.joinList(homes))); }