2025-01-05 17:11:50 +00:00
|
|
|
# Liquid Physics
|
|
|
|
|
|
|
|
This Luanti mod adds physics to liquids.
|
|
|
|
|
|
|
|
This mod is in early alpha.
|
|
|
|
|
|
|
|
## What NOT to expect
|
|
|
|
|
2025-01-11 22:02:29 +00:00
|
|
|
- Proper water equalization and water pressure *
|
|
|
|
- Removing weeds and other wall mounted items *
|
|
|
|
- Interaction of different liquid types, e.g. lava and water *
|
2025-01-05 17:11:50 +00:00
|
|
|
- Interaction with pistons or pipes
|
|
|
|
- Perfect performance
|
2025-01-11 22:02:29 +00:00
|
|
|
- Integration with any other mods *
|
2025-01-05 17:11:50 +00:00
|
|
|
- A smooth liquid surface
|
|
|
|
- Viscosity for different liquid types
|
|
|
|
|
2025-01-11 22:02:29 +00:00
|
|
|
* to an extend
|
|
|
|
|
2025-01-05 17:11:50 +00:00
|
|
|
## What to expect
|
|
|
|
|
|
|
|
- Water leveling for flat surfaces
|
|
|
|
- Settling water
|
|
|
|
- Multi-level liquids from 1 to 8
|
|
|
|
- Draining all oceans in a jiffy
|
|
|
|
|
|
|
|
## API
|
|
|
|
|
|
|
|
- Other developers may chose to support this mod by using the API.
|
2025-01-06 21:27:27 +00:00
|
|
|
```lua
|
|
|
|
--Example: Register default:water_source
|
2025-01-05 17:11:50 +00:00
|
|
|
liquid_physics.register_liquid("default", "water_source", "water_flowing")
|
|
|
|
|
2025-01-11 22:02:29 +00:00
|
|
|
--Example: Register bucket:bucket_water to scoop up liquids
|
|
|
|
liquid_physics.register_bucket("bucket:bucket_water")
|
|
|
|
|
2025-01-06 21:27:27 +00:00
|
|
|
--Example: Check if block underneath is liquid and then proceed to reduce its level
|
|
|
|
local id_water = liquid_physics.get_liquid_id("default:water_source")
|
|
|
|
local liquid = liquid_physics.get_liquid_at(pos)
|
|
|
|
|
|
|
|
if liquid and liquid.liquid_id == id_water then
|
|
|
|
liquid_physics.set_liquid_at(pos, id_water, liquid.liquid_level - 1)
|
|
|
|
end
|
|
|
|
```
|