From 64a508643743cf56b0c06607e911962f852ca9e6 Mon Sep 17 00:00:00 2001 From: CraftBukkit/Spigot 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. By: Erik Broes --- .../main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/paper-server/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/paper-server/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java index 1730751171..06a4358669 100644 --- a/paper-server/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/paper-server/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);