summaryrefslogtreecommitdiffstats
path: root/Essentials/src/com/earth2me/essentials/commands/Commandhome.java
diff options
context:
space:
mode:
Diffstat (limited to 'Essentials/src/com/earth2me/essentials/commands/Commandhome.java')
-rw-r--r--Essentials/src/com/earth2me/essentials/commands/Commandhome.java13
1 files changed, 3 insertions, 10 deletions
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandhome.java b/Essentials/src/com/earth2me/essentials/commands/Commandhome.java
index 546bfc85d..a5d355415 100644
--- a/Essentials/src/com/earth2me/essentials/commands/Commandhome.java
+++ b/Essentials/src/com/earth2me/essentials/commands/Commandhome.java
@@ -23,7 +23,6 @@ public class Commandhome extends EssentialsCommand
public void run(final Server server, final User user, final String commandLabel, final String[] args) throws Exception
{
final Trade charge = new Trade(this.getName(), ess);
- charge.isAffordableFor(user);
User player = user;
String homeName = "";
String[] nameParts;
@@ -45,7 +44,7 @@ public class Commandhome extends EssentialsCommand
}
try
{
- if ("bed".equalsIgnoreCase(homeName))
+ if ("bed".equalsIgnoreCase(homeName) && user.isAuthorized("essentials.home.bed"))
{
final Location bed = player.getBedSpawnLocation();
if (bed != null && bed.getBlock().getType() == Material.BED_BLOCK)
@@ -66,17 +65,11 @@ public class Commandhome extends EssentialsCommand
final List<String> homes = player.getHomes();
if (homes.isEmpty() && player.equals(user))
{
- if (bed != null)
- {
- user.getTeleport().teleport(bed, charge, TeleportCause.COMMAND);
- throw new NoChargeException();
- }
user.getTeleport().respawn(charge, TeleportCause.COMMAND);
-
}
else if (homes.isEmpty())
{
- throw new Exception(player == user ? _("noHomeSet") : _("noHomeSetPlayer"));
+ throw new Exception(_("noHomeSetPlayer"));
}
else if (homes.size() == 1 && player.equals(user))
{
@@ -84,7 +77,7 @@ public class Commandhome extends EssentialsCommand
}
else
{
- if (bed != null)
+ if (bed != null && user.isAuthorized("essentials.home.bed"))
{
homes.add("bed");
}