try improve bed spawn handle

dont act as if bed doesnt exist if its missing
This commit is contained in:
Necrodoom 2013-02-07 08:43:07 +02:00 committed by KHobbits
parent 911224dc64
commit 2a816cef7b

View File

@ -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)));
}