From a88747d904937b2c917c3ad5864ae65bc4fa33c9 Mon Sep 17 00:00:00 2001 From: Nassim Jahnke Date: Thu, 28 Jul 2022 11:47:12 +0200 Subject: [PATCH] Check for dimension equality after adding/replacing new fields --- .../protocols/protocol1_19to1_18_2/packets/EntityPackets.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/common/src/main/java/com/viaversion/viaversion/protocols/protocol1_19to1_18_2/packets/EntityPackets.java b/common/src/main/java/com/viaversion/viaversion/protocols/protocol1_19to1_18_2/packets/EntityPackets.java index b40650dc9..1c4f14f83 100644 --- a/common/src/main/java/com/viaversion/viaversion/protocols/protocol1_19to1_18_2/packets/EntityPackets.java +++ b/common/src/main/java/com/viaversion/viaversion/protocols/protocol1_19to1_18_2/packets/EntityPackets.java @@ -218,10 +218,9 @@ public final class EntityPackets extends EntityRewriter { final CompoundTag dimensionCompound = (CompoundTag) dimension; final CompoundTag element = dimensionCompound.get("element"); final String name = (String) dimensionCompound.get("name").getValue(); + addMonsterSpawnData(element); dimensionDataMap.put(name, new DimensionDataImpl(element)); dimensionsMap.put(element.clone(), name); - - addMonsterSpawnData(element); } tracker(wrapper.user()).setDimensions(dimensionDataMap); @@ -310,6 +309,7 @@ public final class EntityPackets extends EntityRewriter { private static void writeDimensionKey(final PacketWrapper wrapper, final DimensionRegistryStorage registryStorage) throws Exception { // Find dimension key by data final CompoundTag currentDimension = wrapper.read(Type.NBT); + addMonsterSpawnData(currentDimension); String dimensionKey = registryStorage.dimensionKey(currentDimension); if (dimensionKey == null) { if (!Via.getConfig().isSuppressConversionWarnings()) {