Lava
This commit is contained in:
@@ -310,3 +310,18 @@ Deno.test("a bucket picks up a water source but not flowing water, and a water b
|
||||
assertEquals(t.game.world.get_block_id(-2, 100, 0), "bworld:water");
|
||||
assertEquals(t.game.world.get_block_value(-2, 100, 0) >>> 16, 0);
|
||||
});
|
||||
|
||||
Deno.test("a bucket picks up a lava source too, and a lava bucket puts one back", async () => {
|
||||
const t = await setup([["bworld:bucket", 1]]);
|
||||
const held = () => t.game.players()[0].held_item?.type_id;
|
||||
t.game.set_block(1, 100, 0, "bworld:lava");
|
||||
|
||||
t.send(1, { type: "use_block", x: 1, y: 100, z: 0, face: "top" });
|
||||
assertEquals(held(), "bworld:lava_bucket");
|
||||
assertEquals(t.game.world.get_block_id(1, 100, 0), "bworld:air");
|
||||
|
||||
t.send(1, { type: "use_block", x: -2, y: 99, z: 0, face: "top" });
|
||||
assertEquals(held(), "bworld:bucket");
|
||||
assertEquals(t.game.world.get_block_id(-2, 100, 0), "bworld:lava");
|
||||
assertEquals(t.game.world.get_block_value(-2, 100, 0) >>> 16, 0);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user