3
0
Mirror von https://github.com/ViaVersion/ViaVersion.git synchronisiert 2024-11-08 17:20:24 +01:00

Add sanity check to conduit nbt handling

Dieser Commit ist enthalten in:
KennyTV 2020-06-25 12:52:59 +02:00
Ursprung d414106d5a
Commit 5d2a4e2ef3
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: 6BE3B555EBC5982B

Datei anzeigen

@ -99,11 +99,11 @@ public class WorldPackets {
String id = idTag.getValue(); String id = idTag.getValue();
if (id.equals("minecraft:conduit")) { if (id.equals("minecraft:conduit")) {
StringTag targetUuidTag = compoundTag.remove("target_uuid"); Tag targetUuidTag = compoundTag.remove("target_uuid");
if (targetUuidTag == null) return; if (!(targetUuidTag instanceof StringTag)) return;
// target_uuid -> Target // target_uuid -> Target
UUID targetUuid = UUID.fromString(targetUuidTag.getValue()); UUID targetUuid = UUID.fromString((String) targetUuidTag.getValue());
compoundTag.put(new IntArrayTag("Target", UUIDIntArrayType.uuidToIntArray(targetUuid))); compoundTag.put(new IntArrayTag("Target", UUIDIntArrayType.uuidToIntArray(targetUuid)));
} else if (id.equals("minecraft:skull") && compoundTag.get("Owner") instanceof CompoundTag) { } else if (id.equals("minecraft:skull") && compoundTag.get("Owner") instanceof CompoundTag) {
CompoundTag ownerTag = compoundTag.remove("Owner"); CompoundTag ownerTag = compoundTag.remove("Owner");