fix dirt spreads

https://github.com/FaceDeer/dfcaverns/issues/35
This commit is contained in:
FaceDeer 2022-08-18 09:27:07 -06:00
parent 54ca92f0e8
commit 179e113acd
2 changed files with 4 additions and 4 deletions

View File

@ -151,12 +151,12 @@ minetest.register_node("df_primordial_items:dirt_with_mycelium", {
minetest.register_abm{ minetest.register_abm{
label = "df_primordial_items:dirt_with_mycelium_spread", label = "df_primordial_items:dirt_with_mycelium_spread",
nodenames = {df_dependencies.node_name_dirt}, nodenames = {df_dependencies.node_name_dirt},
neighbors = {"df_mapitems:dirt_with_mycelium"}, neighbors = {"df_primordial_items:dirt_with_mycelium"},
interval = 60, interval = 60,
chance = 50, chance = 50,
catch_up = true, catch_up = true,
action = function(pos) action = function(pos)
minetest.swap_node(pos, {name="df_mapitems:dirt_with_mycelium"}) minetest.swap_node(pos, {name="df_primordial_items:dirt_with_mycelium"})
end, end,
} }

View File

@ -306,14 +306,14 @@ minetest.register_node("df_primordial_items:dirt_with_jungle_grass", {
minetest.register_abm{ minetest.register_abm{
label = "df_primordial_items:jungle_grass_spread", label = "df_primordial_items:jungle_grass_spread",
nodenames = {df_dependencies.node_name_dirt}, nodenames = {df_dependencies.node_name_dirt},
neighbors = {"df_mapitems:dirt_with_jungle_grass"}, neighbors = {"df_primordial_items:dirt_with_jungle_grass"},
interval = 60, interval = 60,
chance = 50, chance = 50,
catch_up = true, catch_up = true,
action = function(pos) action = function(pos)
local above_def = minetest.registered_nodes[minetest.get_node({x=pos.x, y=pos.y+1, z=pos.z}).name] local above_def = minetest.registered_nodes[minetest.get_node({x=pos.x, y=pos.y+1, z=pos.z}).name]
if above_def and (above_def.buildable_to == true or above_def.walkable == false) then if above_def and (above_def.buildable_to == true or above_def.walkable == false) then
minetest.swap_node(pos, {name="df_mapitems:dirt_with_jungle_grass"}) minetest.swap_node(pos, {name="df_primordial_items:dirt_with_jungle_grass"})
end end
end, end,
} }