Improve a buuuunch of textures and some reworks
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import { Container, ItemStack } from "$/common/inventory.ts";
|
||||
import { CRAFTING_RESULT_SLOT } from "$/common/protocol.ts";
|
||||
import type { GridRecipe } from "$/common/mod_data.ts";
|
||||
import { choice_ids, type GridRecipe } from "$/common/mod_data.ts";
|
||||
|
||||
// recipes come from mods, see RecipeBook in common/mod_loader.ts
|
||||
|
||||
@@ -23,7 +23,13 @@ function matches_recipe(grid: (string | undefined)[], recipe: GridRecipe): boole
|
||||
|
||||
if (gx >= x && gx < x + recipe.width && gy >= y && gy < y + recipe.height) {
|
||||
const recipe_index = (gy - y) * recipe.width + (gx - x);
|
||||
if (grid[grid_index] !== recipe.pattern[recipe_index]) {
|
||||
const choice = recipe.pattern[recipe_index];
|
||||
const item = grid[grid_index];
|
||||
if (
|
||||
choice === undefined
|
||||
? item !== undefined
|
||||
: item === undefined || !choice_ids(choice).includes(item)
|
||||
) {
|
||||
match = false;
|
||||
break;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user