From 61f71446c60d388489fe9975c15da953e17dd7fd Mon Sep 17 00:00:00 2001 From: SFENCE Date: Tue, 10 Aug 2021 10:14:38 +0200 Subject: [PATCH] Add support for Hades Revisited. --- morelights/init.lua | 32 +++++++++++++++++++++++++++++++- morelights/mod.conf | 2 +- morelights_extras/init.lua | 21 +++++++++++++++++++++ 3 files changed, 53 insertions(+), 2 deletions(-) diff --git a/morelights/init.lua b/morelights/init.lua index 01c8f2b..25878e2 100644 --- a/morelights/init.lua +++ b/morelights/init.lua @@ -53,9 +53,11 @@ if minetest.get_modpath("mcl_core") then morelights.game = "mineclone2" elseif minetest.get_modpath("default") then morelights.game = "minetest_game" +elseif minetest.get_modpath("hades_core") then + morelights.game = "hades_revisited" else error("Morelights requires a compatible game " .. - "(Minetest Game or MineClone 2).") + "(Minetest Game, MineClone 2 or Hades Revisited).") end if morelights.game == "minetest_game" then @@ -70,6 +72,12 @@ elseif morelights.game == "mineclone2" then glass = mcl_sounds.node_sound_glass_defaults(), metal = mcl_sounds.node_sound_metal_defaults() } +elseif morelights.game == "hades_revisited" then + morelights.sounds = { + default = hades_sounds.node_sound_defaults(), + glass = hades_sounds.node_sound_glass_defaults(), + metal = hades_sounds.node_sound_metal_defaults() + } end morelights.craft_items = { @@ -115,9 +123,31 @@ if morelights.game == "mineclone2" then a.stick = "mcl_core:stick" end +if morelights.game == "hades_revisited" then + a.glass = "hades_core:glass" + a.glass_pane = "hades_xpanes:pane_flat" + a.steel = "hades_core:steel_ingot" + a.copper = "hades_core:copper_ingot" + a.tin = "hades_core:tin_ingot" + a.crystal_fragment = "hades_core:mese_crystal_fragment" + a.dye_dark = "dye:dark_grey" + a.dye_light = "dye:white" + a.wool_dark = "wool:grey" + a.wool_light = "wool:white" + a.wood_dark = "hades_trees:jungle_wood" + a.stone_block = "hades_core:stone_block" + a.sandstone_block = "hades_core:sandstone" + a.dirt = "hades_core:dirt" + a.grass = "hades_grass:grass_1" + a.cotton = "hades_farming:cotton" + a.stick = "hades_core:stick" +end + -- Use basic_materials brass if available, otherwise register our own. if minetest.get_modpath("basic_materials") then a.brass = "basic_materials:brass_ingot" +elseif minetest.get_modpath("basic_materials") then + a.brass = "hades_extramaterials:brass_ingot" end local path = minetest.get_modpath("morelights") diff --git a/morelights/mod.conf b/morelights/mod.conf index 6b597e9..6f46847 100644 --- a/morelights/mod.conf +++ b/morelights/mod.conf @@ -1,3 +1,3 @@ name = morelights description = Base mod providing basic items, which the rest of the modpack depends on. -optional_depends = default, mcl_core +optional_depends = default, mcl_core, hades_core diff --git a/morelights_extras/init.lua b/morelights_extras/init.lua index 4467b89..29db8f1 100644 --- a/morelights_extras/init.lua +++ b/morelights_extras/init.lua @@ -68,6 +68,25 @@ do end } + for k, v in pairs(override) do + def[k] = v + end + elseif morelights.game == "hades_revisited" then + local override = { + tiles = { + "hades_core_grass_cover_colorable.png^morelights_extras_blocklight.png", + {name="default_dirt.png", color="white"}, + }, + overlay_tiles = { + {name = "morelights_extras_blocklight.png", color = "#FFFFFF"}, + "", + {name="hades_core_grass_side_cover_colorable.png", tileable_vertical=false}, + }, + paramtype2 = "color", + palette = "hades_core_palette_grass.png", + color = "#acef6a", + } + for k, v in pairs(override) do def[k] = v end @@ -97,6 +116,8 @@ do local tile = "default_sandstone_block.png" if morelights.game == "mineclone2" then tile = "mcl_core_sandstone_smooth.png" + elseif morelights.game == "hades_revisited" then + tile = "default_sandstone.png" end minetest.register_node("morelights_extras:sandstone_block", {