Item: fixed possible type violation in jsonDeserialize()

This commit is contained in:
Dylan K. Taylor
2019-12-12 20:26:26 +00:00
parent 771ccbb727
commit 0a4a1f634f

View File

@@ -695,7 +695,7 @@ class Item implements \JsonSerializable{
$nbt = base64_decode($data["nbt_b64"], true);
}
return ItemFactory::get(
(int) $data["id"], (int) ($data["damage"] ?? 0), (int) ($data["count"] ?? 1), $nbt !== "" ? (new LittleEndianNbtSerializer())->read($nbt)->getTag() : null
(int) $data["id"], (int) ($data["damage"] ?? 0), (int) ($data["count"] ?? 1), $nbt !== "" ? (new LittleEndianNbtSerializer())->read($nbt)->mustGetCompoundTag() : null
);
}