hi guys! I am planning to replicate minecraft Crafting. do you have an idea how to implement it in general? i was thinking about just checking every slot if it has an item. but i am also planning to let the player input the items everywhere as long as it matches the general pattern (you can input any two planks in a crafting grid as long as they are vertical)
i am also storing all these recipes in json like minecraft does:
{
"Recipes":[
{
"shapeless":false,
"recipe":[
"XXX",
" Y ",
" Y "
],
"keys":[
{
"key":"X",
"item":"diamond"
},
{
"key":"Y",
"item":"stick"
}
],
"result":"diamond_pickaxe"
},
{
"shapeless":false,
"recipe":[
"X",
"X",
"Y"
],
"keys":[
{
"key":"X",
"item":"diamond"
},
{
"key":"Y",
"item":"stick"
}
],
"result":"diamond_sword"
},
{
"shapeless":false,
"recipe":[
"X",
"X"
],
"keys":[
{
"key":"X",
"item":"diamond"
}
],
"result":"stick"
}
]
}
this shows how the recipe for the diamond sword can be shifted left to right, the stick recipe can be shifted up, down, left and right and the pickaxe must be crafted exactly like it says. Unfortunatly i dont have a single clue how to implement that. any ideas?
