ItemSerializer: Prohibit serializing recipe input wildcards

This commit is contained in:
Dylan K. Taylor 2022-06-06 20:48:44 +01:00
parent 93124c79ea
commit 86e7ae341f
No known key found for this signature in database
GPG Key ID: 8927471A91CAFD3D

View File

@ -105,6 +105,9 @@ final class ItemSerializer{
if($item->isNull()){
throw new \InvalidArgumentException("Cannot serialize a null itemstack");
}
if($item->hasAnyDamageValue()){
throw new \InvalidArgumentException("Cannot serialize a recipe input as a saved itemstack");
}
if($item instanceof ItemBlock){
$data = $this->serializeBlockItem($item->getBlock());
}else{