Adjusting behavior of 'spawn-if-no-home'.

This commit is contained in:
KHobbits 2011-09-24 03:31:20 +01:00
parent 59c93901d3
commit bd8fe521cd

View File

@ -45,18 +45,18 @@ public class Commandhome extends EssentialsCommand
catch (NotEnoughArgumentsException e)
{
List<String> homes = u.getHomes();
if (homes.isEmpty())
if (homes.isEmpty() && u.equals(user) && ess.getSettings().spawnIfNoHome())
{
user.getTeleport().respawn(ess.getSpawn(), charge);
}
else if (homes.isEmpty())
{
throw new Exception(u == user ? Util.i18n("noHomeSet") : Util.i18n("noHomeSetPlayer"));
}
else if ((homes.size() == 1) && u == user)
else if (homes.size() == 1 && u.equals(user))
{
user.getTeleport().home(u, homes.get(0), charge);
}
else if (ess.getSettings().spawnIfNoHome())
{
user.getTeleport().respawn(ess.getSpawn(), charge);
}
else
{
user.sendMessage(Util.format("homes", Util.joinList(homes)));