diff --git a/src/components/CraftingTable.component.tsx b/src/components/CraftingTable.component.tsx index b26ec33..dd96e65 100644 --- a/src/components/CraftingTable.component.tsx +++ b/src/components/CraftingTable.component.tsx @@ -22,6 +22,7 @@ export default function CraftingTable({ colorTables, setColorTables, setGameState, + recipes, options: { highContrast }, } = useGlobal(); @@ -111,7 +112,11 @@ export default function CraftingTable({ }; const processGuess = () => { - if (currentRecipe?.replace("minecraft:", "") === solution) { + console.log("processGuess", currentRecipe, solution); + if ( + currentRecipe?.replace("minecraft:", "") === + recipes[solution].output.replace("minecraft:", "") + ) { setColorTable([ [2, 2, 2], [2, 2, 2], diff --git a/src/components/Popup.component.tsx b/src/components/Popup.component.tsx index 9ae1b30..3d2ea1e 100644 --- a/src/components/Popup.component.tsx +++ b/src/components/Popup.component.tsx @@ -20,6 +20,8 @@ export default function Popup({ craftingTables, colorTables, userId, + recipes, + items, options: { highContrast }, resetGame, } = useGlobal(); @@ -65,9 +67,7 @@ export default function Popup({ }; // get name of solution item for label - const { items } = useGlobal(); - const solutionName = - "minecraft:" + solution ? items["minecraft:" + solution]?.name : undefined; + const solutionName = items[recipes[solution].output].name; return ( <> @@ -98,7 +98,7 @@ export default function Popup({ >
- + {`Solution: ` + solutionName}