From 5d2a4e2ef3efb4e1d1a30f8f754d915ca0b4b8b1 Mon Sep 17 00:00:00 2001 From: KennyTV Date: Thu, 25 Jun 2020 12:52:59 +0200 Subject: [PATCH] Add sanity check to conduit nbt handling --- .../protocol1_16to1_15_2/packets/WorldPackets.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/common/src/main/java/us/myles/ViaVersion/protocols/protocol1_16to1_15_2/packets/WorldPackets.java b/common/src/main/java/us/myles/ViaVersion/protocols/protocol1_16to1_15_2/packets/WorldPackets.java index 1fd966184..84774d54b 100644 --- a/common/src/main/java/us/myles/ViaVersion/protocols/protocol1_16to1_15_2/packets/WorldPackets.java +++ b/common/src/main/java/us/myles/ViaVersion/protocols/protocol1_16to1_15_2/packets/WorldPackets.java @@ -99,11 +99,11 @@ public class WorldPackets { String id = idTag.getValue(); if (id.equals("minecraft:conduit")) { - StringTag targetUuidTag = compoundTag.remove("target_uuid"); - if (targetUuidTag == null) return; + Tag targetUuidTag = compoundTag.remove("target_uuid"); + if (!(targetUuidTag instanceof StringTag)) return; // target_uuid -> Target - UUID targetUuid = UUID.fromString(targetUuidTag.getValue()); + UUID targetUuid = UUID.fromString((String) targetUuidTag.getValue()); compoundTag.put(new IntArrayTag("Target", UUIDIntArrayType.uuidToIntArray(targetUuid))); } else if (id.equals("minecraft:skull") && compoundTag.get("Owner") instanceof CompoundTag) { CompoundTag ownerTag = compoundTag.remove("Owner");