Basic swimming
This commit is contained in:
@@ -7,6 +7,7 @@ import {
|
||||
block_light_opacity,
|
||||
BlockRegistry,
|
||||
EverythingRegistry,
|
||||
is_liquid_block,
|
||||
RENDER_LAYERS,
|
||||
RenderLayer,
|
||||
} from "$/common/everything_registry.ts";
|
||||
@@ -302,6 +303,12 @@ export class ClientLevel {
|
||||
return block === VOID || (block !== AIR && (this.#blocks[block]?.has_collision ?? true));
|
||||
}
|
||||
|
||||
// water, see is_liquid_block. unloaded chunks aren't
|
||||
is_liquid(x: number, y: number, z: number) {
|
||||
const block = this.get_block(x, y, z);
|
||||
return block !== VOID && block !== AIR && is_liquid_block(this.#blocks[block]);
|
||||
}
|
||||
|
||||
// only changes what this client shows, drops and everything else happen on the server
|
||||
break_block(x: number, y: number, z: number) {
|
||||
const block_chunk_x = Math.floor(x / CHUNK_SIZE);
|
||||
|
||||
Reference in New Issue
Block a user