Fix missing zombie_pigman (1.15.2) => zombified_piglin (1.16) translation in mob_spawner entity (#3147)

This commit is contained in:
Kevin Ludwig 2022-10-27 10:32:31 +02:00 committed by GitHub
parent 955b76f599
commit 17bd048d10
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -141,6 +141,17 @@ public class WorldPackets {
compoundTag.put("Text" + i, new StringTag(text.toString()));
}
}
} else if (id.equals("minecraft:mob_spawner")) {
Tag spawnDataTag = compoundTag.get("SpawnData");
if (spawnDataTag instanceof CompoundTag) {
Tag spawnDataIdTag = ((CompoundTag) spawnDataTag).get("id");
if (spawnDataIdTag instanceof StringTag) {
StringTag spawnDataIdStringTag = ((StringTag) spawnDataIdTag);
if (spawnDataIdStringTag.getValue().equals("minecraft:zombie_pigman")) {
spawnDataIdStringTag.setValue("minecraft:zombified_piglin");
}
}
}
}
}
}