mirror of
https://github.com/TotalFreedomMC/TF-EssentialsX.git
synced 2025-02-19 06:58:17 +00:00
Handle jail teleport locations slightly better.
This commit is contained in:
parent
e045f9d983
commit
c4e4235f30
2 changed files with 16 additions and 4 deletions
|
@ -122,7 +122,9 @@ public class EssentialsPlayerListener implements Listener
|
||||||
{
|
{
|
||||||
user.toggleVanished();
|
user.toggleVanished();
|
||||||
}
|
}
|
||||||
|
if (!user.isJailed()) {
|
||||||
user.setLastLocation();
|
user.setLastLocation();
|
||||||
|
}
|
||||||
user.updateActivity(false);
|
user.updateActivity(false);
|
||||||
user.dispose();
|
user.dispose();
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,6 +11,7 @@ import org.bukkit.ChatColor;
|
||||||
import org.bukkit.Location;
|
import org.bukkit.Location;
|
||||||
import org.bukkit.command.CommandSender;
|
import org.bukkit.command.CommandSender;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
import org.bukkit.event.player.PlayerTeleportEvent.TeleportCause;
|
||||||
|
|
||||||
|
|
||||||
public class User extends UserData implements Comparable<User>, IReplyTo, IUser
|
public class User extends UserData implements Comparable<User>, IReplyTo, IUser
|
||||||
|
@ -176,7 +177,10 @@ public class User extends UserData implements Comparable<User>, IReplyTo, IUser
|
||||||
|
|
||||||
public boolean canAfford(final double cost, final boolean permcheck)
|
public boolean canAfford(final double cost, final boolean permcheck)
|
||||||
{
|
{
|
||||||
if (cost <= 0.0) { return true; }
|
if (cost <= 0.0)
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
final double mon = getMoney();
|
final double mon = getMoney();
|
||||||
if (!permcheck || isAuthorized("essentials.eco.loan"))
|
if (!permcheck || isAuthorized("essentials.eco.loan"))
|
||||||
{
|
{
|
||||||
|
@ -486,6 +490,13 @@ public class User extends UserData implements Comparable<User>, IReplyTo, IUser
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
getTeleport().respawn(null, TeleportCause.PLUGIN);
|
||||||
|
}
|
||||||
|
catch (Exception ex1)
|
||||||
|
{
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -624,7 +635,6 @@ public class User extends UserData implements Comparable<User>, IReplyTo, IUser
|
||||||
{
|
{
|
||||||
enderSee = set;
|
enderSee = set;
|
||||||
}
|
}
|
||||||
|
|
||||||
private transient long teleportInvulnerabilityTimestamp = 0;
|
private transient long teleportInvulnerabilityTimestamp = 0;
|
||||||
|
|
||||||
public void enableInvulnerabilityAfterTeleport()
|
public void enableInvulnerabilityAfterTeleport()
|
||||||
|
|
Loading…
Reference in a new issue