Basic swimming
This commit is contained in:
@@ -10,7 +10,7 @@ import {
|
||||
TICK_DELTA,
|
||||
TICKS_PER_SECOND,
|
||||
} from "$/common/constants.ts";
|
||||
import { BlockRegistry, EverythingRegistry, ItemRegistry } from "$/common/everything_registry.ts";
|
||||
import { BlockRegistry, EverythingRegistry, is_liquid_block, ItemRegistry } from "$/common/everything_registry.ts";
|
||||
import { Container, ItemData, ItemStack } from "$/common/inventory.ts";
|
||||
import {
|
||||
AIR_ID,
|
||||
@@ -1446,8 +1446,7 @@ export class GameServer {
|
||||
|
||||
// in a block entities pass through and players can place into, like water
|
||||
#in_liquid(x: number, y: number, z: number) {
|
||||
const info = this.world.get_block_info(Math.floor(x), Math.floor(y), Math.floor(z));
|
||||
return info !== undefined && !info.has_collision && info.replaceable === true;
|
||||
return is_liquid_block(this.world.get_block_info(Math.floor(x), Math.floor(y), Math.floor(z)));
|
||||
}
|
||||
|
||||
// right click with food: it's eaten if they're hungry, or it's always edible
|
||||
|
||||
Reference in New Issue
Block a user