Burn meta wildcards from Item, allow more dynamic recipe inputs

this was an obstacle for getting rid of legacy item IDs.
This commit is contained in:
Dylan K. Taylor
2022-06-27 13:33:26 +01:00
parent bc5a600d59
commit 55cb68e5b5
20 changed files with 473 additions and 127 deletions

View File

@ -72,9 +72,6 @@ final class ItemSerializer{
* @phpstan-param \Closure(TItemType) : Data $serializer
*/
public function map(Item $item, \Closure $serializer) : void{
if($item->hasAnyDamageValue()){
throw new \InvalidArgumentException("Cannot serialize a recipe wildcard");
}
$index = $item->getTypeId();
if(isset($this->itemSerializers[$index])){
//TODO: REMOVE ME
@ -106,9 +103,6 @@ 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{