diff options
author | KHobbits <rob@khobbits.co.uk> | 2012-09-08 14:30:11 +0100 |
---|---|---|
committer | KHobbits <rob@khobbits.co.uk> | 2012-09-08 14:30:11 +0100 |
commit | 315c4ec1f27f34070ab96068e3bd014241ed887b (patch) | |
tree | c53b90dc47b324c7a8014d18fb9ec6a067a1df7f | |
parent | 682cf7ae08fef8c0e6abfdbda1aa5e8184ca695f (diff) | |
download | Essentials-315c4ec1f27f34070ab96068e3bd014241ed887b.tar Essentials-315c4ec1f27f34070ab96068e3bd014241ed887b.tar.gz Essentials-315c4ec1f27f34070ab96068e3bd014241ed887b.tar.lz Essentials-315c4ec1f27f34070ab96068e3bd014241ed887b.tar.xz Essentials-315c4ec1f27f34070ab96068e3bd014241ed887b.zip |
Potential fix for teleporting issue.
-rw-r--r-- | Essentials/src/com/earth2me/essentials/Teleport.java | 20 | ||||
-rw-r--r-- | Essentials/src/config.yml | 2 |
2 files changed, 11 insertions, 11 deletions
diff --git a/Essentials/src/com/earth2me/essentials/Teleport.java b/Essentials/src/com/earth2me/essentials/Teleport.java index 63ff59644..c437bdec5 100644 --- a/Essentials/src/com/earth2me/essentials/Teleport.java +++ b/Essentials/src/com/earth2me/essentials/Teleport.java @@ -6,7 +6,6 @@ import java.util.Calendar; import java.util.GregorianCalendar; import java.util.logging.Logger; import org.bukkit.Location; -import org.bukkit.entity.Entity; import org.bukkit.entity.Player; import org.bukkit.event.player.PlayerRespawnEvent; import org.bukkit.event.player.PlayerTeleportEvent.TeleportCause; @@ -17,28 +16,29 @@ public class Teleport implements Runnable, ITeleport private static final double MOVE_CONSTANT = 0.3; - private static class Target + private class Target { private final Location location; - private final Entity entity; + private final String name; public Target(Location location) { this.location = location; - this.entity = null; + this.name = null; } - public Target(Entity entity) + public Target(Player entity) { - this.entity = entity; + this.name = entity.getName(); this.location = null; } public Location getLocation() { - if (this.entity != null) + if (this.name != null) { - return this.entity.getLocation(); + + return ess.getServer().getPlayerExact(name).getLocation(); } return location; } @@ -216,7 +216,7 @@ public class Teleport implements Runnable, ITeleport teleport(new Target(loc), chargeFor, cause); } - public void teleport(Entity entity, Trade chargeFor, TeleportCause cause) throws Exception + public void teleport(Player entity, Trade chargeFor, TeleportCause cause) throws Exception { teleport(new Target(entity), chargeFor, cause); } @@ -274,7 +274,7 @@ public class Teleport implements Runnable, ITeleport now(new Target(loc), cause); } - public void now(Entity entity, boolean cooldown, TeleportCause cause) throws Exception + public void now(Player entity, boolean cooldown, TeleportCause cause) throws Exception { if (cooldown) { diff --git a/Essentials/src/config.yml b/Essentials/src/config.yml index a7297866d..438f3102d 100644 --- a/Essentials/src/config.yml +++ b/Essentials/src/config.yml @@ -52,7 +52,7 @@ teleport-delay: 0 # The delay, in seconds, a player can't be attacked by other players after they have been teleported by a command # This will also prevent the player attacking other players -teleport-invulnerability: 2 +teleport-invulnerability: 4 # The delay, in seconds, required between /heal attempts heal-cooldown: 60 |