mirror of
https://github.com/GeyserMC/Geyser.git
synced 2024-08-14 23:57:35 +00:00
Close containers if we did not manage to open it
This commit is contained in:
parent
49f66c2a02
commit
fb57bfb212
1 changed files with 4 additions and 0 deletions
|
|
@ -57,6 +57,7 @@ import org.geysermc.mcprotocollib.protocol.data.game.entity.player.GameMode;
|
|||
import org.geysermc.mcprotocollib.protocol.data.game.item.ItemStack;
|
||||
import org.geysermc.mcprotocollib.protocol.data.game.item.component.DataComponents;
|
||||
import org.geysermc.mcprotocollib.protocol.data.game.recipe.Ingredient;
|
||||
import org.geysermc.mcprotocollib.protocol.packet.ingame.serverbound.inventory.ServerboundContainerClosePacket;
|
||||
import org.geysermc.mcprotocollib.protocol.packet.ingame.serverbound.inventory.ServerboundPickItemPacket;
|
||||
import org.geysermc.mcprotocollib.protocol.packet.ingame.serverbound.inventory.ServerboundSetCreativeModeSlotPacket;
|
||||
import org.jetbrains.annotations.Contract;
|
||||
|
|
@ -110,6 +111,9 @@ public class InventoryUtils {
|
|||
inventory.setDisplayed(true);
|
||||
}
|
||||
} else {
|
||||
// Can occur if we e.g. did not find a spot to put a fake container in
|
||||
ServerboundContainerClosePacket closePacket = new ServerboundContainerClosePacket(inventory.getJavaId());
|
||||
session.sendDownstreamGamePacket(closePacket);
|
||||
session.setOpenInventory(null);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue