stair dependencies

This commit is contained in:
FaceDeer 2022-08-06 19:54:14 -06:00
parent aec23c703d
commit 9f9389c9d5
24 changed files with 143 additions and 148 deletions

View File

@ -1,17 +1,17 @@
local n1 = { name = "df_underworld_items:slade_block", force_place=true } local n1 = { name = "df_underworld_items:slade_block", force_place=true }
local n2 = { name = "stairs:stair_outer_slade_brick", param2 = 1, force_place=true } local n2 = { name = df_dependencies.node_name_stair_outer_slade_brick, param2 = 1, force_place=true }
local n3 = { name = "stairs:stair_slade_brick", force_place=true } local n3 = { name = df_dependencies.node_name_stair_slade_brick, force_place=true }
local n4 = { name = "stairs:stair_outer_slade_brick", force_place=true } local n4 = { name = df_dependencies.node_name_stair_outer_slade_brick, force_place=true }
local n5 = { name = "air", force_place=true } local n5 = { name = "air", force_place=true }
local n6 = { name = "df_underworld_items:slade_seal", force_place=true } local n6 = { name = "df_underworld_items:slade_seal", force_place=true }
local n7 = { name = "stairs:stair_slade_brick", param2 = 1, force_place=true } local n7 = { name = df_dependencies.node_name_stair_slade_brick, param2 = 1, force_place=true }
local n8 = { name = "df_underworld_items:slade_brick", force_place=true } local n8 = { name = "df_underworld_items:slade_brick", force_place=true }
local n9 = { name = "stairs:stair_slade_brick", param2 = 3, force_place=true } local n9 = { name = df_dependencies.node_name_stair_slade_brick, param2 = 3, force_place=true }
local n10 = { name = "df_underworld_items:slade_wall", force_place=true } local n10 = { name = "df_underworld_items:slade_wall", force_place=true }
local n11 = { name = "df_underworld_items:stonebrick_light_worn", prob=192 } -- 50% chance of being force-placed local n11 = { name = "df_underworld_items:stonebrick_light_worn", prob=192 } -- 50% chance of being force-placed
local n12 = { name = "stairs:stair_outer_slade_brick", param2 = 2, force_place=true } local n12 = { name = df_dependencies.node_name_stair_outer_slade_brick, param2 = 2, force_place=true }
local n13 = { name = "stairs:stair_slade_brick", param2 = 2, force_place=true } local n13 = { name = df_dependencies.node_name_stair_slade_brick, param2 = 2, force_place=true }
local n14 = { name = "stairs:stair_outer_slade_brick", param2 = 3, force_place=true } local n14 = { name = df_dependencies.node_name_stair_outer_slade_brick, param2 = 3, force_place=true }
return { return {
name = "df_caverns:lamppost", name = "df_caverns:lamppost",

View File

@ -3,21 +3,21 @@ local n8 = { name = "air", force_place=true }
local n3 = { name = "df_underworld_items:slade_brick", force_place=true } local n3 = { name = "df_underworld_items:slade_brick", force_place=true }
local n4 = { name = "df_underworld_items:slade_wall", force_place=true } local n4 = { name = "df_underworld_items:slade_wall", force_place=true }
local n5 = { name = "stairs:stair_outer_slade_brick", param2 = 1, force_place=true } local n5 = { name = df_dependencies.node_name_stair_outer_slade_brick, param2 = 1, force_place=true }
local n6 = { name = "stairs:stair_slade_brick", force_place=true } local n6 = { name = df_dependencies.node_name_stair_slade_brick, force_place=true }
local n7 = { name = "stairs:stair_outer_slade_brick", force_place=true } local n7 = { name = df_dependencies.node_name_stair_outer_slade_brick, force_place=true }
local n9 = { name = "stairs:slab_slade_brick", param2 = 23, force_place=true } local n9 = { name = df_dependencies.node_name_slab_slade_brick, param2 = 23, force_place=true }
local n10 = { name = "stairs:stair_slade_brick", param2 = 1, force_place=true } local n10 = { name = df_dependencies.node_name_stair_slade_brick, param2 = 1, force_place=true }
local n11 = { name = "stairs:stair_slade_brick", param2 = 3, force_place=true } local n11 = { name = df_dependencies.node_name_stair_slade_brick, param2 = 3, force_place=true }
local n14 = { name = "stairs:stair_slade_brick", param2 = 23, force_place=true } local n14 = { name = df_dependencies.node_name_stair_slade_brick, param2 = 23, force_place=true }
local n15 = { name = "stairs:stair_outer_slade_brick", param2 = 2, force_place=true } local n15 = { name = df_dependencies.node_name_stair_outer_slade_brick, param2 = 2, force_place=true }
local n16 = { name = "stairs:stair_slade_brick", param2 = 2, force_place=true } local n16 = { name = df_dependencies.node_name_stair_slade_brick, param2 = 2, force_place=true }
local n17 = { name = "stairs:stair_outer_slade_brick", param2 = 3, force_place=true } local n17 = { name = df_dependencies.node_name_stair_outer_slade_brick, param2 = 3, force_place=true }
-- foundation nodes -- foundation nodes
local n2 = { name = "df_underworld_items:slade_brick", force_place=false, place_on_condition=mapgen_helper.buildable_to } local n2 = { name = "df_underworld_items:slade_brick", force_place=false, place_on_condition=mapgen_helper.buildable_to }
local n12 = { name = "df_underworld_items:slade_wall", force_place=false, place_on_condition=mapgen_helper.buildable_to } local n12 = { name = "df_underworld_items:slade_wall", force_place=false, place_on_condition=mapgen_helper.buildable_to }
local n13 = { name = "stairs:stair_slade_brick", param2 = 1, force_place=false, place_on_condition=mapgen_helper.buildable_to } local n13 = { name = df_dependencies.node_name_stair_slade_brick, param2 = 1, force_place=false, place_on_condition=mapgen_helper.buildable_to }
return { return {

View File

@ -1,14 +1,14 @@
local n1 = { name = "df_underworld_items:slade_block", force_place=true } local n1 = { name = "df_underworld_items:slade_block", force_place=true }
local n2 = { name = "stairs:stair_outer_slade_brick", param2 = 1, force_place=true } local n2 = { name = df_dependencies.node_name_stair_outer_slade_brick, param2 = 1, force_place=true }
local n3 = { name = "stairs:stair_slade_brick", force_place=true } local n3 = { name = df_dependencies.node_name_stair_slade_brick, force_place=true }
local n4 = { name = "stairs:stair_outer_slade_brick", force_place=true } local n4 = { name = df_dependencies.node_name_stair_outer_slade_brick, force_place=true }
local n5 = { name = "air", force_place=true } local n5 = { name = "air", force_place=true }
local n6 = { name = "df_underworld_items:slade_seal", force_place=true } local n6 = { name = "df_underworld_items:slade_seal", force_place=true }
local n7 = { name = "stairs:stair_slade_brick", param2 = 1, force_place=true } local n7 = { name = df_dependencies.node_name_stair_slade_brick, param2 = 1, force_place=true }
local n8 = { name = "stairs:stair_slade_brick", param2 = 3, force_place=true } local n8 = { name = df_dependencies.node_name_stair_slade_brick, param2 = 3, force_place=true }
local n9 = { name = "stairs:stair_outer_slade_brick", param2 = 2, force_place=true } local n9 = { name = df_dependencies.node_name_stair_outer_slade_brick, param2 = 2, force_place=true }
local n10 = { name = "stairs:stair_slade_brick", param2 = 2, force_place=true } local n10 = { name = df_dependencies.node_name_stair_slade_brick, param2 = 2, force_place=true }
local n11 = { name = "stairs:stair_outer_slade_brick", param2 = 3, force_place=true } local n11 = { name = df_dependencies.node_name_stair_outer_slade_brick, param2 = 3, force_place=true }
return { return {
name="df_caverns:oubliette", name="df_caverns:oubliette",

View File

@ -3,21 +3,21 @@ local n10 = { name = "air", force_place=true }
local n3 = { name = "df_underworld_items:slade_brick", force_place=true } local n3 = { name = "df_underworld_items:slade_brick", force_place=true }
local n4 = { name = "df_underworld_items:slade_wall", force_place=true } local n4 = { name = "df_underworld_items:slade_wall", force_place=true }
local n5 = { name = "stairs:stair_outer_slade_brick", param2 = 1, force_place=true } local n5 = { name = df_dependencies.node_name_stair_outer_slade_brick, param2 = 1, force_place=true }
local n6 = { name = "stairs:stair_slade_brick", force_place=true } local n6 = { name = df_dependencies.node_name_stair_slade_brick, force_place=true }
local n7 = { name = "stairs:stair_outer_slade_brick", force_place=true } local n7 = { name = df_dependencies.node_name_stair_outer_slade_brick, force_place=true }
local n11 = { name = "stairs:stair_slade_brick", param2 = 1, force_place=true } local n11 = { name = df_dependencies.node_name_stair_slade_brick, param2 = 1, force_place=true }
local n12 = { name = "stairs:slab_slade_brick", param2 = 22, force_place=true} local n12 = { name = df_dependencies.node_name_slab_slade_brick, param2 = 22, force_place=true}
local n13 = { name = "stairs:stair_slade_brick", param2 = 3, force_place=true } local n13 = { name = df_dependencies.node_name_stair_slade_brick, param2 = 3, force_place=true }
local n15 = { name = "stairs:stair_outer_slade_brick", param2 = 2, force_place=true } local n15 = { name = df_dependencies.node_name_stair_outer_slade_brick, param2 = 2, force_place=true }
local n16 = { name = "stairs:stair_slade_brick", param2 = 2, force_place=true } local n16 = { name = df_dependencies.node_name_stair_slade_brick, param2 = 2, force_place=true }
local n17 = { name = "stairs:stair_outer_slade_brick", param2 = 3, force_place=true } local n17 = { name = df_dependencies.node_name_stair_outer_slade_brick, param2 = 3, force_place=true }
-- foundation nodes -- foundation nodes
local n2 = { name = "df_underworld_items:slade_brick", force_place=false, place_on_condition=mapgen_helper.buildable_to } local n2 = { name = "df_underworld_items:slade_brick", force_place=false, place_on_condition=mapgen_helper.buildable_to }
local n8 = { name = "stairs:stair_slade_brick", param2 = 2, force_place=false, place_on_condition=mapgen_helper.buildable_to } local n8 = { name = df_dependencies.node_name_stair_slade_brick, param2 = 2, force_place=false, place_on_condition=mapgen_helper.buildable_to }
local n9 = { name = "stairs:stair_slade_brick", force_place=false, place_on_condition=mapgen_helper.buildable_to } local n9 = { name = df_dependencies.node_name_stair_slade_brick, force_place=false, place_on_condition=mapgen_helper.buildable_to }
local n14 = { name = "stairs:stair_slade_brick", param2 = 1, force_place=false, place_on_condition=mapgen_helper.buildable_to } local n14 = { name = df_dependencies.node_name_stair_slade_brick, param2 = 1, force_place=false, place_on_condition=mapgen_helper.buildable_to }
return { return {
name = "df_caverns:small_building", name = "df_caverns:small_building",

View File

@ -1,10 +1,10 @@
local n1 = { name = "df_underworld_items:slade_brick", force_place=false, place_on_condition=mapgen_helper.buildable_to } local n1 = { name = "df_underworld_items:slade_brick", force_place=false, place_on_condition=mapgen_helper.buildable_to }
local n2 = { name = "stairs:stair_inner_slade_brick", param2 = 1, force_place=true } local n2 = { name = df_dependencies.node_name_stair_inner_slade_brick, param2 = 1, force_place=true }
local n3 = { name = "stairs:stair_inner_slade_brick", force_place=true } local n3 = { name = df_dependencies.node_name_stair_inner_slade_brick, force_place=true }
local n4 = { name = "df_underworld_items:slade_brick", force_place=true } local n4 = { name = "df_underworld_items:slade_brick", force_place=true }
local n5 = { name = "stairs:stair_inner_slade_brick", param2 = 2, force_place=true } local n5 = { name = df_dependencies.node_name_stair_inner_slade_brick, param2 = 2, force_place=true }
local n6 = { name = "stairs:stair_inner_slade_brick", param2 = 3, force_place=true } local n6 = { name = df_dependencies.node_name_stair_inner_slade_brick, param2 = 3, force_place=true }
return { return {
name = "df_caverns:small_slab", name = "df_caverns:small_slab",

View File

@ -471,6 +471,8 @@ minetest.register_on_generated(function(minp, maxp, seed)
mapgen_helper.place_schematic_on_data(data, data_param2, area, building.pos, lamppost_schematic) mapgen_helper.place_schematic_on_data(data, data_param2, area, building.pos, lamppost_schematic)
local lamp_pos = vector.new(building.pos.x, building.pos.y+6, building.pos.z) local lamp_pos = vector.new(building.pos.x, building.pos.y+6, building.pos.z)
minetest.after(math.random()*10, function() minetest.after(math.random()*10, function()
-- not all of these locations will get a lamp, but it's easier to just set four
-- timers than to worry about testing first.
minetest.get_node_timer({x=lamp_pos.x+1, y=lamp_pos.y, z=lamp_pos.z}):start(math.random()*60) minetest.get_node_timer({x=lamp_pos.x+1, y=lamp_pos.y, z=lamp_pos.z}):start(math.random()*60)
minetest.get_node_timer({x=lamp_pos.x-1, y=lamp_pos.y, z=lamp_pos.z}):start(math.random()*60) minetest.get_node_timer({x=lamp_pos.x-1, y=lamp_pos.y, z=lamp_pos.z}):start(math.random()*60)
minetest.get_node_timer({x=lamp_pos.x, y=lamp_pos.y, z=lamp_pos.z+1}):start(math.random()*60) minetest.get_node_timer({x=lamp_pos.x, y=lamp_pos.y, z=lamp_pos.z+1}):start(math.random()*60)

View File

@ -38,8 +38,10 @@ end
df_dependencies.mods_required.stairs = true df_dependencies.mods_required.stairs = true
df_dependencies.mods_required.moreblocks = true df_dependencies.mods_required.moreblocks = true
df_dependencies.mods_required.doors = true df_dependencies.mods_required.doors = true
df_dependencies.mods_required.mcl_stairs = true
df_dependencies.register_all_stairs = function(name, override_def)
local node_name_to_stair_properties = function(name, override)
local mod = minetest.get_current_modname() local mod = minetest.get_current_modname()
local node_def = minetest.registered_nodes[mod..":"..name] local node_def = minetest.registered_nodes[mod..":"..name]
@ -49,7 +51,11 @@ df_dependencies.register_all_stairs = function(name, override_def)
for index, value in pairs(override_def) do for index, value in pairs(override_def) do
node_copy[index] = value node_copy[index] = value
end end
return mod, node_copy
end
df_dependencies.register_stairs = function(name, override_def)
local mod, node_copy = node_name_to_stair_properties(name, override_def)
if minetest.get_modpath("stairs") then if minetest.get_modpath("stairs") then
stairs.register_stair_and_slab( stairs.register_stair_and_slab(
name, name,
@ -61,25 +67,38 @@ df_dependencies.register_all_stairs = function(name, override_def)
node_copy.sounds node_copy.sounds
) )
end end
if minetest.get_modpath("mcl_stairs") then
mcl_stairs.register_stair_and_slab_simple(
name,
mod ..":" .. name,
S("@1 Stair", node_copy.description),
S("@1 Slab", node_copy.description),
S("Double @1 Slab", node_copy.description)
)
end
end
df_dependencies.register_more_stairs = function(name, override_def)
local mod, node_copy = node_name_to_stair_properties(name, override_def)
if minetest.get_modpath("moreblocks") then if minetest.get_modpath("moreblocks") then
stairsplus:register_all(mod, name, mod..":"..name, node_copy) stairsplus:register_all(mod, name, mod..":"..name, node_copy)
end end
end end
df_dependencies.register_all_fences = function (name, override_def) df_dependencies.register_all_fences = function (name, override_def)
local mod = minetest.get_current_modname() local mod, node_def = node_name_to_stair_properties(name, override_def)
local material = mod..":"..name
local node_def = minetest.registered_nodes[material]
override_def = override_def or {} override_def = override_def or {}
local material = override_def.material or mod..":"..name
local burntime = override_def.burntime local burntime = override_def.burntime
local texture = override_def.texture or node_def.tiles[1]
if minetest.get_modpath("default") then if minetest.get_modpath("default") then
default.register_fence(material .. "_fence", { default.register_fence(material .. "_fence", {
description = S("@1 Fence", node_def.description), description = S("@1 Fence", node_def.description),
texture = override_def.texture or node_def.tiles[1], texture = texture,
material = override_def.material or material, material = material,
groups = deep_copy(node_def.groups or {}), -- the default register_fence function modifies the groups table passed in, so send a copy instead to be on the safe side. groups = deep_copy(node_def.groups or {}), -- the default register_fence function modifies the groups table passed in, so send a copy instead to be on the safe side.
sounds = node_def.sounds sounds = node_def.sounds
}) })
@ -93,8 +112,8 @@ df_dependencies.register_all_fences = function (name, override_def)
default.register_fence_rail(material .. "_fence_rail", { default.register_fence_rail(material .. "_fence_rail", {
description = S("@1 Fence Rail", node_def.description), description = S("@1 Fence Rail", node_def.description),
texture = override_def.texture or node_def.tiles[1], texture = texture,
material = override_def.material or material, material = material,
groups = deep_copy(node_def.groups or {}), -- the default register_fence_rail function modifies the groups table passed in, so send a copy instead to be on the safe side. groups = deep_copy(node_def.groups or {}), -- the default register_fence_rail function modifies the groups table passed in, so send a copy instead to be on the safe side.
sounds = node_def.sounds sounds = node_def.sounds
}) })
@ -108,20 +127,18 @@ df_dependencies.register_all_fences = function (name, override_def)
default.register_mesepost(material .. "_mese_light", { default.register_mesepost(material .. "_mese_light", {
description = S("@1 Mese Post Light", node_def.description), description = S("@1 Mese Post Light", node_def.description),
texture = override_def.texture or node_def.tiles[1], texture = texture,
material = override_def.material or material, material = material,
groups = deep_copy(node_def.groups or {}), -- the default register_fence_rail function modifies the groups table passed in, so send a copy instead to be on the safe side. groups = deep_copy(node_def.groups or {}), -- the default register_fence_rail function modifies the groups table passed in, so send a copy instead to be on the safe side.
sounds = node_def.sounds sounds = node_def.sounds
}) })
else
-- TODO
end end
if minetest.get_modpath("doors") then if minetest.get_modpath("doors") then
doors.register_fencegate(material .. "_fence_gate", { doors.register_fencegate(material .. "_fence_gate", {
description = S("@1 Fence Gate", node_def.description), description = S("@1 Fence Gate", node_def.description),
texture = override_def.texture or node_def.tiles[1], texture = texture,
material = override_def.material or material, material = material,
groups = deep_copy(node_def.groups or {}), -- the default register_fence_rail function modifies the groups table passed in, so send a copy instead to be on the safe side. groups = deep_copy(node_def.groups or {}), -- the default register_fence_rail function modifies the groups table passed in, so send a copy instead to be on the safe side.
sounds = node_def.sounds sounds = node_def.sounds
}) })
@ -133,8 +150,11 @@ df_dependencies.register_all_fences = function (name, override_def)
burntime = burntime * 2, -- ignoring four sticks burntime = burntime * 2, -- ignoring four sticks
}) })
end end
else
-- TODO
end end
end end
df_dependencies.register_all_stairs_and_fences = function(name, override_def)
df_dependencies.register_stairs(name, override_def)
df_dependencies.register_more_stairs(name, override_def)
df_dependencies.register_all_fences(name, override_def)
end

View File

@ -1,4 +1,4 @@
name = df_dependencies name = df_dependencies
description = A utility mod for df_caverns that gathers all dependencies on minetest_game in one place, to ease compatibility efforts with mineclone and other such games description = A utility mod for df_caverns that gathers all dependencies on minetest_game in one place, to ease compatibility efforts with mineclone and other such games
depends = depends =
optional_depends = beds, bucket, default, doors, farming, fireflies, mcl_beds, mcl_buckets, mcl_chests, mcl_compatibility, mcl_copper, mcl_core, mcl_doors, mcl_farming, mcl_furnaces, mcl_init, mcl_lanterns, mcl_mapgen, mcl_mobitems, mcl_ocean, mcl_potions, mcl_sounds, mcl_strongholds, mcl_torches, mcl_wool, mcl_worlds, mclx_core, mesecons, moreblocks, stairs, vessels, wool optional_depends = beds, bucket, default, doors, farming, fireflies, mcl_beds, mcl_buckets, mcl_chests, mcl_compatibility, mcl_copper, mcl_core, mcl_doors, mcl_farming, mcl_furnaces, mcl_init, mcl_lanterns, mcl_mapgen, mcl_mobitems, mcl_ocean, mcl_potions, mcl_sounds, mcl_strongholds, mcl_torches, mcl_wool, mcl_worlds, mclx_core, mesecons, moreblocks, stairs, vessels, wool, mcl_stairs

View File

@ -6,7 +6,9 @@ local function select_required(...)
newdef[string.match(node, "(.-):")] = node newdef[string.match(node, "(.-):")] = node
end end
local ret = df_dependencies.select_required(newdef) local ret = df_dependencies.select_required(newdef)
assert(minetest.registered_items[ret] ~= nil, "Node " .. ret .. " was returned by a selection call but is not registered.") minetest.after(0, function()
assert(minetest.registered_items[ret] ~= nil, "Node " .. ret .. " was returned by a selection call but is not registered.")
end)
return ret return ret
end end
@ -17,7 +19,9 @@ local function select_optional(...)
end end
local ret = df_dependencies.select_optional(newdef) local ret = df_dependencies.select_optional(newdef)
if ret ~= nil then if ret ~= nil then
assert(minetest.registered_items[ret] ~= nil, "Node " .. ret .. " was returned by an optional selection call but is not registered.") minetest.after(0, function()
assert(minetest.registered_items[ret] ~= nil, "Node " .. ret .. " was returned by an optional selection call but is not registered.")
end)
end end
end end
@ -84,3 +88,14 @@ df_dependencies.node_name_bed_top = select_required("beds:bed_top", "mcl_beds:be
-- from "doors" -- from "doors"
df_dependencies.node_name_door_wood_a = select_required("doors:door_wood_a", "mcl_doors:wooden_door_b_1") df_dependencies.node_name_door_wood_a = select_required("doors:door_wood_a", "mcl_doors:wooden_door_b_1")
df_dependencies.node_name_door_hidden = select_required("doors:hidden", "mcl_doors:wooden_door_t_1") df_dependencies.node_name_door_hidden = select_required("doors:hidden", "mcl_doors:wooden_door_t_1")
-- from "stairs"
df_dependencies.node_name_slab_goblin_cap_stem_wood = select_required("stairs:slab_goblin_cap_stem_wood", "mcl_stairs:slab_goblin_cap_stem_wood")
df_dependencies.node_name_slab_slade_brick = select_required("stairs:slab_slade_brick", "mcl_stairs:slab_slade_brick")
df_dependencies.node_name_stair_goblin_cap_stem_wood = select_required("stairs:stair_goblin_cap_stem_wood", "mcl_stairs:stair_goblin_cap_stem_wood")
df_dependencies.node_name_stair_inner_slade_brick = select_required("stairs:stair_inner_slade_brick", "mcl_stairs:stair_slade_brick_inner")
df_dependencies.node_name_stair_outer_slade_brick = select_required("stairs:stair_outer_slade_brick", "mcl_stairs:stair_slade_brick_outer")
df_dependencies.node_name_stair_slade_block = select_required("stairs:stair_slade_block", "mcl_stairs:stair_slade_block")
df_dependencies.node_name_stair_slade_brick = select_required("stairs:stair_slade_brick", "mcl_stairs:stair_slade_brick")

View File

@ -146,8 +146,7 @@ minetest.register_craft({
} }
}) })
df_trees.register.all_stairs("fern_wood") df_trees.register.all_stairs_and_fences("fern_wood", {burntime=7})
df_trees.register.all_fences("fern_wood", {burntime=7})
minetest.register_node("df_primordial_items:giant_fern_leaves", { minetest.register_node("df_primordial_items:giant_fern_leaves", {
description = S("Giant Fern Leaves"), description = S("Giant Fern Leaves"),

View File

@ -117,8 +117,7 @@ minetest.register_craft({
} }
}) })
df_trees.register.all_stairs("primordial_mush_trunk_wood") df_trees.register.all_stairs_and_fences("primordial_mush_trunk_wood", {burntime = 7})
df_trees.register.all_fences("primordial_mush_trunk_wood", {burntime = 7})
minetest.register_node("df_primordial_items:primordial_mush_cap_wood", { minetest.register_node("df_primordial_items:primordial_mush_cap_wood", {
description = S("Primordial Cap Wood"), description = S("Primordial Cap Wood"),
@ -138,8 +137,7 @@ minetest.register_craft({
} }
}) })
df_trees.register.all_stairs("primordial_mush_cap_wood") df_trees.register.all_stairs_and_fences("primordial_mush_cap_wood", {burntime=12})
df_trees.register.all_fences("primordial_mush_cap_wood", {burntime=12})
minetest.register_craft({ minetest.register_craft({

View File

@ -99,8 +99,7 @@ minetest.register_node("df_trees:black_cap_wood", {
sounds = df_trees.sounds.wood, sounds = df_trees.sounds.wood,
}) })
df_trees.register.all_stairs("black_cap_wood") df_trees.register.all_stairs_and_fences("black_cap_wood", {burntime = 30})
df_trees.register.all_fences("black_cap_wood", {burntime = 30})
minetest.register_craft({ minetest.register_craft({
type = "fuel", type = "fuel",

View File

@ -176,8 +176,7 @@ minetest.register_node("df_trees:blood_thorn_wood", {
sounds = df_trees.sounds.wood, sounds = df_trees.sounds.wood,
}) })
df_trees.register.all_stairs("blood_thorn_wood") df_trees.register.all_stairs_and_fences("blood_thorn_wood", {burntime = 40})
df_trees.register.all_fences("blood_thorn_wood", {burntime = 40})
minetest.register_craft({ minetest.register_craft({
type = "fuel", type = "fuel",

View File

@ -37,9 +37,7 @@ df_trees.textures.gold_block = df_dependencies.texture_gold_block
df_trees.register = {} df_trees.register = {}
df_trees.register.all_stairs = df_dependencies.register_all_stairs df_trees.register.all_stairs_and_fences = df_dependencies.register_all_stairs_and_fences
df_trees.register.all_fences = df_dependencies.register_all_fences
-- this stuff is only for during initialization -- this stuff is only for during initialization
minetest.after(0, function() minetest.after(0, function()

View File

@ -40,8 +40,7 @@ minetest.register_node("df_trees:fungiwood_wood", {
sounds = df_trees.sounds.wood, sounds = df_trees.sounds.wood,
}) })
df_trees.register.all_stairs("fungiwood_wood") df_trees.register.all_stairs_and_fences("fungiwood_wood", {burntime = 7})
df_trees.register.all_fences("fungiwood_wood", {burntime = 7})
minetest.register_craft({ minetest.register_craft({
type = "fuel", type = "fuel",

View File

@ -100,10 +100,8 @@ minetest.register_node("df_trees:goblin_cap_stem_wood", {
sounds = df_trees.sounds.wood, sounds = df_trees.sounds.wood,
}) })
df_trees.register.all_stairs("goblin_cap_wood") df_trees.register.all_stairs_and_fences("goblin_cap_wood", {burntime = 12})
df_trees.register.all_fences("goblin_cap_wood", {burntime = 12}) df_trees.register.all_stairs_and_fences("goblin_cap_stem_wood", {burntime = 7})
df_trees.register.all_stairs("goblin_cap_stem_wood")
df_trees.register.all_fences("goblin_cap_stem_wood", {burntime = 7})
minetest.register_craft({ minetest.register_craft({
type = "fuel", type = "fuel",

View File

@ -83,8 +83,7 @@ minetest.register_node("df_trees:nether_cap_wood", {
sounds = df_trees.sounds.wood, sounds = df_trees.sounds.wood,
}) })
df_trees.register.all_stairs("nether_cap_wood") df_trees.register.all_stairs_and_fences("nether_cap_wood")
df_trees.register.all_fences("nether_cap_wood")
-- sapling -- sapling
minetest.register_node("df_trees:nether_cap_sapling", { minetest.register_node("df_trees:nether_cap_sapling", {

View File

@ -1,6 +1,6 @@
local n1 = { name = "air", prob = 0 } -- external air local n1 = { name = "air", prob = 0 } -- external air
local n2 = { name = "df_trees:goblin_cap" } local n2 = { name = "df_trees:goblin_cap" }
local n3 = {name = "stairs:slab_goblin_cap_stem_wood", param2 = 2} -- porch top local n3 = {name = df_dependencies.node_name_slab_goblin_cap_stem_wood, param2 = 2} -- porch top
local n4 = { name = "df_trees:goblin_cap_gills" } local n4 = { name = "df_trees:goblin_cap_gills" }
local n6 = { name = "df_trees:goblin_cap_stem", force_place=true } -- walls local n6 = { name = "df_trees:goblin_cap_stem", force_place=true } -- walls
local n7 = { name = "df_trees:goblin_cap_stem_wood", force_place=true } -- internal floor local n7 = { name = "df_trees:goblin_cap_stem_wood", force_place=true } -- internal floor
@ -15,9 +15,9 @@ local n17 = { name = df_trees.node_names.bed_top or "air", force_place=true }
local n18 = { name = df_trees.node_names.torch_wall, param2 = 4, force_place=true } local n18 = { name = df_trees.node_names.torch_wall, param2 = 4, force_place=true }
local n19 = { name = "df_trees:goblin_cap_stem" } -- base local n19 = { name = "df_trees:goblin_cap_stem" } -- base
local n20 = {name = "stairs:stair_goblin_cap_stem_wood", param2 = 1 } local n20 = {name = df_dependencies.node_name_stair_goblin_cap_stem_wood, param2 = 1 }
local n21 = {name = "stairs:stair_goblin_cap_stem_wood", param2 = 3 } local n21 = {name = df_dependencies.node_name_stair_goblin_cap_stem_wood, param2 = 3 }
local n22 = {name = "stairs:slab_goblin_cap_stem_wood", param2 = 22} local n22 = {name = df_dependencies.node_name_slab_goblin_cap_stem_wood, param2 = 22}
if minetest.get_modpath("vessels") then if minetest.get_modpath("vessels") then
n18 = { name = "df_trees:glowing_bottle_red", force_place=true} n18 = { name = "df_trees:glowing_bottle_red", force_place=true}

View File

@ -8,7 +8,7 @@ local n7 = { name = "df_trees:goblin_cap_stem_wood", force_place=true } -- inter
local n8 = { name = df_trees.node_names.furnace, param2 = 2, force_place=true } local n8 = { name = df_trees.node_names.furnace, param2 = 2, force_place=true }
local n9 = { name = "air", force_place=true } -- internal air local n9 = { name = "air", force_place=true } -- internal air
local n10 = { name = df_trees.node_names.torch_wall, param2 = 3, force_place = true } local n10 = { name = df_trees.node_names.torch_wall, param2 = 3, force_place = true }
local n12 = {name = "stairs:slab_goblin_cap_stem_wood", param2 = 2} -- porch top local n12 = {name = df_dependencies.node_name_slab_goblin_cap_stem_wood, param2 = 2} -- porch top
local n13 = { name = df_trees.node_names.door_wood_a or "air", param2 = 3, force_place = true } local n13 = { name = df_trees.node_names.door_wood_a or "air", param2 = 3, force_place = true }
local n14 = { name = df_trees.node_names.door_hidden or "air", param2 = 3, force_place = true } local n14 = { name = df_trees.node_names.door_hidden or "air", param2 = 3, force_place = true }
local n15 = n9 -- internal air, but could be a vessel shelf local n15 = n9 -- internal air, but could be a vessel shelf
@ -16,9 +16,9 @@ local n16 = { name = df_trees.node_names.bed_top or "air", param2 = 3, force_pla
local n17 = { name = df_trees.node_names.bed_bottom or "air", param2 = 3, force_place = true } local n17 = { name = df_trees.node_names.bed_bottom or "air", param2 = 3, force_place = true }
local n18 = { name = df_trees.node_names.chest, force_place = true } local n18 = { name = df_trees.node_names.chest, force_place = true }
local n19 = { name = df_trees.node_names.torch_wall, param2 = 2, force_place = true } local n19 = { name = df_trees.node_names.torch_wall, param2 = 2, force_place = true }
local n20 = {name = "stairs:stair_goblin_cap_stem_wood" } local n20 = {name = df_dependencies.node_name_stair_goblin_cap_stem_wood }
local n21 = {name = "stairs:stair_goblin_cap_stem_wood", param2 = 2 } local n21 = {name = df_dependencies.node_name_stair_goblin_cap_stem_wood, param2 = 2 }
local n22 = {name = "stairs:slab_goblin_cap_stem_wood", param2 = 22} local n22 = {name = df_dependencies.node_name_slab_goblin_cap_stem_wood, param2 = 22}
if df_trees.node_names.shelf then if df_trees.node_names.shelf then
-- replace torches with glowing bottles, add vessel shelf -- replace torches with glowing bottles, add vessel shelf

View File

@ -41,8 +41,7 @@ minetest.register_node("df_trees:spore_tree_wood", {
sounds = df_trees.sounds.wood, sounds = df_trees.sounds.wood,
}) })
df_trees.register.all_stairs("spore_tree_wood") df_trees.register.all_stairs_and_fences("spore_tree_wood", {burntime = 6})
df_trees.register.all_fences("spore_tree_wood", {burntime = 6})
minetest.register_craft({ minetest.register_craft({
type = "fuel", type = "fuel",

View File

@ -81,8 +81,7 @@ minetest.register_node("df_trees:tower_cap_wood", {
sounds = df_trees.sounds.wood, sounds = df_trees.sounds.wood,
}) })
df_trees.register.all_stairs("tower_cap_wood") df_trees.register.all_stairs_and_fences("tower_cap_wood", {burntime = 7})
df_trees.register.all_fences("tower_cap_wood", {burntime = 7})
minetest.register_craft({ minetest.register_craft({
type = "fuel", type = "fuel",

View File

@ -151,8 +151,7 @@ minetest.register_node("df_trees:tunnel_tube_wood", {
sounds = df_trees.sounds.wood, sounds = df_trees.sounds.wood,
}) })
df_trees.register.all_stairs("tunnel_tube_wood") df_trees.register.all_stairs_and_fences("tunnel_tube_wood", {burntime = 9})
df_trees.register.all_fences("tunnel_tube_wood", {burntime = 9})
minetest.register_craft({ minetest.register_craft({
type = "fuel", type = "fuel",

View File

@ -435,37 +435,24 @@ local n14 = { name = "df_underworld_items:inscription_block", param2 = 2 }
local n15 = { name = "df_underworld_items:inscription_block", param2 = 3 } local n15 = { name = "df_underworld_items:inscription_block", param2 = 3 }
local n16 = { name = "df_underworld_items:slade_capstone"} local n16 = { name = "df_underworld_items:slade_capstone"}
if minetest.get_modpath("stairs") then df_dependencies.register_stairs("slade_block")
local stair_groups = {level = 3, mese_radiation_shield=1, pit_plasma_resistant=1, slade=1, cracky = 3}
if invulnerable then
stair_groups.immortal = 1
end
stairs.register_stair_and_slab( if invulnerable then
"slade_block", for name, def in pairs(minetest.registered_nodes) do
"df_underworld_items:slade_block", if (name:sub(1,7) == "stairs:" and name:sub(-11) == "slade_block") or
stair_groups, name:sub(1,11) == "mcl_stairs:" and name:sub(-11) == "slade_block" then
{"dfcaverns_slade_block.png"},
S("Slade Block Stair"),
S("Slade Block Slab"),
df_underworld_items.sounds.slade
)
if invulnerable then
for name, def in pairs(minetest.registered_nodes) do
if name:sub(1,7) == "stairs:" and name:sub(-11) == "slade_block" then
minetest.override_item(name, {can_dig = can_dig}) minetest.override_item(name, {can_dig = can_dig})
end
end end
end end
n2 = { name = "stairs:stair_slade_block", param2 = 3 }
n4 = { name = "stairs:stair_slade_block", param2 = 1 }
n7 = { name = "stairs:stair_slade_block", param2 = 2 }
n9 = { name = "stairs:stair_slade_block" }
n10 = { name = "stairs:slab_slade_block", param2 = 21 }
n11 = { name = "stairs:slab_slade_block", param2 = 1 }
end end
n2 = { name = df_dependencies.node_name_stair_slade_block, param2 = 3 }
n4 = { name = df_dependencies.node_name_stair_slade_block, param2 = 1 }
n7 = { name = df_dependencies.node_name_stair_slade_block, param2 = 2 }
n9 = { name = df_dependencies.node_name_stair_slade_block }
n10 = { name = "stairs:slab_slade_block", param2 = 21 }
n11 = { name = "stairs:slab_slade_block", param2 = 1 }
df_underworld_items.seal_temple_schem = { df_underworld_items.seal_temple_schem = {
size = {y = 6, x = 7, z = 7}, size = {y = 6, x = 7, z = 7},

View File

@ -138,33 +138,18 @@ minetest.register_abm{
-- Register stair and slab -- Register stair and slab
if minetest.get_modpath("stairs") then df_dependencies.register_stairs("slade_brick")
local stair_groups = {level = 3, mese_radiation_shield=1, pit_plasma_resistant=1, slade=1}
if invulnerable then if invulnerable then
stair_groups.immortal = 1 for name, def in pairs(minetest.registered_nodes) do
end if (name:sub(1,7) == "stairs:" and name:sub(-11) == "slade_block") or
stair_groups.cracky = 3 name:sub(1,11) == "mcl_stairs:" and name:sub(-11) == "slade_brick" then
minetest.override_item(name, {can_dig = server_diggable_only})
stairs.register_stair_and_slab(
"slade_brick",
"df_underworld_items:slade_brick",
stair_groups,
{"dfcaverns_slade_brick.png"},
S("Slade Stair"),
S("Slade Slab"),
df_underworld_items.sounds.slade
)
if invulnerable then
for name, def in pairs(minetest.registered_nodes) do
if name:sub(1,7) == "stairs:" and name:sub(-11) == "slade_brick" then
minetest.override_item(name, {can_dig = server_diggable_only})
end
end end
end end
end end
if minetest.get_modpath("mesecons_mvps") and df_underworld_items.config.invulnerable_slade then if minetest.get_modpath("mesecons_mvps") and df_underworld_items.config.invulnerable_slade then
mesecon.register_mvps_stopper("df_underworld_items:slade") mesecon.register_mvps_stopper("df_underworld_items:slade")
end end