mirror of
https://github.com/EssentialsX/Essentials.git
synced 2024-11-07 19:40:23 +01:00
Adjusting behavior of 'spawn-if-no-home'.
This commit is contained in:
parent
59c93901d3
commit
bd8fe521cd
@ -45,18 +45,18 @@ public class Commandhome extends EssentialsCommand
|
|||||||
catch (NotEnoughArgumentsException e)
|
catch (NotEnoughArgumentsException e)
|
||||||
{
|
{
|
||||||
List<String> homes = u.getHomes();
|
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"));
|
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);
|
user.getTeleport().home(u, homes.get(0), charge);
|
||||||
}
|
}
|
||||||
else if (ess.getSettings().spawnIfNoHome())
|
|
||||||
{
|
|
||||||
user.getTeleport().respawn(ess.getSpawn(), charge);
|
|
||||||
}
|
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
user.sendMessage(Util.format("homes", Util.joinList(homes)));
|
user.sendMessage(Util.format("homes", Util.joinList(homes)));
|
||||||
|
Loading…
Reference in New Issue
Block a user