mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-24 09:16:06 +01:00
Actually close the inventory on a *cross*-world teleport.
By: Erik Broes <erikbroes@grum.nl>
This commit is contained in:
parent
322754c180
commit
179363588e
1 changed files with 2 additions and 2 deletions
|
@ -313,12 +313,12 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
||||||
|
|
||||||
// Check if the fromWorld and toWorld are the same.
|
// Check if the fromWorld and toWorld are the same.
|
||||||
if (fromWorld == toWorld) {
|
if (fromWorld == toWorld) {
|
||||||
|
entity.netServerHandler.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();
|
||||||
}
|
}
|
||||||
entity.netServerHandler.teleport(to);
|
|
||||||
} else {
|
|
||||||
server.getHandle().moveToWorld(entity, toWorld.dimension, true, to);
|
server.getHandle().moveToWorld(entity, toWorld.dimension, true, to);
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
|
Loading…
Add table
Reference in a new issue