13
0
geforkt von Mirrors/Paper

Close inventory on teleport. FIXES BUKKIT-3021.

By: Andrzej Pomirski <andrzejp@dysleksja.pl>
Dieser Commit ist enthalten in:
CraftBukkit/Spigot 2013-02-09 23:38:53 +01:00
Ursprung d748630f56
Commit 0d9124396f

Datei anzeigen

@ -381,14 +381,15 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
WorldServer fromWorld = ((CraftWorld) from.getWorld()).getHandle(); WorldServer fromWorld = ((CraftWorld) from.getWorld()).getHandle();
WorldServer toWorld = ((CraftWorld) to.getWorld()).getHandle(); WorldServer toWorld = ((CraftWorld) to.getWorld()).getHandle();
// Check if the fromWorld and toWorld are the same.
if (fromWorld == toWorld) {
entity.playerConnection.teleport(to);
} else {
// Close any foreign inventory // Close any foreign inventory
if (getHandle().activeContainer != getHandle().defaultContainer) { if (getHandle().activeContainer != getHandle().defaultContainer) {
getHandle().closeInventory(); getHandle().closeInventory();
} }
// Check if the fromWorld and toWorld are the same.
if (fromWorld == toWorld) {
entity.playerConnection.teleport(to);
} else {
server.getHandle().moveToWorld(entity, toWorld.dimension, true, to, true); server.getHandle().moveToWorld(entity, toWorld.dimension, true, to, true);
} }
return true; return true;