mirror of
https://github.com/essentials/Essentials.git
synced 2025-08-12 01:25:26 +02:00
Move 'spawnifnospawn' check to home decision tree.
This commit is contained in:
@@ -263,16 +263,9 @@ public class Teleport implements Runnable
|
|||||||
{
|
{
|
||||||
final Location loc = user.getHome(home);
|
final Location loc = user.getHome(home);
|
||||||
if (loc == null)
|
if (loc == null)
|
||||||
{
|
|
||||||
if (ess.getSettings().spawnIfNoHome())
|
|
||||||
{
|
|
||||||
respawn(ess.getSpawn(), chargeFor);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
{
|
||||||
throw new NotEnoughArgumentsException();
|
throw new NotEnoughArgumentsException();
|
||||||
}
|
}
|
||||||
}
|
|
||||||
teleport(new Target(loc), chargeFor);
|
teleport(new Target(loc), chargeFor);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -53,6 +53,10 @@ public class Commandhome extends EssentialsCommand
|
|||||||
{
|
{
|
||||||
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)));
|
||||||
|
Reference in New Issue
Block a user