diff options
author | Andrzej Pomirski <andrzejp@dysleksja.pl> | 2013-02-09 23:38:53 +0100 |
---|---|---|
committer | feildmaster <admin@feildmaster.com> | 2013-02-10 17:22:34 -0600 |
commit | 993e19b3fbaef793914f047a9ca6e8c2800c5988 (patch) | |
tree | 4ab15881a7f201489c90d77ee697416ead3f31b7 | |
parent | d06e597ca5e744dddb1cfc9228cba16584141f6c (diff) | |
download | craftbukkit-993e19b3fbaef793914f047a9ca6e8c2800c5988.tar craftbukkit-993e19b3fbaef793914f047a9ca6e8c2800c5988.tar.gz craftbukkit-993e19b3fbaef793914f047a9ca6e8c2800c5988.tar.lz craftbukkit-993e19b3fbaef793914f047a9ca6e8c2800c5988.tar.xz craftbukkit-993e19b3fbaef793914f047a9ca6e8c2800c5988.zip |
Close inventory on teleport. FIXES BUKKIT-3021.
-rw-r--r-- | src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java index b0c23a06..f8dbbee7 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java @@ -381,14 +381,15 @@ public class CraftPlayer extends CraftHumanEntity implements Player { WorldServer fromWorld = ((CraftWorld) from.getWorld()).getHandle(); WorldServer toWorld = ((CraftWorld) to.getWorld()).getHandle(); + // Close any foreign inventory + if (getHandle().activeContainer != getHandle().defaultContainer) { + getHandle().closeInventory(); + } + // Check if the fromWorld and toWorld are the same. if (fromWorld == toWorld) { entity.playerConnection.teleport(to); } else { - // Close any foreign inventory - if (getHandle().activeContainer != getHandle().defaultContainer){ - getHandle().closeInventory(); - } server.getHandle().moveToWorld(entity, toWorld.dimension, true, to, true); } return true; |