mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-08 19:34:09 +01:00
[Bleeding] Make sure to close any open inventory windows before teleporting. Thanks md_5.
By: Erik Broes <erikbroes@grum.nl>
This commit is contained in:
parent
0c70cec69d
commit
64a5086437
1 changed files with 4 additions and 0 deletions
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue