Remove duplicate code

This commit is contained in:
2026-10-13 11:57:43 -03:00
parent dfc6a6d77b
commit 5165698fe3
50 changed files with 307 additions and 812 deletions
+2 -4
View File
@@ -5,15 +5,13 @@
import { assert, assertEquals } from "@std/assert";
import { create_entity } from "$/server/game/entity/entity_types.ts";
import { Mob } from "$/server/game/entity/mob.ts";
import { test_game } from "./helpers.ts";
import { stone_floor, test_game } from "./helpers.ts";
// a stone floor with alice on it, and a rotwalker 3 blocks away
async function setup() {
const t = await test_game("mods");
t.join(1, "alice");
for (let x = -8; x <= 8; x++) {
for (let z = -8; z <= 8; z++) t.game.set_block(x, 99, z, "bworld:stone");
}
stone_floor(t.game, 8);
t.send(1, { type: "move", x: 0.5, y: 100, z: 0.5, yaw: 0, pitch: 0 });
const rotwalker = create_entity(t.game.entities, "undergarden:rotwalker") as Mob;
rotwalker.set_position(0.5, 100, 3.5);