0
0
Fork 0

Sugarcane: No place inside liquid

This commit is contained in:
Wuzzy 2020-11-12 21:12:25 +01:00
parent 9365493696
commit bd2d0f717a
1 changed files with 6 additions and 0 deletions

View File

@ -87,11 +87,17 @@ minetest.register_node("mcl_core:reeds", {
-- Placement rules:
-- * On top of group:soil_sugarcane AND next to water or frosted ice. OR
-- * On top of sugar canes
-- * Not inside liquid
if snn == "mcl_core:reeds" then
return true
elseif minetest.get_item_group(snn, "soil_sugarcane") == 0 then
return false
end
local place_node = minetest.get_node(place_pos)
local pdef = minetest.registered_nodes[place_node.name]
if pdef and pdef.liquidtype ~= "none" then
return false
end
-- Legal water position rules are the same as for decoration spawn_by rules.
-- This differs from MC, which does not allow diagonal neighbors