Add the oak_ on the oak blocks

This commit is contained in:
2026-10-03 18:56:44 -03:00
parent 41fa75e864
commit cb7d655f0c
26 changed files with 40 additions and 44 deletions
+1 -1
View File
@@ -31,7 +31,7 @@ async function setup() {
};
// something to smelt and coal, so the furnace burns
const light_furnace = () => {
container(FURNACE).set_item(0, new ItemStack("bworld:log", 64));
container(FURNACE).set_item(0, new ItemStack("bworld:oak_log", 64));
container(FURNACE).set_item(1, new ItemStack("bworld:coal", 64));
};
const ticks = (n: number) => {
+1 -1
View File
@@ -44,7 +44,7 @@ Deno.test("fences join full sides of solid blocks, but not leaves, plants or a s
const { game, sides } = await setup();
game.set_block(0, Y, 0, "bworld:oak_fence");
game.set_block(0, Y, -1, "bworld:stone");
game.set_block(1, Y, 0, "bworld:leaves");
game.set_block(1, Y, 0, "bworld:oak_leaves");
game.set_block(-1, Y, 0, "bworld:wheat");
assertEquals(sides(0, 0), ["north"]);
assert(!covers_face([[0, 0, 0, 1, 0.5, 1]], "north"));
+1 -1
View File
@@ -28,7 +28,7 @@ Deno.test("the base game loads from mods/bworld", async () => {
assert(EverythingRegistry.get<BlockRegistry>("blocks", "bworld:stone"));
assert(EverythingRegistry.get<ItemRegistry>("items", "bworld:stone"));
assert(EverythingRegistry.get<ItemRegistry>("items", "bworld:coal"));
assert(game.recipes.shaped.some((recipe) => recipe.result.id === "bworld:planks"));
assert(game.recipes.shaped.some((recipe) => recipe.result.id === "bworld:oak_planks"));
assert(game.recipes.furnace.has("bworld:iron_ore"));
assert(game.recipes.fuel.has("bworld:coal"));
assertEquals(EverythingRegistry.get<BlockRegistry>("blocks", "bworld:water")?.replaceable, true);
+1 -1
View File
@@ -113,7 +113,7 @@ Deno.test("a client places a fence joined to the fences and walls beside it, the
const { t, use } = await setup("bworld:oak_fence");
t.game.set_block(-1, 100, 0, "bworld:oak_fence");
t.game.set_block(0, 100, -1, "bworld:stone");
t.game.set_block(1, 100, 0, "bworld:leaves");
t.game.set_block(1, 100, 0, "bworld:oak_leaves");
const client = client_of(t);
client.place("bworld:oak_fence", 0, 100, 0, 0, "top", [0.5, 1, 0.5]);
+4 -4
View File
@@ -93,22 +93,22 @@ Deno.test("shift clicking into a furnace goes by its slot filters, and takes the
});
Deno.test("shift clicking the crafting result crafts as many as fit", async () => {
const t = await setup([["bworld:log", 3]]);
const t = await setup([["bworld:oak_log", 3]]);
// the logs into the grid, then the result shift clicked: 3 crafts of 2 planks
t.send(1, { type: "click", menu: 0, slot: 0, button: 0 });
t.send(1, { type: "click", menu: 0, slot: PLAYER_MENU_CRAFTING, button: 0 });
t.send(1, { type: "click", menu: 0, slot: PLAYER_MENU_CRAFTING + CRAFTING_RESULT_SLOT, button: 0, shift: true });
const messages = t.take(1);
assertEquals(last_container(messages, "crafting").every((item: Msg) => item === null), true);
assertEquals(last_container(messages, "inventory")[8], { id: "bworld:planks", count: 6 });
assertEquals(last_container(messages, "inventory")[8], { id: "bworld:oak_planks", count: 6 });
});
Deno.test("shift clicking the crafting grid puts its items back in the inventory", async () => {
const t = await setup([["bworld:log", 3]]);
const t = await setup([["bworld:oak_log", 3]]);
t.send(1, { type: "click", menu: 0, slot: 0, button: 0 });
t.send(1, { type: "click", menu: 0, slot: PLAYER_MENU_CRAFTING + 4, button: 0 });
t.send(1, { type: "click", menu: 0, slot: PLAYER_MENU_CRAFTING + 4, button: 0, shift: true });
const messages = t.take(1);
assertEquals(last_container(messages, "crafting").every((item: Msg) => item === null), true);
assertEquals(last_container(messages, "inventory")[9], { id: "bworld:log", count: 3 });
assertEquals(last_container(messages, "inventory")[9], { id: "bworld:oak_log", count: 3 });
});
+1 -1
View File
@@ -105,7 +105,7 @@ Deno.test("the base game's tags, from scripts", async () => {
tags.get("items", "bworld:planks").pop();
assertEquals(tags.get("items", "bworld:planks").length, 7);
// deno-lint-ignore no-explicit-any
assertThrows(() => tags.has("recipes" as any, "bworld:planks", "bworld:planks"), Error, 'not "recipes"');
assertThrows(() => tags.has("recipes" as any, "bworld:planks", "bworld:oak_planks"), Error, 'not "recipes"');
});
// mods/bworld and a mod that adds maple wood to the base game's tags
+1 -1
View File
@@ -90,7 +90,7 @@ Deno.test("biome colors blend over the 5x5 columns around, across chunk edges",
Deno.test("oak leaves are the biome's foliage color on every side, birch a fixed green, spruce isn't tinted", async () => {
const colors = { grass: 0xff0000, foliage: 0x00ff80 };
const oak = await mesh_block("bworld:leaves", 8, colors, null);
const oak = await mesh_block("bworld:oak_leaves", 8, colors, null);
assertEquals(oak.top, [[0, 255, 128]]);
assert(oak.sides.some((rgb) => JSON.stringify(rgb) === JSON.stringify(shaded(0x00ff80, 0.8))));
+3 -3
View File
@@ -16,7 +16,7 @@ Deno.test("recipes that take planks take any kind, even mixed, but nothing else"
update_crafting_result(grid, game.recipes.shaped);
return grid.get_item(CRAFTING_RESULT_SLOT);
};
assertEquals(craft("bworld:planks", "bworld:planks")?.type_id, "bworld:stick");
assertEquals(craft("bworld:oak_planks", "bworld:oak_planks")?.type_id, "bworld:stick");
assertEquals(craft("bworld:birch_planks", "bworld:cherry_planks")?.type_id, "bworld:stick");
assertEquals(craft("bworld:birch_planks", "bworld:stone"), undefined);
@@ -27,7 +27,7 @@ Deno.test("recipes that take planks take any kind, even mixed, but nothing else"
assertEquals(grid.get_item(CRAFTING_RESULT_SLOT)?.type_id, "bworld:dark_oak_planks");
// every log burns and smelts
for (const log of ["bworld:log", "bworld:spruce_log", "bworld:cherry_log"]) {
for (const log of ["bworld:oak_log", "bworld:spruce_log", "bworld:cherry_log"]) {
assert(game.recipes.fuel.has(log), log);
assert(game.recipes.furnace.has(log), log);
}
@@ -37,7 +37,7 @@ Deno.test("trees grow the wood of their kind and biome", async () => {
const { game } = await test_game("mods");
const ids = game.world.block_ids;
const woods: Record<string, string> = {
"bworld:log": "oak",
"bworld:oak_log": "oak",
"bworld:spruce_log": "spruce",
"bworld:birch_log": "birch",
"bworld:jungle_log": "jungle",
+2 -2
View File
@@ -56,7 +56,7 @@ Deno.test("region files keep chunks, including negative ones, and saving one aga
Deno.test("changed blocks are saved as whole chunks, and only chunks that changed are saved again", async () => {
const { game } = await test_game("mods");
game.set_block(3, 120, 5, "bworld:stone");
game.set_block(-20, 120, 40, "bworld:planks");
game.set_block(-20, 120, 40, "bworld:oak_planks");
game.world.set_block(-20, 121, 40, "bworld:furnace", 1);
const saved = game.save();
assertEquals(saved.chunks.map((c) => [c.x, c.z]).sort(), [[-2, 2], [0, 0]]);
@@ -75,7 +75,7 @@ Deno.test("changed blocks are saved as whole chunks, and only chunks that change
const loaded = await test_game("mods", saved);
assertEquals(loaded.game.world.get_block_id(3, 120, 5), "bworld:stone");
assertEquals(loaded.game.world.get_block_id(-20, 120, 40), "bworld:planks");
assertEquals(loaded.game.world.get_block_id(-20, 120, 40), "bworld:oak_planks");
assertEquals(loaded.game.world.get_block_value(-20, 121, 40) >>> 16, 1);
// players get the whole chunks, with what was saved in them
const join = loaded.join(1, "alice");