Add Support for dynamic_liquid

(change in dynamic_liquid needed)
master
daretmavi 2020-12-12 22:16:44 +01:00
parent ec62ed62f5
commit ddd17e9a25
2 changed files with 31 additions and 1 deletions

View File

@ -38,6 +38,7 @@ local lava_source_def = minetest.deserialize(minetest.serialize(minetest.registe
local lava_flowing_def = minetest.deserialize(minetest.serialize(minetest.registered_nodes[Liquid_name.lava.flowing])) local lava_flowing_def = minetest.deserialize(minetest.serialize(minetest.registered_nodes[Liquid_name.lava.flowing]))
-- NEW liquid definitions "bucket" liquid -- NEW liquid definitions "bucket" liquid
--minetest.log(dump(minetest.registered_nodes[Liquid_name.water.source]))
minetest.register_node(Liquid_name.water.bucket_source, water_source_def) minetest.register_node(Liquid_name.water.bucket_source, water_source_def)
minetest.override_item(Liquid_name.water.bucket_source, { minetest.override_item(Liquid_name.water.bucket_source, {
description = S("Bucket Water Source"), description = S("Bucket Water Source"),
@ -45,6 +46,14 @@ minetest.override_item(Liquid_name.water.bucket_source, {
liquid_alternative_source = Liquid_name.water.bucket_source, liquid_alternative_source = Liquid_name.water.bucket_source,
liquid_renewable = false, liquid_renewable = false,
}) })
-- For dynamic_liquid support
if minetest.get_modpath("dynamic_liquid") then
-- node is detroyed by lava, Lava source blocks will turn these blocks into steam.
minetest.registered_nodes[Liquid_name.water.bucket_source].groups.dynamic_lava_source_destroys = 1
-- node cools lava
minetest.registered_nodes[Liquid_name.water.bucket_source].groups.dynamic_cools_lava_source = 1
minetest.registered_nodes[Liquid_name.water.bucket_source].groups.dynamic_cools_lava_flowing = 1
end
minetest.register_node(Liquid_name.water.bucket_flowing, water_flowing_def) minetest.register_node(Liquid_name.water.bucket_flowing, water_flowing_def)
minetest.override_item(Liquid_name.water.bucket_flowing, { minetest.override_item(Liquid_name.water.bucket_flowing, {
@ -55,6 +64,22 @@ minetest.override_item(Liquid_name.water.bucket_flowing, {
liquid_renewable = false, liquid_renewable = false,
}) })
-- For dynamic_liquid support
if minetest.get_modpath("dynamic_liquid") then
-- in dynamic_liquid is flowing water not cooling lava
minetest.registered_nodes[Liquid_name.water.bucket_flowing].groups.cools_lava = 0
-- node is detroyed by lava, Flowing lava will turn these blocks into steam
minetest.registered_nodes[Liquid_name.water.bucket_flowing].groups.dynamic_lava_source_destroys = 1
minetest.registered_nodes[Liquid_name.water.bucket_flowing].groups.dynamic_lava_flowing_destroys = 1
-- gedining bucket water as dynamic liquid
dynamic_liquid.liquid_abm(Liquid_name.water.bucket_source, Liquid_name.water.bucket_flowing, 1)
-- this new funktion is needed, because setting goups is not enough
-- not implemented in actrual version (12.12.2020) - musst be added, or use fork https://github.com/daretmavi/dynamic_liquid
dynamic_liquid.add_to_water_nodes(Liquid_name.water.bucket_source, Liquid_name.water.bucket_flowing)
end
minetest.register_node(Liquid_name.lava.bucket_source, lava_source_def) minetest.register_node(Liquid_name.lava.bucket_source, lava_source_def)
minetest.override_item(Liquid_name.lava.bucket_source, { minetest.override_item(Liquid_name.lava.bucket_source, {
description = S("Bucket Lava Source"), description = S("Bucket Lava Source"),
@ -75,6 +100,7 @@ minetest.override_item(Liquid_name.lava.bucket_flowing, {
-- Change Bucket Water to normal "water_source" on contact with it -- Change Bucket Water to normal "water_source" on contact with it
minetest.register_abm({ minetest.register_abm({
label = "Water Source normalization",
nodenames = {Liquid_name.water.bucket_source}, nodenames = {Liquid_name.water.bucket_source},
neighbors = {Liquid_name.water.source, neighbors = {Liquid_name.water.source,
Liquid_name.water.flowing}, Liquid_name.water.flowing},
@ -88,6 +114,7 @@ minetest.register_abm({
-- --
minetest.register_abm({ minetest.register_abm({
label = "Water Flowing normalization",
nodenames = {Liquid_name.water.bucket_flowing}, nodenames = {Liquid_name.water.bucket_flowing},
neighbors = {Liquid_name.water.source, neighbors = {Liquid_name.water.source,
Liquid_name.water.flowing}, Liquid_name.water.flowing},
@ -101,6 +128,7 @@ minetest.register_abm({
-- Change Bucket Water to normal "river_water_source" on contact with it -- Change Bucket Water to normal "river_water_source" on contact with it
minetest.register_abm({ minetest.register_abm({
label = "River Water Source normalization",
nodenames = {Liquid_name.water.bucket_source}, nodenames = {Liquid_name.water.bucket_source},
neighbors = {Liquid_name.water.river_source, neighbors = {Liquid_name.water.river_source,
Liquid_name.water.river_flowing}, Liquid_name.water.river_flowing},
@ -114,6 +142,7 @@ minetest.register_abm({
-- Change Bucket Lava to normal on contact with lava or water -- Change Bucket Lava to normal on contact with lava or water
minetest.register_abm({ minetest.register_abm({
label = "Lava Source normalization",
nodenames = {Liquid_name.lava.bucket_source}, nodenames = {Liquid_name.lava.bucket_source},
neighbors = {Liquid_name.lava.source, neighbors = {Liquid_name.lava.source,
Liquid_name.lava.flowing, Liquid_name.lava.flowing,
@ -133,6 +162,7 @@ minetest.register_abm({
-- Bucket flowing Lava to normal on contact with lava or water -- Bucket flowing Lava to normal on contact with lava or water
minetest.register_abm({ minetest.register_abm({
label = "Lava Flowing normalization",
nodenames = {Liquid_name.lava.bucket_flowing}, nodenames = {Liquid_name.lava.bucket_flowing},
neighbors = {Liquid_name.lava.source, neighbors = {Liquid_name.lava.source,
Liquid_name.lava.flowing, Liquid_name.lava.flowing,

View File

@ -1,4 +1,4 @@
name = bucket name = bucket
description = Bucket - fork of Minetest Game mod with reduced "bucket" liquid flowing description = Bucket - fork of Minetest Game mod with reduced "bucket" liquid flowing
depends = default depends = default
optional_depends = dungeon_loot optional_depends = dungeon_loot, dynamic_liquid