Skip to content

Commit e2fc73d

Browse files
authored
Support for Hades Revisited (#710)
1 parent f24429b commit e2fc73d

File tree

4 files changed

+79
-1
lines changed

4 files changed

+79
-1
lines changed

.luacheckrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ read_globals = {
3030
"VoxelArea",
3131
"mcl_dyes",
3232
"mcl_sounds",
33+
"hades_sounds",
3334
}
3435

3536
globals = {"mesecon"}
Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
--Aliases
2+
3+
core.register_alias("mesecons_gamecompat:chest", "hades_chests:chest")
4+
core.register_alias("mesecons_gamecompat:chest_locked", "hades_chests:chest_locked")
5+
core.register_alias("mesecons_gamecompat:coalblock", "hades_core:coalblock")
6+
core.register_alias("mesecons_gamecompat:cobble", "hades_core:cobble")
7+
core.register_alias("mesecons_gamecompat:glass", "hades_core:glass")
8+
core.register_alias("mesecons_gamecompat:lava_source", "hades_core:lava_source")
9+
core.register_alias("mesecons_gamecompat:mese", "hades_core:mese")
10+
core.register_alias("mesecons_gamecompat:mese_crystal", "hades_core:mese_crystal")
11+
core.register_alias("mesecons_gamecompat:mese_crystal_fragment", "hades_core:mese_crystal_fragment")
12+
core.register_alias("mesecons_gamecompat:obsidian_glass", "hades_core:obsidian_glass")
13+
core.register_alias("mesecons_gamecompat:stone", "hades_core:stone")
14+
core.register_alias("mesecons_gamecompat:steel_ingot", "hades_core:steel_ingot")
15+
core.register_alias("mesecons_gamecompat:steelblock", "hades_core:steelblock")
16+
core.register_alias("mesecons_gamecompat:torch", "hades_torches:torch")
17+
18+
if core.get_modpath("hades_dye") then
19+
for _, color in ipairs(mesecon.dye_colors) do
20+
core.register_alias("mesecons_gamecompat:dye_" .. color, "hades_dye:" .. color)
21+
end
22+
end
23+
24+
-- Sounds
25+
26+
mesecon.node_sound.default = hades_sounds.node_sound_defaults()
27+
mesecon.node_sound.glass = hades_sounds.node_sound_glass_defaults()
28+
mesecon.node_sound.leaves = hades_sounds.node_sound_leaves_defaults()
29+
mesecon.node_sound.stone = hades_sounds.node_sound_stone_defaults()
30+
mesecon.node_sound.wood = hades_sounds.node_sound_wood_defaults()
31+
32+
if core.get_modpath("hades_fire") then
33+
mesecon.sound_name.fire = "fire_fire"
34+
end
35+
36+
if core.get_modpath("hades_tnt") then
37+
mesecon.sound_name.explode = "tnt_explode"
38+
end
39+
40+
-- Textures
41+
42+
mesecon.texture.steel_block = "default_steel_block.png"
43+
44+
-- MVPS stoppers
45+
46+
if core.get_modpath("mesecons_mvps") then
47+
-- All of the locked and internal nodes in Hades Revisited
48+
for _, name in ipairs({
49+
"hades_chests:chest_locked",
50+
"hades_chests:chest_locked_open",
51+
"hades_doors:hidden",
52+
"hades_doors:hidden_center",
53+
}) do
54+
mesecon.register_mvps_stopper(name)
55+
end
56+
core.register_on_mods_loaded(function()
57+
if core.get_modpath("hades_doors") then
58+
for _,v in pairs(core.registered_nodes) do
59+
if v.groups and (v.groups.door or v.groups.trapdoor) then
60+
mesecon.register_mvps_stopper(v.name)
61+
end
62+
end
63+
end
64+
if core.get_modpath("hades_beds") then
65+
for _,v in pairs(core.registered_nodes) do
66+
if v.groups and v.groups.bed then
67+
mesecon.register_mvps_stopper(v.name)
68+
end
69+
end
70+
end
71+
end)
72+
end

mesecons_gamecompat/init.lua

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,11 @@ if minetest.get_modpath("mcl_redstone") then
1919
dofile(minetest.get_modpath("mesecons_gamecompat").."/compat_mcla.lua")
2020
end
2121

22+
if minetest.get_modpath("hades_core") then
23+
minetest.log("info", "Mesecons: detected Hades Revisited Game for game compatibility")
24+
dofile(minetest.get_modpath("mesecons_gamecompat").."/compat_hades.lua")
25+
end
26+
2227
if minetest.get_modpath("doors") then
2328
dofile(minetest.get_modpath("mesecons_gamecompat").."/doors.lua")
2429
end

mesecons_gamecompat/mod.conf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
name = mesecons_gamecompat
22
depends = mesecons
3-
optional_depends = fire, default, dye, mesecons_mvps, tnt, doors, beds, mcl_fire, mcl_core, mcl_dye, mcl_tnt
3+
optional_depends = fire, default, dye, mesecons_mvps, tnt, doors, beds, mcl_fire, mcl_core, mcl_dye, mcl_tnt, hades_sounds

0 commit comments

Comments
 (0)