Remove duplicate code
This commit is contained in:
@@ -10,7 +10,7 @@ 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 { PLAYER_MENU_CRAFTING, PROTOCOL_VERSION } from "$/common/protocol.ts";
|
||||
import { copy_dir, test_game } from "./helpers.ts";
|
||||
import { container_items, copy_dir, test_game } from "./helpers.ts";
|
||||
|
||||
// mods/bworld plus a mod made from the template, in a temp folder
|
||||
function mods_with_template() {
|
||||
@@ -22,8 +22,7 @@ function mods_with_template() {
|
||||
|
||||
// deno-lint-ignore no-explicit-any
|
||||
type Msg = any;
|
||||
const inventory_of = (messages: Msg[]) =>
|
||||
messages.filter((m) => m.type === "container" && m.container === "inventory").at(-1)?.items ?? [];
|
||||
const inventory_of = (messages: Msg[]) => container_items(messages, "inventory") ?? [];
|
||||
|
||||
Deno.test("the base game loads from mods/bworld", async () => {
|
||||
const { game } = await test_game("mods");
|
||||
|
||||
Reference in New Issue
Block a user