Add sanity check to conduit nbt handling

This commit is contained in:
KennyTV 2020-06-25 12:52:59 +02:00
parent d414106d5a
commit 5d2a4e2ef3
No known key found for this signature in database
GPG Key ID: 6BE3B555EBC5982B

View File

@ -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");