mirror of
https://github.com/EssentialsX/Essentials.git
synced 2025-02-03 05:51:22 +01:00
Fix home functionality bugs:
/home not using bed when enabled /home not giving teleport warning
This commit is contained in:
parent
0755fbf089
commit
03445e5b9b
@ -119,10 +119,12 @@ public class Teleport implements Runnable, ITeleport
|
||||
teleportUser.sendMessage(_("teleportationCommencing"));
|
||||
try
|
||||
{
|
||||
if (respawn) {
|
||||
if (respawn)
|
||||
{
|
||||
teleportUser.getTeleport().respawn(cause);
|
||||
}
|
||||
else {
|
||||
else
|
||||
{
|
||||
teleportUser.getTeleport().now(teleportTarget, cause);
|
||||
}
|
||||
cancel(false);
|
||||
@ -344,6 +346,7 @@ public class Teleport implements Runnable, ITeleport
|
||||
}
|
||||
|
||||
cancel(false);
|
||||
warnUser(user, delay);
|
||||
initTimer((long)(delay * 1000.0), user, null, chargeFor, cause, true);
|
||||
teleTimer = ess.scheduleSyncRepeatingTask(this, 10, 10);
|
||||
}
|
||||
@ -352,12 +355,16 @@ public class Teleport implements Runnable, ITeleport
|
||||
{
|
||||
final Player player = user.getBase();
|
||||
Location bed = player.getBedSpawnLocation();
|
||||
if (bed != null && bed.getBlock().getType() != Material.BED_BLOCK)
|
||||
if (bed != null && bed.getBlock().getType() == Material.BED_BLOCK)
|
||||
{
|
||||
now(new Target(bed), cause);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (ess.getSettings().isDebug())
|
||||
{
|
||||
ess.getLogger().info("Could not find bed spawn, forcing respawn event.");
|
||||
}
|
||||
final PlayerRespawnEvent pre = new PlayerRespawnEvent(player, player.getWorld().getSpawnLocation(), false);
|
||||
ess.getServer().getPluginManager().callEvent(pre);
|
||||
now(new Target(pre.getRespawnLocation()), cause);
|
||||
|
@ -69,7 +69,7 @@ public class Commandhome extends EssentialsCommand
|
||||
}
|
||||
else if (homes.isEmpty())
|
||||
{
|
||||
throw new Exception(player == user ? _("noHomeSet") : _("noHomeSetPlayer"));
|
||||
throw new Exception(_("noHomeSetPlayer"));
|
||||
}
|
||||
else if (homes.size() == 1 && player.equals(user))
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user