Rename all "liquid" mentions to "fluid"

This commit is contained in:
2026-10-25 13:54:53 -03:00
parent bcca8fa4a5
commit 0cfa4d9b4a
58 changed files with 547 additions and 548 deletions
+1 -1
View File
@@ -6,7 +6,7 @@
"render_layer": "cutout",
"light_emission": 15,
"item": false,
"liquid": { "range": 3, "ticks": 30, "renewable": false },
"fluid": { "range": 3, "ticks": 30, "renewable": false },
"components": {
"bworld:bucketable": {
"into": "bworld:lava_bucket"
+1 -1
View File
@@ -8,7 +8,7 @@
"light_opacity": 1,
"alpha": 0.8,
"item": false,
"liquid": {},
"fluid": {},
"components": {
"bworld:water_source": {},
"bworld:fishable": {},
+1 -1
View File
@@ -3,7 +3,7 @@
"item": {
"id": "bworld:bucket",
"texture": "bworld:bucket",
"targets_liquids": true,
"targets_fluids": true,
"max_stack": 16,
"base_sell_value": 180
}
+1 -1
View File
@@ -3,7 +3,7 @@
"item": {
"id": "bworld:copper_watering_can",
"texture": "bworld:copper_watering_can",
"targets_liquids": true,
"targets_fluids": true,
"tool": {
"type": "watering_can",
"tier": 1,
+1 -1
View File
@@ -3,7 +3,7 @@
"item": {
"id": "bworld:gold_watering_can",
"texture": "bworld:gold_watering_can",
"targets_liquids": true,
"targets_fluids": true,
"tool": {
"type": "watering_can",
"tier": 0,
+1 -1
View File
@@ -3,7 +3,7 @@
"item": {
"id": "bworld:iron_watering_can",
"texture": "bworld:iron_watering_can",
"targets_liquids": true,
"targets_fluids": true,
"tool": {
"type": "watering_can",
"tier": 2,
+1 -1
View File
@@ -9,7 +9,7 @@
},
"components": {
"bworld:fish": {
"liquid": "bworld:lava",
"fluid": "bworld:lava",
"weight": 2,
"minigame": "valley",
"difficulty": 90
+1 -1
View File
@@ -9,7 +9,7 @@
},
"components": {
"bworld:fish": {
"liquid": "bworld:lava",
"fluid": "bworld:lava",
"weight": 8,
"minigame": "ring",
"difficulty": 61
+1 -1
View File
@@ -9,7 +9,7 @@
},
"components": {
"bworld:fish": {
"liquid": "bworld:lava",
"fluid": "bworld:lava",
"weight": 10,
"minigame": "valley",
"difficulty": 50
+1 -1
View File
@@ -9,7 +9,7 @@
},
"components": {
"bworld:fish": {
"liquid": "bworld:lava",
"fluid": "bworld:lava",
"weight": 1,
"minigame": "maze",
"difficulty": 110
+1 -1
View File
@@ -3,7 +3,7 @@
"item": {
"id": "bworld:stone_watering_can",
"texture": "bworld:stone_watering_can",
"targets_liquids": true,
"targets_fluids": true,
"tool": {
"type": "watering_can",
"tier": 1,
+1 -1
View File
@@ -9,7 +9,7 @@
},
"components": {
"bworld:fish": {
"liquid": "bworld:lava",
"fluid": "bworld:lava",
"weight": 4,
"minigame": "ring",
"difficulty": 81
+1 -1
View File
@@ -9,7 +9,7 @@
},
"components": {
"bworld:fish": {
"liquid": "bworld:lava",
"fluid": "bworld:lava",
"weight": 0.1,
"minigame": "hold",
"difficulty": 50
+1 -1
View File
@@ -9,7 +9,7 @@
},
"components": {
"bworld:fish": {
"liquid": "bworld:lava",
"fluid": "bworld:lava",
"weight": 10,
"minigame": "chess",
"difficulty": 70
+1 -1
View File
@@ -3,7 +3,7 @@
"item": {
"id": "bworld:wood_watering_can",
"texture": "bworld:wood_watering_can",
"targets_liquids": true,
"targets_fluids": true,
"tool": {
"type": "watering_can",
"tier": 0,
+9 -9
View File
@@ -15,9 +15,9 @@ const FISH = "bworld:fish";
// the menu a fish's minigame is played in. client.ts gives it the minigame's screen, see minigames/mod.ts
const MINIGAME_MENU = "bworld:fishing_minigame";
// what's caught in a fishable block whose bworld:fishable doesn't name a table, like water. each table is built from
// the items with bworld:fish that live in its liquid, see register_fishing
// the items with bworld:fish that live in its fluid, see register_fishing
const FISHING_TABLE = "bworld:gameplay/fishing";
// the liquid a fish lives in when it doesn't say
// the fluid a fish lives in when it doesn't say
const WATER = "bworld:water";
// further than this from the hook, the line snaps
const LINE_LENGTH = 16;
@@ -65,7 +65,7 @@ interface FishParams {
// how hard its minigame is, 10 when not given. what it changes is up to the minigame
difficulty?: number;
// the fishable block it's caught in, bworld:water when not given. it's in that block's loot table
liquid?: string;
fluid?: string;
}
interface Cast {
@@ -111,7 +111,7 @@ export function register_fishing(ctx: ServerContext) {
const fly = (cast: Cast, velocity: Position, now: number) => {
const from = cast.position;
const to = { x: from.x + velocity.x, y: from.y + velocity.y, z: from.z + velocity.z };
const hit = ctx.world.raycast(from, to, { liquids: "any" });
const hit = ctx.world.raycast(from, to, { fluids: "any" });
if (!hit) {
cast.position = to;
velocity.x *= DRAG;
@@ -167,7 +167,7 @@ export function register_fishing(ctx: ServerContext) {
return from <= to ? hour >= from && hour < to : hour >= from || hour < to;
});
// every item with bworld:fish is in its liquid's fishing table, caught in its seasons, at its hours and in its
// every item with bworld:fish is in its fluid's fishing table, caught in its seasons, at its hours and in its
// biomes
ctx.components.register_item<FishParams>(FISH, {});
const tables = new Map<string, { item: string; weight: number; conditions: { condition: string }[] }[]>([
@@ -186,12 +186,12 @@ export function register_fishing(ctx: ServerContext) {
if (fish.seasons) conditions.push({ condition: "bworld:season", seasons: fish.seasons });
if (fish.time) conditions.push({ condition: "bworld:time", ...fish.time });
if (fish.biomes) conditions.push({ condition: "bworld:biome", biomes: fish.biomes });
const liquid = fish.liquid ?? WATER;
if (!ctx.blocks.exists(liquid) || !(FISHABLE in ctx.blocks.components(liquid))) {
throw new Error(`${id} is caught in ${liquid}, which isn't a block with ${FISHABLE}`);
const fluid = fish.fluid ?? WATER;
if (!ctx.blocks.exists(fluid) || !(FISHABLE in ctx.blocks.components(fluid))) {
throw new Error(`${id} is caught in ${fluid}, which isn't a block with ${FISHABLE}`);
}
const entry = { item: id, weight: fish.weight ?? 1, conditions };
const table = table_of(liquid);
const table = table_of(fluid);
tables.set(table, [...tables.get(table) ?? [], entry]);
return [entry];
});
+2 -2
View File
@@ -815,11 +815,11 @@ function register_buckets(ctx: ServerContext) {
if (bucket?.id !== BUCKET) return false;
const { x, y, z } = block;
if (ctx.world.get_block(x, y, z) === block.id) {
// only a liquid's source fills it, not where it's flowing
// only a fluid's source fills it, not where it's flowing
if ((ctx.world.get_state(x, y, z, "level") ?? 0) !== 0) return false;
ctx.world.set_block(x, y, z, "bworld:air");
} else {
// the liquid in a waterlogged block, like a fence in water, which stays
// the fluid in a waterlogged block, like a fence in water, which stays
ctx.world.set_state(x, y, z, "waterlogged", 0);
}
bucket.count -= 1;