mirror of
https://github.com/EssentialsX/Essentials.git
synced 2024-12-26 02:58:03 +01:00
Only list bed home if it is set.
This commit is contained in:
parent
137b60c5f2
commit
2f96c9763f
@ -58,11 +58,15 @@ public class Commandhome extends EssentialsCommand
|
|||||||
}
|
}
|
||||||
catch (NotEnoughArgumentsException e)
|
catch (NotEnoughArgumentsException e)
|
||||||
{
|
{
|
||||||
|
Location bed = player.getBedSpawnLocation();
|
||||||
|
if (bed != null && bed.getBlock().getType() != Material.BED_BLOCK)
|
||||||
|
{
|
||||||
|
bed = null;
|
||||||
|
}
|
||||||
final List<String> homes = player.getHomes();
|
final List<String> homes = player.getHomes();
|
||||||
if (homes.isEmpty() && player.equals(user))
|
if (homes.isEmpty() && player.equals(user))
|
||||||
{
|
{
|
||||||
final Location bed = player.getBedSpawnLocation();
|
if (bed != null)
|
||||||
if (bed != null && bed.getBlock().getType() == Material.BED_BLOCK)
|
|
||||||
{
|
{
|
||||||
user.getTeleport().teleport(bed, charge, TeleportCause.COMMAND);
|
user.getTeleport().teleport(bed, charge, TeleportCause.COMMAND);
|
||||||
throw new NoChargeException();
|
throw new NoChargeException();
|
||||||
@ -79,8 +83,11 @@ public class Commandhome extends EssentialsCommand
|
|||||||
user.getTeleport().home(player, homes.get(0), charge);
|
user.getTeleport().home(player, homes.get(0), charge);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
{
|
||||||
|
if (bed != null)
|
||||||
{
|
{
|
||||||
homes.add("bed");
|
homes.add("bed");
|
||||||
|
}
|
||||||
user.sendMessage(_("homes", Util.joinList(homes)));
|
user.sendMessage(_("homes", Util.joinList(homes)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user