From 1d4a9e1df53fb5fbc0bba376968fa2aa0a28070d Mon Sep 17 00:00:00 2001 From: Erik Broes Date: Tue, 17 Jan 2012 13:22:59 +0100 Subject: [PATCH] [Bleeding] Make sure to close any open inventory windows before teleporting. Thanks md_5. --- src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java index 1730751171..06a4358669 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);