Use correct tag name for 1.21->1.21.2 item name fix (#4214)

This commit is contained in:
EnZaXD 2024-10-29 14:55:28 +01:00 committed by GitHub
parent a0c0b7eff2
commit f5033342c9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -429,7 +429,7 @@ public final class BlockItemPacketRewriter1_21_2 extends StructuredItemRewriter<
name.put("extra", new ListTag<>(Collections.singletonList(itemName))); name.put("extra", new ListTag<>(Collections.singletonList(itemName)));
data.set(StructuredDataKey.CUSTOM_NAME, name); data.set(StructuredDataKey.CUSTOM_NAME, name);
saveTag(createCustomTag(item), new ByteTag(true), nbtTagName("custom_name")); saveTag(createCustomTag(item), new ByteTag(true), "remove_custom_name");
} }
} }
return item; return item;
@ -446,7 +446,7 @@ public final class BlockItemPacketRewriter1_21_2 extends StructuredItemRewriter<
final StructuredDataContainer dataContainer = item.dataContainer(); final StructuredDataContainer dataContainer = item.dataContainer();
final CompoundTag customData = dataContainer.get(StructuredDataKey.CUSTOM_DATA); final CompoundTag customData = dataContainer.get(StructuredDataKey.CUSTOM_DATA);
if (customData != null && customData.remove(nbtTagName("custom_name")) != null) { if (customData != null && customData.remove(nbtTagName("remove_custom_name")) != null) {
dataContainer.remove(StructuredDataKey.CUSTOM_NAME); dataContainer.remove(StructuredDataKey.CUSTOM_NAME);
if (customData.isEmpty()) { if (customData.isEmpty()) {
dataContainer.remove(StructuredDataKey.CUSTOM_DATA); dataContainer.remove(StructuredDataKey.CUSTOM_DATA);