From f82aa5bc87d83f971b2513f6fbadc115538cd3f6 Mon Sep 17 00:00:00 2001 From: AJ Ferguson Date: Thu, 7 Nov 2024 04:44:11 -0500 Subject: [PATCH] Read lock data component as compound nbt --- .../data/game/item/component/DataComponentType.java | 2 +- .../data/game/item/component/ItemCodecHelper.java | 8 -------- 2 files changed, 1 insertion(+), 9 deletions(-) diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/data/game/item/component/DataComponentType.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/data/game/item/component/DataComponentType.java index 04682bf0c..889a2599d 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/data/game/item/component/DataComponentType.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/data/game/item/component/DataComponentType.java @@ -86,7 +86,7 @@ public class DataComponentType { public static final DataComponentType> CONTAINER = new DataComponentType<>(listReader(ItemCodecHelper::readOptionalItemStack), listWriter(MinecraftCodecHelper::writeOptionalItemStack), ObjectDataComponent::new); public static final DataComponentType BLOCK_STATE = new DataComponentType<>(ItemCodecHelper::readBlockStateProperties, ItemCodecHelper::writeBlockStateProperties, ObjectDataComponent::new); public static final DataComponentType> BEES = new DataComponentType<>(listReader(ItemCodecHelper::readBeehiveOccupant), listWriter(ItemCodecHelper::writeBeehiveOccupant), ObjectDataComponent::new); - public static final DataComponentType LOCK = new DataComponentType<>(ItemCodecHelper::readLock, ItemCodecHelper::writeLock, ObjectDataComponent::new); + public static final DataComponentType LOCK = new DataComponentType<>(ItemCodecHelper::readCompoundTag, ItemCodecHelper::writeAnyTag, ObjectDataComponent::new); public static final DataComponentType CONTAINER_LOOT = new DataComponentType<>(ItemCodecHelper::readCompoundTag, ItemCodecHelper::writeAnyTag, ObjectDataComponent::new); protected final int id; diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/data/game/item/component/ItemCodecHelper.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/data/game/item/component/ItemCodecHelper.java index 3babbdd45..21da1b4a3 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/data/game/item/component/ItemCodecHelper.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/data/game/item/component/ItemCodecHelper.java @@ -637,12 +637,4 @@ public void writeBeehiveOccupant(ByteBuf buf, BeehiveOccupant occupant) { this.writeVarInt(buf, occupant.getTicksInHive()); this.writeVarInt(buf, occupant.getMinTicksInHive()); } - - public String readLock(ByteBuf buf) { - return this.readAnyTag(buf, NbtType.STRING); - } - - public void writeLock(ByteBuf buf, String key) { - this.writeAnyTag(buf, key); - } }