diff --git a/mods/bworld/blocks/cobblestone.json b/mods/bworld/blocks/cobblestone.json new file mode 100644 index 0000000..4469a53 --- /dev/null +++ b/mods/bworld/blocks/cobblestone.json @@ -0,0 +1,13 @@ +{ + "format_version": 1, + "block": { + "id": "bworld:cobblestone", + "textures": "bworld:cobblestone", + "mining": { + "toughness": 3, + "tool": "pickaxe", + "requires_tool": true + }, + "drops": "bworld:cobblestone" + } +} diff --git a/mods/bworld/blocks/furnace.json b/mods/bworld/blocks/furnace.json index 35ecb77..e001bba 100644 --- a/mods/bworld/blocks/furnace.json +++ b/mods/bworld/blocks/furnace.json @@ -3,8 +3,10 @@ "block": { "id": "bworld:furnace", "textures": { - "front": "bworld:furnace", - "side": "bworld:stone" + "front": "bworld:furnace_front", + "side": "bworld:furnace_side", + "top": "bworld:furnace_top", + "bottom": "bworld:cobblestone" }, "mining": { "toughness": 5, @@ -13,6 +15,16 @@ }, "drops": "bworld:furnace", "interactive": true, + "variants": { + "lit=1": { + "textures": { + "front": "bworld:furnace_front_lit", + "side": "bworld:furnace_side", + "top": "bworld:furnace_top", + "bottom": "bworld:cobblestone" + } + } + }, "states": [ { "name": "lit", diff --git a/mods/bworld/blocks/stone.json b/mods/bworld/blocks/stone.json index 7e701a3..acbd899 100644 --- a/mods/bworld/blocks/stone.json +++ b/mods/bworld/blocks/stone.json @@ -8,6 +8,6 @@ "tool": "pickaxe", "requires_tool": true }, - "drops": "bworld:stone" + "drops": "bworld:cobblestone" } } diff --git a/mods/bworld/textures/cobblestone.png b/mods/bworld/textures/cobblestone.png new file mode 100644 index 0000000..4fcae12 Binary files /dev/null and b/mods/bworld/textures/cobblestone.png differ diff --git a/mods/bworld/textures/fire_empty.png b/mods/bworld/textures/fire_empty.png index 6bed320..bfaa27e 100644 Binary files a/mods/bworld/textures/fire_empty.png and b/mods/bworld/textures/fire_empty.png differ diff --git a/mods/bworld/textures/fire_full.png b/mods/bworld/textures/fire_full.png index bc1ef7e..b4823a3 100644 Binary files a/mods/bworld/textures/fire_full.png and b/mods/bworld/textures/fire_full.png differ diff --git a/mods/bworld/textures/furnace.png b/mods/bworld/textures/furnace.png deleted file mode 100644 index 447beb7..0000000 Binary files a/mods/bworld/textures/furnace.png and /dev/null differ diff --git a/mods/bworld/textures/furnace_front.png b/mods/bworld/textures/furnace_front.png new file mode 100644 index 0000000..388addd Binary files /dev/null and b/mods/bworld/textures/furnace_front.png differ diff --git a/mods/bworld/textures/furnace_front_lit.png b/mods/bworld/textures/furnace_front_lit.png new file mode 100644 index 0000000..3b6e105 Binary files /dev/null and b/mods/bworld/textures/furnace_front_lit.png differ diff --git a/mods/bworld/textures/furnace_side.png b/mods/bworld/textures/furnace_side.png new file mode 100644 index 0000000..2c364db Binary files /dev/null and b/mods/bworld/textures/furnace_side.png differ diff --git a/mods/bworld/textures/furnace_top.png b/mods/bworld/textures/furnace_top.png new file mode 100644 index 0000000..c8efce2 Binary files /dev/null and b/mods/bworld/textures/furnace_top.png differ diff --git a/mods/bworld/textures/leaves.png b/mods/bworld/textures/leaves.png deleted file mode 100644 index 2430449..0000000 Binary files a/mods/bworld/textures/leaves.png and /dev/null differ diff --git a/mods/bworld/textures/stone.png b/mods/bworld/textures/stone.png index 4019103..f59629d 100644 Binary files a/mods/bworld/textures/stone.png and b/mods/bworld/textures/stone.png differ diff --git a/mods/bworld/textures/stone_coal.png b/mods/bworld/textures/stone_coal.png index 7ada392..b1e9d34 100644 Binary files a/mods/bworld/textures/stone_coal.png and b/mods/bworld/textures/stone_coal.png differ diff --git a/mods/bworld/textures/stone_copper.png b/mods/bworld/textures/stone_copper.png index a97b2ac..7585ee6 100644 Binary files a/mods/bworld/textures/stone_copper.png and b/mods/bworld/textures/stone_copper.png differ diff --git a/mods/bworld/textures/stone_gold.png b/mods/bworld/textures/stone_gold.png index c97f7b1..c22782c 100644 Binary files a/mods/bworld/textures/stone_gold.png and b/mods/bworld/textures/stone_gold.png differ diff --git a/mods/bworld/textures/stone_iron.png b/mods/bworld/textures/stone_iron.png index e9368e6..5a4da47 100644 Binary files a/mods/bworld/textures/stone_iron.png and b/mods/bworld/textures/stone_iron.png differ diff --git a/mods/bworld/textures/stone_tin.png b/mods/bworld/textures/stone_tin.png index 8546143..257d5d9 100644 Binary files a/mods/bworld/textures/stone_tin.png and b/mods/bworld/textures/stone_tin.png differ diff --git a/mods/bworld/textures/watering_can.png b/mods/bworld/textures/watering_can.png index 9b8bbd4..4499912 100644 Binary files a/mods/bworld/textures/watering_can.png and b/mods/bworld/textures/watering_can.png differ diff --git a/tests/bmod_test.ts b/tests/bmod_test.ts index 1bfdb08..9b9d5ce 100644 --- a/tests/bmod_test.ts +++ b/tests/bmod_test.ts @@ -41,7 +41,7 @@ Deno.test("packing a mod keeps its data, scripts, textures and credits, and give assert(bmod.credits); const bworld = read_bmod(Deno.readFileSync(`${folder}/bworld.bmod`), "bworld.bmod"); - assertEquals(bworld.data.blocks.length, 41); + assertEquals(bworld.data.blocks.length, 42); assertEquals(Object.keys(bworld.scripts), ["server"]); Deno.removeSync(sources, { recursive: true }); diff --git a/tests/mod_loading_test.ts b/tests/mod_loading_test.ts index d09e697..7935e56 100644 --- a/tests/mod_loading_test.ts +++ b/tests/mod_loading_test.ts @@ -3,6 +3,7 @@ import { AIR, CHUNK_HEIGHT } from "$/common/constants.ts"; import { BlockRegistry, EverythingRegistry, ItemRegistry } from "$/common/everything_registry.ts"; import { block_from_json, block_to_json, item_from_json, item_to_json } from "$/common/mod_data.ts"; import { generate_raw_chunk } from "$/common/generation.ts"; +import { block_variant } from "$/common/block_models.ts"; import { load_worldgen } from "$/common/worldgen_loader.ts"; import { create_mod } from "$/tools/new_mod.ts"; import { PROTOCOL_VERSION } from "$/common/protocol.ts"; @@ -25,9 +26,9 @@ Deno.test("the base game loads from mods/bworld", async () => { const { game } = await test_game("mods"); const bworld = (entries: [string, unknown][]) => entries.filter(([id]) => id.startsWith("bworld:")).length; // 7 kinds of log, planks and leaves - assertEquals(bworld(EverythingRegistry.entries("blocks")), 41); - // 33 items (20 of them tools) plus the item forms of the 36 blocks that have one - assertEquals(bworld(EverythingRegistry.entries("items")), 69); + assertEquals(bworld(EverythingRegistry.entries("blocks")), 42); + // 33 items (20 of them tools) plus the item forms of the 37 blocks that have one + assertEquals(bworld(EverythingRegistry.entries("items")), 70); // bworld's 15 (4 wood tools, 7 planks), the cooking pot and stove are farmersdelight's assertEquals(game.recipes.shaped.length, 17); // every log smelts and burns @@ -238,3 +239,11 @@ Deno.test("every tier of pickaxe, axe, shovel and hoe exists and can be made", a } } }); + +Deno.test("a lit furnace shows its lit front", async () => { + await test_game("mods"); + const furnace = EverythingRegistry.get("blocks", "bworld:furnace")!; + const front = (lit: number) => (block_variant(furnace, { lit }).textures as Record).front; + assertEquals(front(0), "bworld:furnace_front"); + assertEquals(front(1), "bworld:furnace_front_lit"); +});