From 046c93ffb0a0a031c41d8164749b3ae2699115ef Mon Sep 17 00:00:00 2001 From: Camotoy <20743703+Camotoy@users.noreply.github.com> Date: Wed, 8 Dec 2021 09:23:23 -0500 Subject: [PATCH] Fix stonecutters for Bedrock 1.18 --- .../geyser/translator/inventory/InventoryTranslator.java | 1 + .../translator/inventory/StonecutterInventoryTranslator.java | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/core/src/main/java/org/geysermc/geyser/translator/inventory/InventoryTranslator.java b/core/src/main/java/org/geysermc/geyser/translator/inventory/InventoryTranslator.java index 0e22fc0be..66fd6959e 100644 --- a/core/src/main/java/org/geysermc/geyser/translator/inventory/InventoryTranslator.java +++ b/core/src/main/java/org/geysermc/geyser/translator/inventory/InventoryTranslator.java @@ -391,6 +391,7 @@ public abstract class InventoryTranslator { } break; } + case CRAFT_RECIPE: // Called by stonecutters 1.18+ case CRAFT_RECIPE_AUTO: // Called by villagers case CRAFT_NON_IMPLEMENTED_DEPRECATED: // Tends to be called for UI inventories case CRAFT_RESULTS_DEPRECATED: // Tends to be called for UI inventories diff --git a/core/src/main/java/org/geysermc/geyser/translator/inventory/StonecutterInventoryTranslator.java b/core/src/main/java/org/geysermc/geyser/translator/inventory/StonecutterInventoryTranslator.java index ed1f38799..e7140f7b2 100644 --- a/core/src/main/java/org/geysermc/geyser/translator/inventory/StonecutterInventoryTranslator.java +++ b/core/src/main/java/org/geysermc/geyser/translator/inventory/StonecutterInventoryTranslator.java @@ -53,7 +53,8 @@ public class StonecutterInventoryTranslator extends AbstractBlockInventoryTransl @Override public boolean shouldHandleRequestFirst(StackRequestActionData action, Inventory inventory) { - return action.getType() == StackRequestActionType.CRAFT_NON_IMPLEMENTED_DEPRECATED; + // First is pre-1.18. TODO remove after 1.17.40 support is dropped and refactor stonecutter support to use CraftRecipeStackRequestActionData's recipe ID + return action.getType() == StackRequestActionType.CRAFT_NON_IMPLEMENTED_DEPRECATED || action.getType() == StackRequestActionType.CRAFT_RECIPE; } @Override