Change whole gui system
This commit is contained in:
@@ -6,7 +6,7 @@ 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";
|
||||
import { PLAYER_MENU_CRAFTING, PROTOCOL_VERSION } from "$/common/protocol.ts";
|
||||
import { copy_dir, test_game } from "./helpers.ts";
|
||||
|
||||
// mods/bworld plus a mod made from the template, in a temp folder
|
||||
@@ -101,8 +101,9 @@ Deno.test("a mod made from the template loads and runs", async () => {
|
||||
// the shaped recipe: 4 example items in a square
|
||||
send(1, { type: "chat", text: "/give copper_tools:example_item 4" });
|
||||
const items_slot = inventory_of(take(1)).findIndex((i: Msg) => i?.id === "copper_tools:example_item");
|
||||
send(1, { type: "click", container: "inventory", index: items_slot, button: 0 });
|
||||
for (const slot of [0, 1, 3, 4]) send(1, { type: "click", container: "crafting", index: slot, button: 2 });
|
||||
// the player's own menu: the inventory, then the crafting grid
|
||||
send(1, { type: "click", menu: 0, slot: items_slot, button: 0 });
|
||||
for (const slot of [0, 1, 3, 4]) send(1, { type: "click", menu: 0, slot: PLAYER_MENU_CRAFTING + slot, button: 2 });
|
||||
const crafting = take(1).filter((m) => m.container === "crafting").at(-1).items;
|
||||
assertEquals(crafting[9]?.id, "copper_tools:example_block");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user