From 17bd048d10d6df518fb4cb668834d8ea218b4936 Mon Sep 17 00:00:00 2001 From: Kevin Ludwig <32491319+valaphee@users.noreply.github.com> Date: Thu, 27 Oct 2022 10:32:31 +0200 Subject: [PATCH] Fix missing zombie_pigman (1.15.2) => zombified_piglin (1.16) translation in mob_spawner entity (#3147) --- .../protocol1_16to1_15_2/packets/WorldPackets.java | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/common/src/main/java/com/viaversion/viaversion/protocols/protocol1_16to1_15_2/packets/WorldPackets.java b/common/src/main/java/com/viaversion/viaversion/protocols/protocol1_16to1_15_2/packets/WorldPackets.java index f8fd35a03..96e8f81cd 100644 --- a/common/src/main/java/com/viaversion/viaversion/protocols/protocol1_16to1_15_2/packets/WorldPackets.java +++ b/common/src/main/java/com/viaversion/viaversion/protocols/protocol1_16to1_15_2/packets/WorldPackets.java @@ -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"); + } + } + } } } }