Basic swimming
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user