summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKHobbits <rob@khobbits.co.uk>2012-08-28 02:06:11 +0100
committerKHobbits <rob@khobbits.co.uk>2012-08-28 02:06:11 +0100
commitc4e4235f3099b7b9fd3bb785c92f737e8ef272bd (patch)
treebf59a89cb94ed296a0b8dd334eeb983aaeea0d1d
parente045f9d9833cc13363d94adc9ea5062cf36fdf82 (diff)
downloadEssentials-c4e4235f3099b7b9fd3bb785c92f737e8ef272bd.tar
Essentials-c4e4235f3099b7b9fd3bb785c92f737e8ef272bd.tar.gz
Essentials-c4e4235f3099b7b9fd3bb785c92f737e8ef272bd.tar.lz
Essentials-c4e4235f3099b7b9fd3bb785c92f737e8ef272bd.tar.xz
Essentials-c4e4235f3099b7b9fd3bb785c92f737e8ef272bd.zip
Handle jail teleport locations slightly better.
-rw-r--r--Essentials/src/com/earth2me/essentials/EssentialsPlayerListener.java4
-rw-r--r--Essentials/src/com/earth2me/essentials/User.java16
2 files changed, 16 insertions, 4 deletions
diff --git a/Essentials/src/com/earth2me/essentials/EssentialsPlayerListener.java b/Essentials/src/com/earth2me/essentials/EssentialsPlayerListener.java
index 53962cef4..edf36b108 100644
--- a/Essentials/src/com/earth2me/essentials/EssentialsPlayerListener.java
+++ b/Essentials/src/com/earth2me/essentials/EssentialsPlayerListener.java
@@ -122,7 +122,9 @@ public class EssentialsPlayerListener implements Listener
{
user.toggleVanished();
}
- user.setLastLocation();
+ if (!user.isJailed()) {
+ user.setLastLocation();
+ }
user.updateActivity(false);
user.dispose();
}
diff --git a/Essentials/src/com/earth2me/essentials/User.java b/Essentials/src/com/earth2me/essentials/User.java
index b9868148c..a66f3dadf 100644
--- a/Essentials/src/com/earth2me/essentials/User.java
+++ b/Essentials/src/com/earth2me/essentials/User.java
@@ -11,6 +11,7 @@ import org.bukkit.ChatColor;
import org.bukkit.Location;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
+import org.bukkit.event.player.PlayerTeleportEvent.TeleportCause;
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)
{
- if (cost <= 0.0) { return true; }
+ if (cost <= 0.0)
+ {
+ return true;
+ }
final double mon = getMoney();
if (!permcheck || isAuthorized("essentials.eco.loan"))
{
@@ -486,6 +490,13 @@ public class User extends UserData implements Comparable<User>, IReplyTo, IUser
}
catch (Exception ex)
{
+ try
+ {
+ getTeleport().respawn(null, TeleportCause.PLUGIN);
+ }
+ catch (Exception ex1)
+ {
+ }
}
return true;
}
@@ -614,7 +625,7 @@ public class User extends UserData implements Comparable<User>, IReplyTo, IUser
{
invSee = set;
}
-
+
public boolean isEnderSee()
{
return enderSee;
@@ -624,7 +635,6 @@ public class User extends UserData implements Comparable<User>, IReplyTo, IUser
{
enderSee = set;
}
-
private transient long teleportInvulnerabilityTimestamp = 0;
public void enableInvulnerabilityAfterTeleport()