More pathing

This commit is contained in:
2026-11-21 14:21:02 -03:00
parent 0f58a9cbfe
commit 357f8f2bd4
8 changed files with 314 additions and 24 deletions
+2 -14
View File
@@ -15,8 +15,7 @@ import { IDENTITY } from "@/client/rendering/model_math.ts";
import { push_model } from "@/client/rendering/model_renderer.ts";
import { Mob } from "@/server/game/entity/mob.ts";
import { create_entity } from "@/server/game/entity/entity_types.ts";
import { mod_entity_factory } from "@/server/game/entity/mod_entity.ts";
import { container_items, test_game } from "./helpers.ts";
import { container_items, test_game, test_mob } from "./helpers.ts";
Deno.test("a bedrock geo.json becomes an entity model with only what the engine uses", () => {
const geo = JSON.parse(Deno.readTextFileSync("mods/bworld/models/chicken.geo.json"));
@@ -184,18 +183,7 @@ async function walker(fields: Partial<EntityJson>, wall = false) {
}
t.join(1, "alice");
t.send(1, { type: "move", x: -3.5, y: 100, z: -3.5, yaw: 0, pitch: 0 });
const json: EntityJson = {
id: "test:walker",
texture: "bworld:chicken",
behavior: "test:still",
width: 0.6,
height: 1.8,
...fields,
};
const mob = mod_entity_factory(json, new Map([["test:still", () => {}]]))(t.game.entities) as Mob;
mob.set_position(0.5, 100, 0.5);
t.game.entities.add_entity(mob);
return { game: t.game, mob };
return { game: t.game, mob: test_mob(t.game, fields, 0.5, 100, 0.5) };
}
// the highest and lowest its feet got over ticks, walking to x