diff options
author | Wesley Wolfe <weswolf@aol.com> | 2012-11-19 21:38:31 -0600 |
---|---|---|
committer | Wesley Wolfe <weswolf@aol.com> | 2012-11-19 21:38:31 -0600 |
commit | d039986be7d79b1edb706f15d77c6a94ca7041a9 (patch) | |
tree | ee14eb09ada11399b005a5434d743cacb655b4ec /src/main | |
parent | d23c97429febde4b48667abb61e21822af80233c (diff) | |
download | craftbukkit-d039986be7d79b1edb706f15d77c6a94ca7041a9.tar craftbukkit-d039986be7d79b1edb706f15d77c6a94ca7041a9.tar.gz craftbukkit-d039986be7d79b1edb706f15d77c6a94ca7041a9.tar.lz craftbukkit-d039986be7d79b1edb706f15d77c6a94ca7041a9.tar.xz craftbukkit-d039986be7d79b1edb706f15d77c6a94ca7041a9.zip |
No teleporting people back into the server. Fixes BUKKIT-2298
Stale player references will add a player back into the world when
teleporting them, causing a cascade of issues relating to ghost entities
and servers failing to stop.
Diffstat (limited to 'src/main')
-rw-r--r-- | src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java index a1e9f85c..46db36cc 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java @@ -345,7 +345,8 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @Override public boolean teleport(Location location, PlayerTeleportEvent.TeleportCause cause) { - if (getHandle().netServerHandler == null) return false; + EntityPlayer entity = getHandle(); + if (entity.netServerHandler == null || entity.netServerHandler.disconnected) return false; // From = Players current Location Location from = this.getLocation(); @@ -365,8 +366,6 @@ public class CraftPlayer extends CraftHumanEntity implements Player { // Grab the To and From World Handles. WorldServer fromWorld = ((CraftWorld) from.getWorld()).getHandle(); WorldServer toWorld = ((CraftWorld) to.getWorld()).getHandle(); - // Grab the EntityPlayer - EntityPlayer entity = getHandle(); // Check if the fromWorld and toWorld are the same. if (fromWorld == toWorld) { |