Skip to content

Commit

Permalink
Merge pull request #867 from AJ-Ferguson/lock-nbt
Browse files Browse the repository at this point in the history
Read lock data component as compound nbt
  • Loading branch information
basaigh authored Nov 7, 2024
2 parents d5f5ae0 + f82aa5b commit 88188c5
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}

0 comments on commit 88188c5

Please sign in to comment.