1
0
mirror of https://github.com/essentials/Essentials.git synced 2025-08-06 14:46:32 +02:00

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

This commit is contained in:
KHobbits
2011-09-24 03:31:20 +01:00
parent f230439ed3
commit a819a09b6e

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