Major refactor, put compat ingredients in namespace tables

This commit is contained in:
James David Clarke 2023-12-27 17:11:42 +00:00
parent 26a8ab3dd0
commit 58df66b7bc
No known key found for this signature in database
GPG Key ID: 9F5ECFD0E20F1C4C
46 changed files with 276 additions and 309 deletions

View File

@ -1,40 +0,0 @@
import os
import re
# Define the directory path of the project here
# For this example, I'm just using a placeholder path
# You would replace this with the path to your project directory
project_directory = './technic'
# Regex to find all lines with either _ingredient or _sounds variables
variable_regex = re.compile(r'(\w+)(_ingredient|_sounds) = (.*)')
# Function to refactor a single file
def refactor_file(file_path):
changes_made = False
with open(file_path, 'r') as file:
lines = file.readlines()
with open(file_path, 'w') as file:
for line in lines:
match = variable_regex.search(line)
if match:
variable_name = match.group(1) + match.group(2)
new_line = f'technic.compat.{variable_name} = {match.group(3)}\n'
file.write(new_line)
changes_made = True
else:
file.write(line)
return changes_made
# Function to walk through the project directory and refactor all files
def refactor_project(directory):
for subdir, _, files in os.walk(directory):
for file in files:
file_path = os.path.join(subdir, file)
if file_path.endswith('.lua'):
if refactor_file(file_path):
print(f'Refactored {file_path}')
# Run the refactoring on the project directory
refactor_project(project_directory)

View File

@ -38,9 +38,9 @@ if pipeworks.enable_teleport_tube then
minetest.register_craft({
output = 'pipeworks:teleport_tube_1',
recipe = {
{mese_crystal_ingredient, 'technic:copper_coil', mese_crystal_ingredient},
{technic.compat.mese_crystal_ingredient, 'technic:copper_coil', technic.compat.mese_crystal_ingredient},
{'pipeworks:tube_1', 'technic:control_logic_unit', 'pipeworks:tube_1'},
{mese_crystal_ingredient, 'technic:copper_coil', mese_crystal_ingredient},
{technic.compat.mese_crystal_ingredient, 'technic:copper_coil', technic.compat.mese_crystal_ingredient},
}
})
end
@ -62,36 +62,36 @@ minetest.register_craft( {
minetest.register_craft({
output = 'technic:diamond_drill_head',
recipe = {
{'technic:stainless_steel_ingot', diamond_ingredient, 'technic:stainless_steel_ingot'},
{diamond_ingredient, '', diamond_ingredient},
{'technic:stainless_steel_ingot', diamond_ingredient, 'technic:stainless_steel_ingot'},
{'technic:stainless_steel_ingot', technic.compat.diamond_ingredient, 'technic:stainless_steel_ingot'},
{technic.compat.diamond_ingredient, '', technic.compat.diamond_ingredient},
{'technic:stainless_steel_ingot', technic.compat.diamond_ingredient, 'technic:stainless_steel_ingot'},
}
})
minetest.register_craft({
output = 'technic:green_energy_crystal',
recipe = {
{gold_ingot_ingredient, 'technic:battery', green_dye_ingredient},
{technic.compat.gold_ingot_ingredient, 'technic:battery', technic.compat.green_dye_ingredient},
{'technic:battery', 'technic:red_energy_crystal', 'technic:battery'},
{green_dye_ingredient, 'technic:battery', gold_ingot_ingredient},
{technic.compat.green_dye_ingredient, 'technic:battery', technic.compat.gold_ingot_ingredient},
}
})
minetest.register_craft({
output = 'technic:blue_energy_crystal',
recipe = {
{'moreores:mithril_ingot', 'technic:battery', blue_dye_ingredient},
{'moreores:mithril_ingot', 'technic:battery', technic.compat.blue_dye_ingredient},
{'technic:battery', 'technic:green_energy_crystal', 'technic:battery'},
{blue_dye_ingredient, 'technic:battery', 'moreores:mithril_ingot'},
{technic.compat.blue_dye_ingredient, 'technic:battery', 'moreores:mithril_ingot'},
}
})
minetest.register_craft({
output = 'technic:red_energy_crystal',
recipe = {
{'moreores:silver_ingot', 'technic:battery', red_dye_ingredient},
{'moreores:silver_ingot', 'technic:battery', technic.compat.red_dye_ingredient},
{'technic:battery', 'basic_materials:energy_crystal_simple', 'technic:battery'},
{red_dye_ingredient, 'technic:battery', 'moreores:silver_ingot'},
{technic.compat.red_dye_ingredient, 'technic:battery', 'moreores:silver_ingot'},
}
})
@ -143,7 +143,7 @@ minetest.register_craft({
output = 'technic:control_logic_unit',
recipe = {
{'', 'basic_materials:gold_wire', ''},
{copper_ingredient, 'technic:silicon_wafer', copper_ingredient},
{technic.compat.copper_ingredient, 'technic:silicon_wafer', technic.compat.copper_ingredient},
{'', 'technic:chromium_ingot', ''},
},
replacements = { {"basic_materials:gold_wire", "basic_materials:empty_spool"}, },
@ -153,8 +153,8 @@ minetest.register_craft({
output = 'technic:mixed_metal_ingot 9',
recipe = {
{'technic:stainless_steel_ingot', 'technic:stainless_steel_ingot', 'technic:stainless_steel_ingot'},
{bronze_ingredient, bronze_ingredient, bronze_ingredient},
{tin_ingredient, tin_ingredient, tin_ingredient},
{technic.compat.bronze_ingredient, technic.compat.bronze_ingredient, technic.compat.bronze_ingredient},
{technic.compat.tin_ingredient, technic.compat.tin_ingredient, technic.compat.tin_ingredient},
}
})
@ -175,7 +175,7 @@ minetest.register_craft({
})
minetest.register_craft({
output = dirt_ingredient.." 2",
output = technic.compat.dirt_ingredient.." 2",
type = "shapeless",
replacements = {{"bucket:bucket_water","bucket:bucket_empty"}},
recipe = {
@ -191,14 +191,14 @@ minetest.register_craft({
type = "shapeless",
recipe = {
"technic:raw_latex",
coal_ingredient,
coal_ingredient,
coal_ingredient,
coal_ingredient,
coal_ingredient,
coal_ingredient,
coal_ingredient,
coal_ingredient,
technic.compat.coal_ingredient,
technic.compat.coal_ingredient,
technic.compat.coal_ingredient,
technic.compat.coal_ingredient,
technic.compat.coal_ingredient,
technic.compat.coal_ingredient,
technic.compat.coal_ingredient,
technic.compat.coal_ingredient,
},
})

View File

@ -131,7 +131,7 @@ minetest.register_node("technic:machine_casing", {
paramtype = "light",
drawtype = "allfaces",
tiles = {"technic_machine_casing.png"},
sounds = stone_sounds,
sounds = technic.compat.stone_sounds,
})
minetest.register_craftitem("technic:rubber_goo", {
@ -188,7 +188,7 @@ for p = 0, 35 do
is_ground_content = true,
groups = {uranium_block=1, not_in_creative_inventory=nici,
cracky=1, level=2, radioactive=radioactivity},
sounds = stone_sounds,
sounds = technic.compat.stone_sounds,
});
if not ov then
minetest.register_craft({

View File

@ -17,9 +17,9 @@ local cable_entry = "^technic_cable_connection_overlay.png"
minetest.register_craft({
output = "technic:forcefield_emitter_off",
recipe = {
{mese_block_ingredient, "basic_materials:motor", mese_block_ingredient},
{technic.compat.mese_block_ingredient, "basic_materials:motor", technic.compat.mese_block_ingredient},
{"technic:deployer_off", "technic:machine_casing", "technic:deployer_off"},
{mese_block_ingredient, "technic:hv_cable", mese_block_ingredient},
{technic.compat.mese_block_ingredient, "technic:hv_cable", technic.compat.mese_block_ingredient},
}
})
@ -354,7 +354,7 @@ minetest.register_node("technic:forcefield", {
drawtype = "glasslike",
groups = {not_in_creative_inventory=1},
paramtype = "light",
light_source = mt_light_max,
light_source = technic.compat.mt_light_max,
diggable = false,
drop = '',
tiles = {{

View File

@ -24,7 +24,7 @@ local cable_entry = "^technic_cable_connection_overlay.png"
minetest.register_craft({
output = 'technic:hv_nuclear_reactor_core',
recipe = {
{'technic:carbon_plate', obsidian_glass_ingredient, 'technic:carbon_plate'},
{'technic:carbon_plate', technic.compat.obsidian_glass_ingredient, 'technic:carbon_plate'},
{'technic:composite_plate', 'technic:machine_casing', 'technic:composite_plate'},
{'technic:stainless_steel_ingot', 'technic:hv_cable', 'technic:stainless_steel_ingot'},
}
@ -414,7 +414,7 @@ minetest.register_node("technic:hv_nuclear_reactor_core", {
mesh = "technic_reactor.obj",
groups = {cracky = 1, technic_machine = 1, technic_hv = 1, digiline_remote_receive = 1},
legacy_facedir_simple = true,
sounds = wood_sounds,
sounds = technic.compat.wood_sounds,
paramtype = "light",
paramtype2 = "facedir",
stack_max = 1,
@ -449,7 +449,7 @@ minetest.register_node("technic:hv_nuclear_reactor_core_active", {
groups = {cracky = 1, technic_machine = 1, technic_hv = 1, radioactive = 4,
not_in_creative_inventory = 1, digiline_remote_receive = 1},
legacy_facedir_simple = true,
sounds = wood_sounds,
sounds = technic.compat.wood_sounds,
drop = "technic:hv_nuclear_reactor_core",
light_source = 14,
paramtype = "light",

View File

@ -4,9 +4,9 @@
minetest.register_craft({
output = 'technic:lv_alloy_furnace',
recipe = {
{brick_block_ingredient, brick_block_ingredient, brick_block_ingredient},
{brick_block_ingredient, 'technic:machine_casing', brick_block_ingredient},
{brick_block_ingredient, 'technic:lv_cable', brick_block_ingredient},
{technic.compat.brick_block_ingredient, technic.compat.brick_block_ingredient, technic.compat.brick_block_ingredient},
{technic.compat.brick_block_ingredient, 'technic:machine_casing', technic.compat.brick_block_ingredient},
{technic.compat.brick_block_ingredient, 'technic:lv_cable', technic.compat.brick_block_ingredient},
}
})

View File

@ -4,9 +4,9 @@ minetest.register_alias("lv_cable", "technic:lv_cable")
minetest.register_craft({
output = 'technic:lv_cable 6',
recipe = {
{paper_ingredient, paper_ingredient, paper_ingredient},
{copper_ingredient, copper_ingredient, copper_ingredient},
{paper_ingredient, paper_ingredient, paper_ingredient},
{technic.compat.paper_ingredient, technic.compat.paper_ingredient, technic.compat.paper_ingredient},
{technic.compat.copper_ingredient, technic.compat.copper_ingredient, technic.compat.copper_ingredient},
{technic.compat.paper_ingredient, technic.compat.paper_ingredient, technic.compat.paper_ingredient},
}
})

View File

@ -4,7 +4,7 @@ minetest.register_alias("compressor", "technic:lv_compressor")
minetest.register_craft({
output = 'technic:lv_compressor',
recipe = {
{stone_ingredient, 'basic_materials:motor', stone_ingredient},
{technic.compat.stone_ingredient, 'basic_materials:motor', technic.compat.stone_ingredient},
{'mesecons:piston', 'technic:machine_casing', 'mesecons:piston'},
{'basic_materials:silver_wire', 'technic:lv_cable', 'basic_materials:silver_wire'},
},

View File

@ -5,9 +5,9 @@
minetest.register_craft({
output = 'technic:electric_furnace',
recipe = {
{cobble_ingredient, cobble_ingredient, cobble_ingredient},
{cobble_ingredient, 'technic:machine_casing', cobble_ingredient},
{cobble_ingredient, 'technic:lv_cable', cobble_ingredient},
{technic.compat.cobble_ingredient, technic.compat.cobble_ingredient, technic.compat.cobble_ingredient},
{technic.compat.cobble_ingredient, 'technic:machine_casing', technic.compat.cobble_ingredient},
{technic.compat.cobble_ingredient, 'technic:lv_cable', technic.compat.cobble_ingredient},
}
})

View File

@ -8,9 +8,9 @@ minetest.register_alias("lv_generator", "technic:lv_generator")
minetest.register_craft({
output = 'technic:lv_generator',
recipe = {
{stone_ingredient, furnace_ingredient, stone_ingredient},
{stone_ingredient, 'technic:machine_casing', stone_ingredient},
{stone_ingredient, 'technic:lv_cable', stone_ingredient},
{technic.compat.stone_ingredient, technic.compat.furnace_ingredient, technic.compat.stone_ingredient},
{technic.compat.stone_ingredient, 'technic:machine_casing', technic.compat.stone_ingredient},
{technic.compat.stone_ingredient, 'technic:lv_cable', technic.compat.stone_ingredient},
}
})

View File

@ -10,9 +10,9 @@ local S = technic.getter
minetest.register_craft({
output = 'technic:geothermal',
recipe = {
{granite_ingredient, diamond_ingredient, granite_ingredient},
{technic.compat.granite_ingredient, technic.compat.diamond_ingredient, technic.compat.granite_ingredient},
{'basic_materials:copper_wire', 'technic:machine_casing', 'basic_materials:copper_wire'},
{granite_ingredient, 'technic:lv_cable', granite_ingredient},
{technic.compat.granite_ingredient, 'technic:lv_cable', technic.compat.granite_ingredient},
},
replacements = {
{"basic_materials:copper_wire", "basic_materials:empty_spool"},
@ -90,7 +90,7 @@ minetest.register_node("technic:geothermal", {
technic_machine=1, technic_lv=1},
paramtype2 = "facedir",
legacy_facedir_simple = true,
sounds = wood_sounds,
sounds = technic.compat.wood_sounds,
on_construct = function(pos)
local meta = minetest.get_meta(pos)
meta:set_string("infotext", S("Geothermal %s Generator"):format("LV"))
@ -107,7 +107,7 @@ minetest.register_node("technic:geothermal_active", {
groups = {snappy=2, choppy=2, oddly_breakable_by_hand=2,
technic_machine=1, technic_lv=1, not_in_creative_inventory=1},
legacy_facedir_simple = true,
sounds = wood_sounds,
sounds = technic.compat.wood_sounds,
drop = "technic:geothermal",
technic_run = run,
})

View File

@ -3,9 +3,9 @@ minetest.register_alias("grinder", "technic:lv_grinder")
minetest.register_craft({
output = 'technic:lv_grinder',
recipe = {
{desert_stone_ingredient, diamond_ingredient, desert_stone_ingredient},
{desert_stone_ingredient, 'technic:machine_casing', desert_stone_ingredient},
{granite_ingredient, 'technic:lv_cable', granite_ingredient},
{technic.compat.desert_stone_ingredient, technic.compat.diamond_ingredient, technic.compat.desert_stone_ingredient},
{technic.compat.desert_stone_ingredient, 'technic:machine_casing', technic.compat.desert_stone_ingredient},
{technic.compat.granite_ingredient, 'technic:lv_cable', technic.compat.granite_ingredient},
}
})

View File

@ -149,7 +149,7 @@ technic.register_machine("LV", "technic:lv_lamp_active", technic.receiver)
minetest.register_craft({
output = "technic:lv_lamp",
recipe = {
{glass_ingredient, glass_ingredient, glass_ingredient},
{technic.compat.glass_ingredient, technic.compat.glass_ingredient, technic.compat.glass_ingredient},
{"technic:lv_led", "technic:lv_led", "technic:lv_led"},
{"mesecons_materials:glue", "technic:lv_cable", "mesecons_materials:glue"},
}

View File

@ -7,9 +7,9 @@ minetest.register_alias("music_player", "technic:music_player")
minetest.register_craft({
output = 'technic:music_player',
recipe = {
{'technic:chromium_ingot', diamond_ingredient, 'technic:chromium_ingot'},
{diamond_ingredient, 'technic:machine_casing', diamond_ingredient},
{mossy_cobble_ingredient, 'technic:lv_cable', mossy_cobble_ingredient},
{'technic:chromium_ingot', technic.compat.diamond_ingredient, 'technic:chromium_ingot'},
{technic.compat.diamond_ingredient, 'technic:machine_casing', technic.compat.diamond_ingredient},
{technic.compat.mossy_cobble_ingredient, 'technic:lv_cable', technic.compat.mossy_cobble_ingredient},
}
})
@ -96,7 +96,7 @@ minetest.register_node("technic:music_player", {
groups = {snappy=2, choppy=2, oddly_breakable_by_hand=2,
technic_machine=1, technic_lv=1},
connect_sides = {"bottom"},
sounds = wood_sounds,
sounds = technic.compat.wood_sounds,
on_construct = function(pos)
local meta = minetest.get_meta(pos)
meta:set_string("infotext", S("%s Music Player"):format("LV"))

View File

@ -50,7 +50,7 @@ minetest.register_node("technic:solar_panel", {
groups = {snappy=2, choppy=2, oddly_breakable_by_hand=2,
technic_machine=1, technic_lv=1},
connect_sides = {"bottom"},
sounds = wood_sounds,
sounds = technic.compat.wood_sounds,
description = S("Small Solar %s Generator"):format("LV"),
active = false,
drawtype = "nodebox",

View File

@ -11,7 +11,7 @@ minetest.register_alias("water_mill", "technic:water_mill")
minetest.register_craft({
output = 'technic:water_mill',
recipe = {
{'technic:marble', diamond_ingredient, 'technic:marble'},
{'technic:marble', technic.compat.diamond_ingredient, 'technic:marble'},
{'group:wood', 'technic:machine_casing', 'group:wood'},
{'technic:marble', 'technic:lv_cable', 'technic:marble'},
}
@ -80,7 +80,7 @@ minetest.register_node("technic:water_mill", {
groups = {snappy=2, choppy=2, oddly_breakable_by_hand=2,
technic_machine=1, technic_lv=1},
legacy_facedir_simple = true,
sounds = wood_sounds,
sounds = technic.compat.wood_sounds,
on_construct = function(pos)
local meta = minetest.get_meta(pos)
meta:set_string("infotext", S("Hydro %s Generator"):format("LV"))
@ -98,7 +98,7 @@ minetest.register_node("technic:water_mill_active", {
groups = {snappy=2, choppy=2, oddly_breakable_by_hand=2,
technic_machine=1, technic_lv=1, not_in_creative_inventory=1},
legacy_facedir_simple = true,
sounds = wood_sounds,
sounds = technic.compat.wood_sounds,
drop = "technic:water_mill",
technic_run = run,
technic_disabled_machine_name = "technic:water_mill",

View File

@ -77,7 +77,7 @@ minetest.register_node("technic:hydro_turbine", {
groups = {snappy=2, choppy=2, oddly_breakable_by_hand=2,
technic_machine=1, technic_mv=1},
legacy_facedir_simple = true,
sounds = wood_sounds,
sounds = technic.compat.wood_sounds,
on_construct = function(pos)
local meta = minetest.get_meta(pos)
meta:set_string("infotext", S("Hydro %s Generator"):format("MV"))
@ -95,7 +95,7 @@ minetest.register_node("technic:hydro_turbine_active", {
groups = {snappy=2, choppy=2, oddly_breakable_by_hand=2,
technic_machine=1, technic_mv=1, not_in_creative_inventory=1},
legacy_facedir_simple = true,
sounds = wood_sounds,
sounds = technic.compat.wood_sounds,
drop = "technic:hydro_turbine",
technic_run = run,
technic_disabled_machine_name = "technic:hydro_turbine",

View File

@ -105,7 +105,7 @@ minetest.register_node('technic:homedecor_glowlight_half_yellow', {
paramtype = "light",
paramtype2 = "facedir",
walkable = true,
sounds = wood_sounds,
sounds = technic.compat.wood_sounds,
groups = { snappy = 3 },
on_place = function(itemstack, placer, pointed_thing)
@ -145,7 +145,7 @@ minetest.register_node('technic:homedecor_glowlight_half_yellow_active', {
paramtype2 = "facedir",
walkable = true,
light_source = minetest.LIGHT_MAX,
sounds = wood_sounds,
sounds = technic.compat.wood_sounds,
groups = { snappy = 3, not_in_creative_inventory=1},
drop="technic:homedecor_glowlight_half_yellow",
@ -186,7 +186,7 @@ minetest.register_node('technic:homedecor_glowlight_quarter_yellow', {
paramtype = "light",
paramtype2 = "facedir",
walkable = true,
sounds = wood_sounds,
sounds = technic.compat.wood_sounds,
groups = { snappy = 3 },
on_place = function(itemstack, placer, pointed_thing)
@ -226,7 +226,7 @@ minetest.register_node('technic:homedecor_glowlight_quarter_yellow_active', {
paramtype2 = "facedir",
walkable = true,
light_source = minetest.LIGHT_MAX-1,
sounds = wood_sounds,
sounds = technic.compat.wood_sounds,
groups = { snappy = 3, not_in_creative_inventory=1},
drop="technic:homedecor_glowlight_quarter_yellow",
@ -268,7 +268,7 @@ minetest.register_node('technic:homedecor_glowlight_half_white', {
paramtype = "light",
paramtype2 = "facedir",
walkable = true,
sounds = wood_sounds,
sounds = technic.compat.wood_sounds,
groups = { snappy = 3 },
on_place = function(itemstack, placer, pointed_thing)
@ -308,7 +308,7 @@ minetest.register_node('technic:homedecor_glowlight_half_white_active', {
paramtype2 = "facedir",
walkable = true,
light_source = minetest.LIGHT_MAX,
sounds = wood_sounds,
sounds = technic.compat.wood_sounds,
groups = { snappy = 3, not_in_creative_inventory=1},
drop="technic:homedecor_glowlight_half_white",
@ -349,7 +349,7 @@ minetest.register_node('technic:homedecor_glowlight_quarter_white', {
paramtype = "light",
paramtype2 = "facedir",
walkable = true,
sounds = wood_sounds,
sounds = technic.compat.wood_sounds,
groups = { snappy = 3 },
on_place = function(itemstack, placer, pointed_thing)
@ -389,7 +389,7 @@ minetest.register_node('technic:homedecor_glowlight_quarter_white_active', {
paramtype2 = "facedir",
walkable = true,
light_source = minetest.LIGHT_MAX-1,
sounds = wood_sounds,
sounds = technic.compat.wood_sounds,
groups = { snappy = 3, not_in_creative_inventory=1},
drop="technic:homedecor_glowlight_quarter_white",
@ -430,7 +430,7 @@ minetest.register_node('technic:homedecor_glowlight_small_cube_yellow', {
paramtype = "light",
paramtype2 = "facedir",
walkable = true,
sounds = wood_sounds,
sounds = technic.compat.wood_sounds,
groups = { snappy = 3 },
on_place = function(itemstack, placer, pointed_thing)
@ -470,7 +470,7 @@ minetest.register_node('technic:homedecor_glowlight_small_cube_yellow_active', {
paramtype2 = "facedir",
walkable = true,
light_source = minetest.LIGHT_MAX-1,
sounds = wood_sounds,
sounds = technic.compat.wood_sounds,
groups = { snappy = 3, not_in_creative_inventory=1},
drop="technic:homedecor_glowlight_small_cube_yellow",
@ -511,7 +511,7 @@ minetest.register_node('technic:homedecor_glowlight_small_cube_white', {
paramtype = "light",
paramtype2 = "facedir",
walkable = true,
sounds = wood_sounds,
sounds = technic.compat.wood_sounds,
groups = { snappy = 3 },
on_place = function(itemstack, placer, pointed_thing)
@ -551,7 +551,7 @@ minetest.register_node('technic:homedecor_glowlight_small_cube_white_active', {
paramtype2 = "facedir",
walkable = true,
light_source = minetest.LIGHT_MAX-1,
sounds = wood_sounds,
sounds = technic.compat.wood_sounds,
groups = { snappy = 3, not_in_creative_inventory=1},
drop="technic:homedecor_glowlight_small_cube_white",

View File

@ -123,7 +123,7 @@ minetest.register_node("technic:power_radiator", {
tiles = {"technic_lv_cable.png", "technic_lv_cable.png", "technic_lv_cable.png",
"technic_lv_cable.png", "technic_lv_cable.png", "technic_lv_cable.png"},
groups = {snappy=2, choppy=2, oddly_breakable_by_hand=2},
sounds = wood_sounds,
sounds = technic.compat.wood_sounds,
drawtype = "nodebox",
paramtype = "light",
is_ground_content = true,

View File

@ -10,9 +10,9 @@ local tube_entry = "^pipeworks_tube_connection_wooden.png"
minetest.register_craft({
output = 'technic:tool_workshop',
recipe = {
{'group:wood', diamond_ingredient, 'group:wood'},
{'group:wood', technic.compat.diamond_ingredient, 'group:wood'},
{'mesecons_pistons:piston_sticky_off', 'technic:machine_casing', 'technic:carbon_cloth'},
{obsidian_ingredient, 'technic:mv_cable', obsidian_ingredient},
{technic.compat.obsidian_ingredient, 'technic:mv_cable', technic.compat.obsidian_ingredient},
}
})
@ -95,7 +95,7 @@ minetest.register_node("technic:tool_workshop", {
groups = {snappy=2, choppy=2, oddly_breakable_by_hand=2,
technic_machine=1, technic_mv=1, tubedevice=1, tubedevice_receiver=1},
connect_sides = {"bottom", "back", "left", "right"},
sounds = wood_sounds,
sounds = technic.compat.wood_sounds,
on_construct = function(pos)
local meta = minetest.get_meta(pos)
meta:set_string("infotext", S("%s Tool Workshop"):format("MV"))

View File

@ -25,7 +25,7 @@ minetest.register_node("technic:wind_mill_frame", {
tiles = {"technic_carbon_steel_block.png", "default_glass.png"},
sunlight_propagates = true,
groups = {cracky=3},
sounds = stone_sounds,
sounds = technic.compat.stone_sounds,
paramtype = "light",
})
@ -72,7 +72,7 @@ minetest.register_node("technic:wind_mill", {
paramtype2 = "facedir",
groups = {cracky=1, technic_machine=1, technic_mv=1},
connect_sides = {"top", "bottom", "back", "left", "right"},
sounds = stone_sounds,
sounds = technic.compat.stone_sounds,
drawtype = "nodebox",
paramtype = "light",
node_box = {

View File

@ -73,7 +73,7 @@ minetest.register_node("technic:admin_anchor", {
tiles = {"technic_admin_anchor.png"},
is_ground_content = true,
groups = {cracky=3, not_in_creative_inventory=1},
sounds = stone_sounds,
sounds = technic.compat.stone_sounds,
after_place_node = function (pos, placer)
local meta = minetest.get_meta(pos)
if placer and placer:is_player() then

View File

@ -6,9 +6,9 @@ local S = technic.getter
minetest.register_craft({
output = 'technic:coal_alloy_furnace',
recipe = {
{brick_block_ingredient, brick_block_ingredient, brick_block_ingredient},
{brick_block_ingredient, '', brick_block_ingredient},
{brick_block_ingredient, brick_block_ingredient, brick_block_ingredient},
{technic.compat.brick_block_ingredient, technic.compat.brick_block_ingredient, technic.compat.brick_block_ingredient},
{technic.compat.brick_block_ingredient, '', technic.compat.brick_block_ingredient},
{technic.compat.brick_block_ingredient, technic.compat.brick_block_ingredient, technic.compat.brick_block_ingredient},
}
})
@ -36,7 +36,7 @@ minetest.register_node("technic:coal_alloy_furnace", {
paramtype2 = "facedir",
groups = {cracky=2},
legacy_facedir_simple = true,
sounds = stone_sounds,
sounds = technic.compat.stone_sounds,
on_construct = function(pos)
local meta = minetest.get_meta(pos)
meta:set_string("formspec", formspec)
@ -62,7 +62,7 @@ minetest.register_node("technic:coal_alloy_furnace_active", {
drop = "technic:coal_alloy_furnace",
groups = {cracky=2, not_in_creative_inventory=1},
legacy_facedir_simple = true,
sounds = stone_sounds,
sounds = technic.compat.stone_sounds,
can_dig = technic.machine_can_dig,
allow_metadata_inventory_put = technic.machine_inventory_put,
allow_metadata_inventory_take = technic.machine_inventory_take,

View File

@ -142,7 +142,7 @@ local function make_constructor(mark, length)
groups = {snappy=2, choppy=2, oddly_breakable_by_hand=2,
mesecon = 2, technic_constructor = 1},
mesecons = {effector = {action_on = make_on(mark, length)}},
sounds = stone_sounds,
sounds = technic.compat.stone_sounds,
on_construct = function(pos)
local meta = minetest.get_meta(pos)
local formspec = "size[8,9;]"..
@ -194,7 +194,7 @@ local function make_constructor(mark, length)
groups = {snappy=2, choppy=2, oddly_breakable_by_hand=2,
mesecon=2, not_in_creative_inventory=1, technic_constructor=1},
mesecons= {effector = {action_off = make_off(mark)}},
sounds = stone_sounds,
sounds = technic.compat.stone_sounds,
allow_metadata_inventory_put = allow_inventory_put,
allow_metadata_inventory_take = technic.machine_inventory_take,
allow_metadata_inventory_move = technic.machine_inventory_move,

View File

@ -981,7 +981,7 @@ minetest.register_craft({
output = 'technic:template 10',
recipe = {
{ '', 'basic_materials:brass_ingot', '' },
{ 'basic_materials:brass_ingot', mese_crystal_ingredient, 'basic_materials:brass_ingot' },
{ 'basic_materials:brass_ingot', technic.compat.mese_crystal_ingredient, 'basic_materials:brass_ingot' },
{ '', 'basic_materials:brass_ingot', '' },
}
})
@ -1009,7 +1009,7 @@ minetest.register_craft({
output = 'technic:template_tool',
recipe = {
{ '', 'technic:template', '' },
{ mese_crystal_ingredient, 'default:stick', mese_crystal_ingredient },
{ technic.compat.mese_crystal_ingredient, 'default:stick', technic.compat.mese_crystal_ingredient },
{ '', 'default:stick', '' },
}
})

View File

@ -47,7 +47,7 @@ minetest.register_craft({
output = 'technic:injector 1',
recipe = {
{'', 'technic:control_logic_unit',''},
{'', chest_ingredient,''},
{'', technic.compat.chest_ingredient,''},
{'', 'pipeworks:tube_1',''},
}
})
@ -105,7 +105,7 @@ minetest.register_node("technic:injector", {
end,
connect_sides = {left=1, right=1, back=1, top=1, bottom=1},
},
sounds = wood_sounds,
sounds = technic.compat.wood_sounds,
on_construct = function(pos)
local meta = minetest.get_meta(pos)
meta:set_string("infotext", S("Self-Contained Injector"))

View File

@ -10,7 +10,7 @@ minetest.register_craft({
output = "technic:power_monitor",
recipe = {
{"", "", ""},
{"", "technic:machine_casing", copper_ingredient},
{"", "technic:machine_casing", technic.compat.copper_ingredient},
{"technic:lv_cable", "technic:lv_cable", "technic:lv_cable"}
}
})
@ -28,7 +28,7 @@ minetest.register_node("technic:power_monitor",{
paramtype2 = "facedir",
groups = {snappy=2, choppy=2, oddly_breakable_by_hand=2, technic_all_tiers=1, technic_machine=1},
connect_sides = {"bottom", "back"},
sounds = wood_sounds,
sounds = technic.compat.wood_sounds,
on_construct = function(pos)
local meta = minetest.get_meta(pos)
meta:set_string("infotext", S("Power Monitor"))

View File

@ -17,9 +17,9 @@ technic.register_power_tool("technic:blue_energy_crystal", 450000)
minetest.register_craft({
output = "technic:battery",
recipe = {
{"group:wood", copper_ingredient, "group:wood"},
{"group:wood", technic.compat.copper_ingredient, "group:wood"},
{"group:wood", "default:tin_ingot", "group:wood"},
{"group:wood", copper_ingredient, "group:wood"},
{"group:wood", technic.compat.copper_ingredient, "group:wood"},
}
})
-- Sulfur-lead-water recipes:
@ -300,7 +300,7 @@ function technic.register_battery_box(data)
connect_sides = {"bottom"},
tube = data.tube and tube or nil,
paramtype2 = "facedir",
sounds = wood_sounds,
sounds = technic.compat.wood_sounds,
drop = "technic:"..ltier.."_battery_box0",
on_construct = function(pos)
local meta = minetest.get_meta(pos)

View File

@ -161,7 +161,7 @@ function technic.register_cable(tier, size)
inventory_image = "technic_"..ltier.."_cable_wield.png",
wield_image = "technic_"..ltier.."_cable_wield.png",
groups = groups,
sounds = wood_sounds,
sounds = technic.compat.wood_sounds,
drop = "technic:"..ltier.."_cable",
paramtype = "light",
sunlight_propagates = true,
@ -203,7 +203,7 @@ function technic.register_cable(tier, size)
description = S("%s Cable Plate"):format(tier),
tiles = {"technic_"..ltier.."_cable.png"},
groups = table.copy(groups),
sounds = wood_sounds,
sounds = technic.compat.wood_sounds,
drop = "technic:"..ltier.."_cable_plate_1",
paramtype = "light",
sunlight_propagates = true,

View File

@ -35,7 +35,7 @@ end
-- handles the machine upgrades when set or removed
local function on_machine_upgrade(meta, stack)
local stack_name = stack:get_name()
if stack_name == chest_ingredient then
if stack_name == technic.compat.chest_ingredient then
meta:set_int("public", 1)
return 1
elseif stack_name ~= "technic:control_logic_unit"
@ -47,7 +47,7 @@ end
-- something is about to be removed
local function on_machine_downgrade(meta, stack, list)
if stack:get_name() == chest_ingredient then
if stack:get_name() == technic.compat.chest_ingredient then
local inv = meta:get_inventory()
local upg1, upg2 = inv:get_stack("upgrade1", 1), inv:get_stack("upgrade2", 1)

View File

@ -125,7 +125,7 @@ function technic.register_generator(data)
groups = groups,
connect_sides = {"bottom", "back", "left", "right"},
legacy_facedir_simple = true,
sounds = wood_sounds,
sounds = technic.compat.wood_sounds,
tube = data.tube and tube or nil,
on_construct = function(pos)
local meta = minetest.get_meta(pos)
@ -192,7 +192,7 @@ function technic.register_generator(data)
groups = active_groups,
connect_sides = {"bottom"},
legacy_facedir_simple = true,
sounds = wood_sounds,
sounds = technic.compat.wood_sounds,
tube = data.tube and tube or nil,
drop = "technic:"..ltier.."_generator",
can_dig = technic.machine_can_dig,

View File

@ -82,15 +82,15 @@ register_dust("Cast Iron", "technic:cast_iron_ingot")
register_dust("Chernobylite", "technic:chernobylite_block")
register_dust("Chromium", "technic:chromium_ingot")
register_dust("Coal", nil)
register_dust("Copper", copper_ingredient)
register_dust("Copper", technic.compat.copper_ingredient)
register_dust("Lead", "technic:lead_ingot")
register_dust("Gold", gold_ingot_ingredient)
register_dust("Gold", technic.compat.gold_ingot_ingredient)
register_dust("Mithril", "moreores:mithril_ingot")
register_dust("Silver", "moreores:silver_ingot")
register_dust("Stainless Steel", "technic:stainless_steel_ingot")
register_dust("Stone", "default:stone")
register_dust("Sulfur", nil)
register_dust("Tin", tin_ingredient)
register_dust("Tin", technic.compat.tin_ingredient)
register_dust("Wrought Iron", "technic:wrought_iron_ingot")
register_dust("Zinc", "technic:zinc_ingot")
if minetest.get_modpath("gloopores") or minetest.get_modpath("glooptest") then

View File

@ -174,7 +174,7 @@ function technic.register_base_machine(data)
tube = data.tube and tube or nil,
connect_sides = data.connect_sides or connect_default,
legacy_facedir_simple = true,
sounds = wood_sounds,
sounds = technic.compat.wood_sounds,
on_construct = function(pos)
local node = minetest.get_node(pos)
local meta = minetest.get_meta(pos)
@ -245,7 +245,7 @@ function technic.register_base_machine(data)
groups = active_groups,
connect_sides = data.connect_sides or connect_default,
legacy_facedir_simple = true,
sounds = wood_sounds,
sounds = technic.compat.wood_sounds,
tube = data.tube and tube or nil,
can_dig = technic.machine_can_dig,
allow_metadata_inventory_put = technic.machine_inventory_put,

View File

@ -45,7 +45,7 @@ function technic.register_solar_array(data)
"technic_"..ltier.."_solar_array_side.png", "technic_"..ltier.."_solar_array_side.png"},
groups = {snappy=2, choppy=2, oddly_breakable_by_hand=2, technic_machine=1, ["technic_"..ltier]=1},
connect_sides = {"bottom"},
sounds = wood_sounds,
sounds = technic.compat.wood_sounds,
description = S("Arrayed Solar %s Generator"):format(tier),
active = false,
drawtype = "nodebox",

View File

@ -200,7 +200,7 @@ minetest.register_node("technic:supply_converter", {
groups = {snappy=2, choppy=2, oddly_breakable_by_hand=2,
technic_machine=1, technic_all_tiers=1},
connect_sides = {"top", "bottom"},
sounds = wood_sounds,
sounds = technic.compat.wood_sounds,
on_receive_fields = supply_converter_receive_fields,
on_construct = function(pos)
local meta = minetest.get_meta(pos)

View File

@ -15,7 +15,7 @@ minetest.register_craft({
output = "technic:switching_station",
recipe = {
{"", "technic:lv_transformer", ""},
{copper_ingredient, "technic:machine_casing", copper_ingredient},
{technic.compat.copper_ingredient, "technic:machine_casing", technic.compat.copper_ingredient},
{"technic:lv_cable", "technic:lv_cable", "technic:lv_cable"}
}
})
@ -38,7 +38,7 @@ minetest.register_node("technic:switching_station",{
"technic_water_mill_top_active.png"},
groups = {snappy=2, choppy=2, oddly_breakable_by_hand=2, technic_all_tiers=1},
connect_sides = {"bottom"},
sounds = wood_sounds,
sounds = technic.compat.wood_sounds,
on_construct = function(pos)
local meta = minetest.get_meta(pos)
meta:set_string("infotext", S("Switching Station"))

View File

@ -34,74 +34,74 @@ centrifuge_recipes = {
{ "technic:bronze_dust 8", "technic:copper_dust 7", "technic:tin_dust" },
{ "technic:stainless_steel_dust 5", "technic:wrought_iron_dust 4", "technic:chromium_dust" },
{ "technic:brass_dust 3", "technic:copper_dust 2", "technic:zinc_dust" },
{ "technic:chernobylite_dust", sand_ingredient, "technic:uranium3_dust" },
{ dirt_ingredient.." 4", sand_ingredient, gravel_ingredient, "default:clay_lump 2" },
{ "technic:chernobylite_dust", technic.compat.sand_ingredient, "technic:uranium3_dust" },
{ technic.compat.dirt_ingredient.." 4", technic.compat.sand_ingredient, technic.compat.gravel_ingredient, "default:clay_lump 2" },
}
compressor_recipes = {
{snow_block_ingredient, ice_block_ingredient},
{sand_ingredient.." 2", sandstone_ingredient},
{desert_sand_ingredient.." 2", desert_stone_ingredient},
{desert_sand_ingredient, desert_stone_ingredient},
{technic.compat.snow_block_ingredient, technic.compat.ice_block_ingredient},
{technic.compat.sand_ingredient.." 2", technic.compat.sandstone_ingredient},
{technic.compat.desert_sand_ingredient.." 2", technic.compat.desert_stone_ingredient},
{technic.compat.desert_sand_ingredient, technic.compat.desert_stone_ingredient},
{"technic:mixed_metal_ingot", "technic:composite_plate"},
{copper_ingredient.." 5", "technic:copper_plate"},
{technic.compat.copper_ingredient.." 5", "technic:copper_plate"},
{"technic:coal_dust 4", "technic:graphite"},
{"technic:carbon_cloth", "technic:carbon_plate"},
{"technic:uranium35_ingot 5", "technic:uranium_fuel"},
}
extractor_recipes = {
{"technic:coal_dust", dye_black .. " 2"},
{blueberries_ingredient, dye_violet .. " 2"},
{grass_ingredient, dye_green .. " 1"},
{dry_shrub_ingredient, dye_brown .. " 1"},
{junglegrass_ingredient, dye_green .. " 2"},
{cactus_ingredient, dye_green .. " 4"},
{geranium_ingredient, dye_blue .. " 4"},
{dandelion_white_ingredient, dye_white .. " 4"},
{dandelion_yellow_ingredient, dye_yellow .. " 4"},
{tulip_ingredient, dye_orange .. " 4"},
{rose_ingredient, dye_red .. " 4"},
{viola_ingredient, dye_violet .. " 4"},
{blackberry_ingredient, unifieddyes and "unifieddyes:magenta_s50 4" or dye_violet .. " 4"},
{blueberry_ingredient, unifieddyes and "unifieddyes:magenta_s50 4" or ""},
{"technic:coal_dust", technic.compat.dye_black .. " 2"},
{technic.compat.blueberries_ingredient, technic.compat.dye_violet .. " 2"},
{technic.compat.grass_ingredient, technic.compat.dye_green .. " 1"},
{technic.compat.dry_shrub_ingredient, technic.compat.dye_brown .. " 1"},
{technic.compat.junglegrass_ingredient, technic.compat.dye_green .. " 2"},
{technic.compat.cactus_ingredient, technic.compat.dye_green .. " 4"},
{technic.compat.geranium_ingredient, technic.compat.dye_blue .. " 4"},
{technic.compat.dandelion_white_ingredient, technic.compat.dye_white .. " 4"},
{technic.compat.dandelion_yellow_ingredient, technic.compat.dye_yellow .. " 4"},
{technic.compat.tulip_ingredient, technic.compat.dye_orange .. " 4"},
{technic.compat.rose_ingredient, technic.compat.dye_red .. " 4"},
{technic.compat.viola_ingredient, technic.compat.dye_violet .. " 4"},
{technic.compat.blackberry_ingredient, unifieddyes and "unifieddyes:magenta_s50 4" or technic.compat.dye_violet .. " 4"},
{technic.compat.blueberry_ingredient, unifieddyes and "unifieddyes:magenta_s50 4" or ""},
}
freezer_recipes = {
{water_bucket_ingredient, { ice_block_ingredient, emtpy_bucket_ingredient } },
{bucket_river_water_ingredient, { ice_block_ingredient, emtpy_bucket_ingredient } },
{dirt_ingredient , dirt_with_snow_ingredient },
{bucket_lava_ingredient, { obsidian_ingredient, emtpy_bucket_ingredient } }
{technic.compat.water_bucket_ingredient, { technic.compat.ice_block_ingredient, technic.compat.emtpy_bucket_ingredient } },
{technic.compat.bucket_river_water_ingredient, { technic.compat.ice_block_ingredient, technic.compat.emtpy_bucket_ingredient } },
{technic.compat.dirt_ingredient , technic.compat.dirt_with_snow_ingredient },
{technic.compat.bucket_lava_ingredient, { technic.compat.obsidian_ingredient, technic.compat.emtpy_bucket_ingredient } }
}
grinder_recipes = {
-- Dusts
{coal_ingredient, "technic:coal_dust 2"},
{copper_lump_ingredient, "technic:copper_dust 2"},
{desert_stone_ingredient, desert_sand_ingredient},
{gold_lump_ingredient, "technic:gold_dust 2"},
{iron_lump_ingredient, "technic:wrought_iron_dust 2"},
{technic.compat.coal_ingredient, "technic:coal_dust 2"},
{technic.compat.copper_lump_ingredient, "technic:copper_dust 2"},
{technic.compat.desert_stone_ingredient, technic.compat.desert_sand_ingredient},
{technic.compat.gold_lump_ingredient, "technic:gold_dust 2"},
{technic.compat.iron_lump_ingredient, "technic:wrought_iron_dust 2"},
{"moreores:tin_lump", "technic:tin_dust 2"},
{"technic:chromium_lump", "technic:chromium_dust 2"},
{"technic:uranium_lump", "technic:uranium_dust 2"},
{"technic:zinc_lump", "technic:zinc_dust 2"},
{"technic:lead_lump", "technic:lead_dust 2"},
{"technic:sulfur_lump", "technic:sulfur_dust 2"},
{stone_ingredient, "technic:stone_dust"},
{sand_ingredient, "technic:stone_dust"},
{desert_sand_ingredient, "technic:stone_dust"},
{technic.compat.stone_ingredient, "technic:stone_dust"},
{technic.compat.sand_ingredient, "technic:stone_dust"},
{technic.compat.desert_sand_ingredient, "technic:stone_dust"},
-- Other
{cobble_ingredient, gravel_ingredient},
{gravel_ingredient, sand_ingredient},
{sandstone_ingredient, sand_ingredient.." 2"}, -- reverse recipe can be found in the compressor
{desert_stone_ingredient, desert_sand_ingredient.." 2"}, -- reverse recipe can be found in the compressor
{ice_block_ingredient, snow_block_ingredient},
{technic.compat.cobble_ingredient, technic.compat.gravel_ingredient},
{technic.compat.gravel_ingredient, technic.compat.sand_ingredient},
{technic.compat.sandstone_ingredient, technic.compat.sand_ingredient.." 2"}, -- reverse recipe can be found in the compressor
{technic.compat.desert_stone_ingredient, technic.compat.desert_sand_ingredient.." 2"}, -- reverse recipe can be found in the compressor
{technic.compat.ice_block_ingredient, technic.compat.snow_block_ingredient},
}
alloy_recipes = {
{"technic:copper_dust 7", "technic:tin_dust", "technic:bronze_dust 8", 12},
{copper_ingredient.." 7", tin_ingredient, bronze_ingredient.." 8", 12},
{technic.compat.copper_ingredient.." 7", technic.compat.tin_ingredient, technic.compat.bronze_ingredient.." 8", 12},
{"technic:wrought_iron_dust 2", "technic:coal_dust", "technic:carbon_steel_dust 2", 6},
{"technic:wrought_iron_ingot 2", "technic:coal_dust", "technic:carbon_steel_ingot 2", 6},
{"technic:carbon_steel_dust 2", "technic:coal_dust", "technic:cast_iron_dust 2", 6},
@ -109,14 +109,14 @@ alloy_recipes = {
{"technic:carbon_steel_dust 4", "technic:chromium_dust", "technic:stainless_steel_dust 5", 7.5},
{"technic:carbon_steel_ingot 4", "technic:chromium_ingot", "technic:stainless_steel_ingot 5", 7.5},
{"technic:copper_dust 2", "technic:zinc_dust", "technic:brass_dust 3"},
{copper_ingredient.." 2", "technic:zinc_ingot", "basic_materials:brass_ingot 3"},
{sand_ingredient.." 2", "technic:coal_dust 2", "technic:silicon_wafer"},
{technic.compat.copper_ingredient.." 2", "technic:zinc_ingot", "basic_materials:brass_ingot 3"},
{technic.compat.sand_ingredient.." 2", "technic:coal_dust 2", "technic:silicon_wafer"},
{"technic:silicon_wafer", "technic:gold_dust", "technic:doped_silicon_wafer"},
-- from https://en.wikipedia.org/wiki/Carbon_black
-- The highest volume use of carbon black is as a reinforcing filler in rubber products, especially tires.
-- "[Compounding a] pure gum vulcanizate … with 50% of its weight of carbon black improves its tensile strength and wear resistance …"
{"technic:raw_latex 4", "technic:coal_dust 2", "technic:rubber 6", 2},
{ice_block_ingredient, emtpy_bucket_ingredient, water_bucket_ingredient, 1 },
{technic.compat.ice_block_ingredient, technic.compat.emtpy_bucket_ingredient, technic.compat.water_bucket_ingredient, 1 },
}
for _, data in pairs(alloy_recipes) do

View File

@ -2,7 +2,6 @@ local default = minetest.get_modpath("default") and default or {}
local mcl = minetest.get_modpath("mcl_core")
-- Compatibility table
local technic = {}
technic.compat = {}
-- Helper function to set compatibility variables
@ -11,101 +10,101 @@ local function set_compat(mcl_value, default_value)
end
-- Mineclone2 Support
stone_sounds = mcl_core_modpath and mcl_sounds.node_sound_stone_defaults() or default.node_sound_stone_defaults()
mt_light_max = mcl_core_modpath and mcl_core.LIGHT_MAX or default.LIGHT_MAX
copper_ingredient = mcl_core_modpath and "mcl_copper:copper_ingot" or 'default:copper_ingot'
iron_ingredient = mcl_core_modpath and "mcl_core:iron_ingot" or 'default:steel_ingot'
iron_lump_ingredient = mcl_core_modpath and "mcl_raw_ores:raw_iron" or 'default:iron_lump'
gold_lump_ingredient = mcl_core_modpath and "mcl_raw_ores:raw_gold" or 'default:gold_lump'
copper_lump_ingredient = mcl_core_modpath and "mcl_copper:raw_copper" or 'default:copper_lump'
mese_crystal_ingredient = mcl_core_modpath and "mesecons:wire_00000000_off" or 'default:mese_crystal'
diamond_ingredient = mcl_core_modpath and "mcl_core:diamond" or 'default:diamond'
glass_ingredient = mcl_core_modpath and "mcl_core:glass" or 'default:glass'
brick_block_ingredient = mcl_core_modpath and "mcl_core:brick_block" or 'default:brick'
mese_block_ingredient = mcl_core_modpath and "mesecons_torch:redstoneblock" or "default:mese"
paper_ingredient = mcl_core_modpath and "mcl_core:paper" or 'default:paper'
obsidian_glass_ingredient = mcl_core_modpath and "mcl_core:obsidian" or 'default:obsidian_glass'
obsidian_ingredient = mcl_core_modpath and "mcl_core:obsidian" or 'default:obsidian'
green_dye_ingredient = mcl_core_modpath and "mcl_dye:green" or 'dye:green'
blue_dye_ingredient = mcl_core_modpath and "mcl_dye:blue" or 'dye:blue'
red_dye_ingredient = mcl_core_modpath and "mcl_dye:red" or 'dye:red'
white_dye_ingredient = mcl_core_modpath and "mcl_dye:white" or 'dye:white'
gold_ingot_ingredient = mcl_core_modpath and "mcl_core:gold_ingot" or 'default:gold_ingot'
chest_ingredient = mcl_core_modpath and "mcl_chests:chest" or "default:chest"
stone_ingredient = mcl_core_modpath and "mcl_core:stone" or "default:stone"
wood_fence_ingredient = mcl_core_modpath and "group:fence_wood" or "default:fence_wood"
diamond_ingredient = mcl_core_modpath and "mcl_core:diamond" or "default:diamond"
bronze_ingredient = mcl_core_modpath and "mcl_copper:copper_ingot" or 'default:bronze_ingot'
tin_ingredient = mcl_core_modpath and "moreores:tin_ingot" or 'default:tin_ingot'
sandstone_ingredient = mcl_core_modpath and "mcl_core:sandstone" or 'default:desert_stone'
sand_ingredient = mcl_core_modpath and "mcl_core:sand" or 'default:sand'
gravel_ingredient = mcl_core_modpath and "mcl_core:gravel" or 'default:gravel'
desert_stone_ingredient = mcl_core_modpath and "mcl_core:redsandstone" or 'default:desert_stone'
desert_sand_ingredient = mcl_core_modpath and "mcl_core:redsand" or 'default:desert_sand'
furnace_ingredient = mcl_core_modpath and "mcl_furnaces:furnace" or 'default:furnace'
mossy_cobble_ingredient = mcl_core_modpath and "mcl_core:mossycobble" or 'default:mossycobble'
cobble_ingredient = mcl_core_modpath and "mcl_core:cobble" or 'default:cobble'
snow_block_ingredient = mcl_core_modpath and "mcl_core:snowblock" or 'default:snowblock'
ice_block_ingredient = mcl_core_modpath and "mcl_core:ice" or 'default:ice'
granite_ingredient = mcl_core_modpath and "mcl_core:granite" or 'technic:granite'
granite_bricks_ingredient = mcl_core_modpath and "mcl_core:granite_smooth" or 'technic:granite_bricks'
coal_ingredient = mcl_core_modpath and "group:coal" or "default:coal_lump"
dirt_ingredient = mcl_core_modpath and "mcl_core:dirt" or "default:dirt"
mesecons_fiber_ingredient = mcl_core_modpath and "mesecons:wire_00000000_off" or "mesecons_materials:fiber"
stick_ingredient = mcl_core_modpath and "mcl_core:stick" or "default:stick"
emtpy_bucket_ingredient = mcl_core_modpath and "mcl_buckets:bucket_empty" or "bucket:bucket_empty"
water_bucket_ingredient = mcl_core_modpath and "mcl_buckets:bucket_water" or "bucket:bucket_water"
technic.compat.stone_sounds = mcl and mcl_sounds.node_sound_stone_defaults() or default.node_sound_stone_defaults()
technic.compat.mt_light_max = mcl and mcl_core.LIGHT_MAX or default.LIGHT_MAX
technic.compat.copper_ingredient = mcl and "mcl_copper:copper_ingot" or 'default:copper_ingot'
technic.compat.iron_ingredient = mcl and "mcl_core:iron_ingot" or 'default:steel_ingot'
technic.compat.iron_lump_ingredient = mcl and "mcl_raw_ores:raw_iron" or 'default:iron_lump'
technic.compat.gold_lump_ingredient = mcl and "mcl_raw_ores:raw_gold" or 'default:gold_lump'
technic.compat.copper_lump_ingredient = mcl and "mcl_copper:raw_copper" or 'default:copper_lump'
technic.compat.mese_crystal_ingredient = mcl and "mesecons:wire_00000000_off" or 'default:mese_crystal'
technic.compat.diamond_ingredient = mcl and "mcl_core:diamond" or 'default:diamond'
technic.compat.glass_ingredient = mcl and "mcl_core:glass" or 'default:glass'
technic.compat.brick_block_ingredient = mcl and "mcl_core:brick_block" or 'default:brick'
technic.compat.mese_block_ingredient = mcl and "mesecons_torch:redstoneblock" or "default:mese"
technic.compat.paper_ingredient = mcl and "mcl_core:paper" or 'default:paper'
technic.compat.obsidian_glass_ingredient = mcl and "mcl_core:obsidian" or 'default:obsidian_glass'
technic.compat.obsidian_ingredient = mcl and "mcl_core:obsidian" or 'default:obsidian'
technic.compat.green_dye_ingredient = mcl and "mcl_dye:green" or 'dye:green'
technic.compat.blue_dye_ingredient = mcl and "mcl_dye:blue" or 'dye:blue'
technic.compat.red_dye_ingredient = mcl and "mcl_dye:red" or 'dye:red'
technic.compat.white_dye_ingredient = mcl and "mcl_dye:white" or 'dye:white'
technic.compat.gold_ingot_ingredient = mcl and "mcl_core:gold_ingot" or 'default:gold_ingot'
technic.compat.chest_ingredient = mcl and "mcl_chests:chest" or "default:chest"
technic.compat.stone_ingredient = mcl and "mcl_core:stone" or "default:stone"
technic.compat.wood_fence_ingredient = mcl and "group:fence_wood" or "default:fence_wood"
technic.compat.diamond_ingredient = mcl and "mcl_core:diamond" or "default:diamond"
technic.compat.bronze_ingredient = mcl and "mcl_copper:copper_ingot" or 'default:bronze_ingot'
technic.compat.tin_ingredient = mcl and "moreores:tin_ingot" or 'default:tin_ingot'
technic.compat.sandstone_ingredient = mcl and "mcl_core:sandstone" or 'default:desert_stone'
technic.compat.sand_ingredient = mcl and "mcl_core:sand" or 'default:sand'
technic.compat.gravel_ingredient = mcl and "mcl_core:gravel" or 'default:gravel'
technic.compat.desert_stone_ingredient = mcl and "mcl_core:redsandstone" or 'default:desert_stone'
technic.compat.desert_sand_ingredient = mcl and "mcl_core:redsand" or 'default:desert_sand'
technic.compat.furnace_ingredient = mcl and "mcl_furnaces:furnace" or 'default:furnace'
technic.compat.mossy_cobble_ingredient = mcl and "mcl_core:mossycobble" or 'default:mossycobble'
technic.compat.cobble_ingredient = mcl and "mcl_core:cobble" or 'default:cobble'
technic.compat.snow_block_ingredient = mcl and "mcl_core:snowblock" or 'default:snowblock'
technic.compat.ice_block_ingredient = mcl and "mcl_core:ice" or 'default:ice'
technic.compat.granite_ingredient = mcl and "mcl_core:granite" or 'technic:granite'
technic.compat.granite_bricks_ingredient = mcl and "mcl_core:granite_smooth" or 'technic:granite_bricks'
technic.compat.coal_ingredient = mcl and "group:coal" or "default:coal_lump"
technic.compat.dirt_ingredient = mcl and "mcl_core:dirt" or "default:dirt"
technic.compat.mesecons_fiber_ingredient = mcl and "mesecons:wire_00000000_off" or "mesecons_materials:fiber"
technic.compat.stick_ingredient = mcl and "mcl_core:stick" or "default:stick"
technic.compat.emtpy_bucket_ingredient = mcl and "mcl_buckets:bucket_empty" or "bucket:bucket_empty"
technic.compat.water_bucket_ingredient = mcl and "mcl_buckets:bucket_water" or "bucket:bucket_water"
-- Ingredient Variables
if mcl_core_modpath then
blueberries_ingredient = "mcl_farming:blueberries"
grass_ingredient = "mcl_core:grass"
dry_shrub_ingredient = "mcl_core:deadbush"
junglegrass_ingredient = "mcl_core:tallgrass"
cactus_ingredient = "mcl_core:cactus"
geranium_ingredient = "mcl_flowers:blue_orchid"
dandelion_white_ingredient = "mcl_flowers:oxeye_daisy"
dandelion_yellow_ingredient = "mcl_flowers:dandelion"
tulip_ingredient = "mcl_flowers:orange_tulip"
rose_ingredient = "mcl_flowers:poppy"
viola_ingredient = "mcl_flowers:allium"
if mcl then
technic.compat.blueberries_ingredient = "mcl_farming:blueberries"
technic.compat.grass_ingredient = "mcl_core:grass"
technic.compat.dry_shrub_ingredient = "mcl_core:deadbush"
technic.compat.junglegrass_ingredient = "mcl_core:tallgrass"
technic.compat.cactus_ingredient = "mcl_core:cactus"
technic.compat.geranium_ingredient = "mcl_flowers:blue_orchid"
technic.compat.dandelion_white_ingredient = "mcl_flowers:oxeye_daisy"
technic.compat.dandelion_yellow_ingredient = "mcl_flowers:dandelion"
technic.compat.tulip_ingredient = "mcl_flowers:orange_tulip"
technic.compat.rose_ingredient = "mcl_flowers:poppy"
technic.compat.viola_ingredient = "mcl_flowers:allium"
else
blueberries_ingredient = "default:blueberries"
grass_ingredient = "default:grass_1"
dry_shrub_ingredient = "default:dry_shrub"
junglegrass_ingredient = "default:junglegrass"
cactus_ingredient = "default:cactus"
geranium_ingredient = "flowers:geranium"
dandelion_white_ingredient = "flowers:dandelion_white"
dandelion_yellow_ingredient = "flowers:dandelion_yellow"
tulip_ingredient = "flowers:tulip"
rose_ingredient = "flowers:rose"
viola_ingredient = "flowers:viola"
technic.compat.blueberries_ingredient = "default:blueberries"
technic.compat.grass_ingredient = "default:grass_1"
technic.compat.dry_shrub_ingredient = "default:dry_shrub"
technic.compat.junglegrass_ingredient = "default:junglegrass"
technic.compat.cactus_ingredient = "default:cactus"
technic.compat.geranium_ingredient = "flowers:geranium"
technic.compat.dandelion_white_ingredient = "flowers:dandelion_white"
technic.compat.dandelion_yellow_ingredient = "flowers:dandelion_yellow"
technic.compat.tulip_ingredient = "flowers:tulip"
technic.compat.rose_ingredient = "flowers:rose"
technic.compat.viola_ingredient = "flowers:viola"
end
-- Dye Output Variables
if mcl_core_modpath then
dye_black = "mcl_dye:black"
dye_violet = "mcl_dye:violet"
dye_green = "mcl_dye:green"
dye_brown = "mcl_dye:brown"
dye_blue = "mcl_dye:blue"
dye_white = "mcl_dye:white"
dye_yellow = "mcl_dye:yellow"
dye_orange = "mcl_dye:orange"
dye_red = "mcl_dye:red"
if mcl then
technic.compat.dye_black = "mcl_dye:black"
technic.compat.dye_violet = "mcl_dye:violet"
technic.compat.dye_green = "mcl_dye:green"
technic.compat.dye_brown = "mcl_dye:brown"
technic.compat.dye_blue = "mcl_dye:blue"
technic.compat.dye_white = "mcl_dye:white"
technic.compat.dye_yellow = "mcl_dye:yellow"
technic.compat.dye_orange = "mcl_dye:orange"
technic.compat.dye_red = "mcl_dye:red"
else
dye_black = "dye:black"
dye_violet = "dye:violet"
dye_green = "dye:green"
dye_brown = "dye:brown"
dye_blue = "dye:blue"
dye_white = "dye:white"
dye_yellow = "dye:yellow"
dye_orange = "dye:orange"
dye_red = "dye:red"
technic.compat.dye_black = "dye:black"
technic.compat.dye_violet = "dye:violet"
technic.compat.dye_green = "dye:green"
technic.compat.dye_brown = "dye:brown"
technic.compat.dye_blue = "dye:blue"
technic.compat.dye_white = "dye:white"
technic.compat.dye_yellow = "dye:yellow"
technic.compat.dye_orange = "dye:orange"
technic.compat.dye_red = "dye:red"
end
dirt_with_snow_ingredient = mcl_core_modpath and "mcl_core:dirt_with_grass_snow" or "default:dirt_with_snow"
bucket_lava_ingredient = mcl_core_modpath and "mcl_buckets:bucket_lava" or "bucket:bucket_lava"
bucket_river_water_ingredient = mcl_core_modpath and "mcl_buckets:bucket_river_water" or "bucket:bucket_river_water"
technic.compat.dirt_with_snow_ingredient = mcl and "mcl_core:dirt_with_grass_snow" or "default:dirt_with_snow"
technic.compat.bucket_lava_ingredient = mcl and "mcl_buckets:bucket_lava" or "bucket:bucket_lava"
technic.compat.bucket_river_water_ingredient = mcl and "mcl_buckets:bucket_river_water" or "bucket:bucket_river_water"

View File

@ -52,7 +52,7 @@ local rad_resistance_node = {
["default:ice"] = 5.6,
["default:lava_flowing"] = 8.5,
["default:lava_source"] = 17,
[mese_block_ingredient] = 21,
[technic.compat.mese_block_ingredient] = 21,
["default:mossycobble"] = 15,
["default:tinblock"] = 37,
["pbj_pup:pbj_pup"] = 10000,
@ -64,7 +64,7 @@ local rad_resistance_node = {
["nyancat:nyancat"] = 10000,
["nyancat:nyancat_rainbow"] = 10000,
["default:obsidian"] = 18,
[obsidian_glass_ingredient] = 18,
[technic.compat.obsidian_glass_ingredient] = 18,
["default:sand"] = 10,
["default:sandstone"] = 15,
["default:sandstonebrick"] = 15,
@ -153,7 +153,7 @@ local rad_resistance_node = {
["technic:chromium_block"] = 37,
["technic:corium_flowing"] = 40,
["technic:corium_source"] = 80,
[granite_ingredient] = 18,
[technic.compat.granite_ingredient] = 18,
["technic:lead_block"] = 80,
["technic:marble"] = 18,
["technic:marble_bricks"] = 18,
@ -457,7 +457,7 @@ minetest.register_node("technic:chernobylite_block", {
tiles = {"technic_chernobylite_block.png"},
is_ground_content = true,
groups = {cracky=1, radioactive=4, level=2},
sounds = stone_sounds,
sounds = technic.compat.stone_sounds,
light_source = 2,
})

View File

@ -135,7 +135,7 @@ minetest.register_craft({
output = 'technic:river_water_can 1',
recipe = {
{'technic:zinc_ingot', 'technic:rubber', 'technic:zinc_ingot'},
{iron_ingredient, '', iron_ingredient},
{'technic:zinc_ingot', iron_ingredient, 'technic:zinc_ingot'},
{technic.compat.iron_ingredient, '', technic.compat.iron_ingredient},
{'technic:zinc_ingot', technic.compat.iron_ingredient, 'technic:zinc_ingot'},
}
})

View File

@ -6,9 +6,9 @@ local S = technic.getter
minetest.register_craft({
output = 'technic:mining_drill',
recipe = {
{tin_ingredient, 'technic:diamond_drill_head', tin_ingredient},
{technic.compat.tin_ingredient, 'technic:diamond_drill_head', technic.compat.tin_ingredient},
{'technic:stainless_steel_ingot', 'basic_materials:motor', 'technic:stainless_steel_ingot'},
{'', 'technic:red_energy_crystal', copper_ingredient},
{'', 'technic:red_energy_crystal', technic.compat.copper_ingredient},
}
})
minetest.register_craft({

View File

@ -11,25 +11,25 @@ local S = technic.getter
minetest.register_craft({
output = "technic:laser_mk1",
recipe = {
{diamond_ingredient, "basic_materials:brass_ingot", obsidian_glass_ingredient},
{technic.compat.diamond_ingredient, "basic_materials:brass_ingot", technic.compat.obsidian_glass_ingredient},
{"","basic_materials:brass_ingot", "technic:red_energy_crystal"},
{"", "", copper_ingredient},
{"", "", technic.compat.copper_ingredient},
}
})
minetest.register_craft({
output = "technic:laser_mk2",
recipe = {
{diamond_ingredient, "technic:carbon_steel_ingot", "technic:laser_mk1"},
{technic.compat.diamond_ingredient, "technic:carbon_steel_ingot", "technic:laser_mk1"},
{"", "technic:carbon_steel_ingot", "technic:green_energy_crystal"},
{"", "", copper_ingredient},
{"", "", technic.compat.copper_ingredient},
}
})
minetest.register_craft({
output = "technic:laser_mk3",
recipe = {
{diamond_ingredient, "technic:carbon_steel_ingot", "technic:laser_mk2"},
{technic.compat.diamond_ingredient, "technic:carbon_steel_ingot", "technic:laser_mk2"},
{"", "technic:carbon_steel_ingot", "technic:blue_energy_crystal"},
{"", "", copper_ingredient},
{"", "", technic.compat.copper_ingredient},
}
})

View File

@ -90,9 +90,9 @@ minetest.register_tool("technic:sonic_screwdriver", {
minetest.register_craft({
output = "technic:sonic_screwdriver",
recipe = {
{"", diamond_ingredient, ""},
{mesecons_fiber_ingredient, "technic:battery", mesecons_fiber_ingredient},
{mesecons_fiber_ingredient, "moreores:mithril_ingot", mesecons_fiber_ingredient}
{"", technic.compat.diamond_ingredient, ""},
{technic.compat.mesecons_fiber_ingredient, "technic:battery", technic.compat.mesecons_fiber_ingredient},
{technic.compat.mesecons_fiber_ingredient, "moreores:mithril_ingot", technic.compat.mesecons_fiber_ingredient}
}
})

View File

@ -38,8 +38,8 @@ minetest.register_tool("technic:treetap", {
minetest.register_craft({
output = "technic:treetap",
recipe = {
{"pipeworks:tube_1", "group:wood", stick_ingredient},
{"", stick_ingredient, stick_ingredient}
{"pipeworks:tube_1", "group:wood", technic.compat.stick_ingredient},
{"", technic.compat.stick_ingredient, technic.compat.stick_ingredient}
},
})

View File

@ -19,9 +19,9 @@ if technic_cnc.use_technic then
minetest.register_craft({
output = 'technic:cnc',
recipe = {
{glass_ingredient, 'technic:diamond_drill_head', glass_ingredient},
{'technic:control_logic_unit', 'technic:machine_casing', 'basic_materials:motor'},
{'technic:carbon_steel_ingot', 'technic:lv_cable', 'technic:carbon_steel_ingot'},
{technic_cnc.compat.glass_ingredient, 'technic:diamond_drill_head', technic_cnc.compat.glass_ingredient},
{'technic:control_logic_unit', 'technic:machine_casing', 'basic_materials:motor'},
{'technic:carbon_steel_ingot', 'technic:lv_cable', 'technic:carbon_steel_ingot'},
},
})
@ -34,9 +34,9 @@ else
minetest.register_craft({
output = 'technic:cnc',
recipe = {
{glass_ingredient, diamond_ingredient, glass_ingredient},
{'basic_materials:ic', 'default:steelblock', 'basic_materials:motor'},
{'default:steel_ingot', mese_block_ingredient, 'default:steel_ingot'},
{technic_cnc.compat.glass_ingredient, technic_cnc.compat.diamond_ingredient, technic_cnc.compat.glass_ingredient},
{'basic_materials:ic', 'default:steelblock', 'basic_materials:motor'},
{'default:steel_ingot', technic_cnc.compat.mese_block_ingredient, 'default:steel_ingot'},
},
})

View File

@ -7,6 +7,14 @@ technic_cnc.technic_modpath = minetest.get_modpath("technic")
technic_cnc.use_technic = technic_cnc.technic_modpath
and minetest.settings:get_bool("technic_cnc_use_technic") ~= false
local mcl = minetest.get_modpath("mcl_core")
-- Compatibility table
technic_cnc.compat = {}
technic_cnc.compat.glass_ingredient = mcl and "mcl_core:glass" or 'default:glass'
technic_cnc.compat.mese_block_ingredient = mcl and "mesecons_torch:redstoneblock" or "default:mese"
technic_cnc.compat.diamond_ingredient = mcl and "mcl_core:diamond" or "default:diamond"
if rawget(_G, "intllib") then
technic_cnc.getter = intllib.Getter()
else