From 8391e9d924e14f58a9857056b75f39c3f9f0185b Mon Sep 17 00:00:00 2001 From: Nassim Jahnke Date: Tue, 22 Oct 2024 13:23:06 +0200 Subject: [PATCH] Fix consumable writing --- .../api/minecraft/item/data/Consumable1_21_2.java | 7 +++---- .../protocols/v1_21to1_21_2/Protocol1_21To1_21_2.java | 4 ++-- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/api/src/main/java/com/viaversion/viaversion/api/minecraft/item/data/Consumable1_21_2.java b/api/src/main/java/com/viaversion/viaversion/api/minecraft/item/data/Consumable1_21_2.java index caf9106e0..020026379 100644 --- a/api/src/main/java/com/viaversion/viaversion/api/minecraft/item/data/Consumable1_21_2.java +++ b/api/src/main/java/com/viaversion/viaversion/api/minecraft/item/data/Consumable1_21_2.java @@ -76,7 +76,7 @@ public record Consumable1_21_2(float consumeSeconds, int animationType, Holder value) { Types.VAR_INT.writePrimitive(buffer, value.id); - value.write(buffer); + value.writeValue(buffer); } }; public static final Type[]> ARRAY_TYPE = new ArrayType<>(TYPE); @@ -86,9 +86,8 @@ public record Consumable1_21_2(float consumeSeconds, int animationType, Holder(id, type, (T) value); } - void write(final ByteBuf buf) { - Types.VAR_INT.writePrimitive(buf, id); - type.write(buf, value); + void writeValue(final ByteBuf buf) { + this.type.write(buf, this.value); } } diff --git a/common/src/main/java/com/viaversion/viaversion/protocols/v1_21to1_21_2/Protocol1_21To1_21_2.java b/common/src/main/java/com/viaversion/viaversion/protocols/v1_21to1_21_2/Protocol1_21To1_21_2.java index 80e346caf..28307acd2 100644 --- a/common/src/main/java/com/viaversion/viaversion/protocols/v1_21to1_21_2/Protocol1_21To1_21_2.java +++ b/common/src/main/java/com/viaversion/viaversion/protocols/v1_21to1_21_2/Protocol1_21To1_21_2.java @@ -214,11 +214,11 @@ public final class Protocol1_21To1_21_2 extends AbstractProtocol