Rename all "liquid" mentions to "fluid"
This commit is contained in:
@@ -12,7 +12,7 @@ import type { BlockRegistry } from "$/common/everything_registry.ts";
|
||||
import type { ItemStack } from "$/common/inventory.ts";
|
||||
import type { Shape } from "$/common/block_shapes.ts";
|
||||
import type { Season } from "$/common/worldgen/biomes.ts";
|
||||
import { type Collisions, type LiquidInCell, physics } from "$/common/physics.ts";
|
||||
import { type Collisions, type FluidInCell, physics } from "$/common/physics.ts";
|
||||
import type { EntityData, EntityEvent, EntityInfo } from "$/common/protocol.ts";
|
||||
import type { ServerPlayer } from "../player.ts";
|
||||
|
||||
@@ -70,9 +70,9 @@ export interface EntityLevel {
|
||||
// what it bumps into at a block, see common/physics.ts
|
||||
collision_shape(x: number, y: number, z: number): boolean | Shape;
|
||||
// water, and other blocks you're in instead of on
|
||||
is_liquid(x: number, y: number, z: number): boolean;
|
||||
// the liquid there and how high it is, for liquids pushing things along
|
||||
liquid_at(x: number, y: number, z: number): LiquidInCell | undefined;
|
||||
is_fluid(x: number, y: number, z: number): boolean;
|
||||
// the fluid there and how high it is, for fluids pushing things along
|
||||
fluid_at(x: number, y: number, z: number): FluidInCell | undefined;
|
||||
get_block_info(x: number, y: number, z: number): BlockRegistry | undefined;
|
||||
// the column's biome, like "bworld:plains"
|
||||
biome_at(x: number, z: number): string;
|
||||
@@ -241,10 +241,10 @@ export abstract class Entity {
|
||||
this.fall_distance = 0;
|
||||
this.fire = 0;
|
||||
}
|
||||
if (this.pushed_by_liquid) {
|
||||
physics.push_by_liquid(
|
||||
if (this.pushed_by_fluid) {
|
||||
physics.push_by_fluid(
|
||||
this,
|
||||
(x, y, z) => this.level.liquid_at(x, y, z),
|
||||
(x, y, z) => this.level.fluid_at(x, y, z),
|
||||
(x, y, z) => this.level.collision_shape(x, y, z),
|
||||
false,
|
||||
);
|
||||
@@ -266,18 +266,18 @@ export abstract class Entity {
|
||||
}
|
||||
}
|
||||
|
||||
// flowing liquid pushes it along, like minecraft's isPushedByFluid
|
||||
get pushed_by_liquid() {
|
||||
// flowing fluid pushes it along, like minecraft's isPushedByFluid
|
||||
get pushed_by_fluid() {
|
||||
return true;
|
||||
}
|
||||
|
||||
update_in_water() {
|
||||
this.in_water = physics.in_water(this, (x, y, z) => this.level.is_liquid(x, y, z));
|
||||
this.in_water = physics.in_water(this, (x, y, z) => this.level.is_fluid(x, y, z));
|
||||
}
|
||||
|
||||
// its eyes are in water, so it can't breathe
|
||||
get eyes_in_water() {
|
||||
return physics.eyes_in_water(this, this.eye_height, (x, y, z) => this.level.is_liquid(x, y, z));
|
||||
return physics.eyes_in_water(this, this.eye_height, (x, y, z) => this.level.is_fluid(x, y, z));
|
||||
}
|
||||
|
||||
// falls and moves by its velocity for one tick (see move_body), and counts how far it fell. returns what it hit
|
||||
|
||||
Reference in New Issue
Block a user