From d74f91d606f43ceb04b18afa8ee3c671b697d9f6 Mon Sep 17 00:00:00 2001 From: Nassim Jahnke Date: Sat, 18 Feb 2023 10:00:57 +0100 Subject: [PATCH] Handle item/block/particle metadata --- .../protocol1_19_4to1_19_3/packets/EntityPackets.java | 2 ++ .../viaversion/viaversion/rewriter/RecipeRewriter.java | 8 +++++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/common/src/main/java/com/viaversion/viaversion/protocols/protocol1_19_4to1_19_3/packets/EntityPackets.java b/common/src/main/java/com/viaversion/viaversion/protocols/protocol1_19_4to1_19_3/packets/EntityPackets.java index 186656b38..21bd2ba01 100644 --- a/common/src/main/java/com/viaversion/viaversion/protocols/protocol1_19_4to1_19_3/packets/EntityPackets.java +++ b/common/src/main/java/com/viaversion/viaversion/protocols/protocol1_19_4to1_19_3/packets/EntityPackets.java @@ -148,6 +148,8 @@ public final class EntityPackets extends EntityRewriter { // Added in 1.19.4 recipeHandlers.put("smithing_transform", this::handleSmithingTransform); - recipeHandlers.put("smithing_trim", this::handleSmithingTransform); + recipeHandlers.put("smithing_trim", this::handleSmithingTrim); recipeHandlers.put("crafting_decorated_pot", this::handleSimpleRecipe); } @@ -121,6 +121,12 @@ public class RecipeRewriter { rewrite(wrapper.passthrough(Type.FLAT_VAR_INT_ITEM)); // Result } + public void handleSmithingTrim(final PacketWrapper wrapper) throws Exception { + handleIngredient(wrapper); // Template + handleIngredient(wrapper); // Base + handleIngredient(wrapper); // Additions + } + protected void rewrite(@Nullable Item item) { if (protocol.getItemRewriter() != null) { protocol.getItemRewriter().handleItemToClient(item);