summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKHobbits <rob@khobbits.co.uk>2012-01-28 01:39:51 +0000
committerKHobbits <rob@khobbits.co.uk>2012-01-28 01:39:51 +0000
commit2f96c9763f3d0a80fe0385768fbc814faf4035bb (patch)
treea424a03705cc9dcd58368a8974cf008d17eccfc5
parent137b60c5f2385d7085fec072a7a6c0115274aaa1 (diff)
downloadEssentials-2f96c9763f3d0a80fe0385768fbc814faf4035bb.tar
Essentials-2f96c9763f3d0a80fe0385768fbc814faf4035bb.tar.gz
Essentials-2f96c9763f3d0a80fe0385768fbc814faf4035bb.tar.lz
Essentials-2f96c9763f3d0a80fe0385768fbc814faf4035bb.tar.xz
Essentials-2f96c9763f3d0a80fe0385768fbc814faf4035bb.zip
Only list bed home if it is set.
-rw-r--r--Essentials/src/com/earth2me/essentials/commands/Commandhome.java13
1 files changed, 10 insertions, 3 deletions
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandhome.java b/Essentials/src/com/earth2me/essentials/commands/Commandhome.java
index 2bd09468e..ebe57adf7 100644
--- a/Essentials/src/com/earth2me/essentials/commands/Commandhome.java
+++ b/Essentials/src/com/earth2me/essentials/commands/Commandhome.java
@@ -58,11 +58,15 @@ public class Commandhome extends EssentialsCommand
}
catch (NotEnoughArgumentsException e)
{
+ Location bed = player.getBedSpawnLocation();
+ if (bed != null && bed.getBlock().getType() != Material.BED_BLOCK)
+ {
+ bed = null;
+ }
final List<String> homes = player.getHomes();
if (homes.isEmpty() && player.equals(user))
{
- final Location bed = player.getBedSpawnLocation();
- if (bed != null && bed.getBlock().getType() == Material.BED_BLOCK)
+ if (bed != null)
{
user.getTeleport().teleport(bed, charge, TeleportCause.COMMAND);
throw new NoChargeException();
@@ -80,7 +84,10 @@ public class Commandhome extends EssentialsCommand
}
else
{
- homes.add("bed");
+ if (bed != null)
+ {
+ homes.add("bed");
+ }
user.sendMessage(_("homes", Util.joinList(homes)));
}
}