summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKHobbits <rob@khobbits.co.uk>2012-09-08 14:30:11 +0100
committerKHobbits <rob@khobbits.co.uk>2012-09-08 14:30:11 +0100
commitacf4d0bcf509ce89b907567b2ce102cc353c8abf (patch)
treed995fdd1a34eb09a1f0f70639d611b4d7314e2bc
parent6c3b13a7a4dca0dfe03195d601e9e78c4244cf20 (diff)
downloadEssentials-acf4d0bcf509ce89b907567b2ce102cc353c8abf.tar
Essentials-acf4d0bcf509ce89b907567b2ce102cc353c8abf.tar.gz
Essentials-acf4d0bcf509ce89b907567b2ce102cc353c8abf.tar.lz
Essentials-acf4d0bcf509ce89b907567b2ce102cc353c8abf.tar.xz
Essentials-acf4d0bcf509ce89b907567b2ce102cc353c8abf.zip
Potential fix for teleporting issue.
-rw-r--r--Essentials/src/com/earth2me/essentials/Teleport.java20
-rw-r--r--Essentials/src/config.yml2
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