Fix trim material ids at tail

This commit is contained in:
Nassim Jahnke 2024-04-24 10:11:22 +02:00
parent b78f9d350b
commit c5e6fa7d0c
No known key found for this signature in database
GPG Key ID: EF6771C01F6EF02F
3 changed files with 3 additions and 1 deletions

View File

@ -27,11 +27,11 @@ public final class TrimMaterials1_20_3 {
"copper", "copper",
"diamond", "diamond",
"emerald", "emerald",
"quartz",
"gold", "gold",
"iron", "iron",
"lapis", "lapis",
"netherite", "netherite",
"quartz",
"redstone" "redstone"
); );

View File

@ -892,6 +892,7 @@ public final class BlockItemPacketRewriter1_20_5 extends ItemRewriter<Clientboun
if (id == -1) { if (id == -1) {
return; return;
} }
materialHolder = Holder.of(id); materialHolder = Holder.of(id);
} else if (materialTag instanceof CompoundTag) { } else if (materialTag instanceof CompoundTag) {
final CompoundTag materialCompoundTag = (CompoundTag) materialTag; final CompoundTag materialCompoundTag = (CompoundTag) materialTag;

View File

@ -668,6 +668,7 @@ public final class StructuredDataConverter {
if (unmappedId != -1) { if (unmappedId != -1) {
return unmappedId; return unmappedId;
} }
final IntTag itemBackupTag = tag.getIntTag(ITEM_BACKUP_TAG_KEY); final IntTag itemBackupTag = tag.getIntTag(ITEM_BACKUP_TAG_KEY);
if (itemBackupTag != null) { if (itemBackupTag != null) {
tag.remove(ITEM_BACKUP_TAG_KEY); tag.remove(ITEM_BACKUP_TAG_KEY);