From ad60eb538edb10844e971ef4912778aab9aa0033 Mon Sep 17 00:00:00 2001 From: snowleo Date: Sun, 4 Dec 2011 22:57:40 +0100 Subject: [PATCH] Ignore teleport cooldown on /tjail --- Essentials/src/com/earth2me/essentials/Jail.java | 2 +- Essentials/src/com/earth2me/essentials/Teleport.java | 7 +++++-- .../essentials/spawn/EssentialsSpawnPlayerListener.java | 2 +- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/Essentials/src/com/earth2me/essentials/Jail.java b/Essentials/src/com/earth2me/essentials/Jail.java index fbbb4376e..b573e4a13 100644 --- a/Essentials/src/com/earth2me/essentials/Jail.java +++ b/Essentials/src/com/earth2me/essentials/Jail.java @@ -46,7 +46,7 @@ public class Jail extends BlockListener implements IConf { if (!(user.getBase() instanceof OfflinePlayer)) { - user.getTeleport().now(getJail(jail)); + user.getTeleport().now(getJail(jail), false); } user.setJail(jail); } diff --git a/Essentials/src/com/earth2me/essentials/Teleport.java b/Essentials/src/com/earth2me/essentials/Teleport.java index 94371fdde..92a4b77f5 100644 --- a/Essentials/src/com/earth2me/essentials/Teleport.java +++ b/Essentials/src/com/earth2me/essentials/Teleport.java @@ -228,9 +228,12 @@ public class Teleport implements Runnable user.getBase().teleport(Util.getSafeDestination(target.getLocation())); } - public void now(Location loc) throws Exception + public void now(Location loc, boolean cooldown) throws Exception { - cooldown(false); + if (cooldown) + { + cooldown(false); + } now(new Target(loc)); } diff --git a/EssentialsSpawn/src/com/earth2me/essentials/spawn/EssentialsSpawnPlayerListener.java b/EssentialsSpawn/src/com/earth2me/essentials/spawn/EssentialsSpawnPlayerListener.java index 57b842c82..bca748296 100644 --- a/EssentialsSpawn/src/com/earth2me/essentials/spawn/EssentialsSpawnPlayerListener.java +++ b/EssentialsSpawn/src/com/earth2me/essentials/spawn/EssentialsSpawnPlayerListener.java @@ -64,7 +64,7 @@ public class EssentialsSpawnPlayerListener extends PlayerListener { try { - user.getTeleport().now(ess.getSpawn().getSpawn(ess.getSettings().getNewbieSpawn())); + user.getTeleport().now(ess.getSpawn().getSpawn(ess.getSettings().getNewbieSpawn()), false); } catch (Exception ex) {