Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 6c74c3de5c | |||
| fa60ac48a2 |
@@ -22,7 +22,6 @@ This mod is in early alpha.
|
|||||||
- Settling water
|
- Settling water
|
||||||
- Multi-level liquids from 1 to 8
|
- Multi-level liquids from 1 to 8
|
||||||
- Draining all oceans in a jiffy
|
- Draining all oceans in a jiffy
|
||||||
- Water duplication due to a [bug](https://github.com/minetest/minetest/issues/15647) in the Luanti Engine
|
|
||||||
|
|
||||||
## API
|
## API
|
||||||
|
|
||||||
|
|||||||
15
api.lua
15
api.lua
@@ -80,14 +80,11 @@ function liquid_physics.register_liquid(namespace, source_name, flowing_name)
|
|||||||
|
|
||||||
if flowing_liquid_def.liquidtype ~= "flowing" then
|
if flowing_liquid_def.liquidtype ~= "flowing" then
|
||||||
error("Liquid Physics: " ..
|
error("Liquid Physics: " ..
|
||||||
source_liquid_name .. " is of type " .. source_liquid_def.drawtype .. " and not of type source")
|
source_liquid_name .. " is of type " .. source_liquid_def.drawtype .. " and not of type flowing")
|
||||||
end
|
end
|
||||||
|
|
||||||
--Overwrite source
|
--Overwrite source
|
||||||
source_liquid_def.liquid_range = 0
|
source_liquid_def.liquid_range = 0
|
||||||
source_liquid_def.liquid_renewable = false
|
|
||||||
source_liquid_def.liquid_alternative_flowing = source_liquid_name
|
|
||||||
source_liquid_def.liquid_alternative_source = source_liquid_name
|
|
||||||
|
|
||||||
core.register_node(":" .. source_liquid_name, source_liquid_def)
|
core.register_node(":" .. source_liquid_name, source_liquid_def)
|
||||||
liquid_physics._liquid_ids[source_liquid_name] = id
|
liquid_physics._liquid_ids[source_liquid_name] = id
|
||||||
@@ -142,14 +139,8 @@ function liquid_physics.register_liquid(namespace, source_name, flowing_name)
|
|||||||
|
|
||||||
table.insert(liquids, source_liquid_name)
|
table.insert(liquids, source_liquid_name)
|
||||||
|
|
||||||
--Finally, replace flowing, such that it behaves like a source
|
-- Finally, stop flowing
|
||||||
flowing_liquid_def.liquidtype = "source"
|
core.override_item(flowing_liquid_name, { liquid_range = 0, liquid_renewable = false }, nil)
|
||||||
flowing_liquid_def.liquid_range = 0
|
|
||||||
flowing_liquid_def.liquid_renewable = false
|
|
||||||
flowing_liquid_def.liquid_alternative_flowing = source_liquid_name
|
|
||||||
flowing_liquid_def.liquid_alternative_source = source_liquid_name
|
|
||||||
|
|
||||||
core.register_node(":" .. flowing_liquid_name, flowing_liquid_def)
|
|
||||||
liquid_physics._liquid_ids[flowing_liquid_name] = id
|
liquid_physics._liquid_ids[flowing_liquid_name] = id
|
||||||
|
|
||||||
liquid_physics._registered_liquids[id] = liquids
|
liquid_physics._registered_liquids[id] = liquids
|
||||||
|
|||||||
Reference in New Issue
Block a user