summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsnowleo <snowleo@e251c2fe-e539-e718-e476-b85c1f46cddb>2011-05-22 19:41:22 +0000
committersnowleo <snowleo@e251c2fe-e539-e718-e476-b85c1f46cddb>2011-05-22 19:41:22 +0000
commitaeb46128bc75c67401c5f61a0bbadeadb6cf4a29 (patch)
tree728bb51970b4cd3ede6955fa2f7b52ed0d4493d5
parent1f2374083297fb597c41de1bf2d04fc57a36c8cd (diff)
downloadEssentials-aeb46128bc75c67401c5f61a0bbadeadb6cf4a29.tar
Essentials-aeb46128bc75c67401c5f61a0bbadeadb6cf4a29.tar.gz
Essentials-aeb46128bc75c67401c5f61a0bbadeadb6cf4a29.tar.lz
Essentials-aeb46128bc75c67401c5f61a0bbadeadb6cf4a29.tar.xz
Essentials-aeb46128bc75c67401c5f61a0bbadeadb6cf4a29.zip
Ignore teleport delay on portals,
fix cooldown not working if delay is disabled, fix cooldown for teleport.now() git-svn-id: https://svn.java.net/svn/essentials~svn/trunk@1517 e251c2fe-e539-e718-e476-b85c1f46cddb
-rw-r--r--Essentials/src/com/earth2me/essentials/EssentialsPlayerListener.java2
-rw-r--r--Essentials/src/com/earth2me/essentials/Teleport.java10
2 files changed, 11 insertions, 1 deletions
diff --git a/Essentials/src/com/earth2me/essentials/EssentialsPlayerListener.java b/Essentials/src/com/earth2me/essentials/EssentialsPlayerListener.java
index f0b4941b7..464002548 100644
--- a/Essentials/src/com/earth2me/essentials/EssentialsPlayerListener.java
+++ b/Essentials/src/com/earth2me/essentials/EssentialsPlayerListener.java
@@ -162,7 +162,7 @@ public class EssentialsPlayerListener extends PlayerListener
event.setTo(loc);
try
{
- user.getTeleport().teleport(loc, new Charge("portal"));
+ user.getTeleport().now(loc, new Charge("portal"));
}
catch (Exception ex)
{
diff --git a/Essentials/src/com/earth2me/essentials/Teleport.java b/Essentials/src/com/earth2me/essentials/Teleport.java
index a618e3eab..3318aa779 100644
--- a/Essentials/src/com/earth2me/essentials/Teleport.java
+++ b/Essentials/src/com/earth2me/essentials/Teleport.java
@@ -190,6 +190,7 @@ public class Teleport implements Runnable
cooldown(true);
if (delay <= 0 || user.isAuthorized("essentials.teleport.timer.bypass"))
{
+ cooldown(false);
now(target);
if (chargeFor != null)
{
@@ -217,11 +218,20 @@ public class Teleport implements Runnable
public void now(Location loc) throws Exception
{
+ cooldown(false);
+ now(new Target(loc));
+ }
+
+ public void now(Location loc, Charge chargeFor) throws Exception
+ {
+ cooldown(false);
+ chargeFor.charge(user);
now(new Target(loc));
}
public void now(Entity entity) throws Exception
{
+ cooldown(false);
now(new Target(entity));
}