mirror of
https://github.com/TotalFreedomMC/TF-EssentialsX.git
synced 2025-08-05 20:12:54 +00:00
Adjusting behavior of 'spawn-if-no-home'.
This commit is contained in:
parent
59c93901d3
commit
bd8fe521cd
1 changed files with 6 additions and 6 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue