mirror of
https://github.com/FaceDeer/dfcaverns.git
synced 2024-12-25 18:30:36 +01:00
getting close to actually being able to run mineclone with this
This commit is contained in:
parent
bb6cb4efa1
commit
457b79b48d
@ -3,8 +3,12 @@ local S = minetest.get_translator(minetest.get_current_modname())
|
||||
if minetest.get_modpath("default") then
|
||||
df_dependencies.register_leafdecay = default.register_leafdecay
|
||||
df_dependencies.after_place_leaves = default.after_place_leaves
|
||||
else
|
||||
--TODO
|
||||
elseif ("mcl_core") then
|
||||
-- Mineclone does leaf decay differently, it uses the "leafdecay" group to require that leaves remain
|
||||
-- within the group value distance of any node of group "tree".
|
||||
-- make sure to add place_param2 = 1 to leaves to prevent decay of player-placed leaves
|
||||
df_dependencies.register_leafdecay = function() end
|
||||
df_dependencies.after_place_leaves = function() end
|
||||
end
|
||||
|
||||
|
||||
|
@ -22,11 +22,14 @@ df_dependencies.select_required = function(def)
|
||||
end
|
||||
|
||||
df_dependencies.select_optional = function(def)
|
||||
local ret
|
||||
for mod, item in pairs(def) do
|
||||
df_dependencies.mods_required[mod] = true
|
||||
if minetest.get_modpath(mod) then
|
||||
return item
|
||||
ret = item
|
||||
end
|
||||
end
|
||||
return ret
|
||||
end
|
||||
|
||||
dofile(modpath.."/nodes.lua")
|
||||
@ -34,7 +37,16 @@ dofile(modpath.."/sounds.lua")
|
||||
dofile(modpath.."/helper_functions.lua")
|
||||
dofile(modpath.."/misc.lua")
|
||||
|
||||
minetest.debug(dump(df_dependencies.mods_required))
|
||||
local mods_required = ""
|
||||
local mods_sorted = {}
|
||||
for mod, _ in pairs(df_dependencies.mods_required) do
|
||||
table.insert(mods_sorted, mod)
|
||||
end
|
||||
table.sort(mods_sorted)
|
||||
for _, mod in ipairs(mods_sorted) do
|
||||
mods_required = mods_required .. ", " .. mod
|
||||
end
|
||||
minetest.debug(mods_required)
|
||||
|
||||
-- This mod is meant to only exist at initialization time. Other mods should make copies of anything it points to for their own use.
|
||||
minetest.after(1, function() df_dependencies = nil end)
|
||||
|
@ -1,4 +1,4 @@
|
||||
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
|
||||
depends = default
|
||||
optional_depends = moreblocks, stairs, doors, farming, wool, fireflies, vessels, bucket, beds
|
||||
depends =
|
||||
optional_depends = beds, bucket, default, doors, farming, fireflies, mcl_beds, mcl_buckets, mcl_chests, mcl_copper, mcl_core, mcl_doors, mcl_farming, mcl_furnaces, mcl_lanterns, mcl_mobitems, mcl_ocean, mcl_potions, mcl_sounds, mcl_strongholds, mcl_torches, mcl_vars, mcl_wool, mcl_worlds, mclx_core, mesecons, moreblocks, stairs, vessels, wool
|
@ -39,7 +39,7 @@ df_dependencies.node_name_ice = select_required("default:ice", "mcl_core:ice")
|
||||
df_dependencies.node_name_junglewood = select_required("default:junglewood", "mcl_core:junglewood")
|
||||
df_dependencies.node_name_lava_source = select_required("default:lava_source", "mcl_core:lava_source")
|
||||
df_dependencies.node_name_mese_crystal = select_required("default:mese_crystal", "mesecons:redstone") -- TODO make sure this is properly balanced. Also, mesecons mod conflict with non-mcl mesecons?
|
||||
df_dependencies.node_name_meselamp = select_required("default:meselamp")
|
||||
df_dependencies.node_name_meselamp = select_required("default:meselamp", "mcl_lanterns:lantern_floor")
|
||||
df_dependencies.node_name_mossycobble = select_required("default:mossycobble", "mcl_core:mossycobble")
|
||||
df_dependencies.node_name_obsidian = select_required("default:obsidian", "mcl_core:obsidian")
|
||||
df_dependencies.node_name_paper = select_required("default:paper", "mcl_core:paper")
|
||||
@ -57,7 +57,7 @@ df_dependencies.node_name_water_flowing = select_required("default:water_flowing
|
||||
df_dependencies.node_name_water_source = select_required("default:water_source", "mcl_core:water_source")
|
||||
df_dependencies.node_name_stone_with_iron = select_required("default:stone_with_iron", "mcl_core:stone_with_iron")
|
||||
df_dependencies.node_name_steelblock = select_required("default:steelblock", "mcl_core:ironblock")
|
||||
df_dependencies.node_name_stone_with_copper = select_required("default:stone_with_copper", "mcl_core:stone_with_copper")
|
||||
df_dependencies.node_name_stone_with_copper = select_required("default:stone_with_copper", "mcl_copper:stone_with_copper")
|
||||
df_dependencies.node_name_copperblock = select_required("default:copperblock", "mcl_copper:block_raw")
|
||||
|
||||
df_dependencies.node_name_dirt_furrowed = select_required("farming:soil", "mcl_farming:soil")
|
||||
|
@ -157,7 +157,7 @@ minetest.register_node("df_primordial_items:giant_fern_leaves", {
|
||||
visual_scale = 1.41,
|
||||
inventory_image = "dfcaverns_jungle_fern_leaves_01.png",
|
||||
wield_image = "dfcaverns_jungle_fern_leaves_01.png",
|
||||
groups = {snappy = 3, leafdecay = 3, flammable = 2, leaves = 1},
|
||||
groups = {snappy = 3, leafdecay = 2, flammable = 2, leaves = 1},
|
||||
is_ground_content = false,
|
||||
paramtype = "light",
|
||||
drawtype = "plantlike",
|
||||
@ -168,6 +168,7 @@ minetest.register_node("df_primordial_items:giant_fern_leaves", {
|
||||
use_texture_alpha = "clip",
|
||||
sunlight_propagates = true,
|
||||
after_place_node = df_primordial_items.after_place_leaves,
|
||||
place_param2 = 1, -- Prevent leafdecay for placed nodes
|
||||
drop = {
|
||||
max_items = 1,
|
||||
items = {
|
||||
|
@ -22,7 +22,7 @@ minetest.register_node("df_primordial_items:jungle_mushroom_cap_1", {
|
||||
tiles = {"dfcaverns_jungle_mushroom_top_02.png"},
|
||||
paramtype2 = "facedir",
|
||||
is_ground_content = false,
|
||||
groups = {choppy = 2, oddly_breakable_by_hand = 1, flammable = 2, primordial_mushroom_cap = 1},
|
||||
groups = {tree = 1, choppy = 2, oddly_breakable_by_hand = 1, flammable = 2, primordial_mushroom_cap = 1},
|
||||
sounds = df_trees.node_sound_tree_soft_fungus_defaults(),
|
||||
on_place = minetest.rotate_node,
|
||||
drop = {
|
||||
@ -46,7 +46,7 @@ minetest.register_node("df_primordial_items:jungle_mushroom_cap_2", {
|
||||
tiles = {"dfcaverns_jungle_mushroom_top_01.png"},
|
||||
paramtype2 = "facedir",
|
||||
is_ground_content = false,
|
||||
groups = {choppy = 2, oddly_breakable_by_hand = 1, flammable = 2, primordial_mushroom_cap = 1},
|
||||
groups = {tree = 1, choppy = 2, oddly_breakable_by_hand = 1, flammable = 2, primordial_mushroom_cap = 1},
|
||||
sounds = df_trees.node_sound_tree_soft_fungus_defaults(),
|
||||
on_place = minetest.rotate_node,
|
||||
drop = {
|
||||
|
@ -15,7 +15,7 @@ minetest.register_node("df_primordial_items:jungle_leaves", {
|
||||
paramtype = "light",
|
||||
is_ground_content = false,
|
||||
buildable_to = true,
|
||||
groups = {snappy = 3, leafdecay = 3, flammable = 2, leaves = 1},
|
||||
groups = {snappy = 3, leafdecay = 1, flammable = 2, leaves = 1},
|
||||
sounds = df_primordial_items.sounds.leaves,
|
||||
drop = {
|
||||
max_items = 1,
|
||||
@ -30,6 +30,7 @@ minetest.register_node("df_primordial_items:jungle_leaves", {
|
||||
}
|
||||
},
|
||||
after_place_node = df_primordial_items.after_place_leaves,
|
||||
place_param2 = 1, -- Prevent leafdecay for placed nodes
|
||||
})
|
||||
|
||||
minetest.register_node("df_primordial_items:jungle_leaves_glowing", {
|
||||
@ -47,7 +48,7 @@ minetest.register_node("df_primordial_items:jungle_leaves_glowing", {
|
||||
is_ground_content = false,
|
||||
buildable_to = true,
|
||||
light_source = 2,
|
||||
groups = {snappy = 3, leafdecay = 3, flammable = 2, leaves = 1},
|
||||
groups = {snappy = 3, leafdecay = 1, flammable = 2, leaves = 1},
|
||||
sounds = df_primordial_items.sounds.leaves,
|
||||
drop = {
|
||||
max_items = 1,
|
||||
@ -62,6 +63,7 @@ minetest.register_node("df_primordial_items:jungle_leaves_glowing", {
|
||||
}
|
||||
},
|
||||
after_place_node = df_primordial_items.after_place_leaves,
|
||||
place_param2 = 1, -- Prevent leafdecay for placed nodes
|
||||
})
|
||||
|
||||
-- Trunk
|
||||
|
@ -31,7 +31,7 @@ minetest.register_node("df_primordial_items:mushroom_gills", {
|
||||
tiles = {"dfcaverns_mush_gills.png"},
|
||||
inventory_image = "dfcaverns_mush_gills.png",
|
||||
wield_image = "dfcaverns_mush_gills.png",
|
||||
groups = {snappy = 3, flora = 1, flammable = 1, leaves = 1},
|
||||
groups = {snappy = 3, flora = 1, flammable = 1, leaves = 1, leafdecay = 5},
|
||||
paramtype = "light",
|
||||
drawtype = "plantlike",
|
||||
waving = 2,
|
||||
@ -55,6 +55,7 @@ minetest.register_node("df_primordial_items:mushroom_gills", {
|
||||
}
|
||||
},
|
||||
after_place_node = df_primordial_items.after_place_leaves,
|
||||
place_param2 = 1, -- Prevent leafdecay for placed nodes
|
||||
})
|
||||
|
||||
minetest.register_node("df_primordial_items:mushroom_gills_glowing", {
|
||||
@ -64,7 +65,7 @@ minetest.register_node("df_primordial_items:mushroom_gills_glowing", {
|
||||
tiles = {"dfcaverns_mush_gills_glow.png"},
|
||||
inventory_image = "dfcaverns_mush_gills_glow.png",
|
||||
wield_image = "dfcaverns_mush_gills_glow.png",
|
||||
groups = {snappy = 3, flora = 1, flammable = 1, leaves = 1},
|
||||
groups = {snappy = 3, flora = 1, flammable = 1, leaves = 1, leafdecay = 5},
|
||||
paramtype = "light",
|
||||
drawtype = "plantlike",
|
||||
waving = 2,
|
||||
@ -89,6 +90,7 @@ minetest.register_node("df_primordial_items:mushroom_gills_glowing", {
|
||||
}
|
||||
},
|
||||
after_place_node = df_primordial_items.after_place_leaves,
|
||||
place_param2 = 1, -- Prevent leafdecay for placed nodes
|
||||
})
|
||||
|
||||
df_primordial_items.register_leafdecay({
|
||||
|
@ -29,7 +29,7 @@ minetest.register_node("df_trees:black_cap_gills", {
|
||||
_doc_items_usagehelp = df_trees.doc.black_cap_usage,
|
||||
tiles = {"dfcaverns_black_cap_gills.png"},
|
||||
is_ground_content = false,
|
||||
groups = {snappy = 3, leafdecay = 3, flammable = 2, leaves = 1},
|
||||
groups = {snappy = 3, leafdecay = 1, flammable = 2, leaves = 1},
|
||||
sounds = df_trees.sounds.leaves,
|
||||
drawtype = "plantlike",
|
||||
paramtype = "light",
|
||||
@ -46,6 +46,7 @@ minetest.register_node("df_trees:black_cap_gills", {
|
||||
}
|
||||
},
|
||||
after_place_node = df_trees.after_place_leaves,
|
||||
place_param2 = 1, -- Prevent leafdecay for placed nodes
|
||||
})
|
||||
|
||||
df_trees.register_leafdecay({
|
||||
|
@ -81,7 +81,7 @@ minetest.register_node("df_trees:fungiwood_shelf",{
|
||||
}
|
||||
},
|
||||
is_ground_content = false,
|
||||
groups = {snappy = 3, leafdecay = 3, flammable = 2, leaves = 1},
|
||||
groups = {snappy = 3, leafdecay = 5, flammable = 2, leaves = 1},
|
||||
drop = {
|
||||
max_items = 1,
|
||||
items = {
|
||||
@ -92,6 +92,7 @@ minetest.register_node("df_trees:fungiwood_shelf",{
|
||||
sounds = df_trees.sounds.leaves,
|
||||
|
||||
after_place_node = df_trees.after_place_leaves,
|
||||
place_param2 = 1, -- Prevent leafdecay for placed nodes
|
||||
})
|
||||
|
||||
df_trees.register_leafdecay({
|
||||
|
@ -35,7 +35,7 @@ minetest.register_node("df_trees:goblin_cap_gills", {
|
||||
_doc_items_usagehelp = df_trees.doc.goblin_cap_usage,
|
||||
tiles = {"dfcaverns_goblin_cap_gills.png"},
|
||||
is_ground_content = false,
|
||||
groups = {snappy = 3, leafdecay = 3, flammable = 2, leaves = 1, goblin_cap = 1},
|
||||
groups = {snappy = 3, leafdecay = 1, flammable = 2, leaves = 1, goblin_cap = 1},
|
||||
sounds = df_trees.sounds.leaves,
|
||||
drawtype = "plantlike",
|
||||
paramtype = "light",
|
||||
@ -52,6 +52,7 @@ minetest.register_node("df_trees:goblin_cap_gills", {
|
||||
}
|
||||
},
|
||||
after_place_node = df_trees.after_place_leaves,
|
||||
place_param2 = 1, -- Prevent leafdecay for placed nodes
|
||||
})
|
||||
|
||||
df_trees.register_leafdecay({
|
||||
|
@ -30,7 +30,7 @@ minetest.register_node("df_trees:nether_cap_gills", {
|
||||
tiles = {"dfcaverns_nether_cap_gills.png"},
|
||||
is_ground_content = false,
|
||||
light_source = 6,
|
||||
groups = {snappy = 3, leafdecay = 3, leaves = 1, puts_out_fire = 1, cools_lava = 1, freezes_water = 1, nether_cap = 1},
|
||||
groups = {snappy = 3, leafdecay = 1, leaves = 1, puts_out_fire = 1, cools_lava = 1, freezes_water = 1, nether_cap = 1},
|
||||
sounds = df_trees.sounds.leaves,
|
||||
drawtype = "plantlike",
|
||||
paramtype = "light",
|
||||
@ -47,6 +47,7 @@ minetest.register_node("df_trees:nether_cap_gills", {
|
||||
}
|
||||
},
|
||||
after_place_node = df_trees.after_place_leaves,
|
||||
place_param2 = 1, -- Prevent leafdecay for placed nodes
|
||||
})
|
||||
|
||||
df_trees.register_leafdecay({
|
||||
|
@ -94,6 +94,7 @@ minetest.register_node("df_trees:spore_tree_hyphae", {
|
||||
sounds = df_trees.sounds.leaves,
|
||||
|
||||
after_place_node = df_trees.after_place_leaves,
|
||||
place_param2 = 1, -- Prevent leafdecay for placed nodes
|
||||
})
|
||||
|
||||
minetest.register_node("df_trees:spore_tree_fruiting_body", {
|
||||
@ -134,6 +135,7 @@ minetest.register_node("df_trees:spore_tree_fruiting_body", {
|
||||
sounds = df_trees.sounds.leaves,
|
||||
|
||||
after_place_node = df_trees.after_place_leaves,
|
||||
place_param2 = 1, -- Prevent leafdecay for placed nodes
|
||||
})
|
||||
|
||||
df_trees.register_leafdecay({
|
||||
|
@ -109,6 +109,11 @@ minetest.register_node("ice_sprites:hidden_ice_sprite", {
|
||||
-- ice sprite in a bottle
|
||||
if node_name_glass_bottle then
|
||||
|
||||
local glass_sounds
|
||||
if minetest.get_modpath("df_dependencies") then
|
||||
glass_sounds = df_dependencies.sound_glass
|
||||
end
|
||||
|
||||
minetest.register_node("ice_sprites:ice_sprite_bottle", {
|
||||
description = S("Ice Sprite in a Bottle"),
|
||||
_doc_items_longdesc = ice_sprite_bottle_desc,
|
||||
@ -135,7 +140,7 @@ minetest.register_node("ice_sprites:ice_sprite_bottle", {
|
||||
type = "fixed",
|
||||
fixed = {-0.25, -0.5, -0.25, 0.25, 0.3, 0.25}
|
||||
},
|
||||
sounds = default.node_sound_glass_defaults(),
|
||||
sounds = glass_sounds(),
|
||||
on_rightclick = function(pos, node, player, itemstack, pointed_thing)
|
||||
local lower_pos = {x = pos.x, y = pos.y + 1, z = pos.z}
|
||||
if minetest.is_protected(pos, player:get_player_name()) or
|
||||
|
18
oil/init.lua
18
oil/init.lua
@ -11,6 +11,10 @@ end
|
||||
|
||||
local oil_sounds = {footstep = {name = "oil_oil_footstep", gain = 0.2}}
|
||||
|
||||
local water_source = df_dependencies.node_name_water_source
|
||||
local water_flowing = df_dependencies.node_name_water_flowing
|
||||
local bucket_empty = df_dependencies.node_name_bucket_empty
|
||||
|
||||
minetest.register_node("oil:oil_source", {
|
||||
description = S("Oil"),
|
||||
_doc_items_longdesc = oil_desc,
|
||||
@ -124,7 +128,7 @@ if minetest.get_modpath("dynamic_liquid") then
|
||||
minetest.register_abm({
|
||||
label = "oil:oil floats",
|
||||
nodenames = {"oil:oil_source"},
|
||||
neighbors = {"default:water_source"},
|
||||
neighbors = {water_source},
|
||||
interval = 1.0,
|
||||
chance = 1,
|
||||
catch_up = true,
|
||||
@ -132,7 +136,7 @@ if minetest.get_modpath("dynamic_liquid") then
|
||||
local next_pos = {x=pos.x, y=pos.y+1, z=pos.z}
|
||||
local next_node = minetest.get_node(next_pos)
|
||||
local above_name = next_node.name
|
||||
if above_name == "default:water_source" then
|
||||
if above_name == water_source then
|
||||
minetest.swap_node(next_pos, {name="oil:oil_source"})
|
||||
minetest.swap_node(pos, next_node)
|
||||
else
|
||||
@ -145,7 +149,7 @@ if minetest.get_modpath("dynamic_liquid") then
|
||||
next_pos.z = next_pos.z + displacement
|
||||
end
|
||||
next_node = minetest.get_node(next_pos)
|
||||
if next_node.name == "default:water_source" then
|
||||
if next_node.name == water_source then
|
||||
if above_name ~= "air" then
|
||||
-- we're not on the surface, so try any lateral movement
|
||||
minetest.swap_node(next_pos, {name="oil:oil_source"})
|
||||
@ -169,14 +173,14 @@ if minetest.get_modpath("dynamic_liquid") then
|
||||
minetest.register_abm({
|
||||
label = "oil:oil settles",
|
||||
nodenames = {"oil:oil_source"},
|
||||
neighbors = {"default:water_flowing"},
|
||||
neighbors = {water_flowing},
|
||||
interval = 1.0,
|
||||
chance = 1,
|
||||
catch_up = true,
|
||||
action = function(pos, node)
|
||||
local next_pos = {x=pos.x, y=pos.y-1, z=pos.z}
|
||||
local next_node = minetest.get_node(next_pos)
|
||||
if next_node.name == "default:water_flowing" then
|
||||
if next_node.name == water_flowing then
|
||||
minetest.swap_node(next_pos, {name="oil:oil_source"})
|
||||
minetest.swap_node(pos, next_node)
|
||||
end
|
||||
@ -198,7 +202,7 @@ if minetest.get_modpath("bucket") then
|
||||
type = "fuel",
|
||||
recipe = "oil:oil_bucket",
|
||||
burntime = 370, -- same as coalblock
|
||||
replacements = {{"oil:oil_bucket", "bucket:bucket_empty"}},
|
||||
replacements = {{"oil:oil_bucket", bucket_empty}},
|
||||
})
|
||||
|
||||
if minetest.get_modpath("basic_materials") then
|
||||
@ -207,7 +211,7 @@ if minetest.get_modpath("bucket") then
|
||||
output = "basic_materials:paraffin",
|
||||
recipe = "oil:oil_bucket",
|
||||
cooktime = 5,
|
||||
replacements = {{"oil:oil_bucket", "bucket:bucket_empty"}},
|
||||
replacements = {{"oil:oil_bucket", bucket_empty}},
|
||||
})
|
||||
end
|
||||
end
|
@ -1,4 +1,4 @@
|
||||
name = oil
|
||||
description = Oil liquid type
|
||||
depends = default
|
||||
optional_depends = dynamic_liquid, bucket, doc, basic_materials
|
||||
depends = df_dependencies
|
||||
optional_depends = dynamic_liquid, doc, basic_materials
|
Loading…
Reference in New Issue
Block a user