From 112f4ddb8d8ef6d2518f6adde57300f31c6c5be1 Mon Sep 17 00:00:00 2001 From: chris Date: Fri, 15 Mar 2024 17:33:48 +0100 Subject: [PATCH] Fix: Inventory handling when client tries to open the player inventory when it shouldn't (#4499) * attempt at fixing * Fix wrong handling of OPEN_INVENTORY case in BedrockInteractTranslator --- .../bedrock/entity/player/BedrockInteractTranslator.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/core/src/main/java/org/geysermc/geyser/translator/protocol/bedrock/entity/player/BedrockInteractTranslator.java b/core/src/main/java/org/geysermc/geyser/translator/protocol/bedrock/entity/player/BedrockInteractTranslator.java index 80141f849..07e192bb7 100644 --- a/core/src/main/java/org/geysermc/geyser/translator/protocol/bedrock/entity/player/BedrockInteractTranslator.java +++ b/core/src/main/java/org/geysermc/geyser/translator/protocol/bedrock/entity/player/BedrockInteractTranslator.java @@ -127,9 +127,9 @@ public class BedrockInteractTranslator extends PacketTranslator InventoryUtils.openInventory(session, session.getPlayerInventory()); } } else { - // Case: Player opens a player inventory, while we think it shouldn't have! - // Close all inventories, reset to player inventory. - InventoryUtils.closeInventory(session, session.getOpenInventory().getJavaId(), false); + // Case: Player tries to open a player inventory, while we think it should be in a different inventory + // Now: Open the inventory that we're supposed to be in. + InventoryUtils.openInventory(session, session.getOpenInventory()); } break; }