Basic swimming

This commit is contained in:
2026-10-01 21:12:30 -03:00
parent 6e5703a482
commit d5015edfa1
10 changed files with 203 additions and 20 deletions
+2 -2
View File
@@ -3,6 +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 type { ItemStack } from "$/common/inventory.ts";
import type { EntityEvent, EntityInfo, ServerMessage } from "$/common/protocol.ts";
import type { ServerPlayer } from "../player.ts";
@@ -89,8 +90,7 @@ export class EntityManager implements EntityLevel {
}
is_liquid(x: number, y: number, z: number) {
const info = this.#host.world.get_block_info(x, y, z);
return info !== undefined && !info.has_collision && info.replaceable === true;
return is_liquid_block(this.#host.world.get_block_info(x, y, z));
}
get_block_info(x: number, y: number, z: number) {