Skip to content

Commit

Permalink
fix crash when using mesecons with default game, remove flora group f…
Browse files Browse the repository at this point in the history
…rom all plants.
  • Loading branch information
FaceDeer committed Aug 29, 2022
1 parent e82fcf7 commit 77b990a
Show file tree
Hide file tree
Showing 18 changed files with 122 additions and 123 deletions.
15 changes: 7 additions & 8 deletions df_dependencies/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4,25 +4,24 @@ local modpath = minetest.get_modpath(minetest.get_current_modname())
df_dependencies.mods_required = {}

df_dependencies.select_required = function(def)
local count = 0
local total = 0
local ret
for mod, item in pairs(def) do
total = total + 1
for _, dependency in ipairs(def) do
mod = dependency[1]
item = dependency[2]
df_dependencies.mods_required[mod] = true
if minetest.get_modpath(mod) then
count = count + 1
ret = item
end
end
assert(count ~= 0, "Unable to find item for dependency set " .. dump(def))
assert(count == 1, "Found more than one item for dependency set " .. dump(def))
assert(ret, "Unable to find item for dependency set " .. dump(def))
return ret
end

df_dependencies.select_optional = function(def)
local ret
for mod, item in pairs(def) do
for _, dependency in ipairs(def) do
mod = dependency[1]
item = dependency[2]
df_dependencies.mods_required[mod] = true
if minetest.get_modpath(mod) then
ret = item
Expand Down
30 changes: 15 additions & 15 deletions df_dependencies/misc.lua
Original file line number Diff line number Diff line change
Expand Up @@ -49,24 +49,24 @@ end
-- don't trigger on air, that's for sparkle generation
df_dependencies.abm_pit_plasma_neighbors = {"group:stone", "group:lava", "group:water", "group:material_stone"}

df_dependencies.texture_cobble = select_required({default="default_cobble.png", mcl_core="default_cobble.png"})
df_dependencies.texture_coral_skeleton = select_required({default="default_coral_skeleton.png", mcl_ocean="mcl_ocean_dead_horn_coral_block.png"})
df_dependencies.texture_dirt = select_required({default="default_dirt.png", mcl_core="default_dirt.png"})
df_dependencies.texture_gold_block = select_required({default="default_gold_block.png", mcl_core="default_gold_block.png"})
df_dependencies.texture_ice = select_required({default="default_ice.png", mcl_core="default_ice.png"})
df_dependencies.texture_sand = select_required({default="default_sand.png", mcl_core="default_sand.png"})
df_dependencies.texture_stone = select_required({default="default_stone.png", mcl_core="default_stone.png"})
df_dependencies.texture_wood = select_required({default="default_wood.png", mcl_core="default_wood.png"})
df_dependencies.texture_mineral_coal = select_required({default="default_mineral_coal.png", mcl_core="mcl_core_coal_ore.png"}) -- MCL's coal texture isn't transparent, but is only used with gas seeps and should work fine that way
df_dependencies.texture_glass_bottle = select_required({vessels="vessels_glass_bottle.png", mcl_potions="mcl_potions_potion_bottle.png"})
df_dependencies.texture_cobble = select_required({{"default", "default_cobble.png"}, {"mcl_core", "default_cobble.png"}})
df_dependencies.texture_coral_skeleton = select_required({{"default", "default_coral_skeleton.png"}, {"mcl_ocean", "mcl_ocean_dead_horn_coral_block.png"}})
df_dependencies.texture_dirt = select_required({{"default", "default_dirt.png"}, {"mcl_core", "default_dirt.png"}})
df_dependencies.texture_gold_block = select_required({{"default", "default_gold_block.png"}, {"mcl_core", "default_gold_block.png"}})
df_dependencies.texture_ice = select_required({{"default", "default_ice.png"}, {"mcl_core", "default_ice.png"}})
df_dependencies.texture_sand = select_required({{"default", "default_sand.png"}, {"mcl_core", "default_sand.png"}})
df_dependencies.texture_stone = select_required({{"default", "default_stone.png"}, {"mcl_core", "default_stone.png"}})
df_dependencies.texture_wood = select_required({{"default", "default_wood.png"}, {"mcl_core", "default_wood.png"}})
df_dependencies.texture_mineral_coal = select_required({{"default", "default_mineral_coal.png"}, {"mcl_core", "mcl_core_coal_ore.png"}}) -- MCL's coal texture isn't transparent, but is only used with gas seeps and should work fine that way
df_dependencies.texture_glass_bottle = select_required({{"vessels", "vessels_glass_bottle.png"}, {"mcl_potions", "mcl_potions_potion_bottle.png"}})
df_dependencies.texture_meselamp = "dfcaverns_glow_mese.png"

df_dependencies.texture_tool_steelhoe = select_required({default="farming_tool_steelhoe.png", mcl_farming="farming_tool_steelhoe.png"})
df_dependencies.texture_tool_steelpick = select_required({default="default_tool_steelpick.png", mcl_farming="default_tool_steelpick.png"})
df_dependencies.texture_tool_steelshovel = select_required({default="default_tool_steelshovel.png", mcl_farming="default_tool_steelshovel.png"})
df_dependencies.texture_farming_soil = select_required({default="(default_dirt.png^farming_soil.png)", mcl_farming="mcl_farming_farmland_dry.png"})
df_dependencies.texture_tool_steelhoe = select_required({{"default", "farming_tool_steelhoe.png"}, {"mcl_farming", "farming_tool_steelhoe.png"}})
df_dependencies.texture_tool_steelpick = select_required({{"default", "default_tool_steelpick.png"}, {"mcl_farming", "default_tool_steelpick.png"}})
df_dependencies.texture_tool_steelshovel = select_required({{"default", "default_tool_steelshovel.png"}, {"mcl_farming", "default_tool_steelshovel.png"}})
df_dependencies.texture_farming_soil = select_required({{"default", "(default_dirt.png^farming_soil.png)"}, {"mcl_farming", "mcl_farming_farmland_dry.png"}})

df_dependencies.texture_mapping_kit = select_required({default="map_mapping_kit.png", mcl_maps="mcl_maps_map_filled.png"})
df_dependencies.texture_mapping_kit = select_required({{"default", "map_mapping_kit.png"}, {"mcl_maps", "mcl_maps_map_filled.png"}})

df_dependencies.nethercap_name = S("Nethercap")
if minetest.get_modpath("mcl_mapgen_core") then
Expand Down
138 changes: 69 additions & 69 deletions df_dependencies/nodes.lua
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
local S = minetest.get_translator(minetest.get_current_modname())

local required_nodes = {}
local function select_required(...)
local function select_required(def)
local newdef = {}
for _, node in pairs({...}) do
newdef[string.match(node, "(.-):")] = node
for _, node in ipairs(def) do
table.insert(newdef, {string.match(node, "(.-):"), node})
end
local ret = df_dependencies.select_required(newdef)
table.insert(required_nodes, ret)
return ret
end

local function select_optional(...)
local function select_optional(def)
local newdef = {}
for _, node in pairs({...}) do
newdef[string.match(node, "(.-):")] = node
for _, node in ipairs(def) do
table.insert(newdef, {string.match(node, "(.-):"), node})
end
local ret = df_dependencies.select_optional(newdef)
table.insert(required_nodes, ret)
Expand All @@ -37,86 +37,86 @@ minetest.after(0, function()
end)


df_dependencies.node_name_apple = select_required("default:apple", "mcl_core:apple")
df_dependencies.node_name_chest = select_required("default:chest", "mcl_chests:chest")
df_dependencies.node_name_coalblock = select_required("default:coalblock", "mcl_core:coalblock")
df_dependencies.node_name_coal_lump = select_required("default:coal_lump", "mcl_core:coal_lump")
df_dependencies.node_name_cobble = select_required("default:cobble", "mcl_core:cobble")
df_dependencies.node_name_coral_skeleton = select_required("default:coral_skeleton", "mcl_ocean:dead_horn_coral_block")
df_dependencies.node_name_desert_sand = select_required("default:desert_sand", "mcl_core:redsand")
df_dependencies.node_name_dirt = select_required("default:dirt", "mcl_core:dirt")
df_dependencies.node_name_dry_grass_3 = select_required("default:dry_grass_3", "mcl_core:deadbush") -- There doesn't seem to be an MCL equivalent of this
df_dependencies.node_name_dry_grass_4 = select_required("default:dry_grass_4", "mcl_core:deadbush") -- There doesn't seem to be an MCL equivalent of this
df_dependencies.node_name_dry_shrub = select_required("default:dry_shrub", "mcl_core:deadbush")
df_dependencies.node_name_furnace = select_required("default:furnace", "mcl_furnaces:furnace")
df_dependencies.node_name_gold_ingot = select_required("default:gold_ingot", "mcl_core:gold_ingot")
df_dependencies.node_name_gravel = select_required("default:gravel", "mcl_core:gravel")
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:wire_00000000_off") --make sure default:mese_crystal is first, so that default will be checked for before mesecons is checked for.
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")
df_dependencies.node_name_river_water_flowing = select_required("default:river_water_flowing", "mclx_core:river_water_flowing")
df_dependencies.node_name_river_water_source = select_required("default:river_water_source", "mclx_core:river_water_source")
df_dependencies.node_name_sand = select_required("default:sand", "mcl_core:sand")
df_dependencies.node_name_silver_sand = select_required("default:silver_sand", "mcl_core:sand") -- There doesn't seem to be an MCL equivalent of this
df_dependencies.node_name_snow = select_required("default:snow", "mcl_core:snow")
df_dependencies.node_name_stone = select_required("default:stone", "mcl_core:stone")
df_dependencies.node_name_stone_with_coal = select_required("default:stone_with_coal", "mcl_core:stone_with_coal")
df_dependencies.node_name_stone_with_mese = select_required("default:stone_with_mese", "mcl_core:stone_with_redstone")
df_dependencies.node_name_torch = select_required("default:torch", "mcl_torches:torch")
df_dependencies.node_name_torch_wall = select_required("default:torch_wall", "mcl_torches:torch_wall")
df_dependencies.node_name_water_flowing = select_required("default:water_flowing", "mcl_core: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_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")
df_dependencies.node_name_dirt_wet = select_required("farming:soil_wet", "mcl_farming:soil_wet")
--df_dependencies.node_name_mortar_pestle = select_optional("farming:mortar_pestle") -- TODO where did this go?
df_dependencies.node_name_string = select_required("farming:string", "mcl_mobitems:string")

df_dependencies.node_name_bucket_empty = select_required("bucket:bucket_empty", "mcl_buckets:bucket_empty")
df_dependencies.node_name_bucket_lava = select_required("bucket:bucket_lava", "mcl_buckets:bucket_lava")
df_dependencies.node_name_apple = select_required({"default:apple", "mcl_core:apple"})
df_dependencies.node_name_chest = select_required({"default:chest", "mcl_chests:chest"})
df_dependencies.node_name_coalblock = select_required({"default:coalblock", "mcl_core:coalblock"})
df_dependencies.node_name_coal_lump = select_required({"default:coal_lump", "mcl_core:coal_lump"})
df_dependencies.node_name_cobble = select_required({"default:cobble", "mcl_core:cobble"})
df_dependencies.node_name_coral_skeleton = select_required({"default:coral_skeleton", "mcl_ocean:dead_horn_coral_block"})
df_dependencies.node_name_desert_sand = select_required({"default:desert_sand", "mcl_core:redsand"})
df_dependencies.node_name_dirt = select_required({"default:dirt", "mcl_core:dirt"})
df_dependencies.node_name_dry_grass_3 = select_required({"default:dry_grass_3", "mcl_core:deadbush"}) -- There doesn't seem to be an MCL equivalent of this
df_dependencies.node_name_dry_grass_4 = select_required({"default:dry_grass_4", "mcl_core:deadbush"}) -- There doesn't seem to be an MCL equivalent of this
df_dependencies.node_name_dry_shrub = select_required({"default:dry_shrub", "mcl_core:deadbush"})
df_dependencies.node_name_furnace = select_required({"default:furnace", "mcl_furnaces:furnace"})
df_dependencies.node_name_gold_ingot = select_required({"default:gold_ingot", "mcl_core:gold_ingot"})
df_dependencies.node_name_gravel = select_required({"default:gravel", "mcl_core:gravel"})
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({"mesecons:wire_00000000_off", "default:mese_crystal"}) --make sure default:mese_crystal is second, so that default will take priority if mesecons is also installed.
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"})
df_dependencies.node_name_river_water_flowing = select_required({"default:river_water_flowing", "mclx_core:river_water_flowing"})
df_dependencies.node_name_river_water_source = select_required({"default:river_water_source", "mclx_core:river_water_source"})
df_dependencies.node_name_sand = select_required({"default:sand", "mcl_core:sand"})
df_dependencies.node_name_silver_sand = select_required({"default:silver_sand", "mcl_core:sand"}) -- There doesn't seem to be an MCL equivalent of this
df_dependencies.node_name_snow = select_required({"default:snow", "mcl_core:snow"})
df_dependencies.node_name_stone = select_required({"default:stone", "mcl_core:stone"})
df_dependencies.node_name_stone_with_coal = select_required({"default:stone_with_coal", "mcl_core:stone_with_coal"})
df_dependencies.node_name_stone_with_mese = select_required({"default:stone_with_mese", "mcl_core:stone_with_redstone"})
df_dependencies.node_name_torch = select_required({"default:torch", "mcl_torches:torch"})
df_dependencies.node_name_torch_wall = select_required({"default:torch_wall", "mcl_torches:torch_wall"})
df_dependencies.node_name_water_flowing = select_required({"default:water_flowing", "mcl_core: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_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"})
df_dependencies.node_name_dirt_wet = select_required({"farming:soil_wet", "mcl_farming:soil_wet"})
--df_dependencies.node_name_mortar_pestle = select_optional({"farming:mortar_pestle"}) -- TODO where did this go?
df_dependencies.node_name_string = select_required({"farming:string", "mcl_mobitems:string"})

df_dependencies.node_name_bucket_empty = select_required({"bucket:bucket_empty", "mcl_buckets:bucket_empty"})
df_dependencies.node_name_bucket_lava = select_required({"bucket:bucket_lava", "mcl_buckets:bucket_lava"})

-- from "wool"

df_dependencies.node_name_wool_white = select_required("wool:white", "mcl_wool:white")
df_dependencies.node_name_wool_white = select_required({"wool:white", "mcl_wool:white"})

-- from "fireflies"
df_dependencies.node_name_fireflies = select_optional("fireflies:firefly")
df_dependencies.node_name_fireflies = select_optional({"fireflies:firefly"})

-- from "vessels"
df_dependencies.node_name_glass_bottle = select_required("vessels:glass_bottle", "mcl_potions:glass_bottle")
df_dependencies.node_name_shelf = select_optional("vessels:shelf")
df_dependencies.node_name_glass_bottle = select_required({"vessels:glass_bottle", "mcl_potions:glass_bottle"})
df_dependencies.node_name_shelf = select_optional({"vessels:shelf"})

-- from "beds"
df_dependencies.node_name_bed_bottom = select_required("beds:bed_bottom", "mcl_beds:bed_red_bottom")
df_dependencies.node_name_bed_top = select_required("beds:bed_top", "mcl_beds:bed_red_top")
df_dependencies.node_name_bed_bottom = select_required({"beds:bed_bottom", "mcl_beds:bed_red_bottom"})
df_dependencies.node_name_bed_top = select_required({"beds:bed_top", "mcl_beds:bed_red_top"})

-- 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_hidden = select_required("doors:hidden", "mcl_doors:wooden_door_t_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"})

-- 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_slab_slade_block = select_required("stairs:slab_slade_block", "mcl_stairs:slab_slade_block")
df_dependencies.node_name_stair_slade_brick = select_required("stairs:stair_slade_brick", "mcl_stairs:stair_slade_brick")
df_dependencies.node_name_slab_slade_block_top = select_optional("mcl_stairs:slab_slade_block_top")
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_slab_slade_block = select_required({"stairs:slab_slade_block", "mcl_stairs:slab_slade_block"})
df_dependencies.node_name_stair_slade_brick = select_required({"stairs:stair_slade_brick", "mcl_stairs:stair_slade_brick"})
df_dependencies.node_name_slab_slade_block_top = select_optional({"mcl_stairs:slab_slade_block_top"})

-- from "tnt"

df_dependencies.node_name_gunpowder = select_optional("tnt:gunpowder", "mcl_mobitems:gunpowder")
df_dependencies.node_name_gunpowder = select_optional({"tnt:gunpowder", "mcl_mobitems:gunpowder"})

local modpath = minetest.get_modpath(minetest.get_current_modname())

Expand Down
Loading

0 comments on commit 77b990a

Please sign in to comment.