TypeConverter: duct tape for crafting recipe block inputs

This commit is contained in:
Dylan K. Taylor 2022-06-06 21:47:04 +01:00
parent 13bb1c26fb
commit c89f7f8e5e
No known key found for this signature in database
GPG Key ID: 8927471A91CAFD3D

View File

@ -123,6 +123,11 @@ class TypeConverter{
$meta = self::RECIPE_INPUT_WILDCARD_META; $meta = self::RECIPE_INPUT_WILDCARD_META;
}else{ }else{
[$id, $meta] = ItemTranslator::getInstance()->toNetworkId($itemStack); [$id, $meta] = ItemTranslator::getInstance()->toNetworkId($itemStack);
if($id < 256){
//TODO: this is needed for block crafting recipes to work - we need to replace this with some kind of
//blockstate <-> meta mapping table so that we can remove the legacy code from the core
$meta = $itemStack->getMeta();
}
} }
return new RecipeIngredient($id, $meta, $itemStack->getCount()); return new RecipeIngredient($id, $meta, $itemStack->getCount());
} }