Basin
This commit is contained in:
@@ -148,3 +148,19 @@ Deno.test("items fall into water, float back up and bob at its surface", async (
|
||||
assert(Math.min(...heights) > 102.4, `down to ${Math.min(...heights)}`);
|
||||
assertEquals([item.x, item.z], [6.5, 0.5]);
|
||||
});
|
||||
|
||||
Deno.test("an item inside a block floats out of it, but not out of a hollow in one", async () => {
|
||||
const { game, join } = await test_game("mods");
|
||||
// things only move near players
|
||||
join(1, "alice");
|
||||
build_floor(game);
|
||||
game.set_block(0, 100, 0, "bworld:stone");
|
||||
game.set_block(2, 100, 0, "bworld:juicer");
|
||||
const buried = game.spawn_item(0.5, 100.3, 0.5, new ItemStack("bworld:dirt", 1));
|
||||
// between its posts and under its press, above its floor
|
||||
const kept = game.spawn_item(2.5, 100.2, 0.5, new ItemStack("bworld:dirt", 1));
|
||||
for (let i = 0; i < 40; i++) game.tick();
|
||||
assert(buried.y >= 101, `${buried.y}`);
|
||||
assert(kept.on_ground);
|
||||
assertEquals(kept.y, 100 + 2 / 16);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user