Skip to content

Commit

Permalink
MineClone/MineClonia compatibility for technic worldgen (#323)
Browse files Browse the repository at this point in the history
Co-authored-by: OgelGames <[email protected]>
  • Loading branch information
nonfreegithub and OgelGames authored Sep 29, 2023
1 parent 735f731 commit f5949f6
Show file tree
Hide file tree
Showing 6 changed files with 182 additions and 96 deletions.
3 changes: 2 additions & 1 deletion .luacheckrc
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ read_globals = {
"unifieddyes", "digiline_remote",
"drawers", "mg",
"craftguide", "i3", "mtt",
"vizlib",
"vizlib", "mcl_sounds", "mcl_vars",
"mcl_worlds",

-- Only used in technic/machines/MV/lighting.lua (disabled)
"isprotect", "homedecor_expect_infinite_stacks",
Expand Down
12 changes: 11 additions & 1 deletion technic_worldgen/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,21 @@ local modpath = minetest.get_modpath("technic_worldgen")

technic = rawget(_G, "technic") or {}

technic.sounds = {}
if minetest.get_modpath("default") then
technic.sounds = default
end
if minetest.get_modpath("mcl_sounds") then
technic.sounds = mcl_sounds
end

dofile(modpath.."/config.lua")
dofile(modpath.."/nodes.lua")
dofile(modpath.."/oregen.lua")
dofile(modpath.."/crafts.lua")
dofile(modpath.."/overrides.lua")
if minetest.get_modpath("default") then
dofile(modpath.."/overrides.lua")
end

-- Rubber trees, moretrees also supplies these
if not minetest.get_modpath("moretrees") then
Expand Down
4 changes: 2 additions & 2 deletions technic_worldgen/mod.conf
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
name = technic_worldgen
depends = default
optional_depends = mg
depends =
optional_depends = default, mcl_core, mcl_sounds, mcl_init, mcl_worlds, mg
133 changes: 86 additions & 47 deletions technic_worldgen/nodes.lua
Original file line number Diff line number Diff line change
@@ -1,152 +1,191 @@

local S = minetest.get_translator("technic_worldgen")

local has_mcl = minetest.get_modpath("mcl_core")

minetest.register_node(":technic:mineral_uranium", {
description = S("Uranium Ore"),
tiles = {"default_stone.png^technic_mineral_uranium.png"},
is_ground_content = true,
groups = {cracky=3, radioactive=1},
sounds = default.node_sound_stone_defaults(),
groups = {cracky=3, radioactive=1, pickaxey=1},
_mcl_hardness = 0.8,
_mcl_blast_resistance = 1,
sounds = technic.sounds.node_sound_stone_defaults(),
drop = "technic:uranium_lump",
})

minetest.register_node(":technic:mineral_chromium", {
description = S("Chromium Ore"),
tiles = {"default_stone.png^technic_mineral_chromium.png"},
is_ground_content = true,
groups = {cracky=3},
sounds = default.node_sound_stone_defaults(),
groups = {cracky=3, pickaxey=1},
_mcl_hardness = 0.8,
_mcl_blast_resistance = 1,
sounds = technic.sounds.node_sound_stone_defaults(),
drop = "technic:chromium_lump",
})

minetest.register_node(":technic:mineral_zinc", {
description = S("Zinc Ore"),
tiles = {"default_stone.png^technic_mineral_zinc.png"},
is_ground_content = true,
groups = {cracky=3},
sounds = default.node_sound_stone_defaults(),
groups = {cracky=3, pickaxey=1},
_mcl_hardness = 0.8,
_mcl_blast_resistance = 1,
sounds = technic.sounds.node_sound_stone_defaults(),
drop = "technic:zinc_lump",
})

minetest.register_node(":technic:mineral_lead", {
description = S("Lead Ore"),
tiles = {"default_stone.png^technic_mineral_lead.png"},
is_ground_content = true,
groups = {cracky=3},
sounds = default.node_sound_stone_defaults(),
groups = {cracky=3, pickaxey=1},
_mcl_hardness = 0.8,
_mcl_blast_resistance = 1,
sounds = technic.sounds.node_sound_stone_defaults(),
drop = "technic:lead_lump",
})

minetest.register_node(":technic:mineral_sulfur", {
description = S("Sulfur Ore"),
tiles = {"default_stone.png^technic_mineral_sulfur.png"},
is_ground_content = true,
groups = {cracky=3},
sounds = default.node_sound_stone_defaults(),
groups = {cracky=3, pickaxey=1},
_mcl_hardness = 0.8,
_mcl_blast_resistance = 1,
sounds = technic.sounds.node_sound_stone_defaults(),
drop = "technic:sulfur_lump",
})

minetest.register_node(":technic:granite", {
description = S("Granite"),
tiles = {"technic_granite.png"},
is_ground_content = true,
groups = {cracky=1},
sounds = default.node_sound_stone_defaults(),
})

minetest.register_node(":technic:granite_bricks", {
description = S("Granite Bricks"),
tiles = {"technic_granite_bricks.png"},
is_ground_content = true,
groups = {cracky=1},
sounds = default.node_sound_stone_defaults(),
})
if has_mcl then
minetest.register_alias("technic:granite", "mcl_core:granite")
minetest.register_alias("technic:granite_bricks", "mcl_core:granite_smooth")
else
minetest.register_node(":technic:granite", {
description = S("Granite"),
tiles = {"technic_granite.png"},
is_ground_content = true,
groups = {cracky=1},
sounds = technic.sounds.node_sound_stone_defaults(),
})

minetest.register_node(":technic:granite_bricks", {
description = S("Granite Bricks"),
tiles = {"technic_granite_bricks.png"},
is_ground_content = true,
groups = {cracky=1},
sounds = technic.sounds.node_sound_stone_defaults(),
})
end

minetest.register_node(":technic:marble", {
description = S("Marble"),
tiles = {"technic_marble.png"},
is_ground_content = true,
groups = {cracky=3, marble=1},
sounds = default.node_sound_stone_defaults(),
groups = {cracky=3, marble=1, pickaxey=1},
_mcl_hardness = 0.8,
_mcl_blast_resistance = 1,
sounds = technic.sounds.node_sound_stone_defaults(),
})

minetest.register_node(":technic:marble_bricks", {
description = S("Marble Bricks"),
tiles = {"technic_marble_bricks.png"},
is_ground_content = true,
groups = {cracky=3},
sounds = default.node_sound_stone_defaults(),
groups = {cracky=3, pickaxey=1},
_mcl_hardness = 0.8,
_mcl_blast_resistance = 1,
sounds = technic.sounds.node_sound_stone_defaults(),
})

minetest.register_node(":technic:uranium_block", {
description = S("Uranium Block"),
tiles = {"technic_uranium_block.png"},
is_ground_content = true,
groups = {uranium_block=1, cracky=1, level=2, radioactive=2},
sounds = default.node_sound_stone_defaults()
groups = {uranium_block=1, cracky=1, level=has_mcl and 0 or 2, radioactive=2, pickaxey=4},
_mcl_hardness = 1,
_mcl_blast_resistance = 1,
sounds = technic.sounds.node_sound_stone_defaults()
})

minetest.register_node(":technic:chromium_block", {
description = S("Chromium Block"),
tiles = {"technic_chromium_block.png"},
is_ground_content = true,
groups = {cracky=1, level=2},
sounds = default.node_sound_stone_defaults()
groups = {cracky=1, level=has_mcl and 0 or 2, pickaxey=4},
_mcl_hardness = 1,
_mcl_blast_resistance = 1,
sounds = technic.sounds.node_sound_stone_defaults()
})

minetest.register_node(":technic:zinc_block", {
description = S("Zinc Block"),
tiles = {"technic_zinc_block.png"},
is_ground_content = true,
groups = {cracky=1, level=2},
sounds = default.node_sound_stone_defaults()
groups = {cracky=1, level=has_mcl and 0 or 2, pickaxey=4},
_mcl_hardness = 1,
_mcl_blast_resistance = 1,
sounds = technic.sounds.node_sound_stone_defaults()
})

minetest.register_node(":technic:lead_block", {
description = S("Lead Block"),
tiles = {"technic_lead_block.png"},
is_ground_content = true,
groups = {cracky=1, level=2},
sounds = default.node_sound_stone_defaults()
groups = {cracky=1, level=has_mcl and 0 or 2, pickaxey=4},
_mcl_hardness = 1,
_mcl_blast_resistance = 1,
sounds = technic.sounds.node_sound_stone_defaults()
})

minetest.register_node(":technic:cast_iron_block", {
description = S("Cast Iron Block"),
tiles = {"technic_cast_iron_block.png"},
is_ground_content = true,
groups = {cracky=1, level=2},
sounds = default.node_sound_stone_defaults()
groups = {cracky=1, level=has_mcl and 0 or 2, pickaxey=4},
_mcl_hardness = 1,
_mcl_blast_resistance = 1,
sounds = technic.sounds.node_sound_stone_defaults()
})

minetest.register_node(":technic:carbon_steel_block", {
description = S("Carbon Steel Block"),
tiles = {"technic_carbon_steel_block.png"},
is_ground_content = true,
groups = {cracky=1, level=2},
sounds = default.node_sound_stone_defaults()
groups = {cracky=1, level=has_mcl and 0 or 2, pickaxey=4},
_mcl_hardness = 1,
_mcl_blast_resistance = 1,
sounds = technic.sounds.node_sound_stone_defaults()
})

minetest.register_node(":technic:stainless_steel_block", {
description = S("Stainless Steel Block"),
tiles = {"technic_stainless_steel_block.png"},
is_ground_content = true,
groups = {cracky=1, level=2},
sounds = default.node_sound_stone_defaults()
groups = {cracky=1, level=has_mcl and 0 or 2, pickaxey=4},
_mcl_hardness = 1,
_mcl_blast_resistance = 1,
sounds = technic.sounds.node_sound_stone_defaults()
})

minetest.register_node(":technic:sulfur_block", {
description = S("Sulfur Block"),
tiles = {"technic_sulfur_block.png"},
is_ground_content = true,
groups = {cracky = 3},
sounds = default.node_sound_stone_defaults()
groups = {cracky = 3, pickaxey=1, handy=1},
_mcl_hardness = 1,
_mcl_blast_resistance = 1,
sounds = technic.sounds.node_sound_stone_defaults()
})

minetest.register_node(":technic:blast_resistant_concrete", {
description = S("Blast-resistant Concrete Block"),
tiles = {"technic_blast_resistant_concrete_block.png"},
groups = {cracky = 1, level = 3, concrete = 1},
sounds = default.node_sound_stone_defaults(),
groups = {cracky = 1, level = has_mcl and 0 or 3, concrete = 1, pickaxey=5},
_mcl_hardness = 5,
_mcl_blast_resistance = 9,
sounds = technic.sounds.node_sound_stone_defaults(),
on_blast = function(pos, intensity)
if intensity > 9 then
minetest.remove_node(pos)
Expand Down
Loading

0 comments on commit f5949f6

Please sign in to comment.