From b403ca12d6b383c4eeaca406b0e20c7250394a3e Mon Sep 17 00:00:00 2001 From: AJ Ferguson <AJ-Ferguson@users.noreply.github.com> Date: Thu, 7 Nov 2024 03:06:16 -0500 Subject: [PATCH] Update lock data component --- .../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<T> { public static final DataComponentType<List<ItemStack>> CONTAINER = new DataComponentType<>(listReader(ItemCodecHelper::readOptionalItemStack), listWriter(MinecraftCodecHelper::writeOptionalItemStack), ObjectDataComponent::new); public static final DataComponentType<BlockStateProperties> BLOCK_STATE = new DataComponentType<>(ItemCodecHelper::readBlockStateProperties, ItemCodecHelper::writeBlockStateProperties, ObjectDataComponent::new); public static final DataComponentType<List<BeehiveOccupant>> BEES = new DataComponentType<>(listReader(ItemCodecHelper::readBeehiveOccupant), listWriter(ItemCodecHelper::writeBeehiveOccupant), ObjectDataComponent::new); - public static final DataComponentType<String> LOCK = new DataComponentType<>(ItemCodecHelper::readLock, ItemCodecHelper::writeLock, ObjectDataComponent::new); + public static final DataComponentType<NbtMap> LOCK = new DataComponentType<>(ItemCodecHelper::readCompoundTag, ItemCodecHelper::writeAnyTag, ObjectDataComponent::new); public static final DataComponentType<NbtMap> 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); - } }