From bba0a3a3a621368f49565f1e61f730fc9ff91eed Mon Sep 17 00:00:00 2001 From: Nassim Jahnke Date: Mon, 17 Jun 2024 12:21:25 +0200 Subject: [PATCH] Handle new trial chamber map decoration type Fixes #789 --- .../rewriter/BlockItemPacketRewriter1_20_5.java | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/common/src/main/java/com/viaversion/viabackwards/protocol/v1_20_5to1_20_3/rewriter/BlockItemPacketRewriter1_20_5.java b/common/src/main/java/com/viaversion/viabackwards/protocol/v1_20_5to1_20_3/rewriter/BlockItemPacketRewriter1_20_5.java index 642690e0..c7bcb0e3 100644 --- a/common/src/main/java/com/viaversion/viabackwards/protocol/v1_20_5to1_20_3/rewriter/BlockItemPacketRewriter1_20_5.java +++ b/common/src/main/java/com/viaversion/viabackwards/protocol/v1_20_5to1_20_3/rewriter/BlockItemPacketRewriter1_20_5.java @@ -186,6 +186,23 @@ public final class BlockItemPacketRewriter1_20_5 extends BackwardsStructuredItem } }); + protocol.registerClientbound(ClientboundPackets1_20_5.MAP_ITEM_DATA, wrapper -> { + wrapper.passthrough(Types.VAR_INT); // Map id + wrapper.passthrough(Types.BYTE); // Scale + wrapper.passthrough(Types.BOOLEAN); // Locked + if (wrapper.passthrough(Types.BOOLEAN)) { + final int icons = wrapper.passthrough(Types.VAR_INT); + for (int i = 0; i < icons; i++) { + final int decorationType = wrapper.read(Types.VAR_INT); + wrapper.write(Types.VAR_INT, decorationType == 34 ? 32 : decorationType); // Trial champer to jungle temple + wrapper.passthrough(Types.BYTE); // X + wrapper.passthrough(Types.BYTE); // Y + wrapper.passthrough(Types.BYTE); // Rotation + wrapper.passthrough(Types.OPTIONAL_TAG); // Display name + } + } + }); + final RecipeRewriter1_20_3 recipeRewriter = new RecipeRewriter1_20_3<>(protocol); protocol.registerClientbound(ClientboundPackets1_20_5.UPDATE_RECIPES, wrapper -> { final int size = wrapper.passthrough(Types.VAR_INT);