Allow overriding visible fluid medium in node defs

This allows e.g. non-sunlight-propagates nodes to
behave like sunlight-propagates ones for purposes
of nametag display.

This should complete the changes necessary to
make NodeCore "darkcore" mode feasible with
true darkness by disabling sunlight_propagates
for air to block moonlight, but still pass optics,
nametags, and radiant heat as if transparent.
This commit is contained in:
Aaron Suen 2022-10-09 12:09:31 -04:00
parent e92d6f6d64
commit 585aae3b74

View File

@ -34,7 +34,8 @@ local function fluidmedium(pos)
local node = minetest.get_node(pos) local node = minetest.get_node(pos)
local def = minetest.registered_items[node.name] local def = minetest.registered_items[node.name]
if not def then return node.name end if not def then return node.name end
if def.sunlight_propagates then return "CLEAR" end if def.visible_fluid_medium then return def.visible_fluid_medium end
if def.sunlight_propagates then return "air" end
return def.liquid_alternative_source or node.name return def.liquid_alternative_source or node.name
end end