Waterlogging

This commit is contained in:
2026-10-07 20:56:24 -03:00
parent 78117f65c9
commit 757ee74bc7
26 changed files with 459 additions and 73 deletions
+3 -3
View File
@@ -3,8 +3,7 @@
// when those move or change, and forgets them when they leave it
import { CHUNK_SIZE } from "$/common/constants.ts";
import { is_within_view } from "$/common/chunk_streaming.ts";
import { is_liquid_block } from "$/common/everything_registry.ts";
import { liquid_in_cell } from "$/common/utils.ts";
import { liquid_block, liquid_in_cell } from "$/common/utils.ts";
import type { ItemStack } from "$/common/inventory.ts";
import type { EntityEvent, EntityInfo, ServerMessage } from "$/common/protocol.ts";
import type { ServerPlayer } from "../player.ts";
@@ -95,7 +94,8 @@ export class EntityManager implements EntityLevel {
}
is_liquid(x: number, y: number, z: number) {
return is_liquid_block(this.#host.world.get_block_info(x, y, z));
const world = this.#host.world;
return liquid_block(world.get_block_value(x, y, z), world.get_block_info(x, y, z)) !== undefined;
}
get_block_info(x: number, y: number, z: number) {