TypeConverter: account for possible out-of-range meta in items

This commit is contained in:
Dylan K. Taylor 2022-03-15 23:44:41 +00:00
parent 869dda9a45
commit c8e1cfcbee
No known key found for this signature in database
GPG Key ID: 8927471A91CAFD3D

View File

@ -232,6 +232,9 @@ class TypeConverter{
$compound = null;
}
}
if($meta < 0 || $meta >= 0x7fff){ //this meta value may have been restored from the NBT
throw new TypeConversionException("Item meta must be in range 0 ... " . 0x7fff . " (received $meta)");
}
try{
return ItemFactory::getInstance()->get(