From 179363588e30c590b270d21266045368c64731f5 Mon Sep 17 00:00:00 2001 From: CraftBukkit/Spigot Date: Tue, 17 Jan 2012 22:50:18 +0100 Subject: [PATCH] Actually close the inventory on a *cross*-world teleport. By: Erik Broes --- .../main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 8109958460..e4f1b160ef 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 @@ -313,12 +313,12 @@ public class CraftPlayer extends CraftHumanEntity implements Player { // Check if the fromWorld and toWorld are the same. if (fromWorld == toWorld) { + entity.netServerHandler.teleport(to); + } else { // Close any foreign inventory if (getHandle().activeContainer != getHandle().defaultContainer){ getHandle().closeInventory(); } - entity.netServerHandler.teleport(to); - } else { server.getHandle().moveToWorld(entity, toWorld.dimension, true, to); } return true;