Test mod
This commit is contained in:
@@ -80,13 +80,13 @@ BLOCK_BEHAVIORS["bworld:chest"] = {
|
||||
|
||||
// furnace
|
||||
|
||||
interface FurnaceRecipe {
|
||||
export interface FurnaceRecipe {
|
||||
input: string;
|
||||
output: ItemStack;
|
||||
cook_time: number;
|
||||
}
|
||||
|
||||
const FURNACE_RECIPES: FurnaceRecipe[] = [
|
||||
export const FURNACE_RECIPES: FurnaceRecipe[] = [
|
||||
{
|
||||
input: "bworld:log",
|
||||
output: new ItemStack("bworld:coal", 1),
|
||||
@@ -119,7 +119,7 @@ const FURNACE_RECIPES: FurnaceRecipe[] = [
|
||||
},
|
||||
];
|
||||
|
||||
const FUEL_VALUES: Record<string, number> = {
|
||||
export const FUEL_VALUES: Record<string, number> = {
|
||||
"bworld:coal": 1000,
|
||||
"bworld:log": 100,
|
||||
};
|
||||
|
||||
@@ -8,7 +8,7 @@ export interface CraftingRecipe {
|
||||
result: { id: string; count: number };
|
||||
}
|
||||
|
||||
const recipes: CraftingRecipe[] = [
|
||||
export const CRAFTING_RECIPES: CraftingRecipe[] = [
|
||||
{
|
||||
width: 3,
|
||||
height: 3,
|
||||
@@ -117,7 +117,7 @@ function matches_recipe(grid: (string | undefined)[], recipe: CraftingRecipe): b
|
||||
// puts what the grid makes in the result slot
|
||||
export function update_crafting_result(crafting: Container) {
|
||||
const grid = get_crafting_grid(crafting);
|
||||
const recipe = recipes.find((recipe) => matches_recipe(grid, recipe));
|
||||
const recipe = CRAFTING_RECIPES.find((recipe) => matches_recipe(grid, recipe));
|
||||
crafting.set_item(CRAFTING_RESULT_SLOT, recipe ? new ItemStack(recipe.result.id, recipe.result.count) : undefined);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user