diff options
author | Erik Broes <erikbroes@grum.nl> | 2012-01-17 13:22:59 +0100 |
---|---|---|
committer | Erik Broes <erikbroes@grum.nl> | 2012-01-17 19:49:52 +0100 |
commit | 1d4a9e1df53fb5fbc0bba376968fa2aa0a28070d (patch) | |
tree | e6b58304391d3d348abfd089a5cd8f0570d71610 /src | |
parent | 1d04305cea458383e746bc6d7b22a21f6516988c (diff) | |
download | craftbukkit-1d4a9e1df53fb5fbc0bba376968fa2aa0a28070d.tar craftbukkit-1d4a9e1df53fb5fbc0bba376968fa2aa0a28070d.tar.gz craftbukkit-1d4a9e1df53fb5fbc0bba376968fa2aa0a28070d.tar.lz craftbukkit-1d4a9e1df53fb5fbc0bba376968fa2aa0a28070d.tar.xz craftbukkit-1d4a9e1df53fb5fbc0bba376968fa2aa0a28070d.zip |
[Bleeding] Make sure to close any open inventory windows before teleporting. Thanks md_5.
Diffstat (limited to 'src')
-rw-r--r-- | src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java index 17307511..06a43586 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java @@ -312,6 +312,10 @@ public class CraftPlayer extends CraftHumanEntity implements Player { // Check if the fromWorld and toWorld are the same. if (fromWorld == toWorld) { + // Close any foreign inventory + if (getHandle().activeContainer != getHandle().defaultContainer){ + getHandle().closeInventory(); + } entity.netServerHandler.teleport(to); } else { server.getHandle().moveToWorld(entity, toWorld.dimension, true, to); |