Add mods: technic, moreores, paintings, Nyancat (Pbj_pup). Small fix: sandwiches

This commit is contained in:
N-Nachtigal 2025-06-05 16:15:56 +02:00
parent 15e8e696a2
commit fb09deddc1
1404 changed files with 156555 additions and 211 deletions

View file

@ -0,0 +1,23 @@
-- MV alloy furnace
local S = technic.getter
minetest.register_craft({
output = 'technic:mv_alloy_furnace',
recipe = {
{'technic:stainless_steel_ingot', 'technic:lv_alloy_furnace', 'technic:stainless_steel_ingot'},
{'pipeworks:tube_1', 'technic:mv_transformer', 'pipeworks:tube_1'},
{'technic:stainless_steel_ingot', 'technic:mv_cable', 'technic:stainless_steel_ingot'},
}
})
technic.register_base_machine("technic:mv_alloy_furnace", {
typename = "alloy",
description = S("@1 Alloy Furnace", S("MV")),
insert_object = technic.insert_object_unique_stack,
can_insert = technic.can_insert_unique_stack,
tier = "MV",
speed = 1.5,
upgrade = 1,
tube = 1,
demand = {3000, 2000, 1000}
})

View file

@ -0,0 +1,21 @@
-- MV Battery box
minetest.register_craft({
output = 'technic:mv_battery_box0',
recipe = {
{'technic:lv_battery_box0', 'technic:lv_battery_box0', 'technic:lv_battery_box0'},
{'technic:lv_battery_box0', 'technic:mv_transformer', 'technic:lv_battery_box0'},
{'', 'technic:mv_cable', ''},
}
})
technic.register_battery_box("technic:mv_battery_box", {
tier = "MV",
max_charge = 200000,
charge_rate = 20000,
discharge_rate = 80000,
charge_step = 2000,
discharge_step = 8000,
upgrade = 1,
tube = 1,
})

View file

@ -0,0 +1,56 @@
local S = technic.getter
minetest.register_alias("mv_cable", "technic:mv_cable")
minetest.register_craft({
output = 'technic:mv_cable 3',
recipe ={
{'technic:rubber', 'technic:rubber', 'technic:rubber'},
{'technic:lv_cable', 'technic:lv_cable', 'technic:lv_cable'},
{'technic:rubber', 'technic:rubber', 'technic:rubber'},
}
})
minetest.register_craft({
output = "technic:mv_cable_plate_1 5",
recipe = {
{"" , "" , "technic:mv_cable"},
{"technic:mv_cable", "technic:mv_cable", "technic:mv_cable"},
{"" , "" , "technic:mv_cable"},
}
})
minetest.register_craft({
output = "technic:mv_cable",
recipe = {{"technic:mv_cable_plate_1"}}
})
-- Register cables
technic.register_cable("technic:mv_cable", {
tier = "MV",
size = 2.5/16,
description = S("@1 Cable", S("MV"))
})
technic.register_cable_plate("technic:mv_cable_plate", {
tier = "MV",
size = 2.5/16,
description = S("@1 Cable Plate", S("MV")),
tiles = {"technic_mv_cable.png"},
})
if minetest.get_modpath("digilines") then
technic.register_cable("technic:mv_digi_cable", {
tier = "MV",
size = 2.5/16,
description = S("@1 Digiline Cable", S("MV")),
digiline = { wire = { rules = technic.digilines.rules_allfaces } }
})
technic.register_cable_plate("technic:mv_digi_cable_plate", {
tier = "MV",
size = 2.5/16,
description = S("@1 Digiline Cable Plate", S("MV")),
digiline = { wire = { rules = technic.digilines.rules_allfaces } },
tiles = {"technic_mv_digi_cable.png"}
})
end

View file

@ -0,0 +1,20 @@
local S = technic.getter
minetest.register_craft({
output = "technic:mv_centrifuge",
recipe = {
{"basic_materials:motor", "technic:copper_plate", "technic:diamond_drill_head"},
{"technic:copper_plate", "technic:machine_casing", "technic:copper_plate" },
{"pipeworks:one_way_tube", "technic:mv_cable", "pipeworks:mese_filter" },
}
})
technic.register_base_machine("technic:mv_centrifuge", {
typename = "separating",
description = S("@1 Centrifuge", S("MV")),
tier = "MV",
demand = { 8000, 7000, 6000 },
speed = 2,
upgrade = 1,
tube = 1,
})

View file

@ -0,0 +1,21 @@
-- MV compressor
local S = technic.getter
minetest.register_craft({
output = 'technic:mv_compressor',
recipe = {
{'technic:stainless_steel_ingot', 'technic:lv_compressor', 'technic:stainless_steel_ingot'},
{'pipeworks:tube_1', 'technic:mv_transformer', 'pipeworks:tube_1'},
{'technic:stainless_steel_ingot', 'technic:mv_cable', 'technic:stainless_steel_ingot'},
}
})
technic.register_base_machine("technic:mv_compressor", {
typename = "compressing",
description = S("@1 Compressor", S("MV")),
tier = "MV",
demand = {800, 600, 400},
speed = 2,
upgrade = 1,
tube = 1
})

View file

@ -0,0 +1,26 @@
-- MV Electric Furnace
-- This is a faster version of the stone furnace which runs on EUs
-- In addition to this it can be upgraded with microcontrollers and batteries
-- This new version uses the batteries to lower the power consumption of the machine
-- Also in addition this furnace can be attached to the pipe system from the pipeworks mod.
local S = technic.getter
-- FIXME: kpoppel I'd like to introduce an induction heating element here also
minetest.register_craft({
output = 'technic:mv_electric_furnace',
recipe = {
{'technic:stainless_steel_ingot', 'technic:lv_electric_furnace', 'technic:stainless_steel_ingot'},
{'pipeworks:tube_1', 'technic:mv_transformer', 'pipeworks:tube_1'},
{'technic:stainless_steel_ingot', 'technic:mv_cable', 'technic:stainless_steel_ingot'},
}
})
technic.register_base_machine("technic:mv_electric_furnace", {
typename = "cooking",
description = S("@1 Furnace", S("MV")),
tier="MV",
upgrade=1,
tube=1,
demand={2000, 1000, 500},
speed=4
})

View file

@ -0,0 +1,21 @@
-- MV extractor
local S = technic.getter
minetest.register_craft({
output = 'technic:mv_extractor',
recipe = {
{'technic:stainless_steel_ingot', 'technic:lv_extractor', 'technic:stainless_steel_ingot'},
{'pipeworks:tube_1', 'technic:mv_transformer', 'pipeworks:tube_1'},
{'technic:stainless_steel_ingot', 'technic:mv_cable', 'technic:stainless_steel_ingot'},
}
})
technic.register_base_machine("technic:mv_extractor", {
typename = "extracting",
description = S("@1 Extractor", S("MV")),
tier = "MV",
demand = {800, 600, 400},
speed = 2,
upgrade = 1,
tube = 1
})

View file

@ -0,0 +1,21 @@
-- MV freezer
local S = technic.getter
minetest.register_craft({
output = 'technic:mv_freezer',
recipe = {
{'technic:stainless_steel_ingot', 'basic_materials:motor', 'technic:stainless_steel_ingot'},
{'pipeworks:pipe_1_empty', 'technic:mv_transformer', 'pipeworks:pipe_1_empty'},
{'technic:stainless_steel_ingot', 'technic:mv_cable', 'technic:stainless_steel_ingot'},
}
})
technic.register_base_machine("technic:mv_freezer", {
typename = "freezing",
description = S("@1 Freezer", S("MV")),
tier = "MV",
demand = {800, 600, 400},
speed = 0.5,
upgrade = 1,
tube = 1
})

View file

@ -0,0 +1,11 @@
minetest.register_craft({
output = 'technic:mv_generator',
recipe = {
{'technic:stainless_steel_ingot', 'technic:lv_generator', 'technic:stainless_steel_ingot'},
{'pipeworks:tube_1', 'technic:mv_transformer', 'pipeworks:tube_1'},
{'technic:stainless_steel_ingot', 'technic:mv_cable', 'technic:stainless_steel_ingot'},
}
})
technic.register_generator({tier="MV", tube=1, supply=600})

View file

@ -0,0 +1,21 @@
-- MV grinder
local S = technic.getter
minetest.register_craft({
output = 'technic:mv_grinder',
recipe = {
{'technic:stainless_steel_ingot', 'technic:lv_grinder', 'technic:stainless_steel_ingot'},
{'pipeworks:tube_1', 'technic:mv_transformer', 'pipeworks:tube_1'},
{'technic:stainless_steel_ingot', 'technic:mv_cable', 'technic:stainless_steel_ingot'},
}
})
technic.register_base_machine("technic:mv_grinder", {
typename = "grinding",
description = S("@1 Grinder", S("MV")),
tier="MV",
demand={600, 450, 300},
speed=2,
upgrade=1,
tube=1
})

View file

@ -0,0 +1,111 @@
-- A Hydro Turbine produces MV EUs by exploiting flowing water across it
-- It is a MV EU supplier and fairly high yield (max 1800EUs)
local S = technic.getter
local cable_entry = "^technic_cable_connection_overlay.png"
minetest.register_alias("hydro_turbine", "technic:hydro_turbine")
minetest.register_craft({
output = 'technic:hydro_turbine',
recipe = {
{'technic:stainless_steel_ingot', 'technic:water_mill', 'technic:stainless_steel_ingot'},
{'technic:water_mill', 'technic:mv_transformer', 'technic:water_mill'},
{'technic:stainless_steel_ingot', 'technic:mv_cable', 'technic:stainless_steel_ingot'},
}
})
local function get_water_flow(pos)
local node = minetest.get_node(pos)
if minetest.get_item_group(node.name, "water") == 3 then
return node.param2 -- returns approx. water flow, if any
end
return 0
end
---
-- 10 times better than LV hydro because of 2 extra water mills and 4 stainless steel, a transformer and whatnot ;P.
-- Man hydro turbines are tough and long lasting. So, give it some value :)
local run = function(pos, node)
local meta = minetest.get_meta(pos)
local water_flow = 0
local production_level
local eu_supply
local max_output = 40 * 45 -- Generates 1800EU/s
local positions = {
{x=pos.x+1, y=pos.y, z=pos.z},
{x=pos.x-1, y=pos.y, z=pos.z},
{x=pos.x, y=pos.y, z=pos.z+1},
{x=pos.x, y=pos.y, z=pos.z-1},
}
for _, p in pairs(positions) do
water_flow = water_flow + get_water_flow(p)
end
eu_supply = math.min(40 * water_flow, max_output)
production_level = math.floor(100 * eu_supply / max_output)
meta:set_int("MV_EU_supply", eu_supply)
meta:set_string("infotext", S("@1 (@2% Efficiency)",
S("Hydro @1 Generator", S("MV")), production_level))
if production_level > 0 and
minetest.get_node(pos).name == "technic:hydro_turbine" then
technic.swap_node(pos, "technic:hydro_turbine_active")
meta:set_int("MV_EU_supply", 0)
return
end
if production_level == 0 then
technic.swap_node(pos, "technic:hydro_turbine")
end
end
minetest.register_node("technic:hydro_turbine", {
description = S("Hydro @1 Generator", S("MV")),
tiles = {
"technic_hydro_turbine_top.png",
"technic_machine_bottom.png"..cable_entry,
"technic_hydro_turbine_side.png",
"technic_hydro_turbine_side.png",
"technic_hydro_turbine_side.png",
"technic_hydro_turbine_side.png"
},
paramtype2 = "facedir",
groups = {snappy=2, choppy=2, oddly_breakable_by_hand=2,
technic_machine=1, technic_mv=1, axey=2, handy=1},
is_ground_content = false,
_mcl_blast_resistance = 1,
_mcl_hardness = 0.8,
legacy_facedir_simple = true,
sounds = technic.sounds.node_sound_wood_defaults(),
on_construct = function(pos)
local meta = minetest.get_meta(pos)
meta:set_string("infotext", S("Hydro @1 Generator", S("MV")))
meta:set_int("MV_EU_supply", 0)
end,
technic_run = run,
})
minetest.register_node("technic:hydro_turbine_active", {
description = S("Hydro @1 Generator", S("MV")),
tiles = {"technic_hydro_turbine_top_active.png", "technic_machine_bottom.png",
"technic_hydro_turbine_side.png", "technic_hydro_turbine_side.png",
"technic_hydro_turbine_side.png", "technic_hydro_turbine_side.png"},
paramtype2 = "facedir",
groups = {snappy=2, choppy=2, oddly_breakable_by_hand=2, axey=2, handy=1,
technic_machine=1, technic_mv=1, not_in_creative_inventory=1},
is_ground_content = false,
_mcl_blast_resistance = 1,
_mcl_hardness = 0.8,
legacy_facedir_simple = true,
sounds = technic.sounds.node_sound_wood_defaults(),
drop = "technic:hydro_turbine",
technic_run = run,
technic_disabled_machine_name = "technic:hydro_turbine",
})
technic.register_machine("MV", "technic:hydro_turbine", technic.producer)
technic.register_machine("MV", "technic:hydro_turbine_active", technic.producer)

View file

@ -0,0 +1,28 @@
technic.register_tier("MV", "Medium Voltage")
local path = technic.modpath.."/machines/MV"
-- Wiring stuff
dofile(path.."/cables.lua")
dofile(path.."/battery_box.lua")
-- Generators
if technic.config:get_bool("enable_wind_mill") then
dofile(path.."/wind_mill.lua")
end
dofile(path.."/generator.lua")
dofile(path.."/solar_array.lua")
dofile(path.."/hydro_turbine.lua")
-- Machines
dofile(path.."/alloy_furnace.lua")
dofile(path.."/electric_furnace.lua")
dofile(path.."/grinder.lua")
dofile(path.."/extractor.lua")
dofile(path.."/compressor.lua")
dofile(path.."/centrifuge.lua")
dofile(path.."/tool_workshop.lua")
dofile(path.."/freezer.lua")

View file

@ -0,0 +1,18 @@
minetest.register_craft({
output = 'technic:mv_solar_array 1',
recipe = {
{'technic:lv_solar_array', 'technic:lv_solar_array', 'technic:lv_solar_array'},
{'technic:carbon_steel_ingot', 'technic:mv_transformer', 'technic:carbon_steel_ingot'},
{'', 'technic:mv_cable', ''},
}
})
technic.register_solar_array("technic:mv_solar_array", {
tier="MV",
power=30
})
-- compatibility alias for upgrading from old versions of technic
minetest.register_alias("technic:solar_panel_mv", "technic:mv_solar_array")
minetest.register_alias("technic:solar_array_mv", "technic:mv_solar_array")

View file

@ -0,0 +1,152 @@
-- Tool workshop
-- This machine repairs tools.
minetest.register_alias("tool_workshop", "technic:tool_workshop")
local S = technic.getter
local mat = technic.materials
local tube_entry = "^pipeworks_tube_connection_wooden.png"
minetest.register_craft({
output = 'technic:tool_workshop',
recipe = {
{'group:wood', mat.diamond, 'group:wood'},
{'mesecons_pistons:piston_sticky_off', 'technic:machine_casing', 'technic:carbon_cloth'},
{mat.obsidian, 'technic:mv_cable', mat.obsidian},
}
})
local workshop_demand = {5000, 3500, 2000}
local size = minetest.get_modpath("mcl_formspec") and "size[9,9;]" or "size[8,9;]"
local workshop_formspec =
size..
"list[context;src;3,1;1,1;]"..
"label[0,0;"..S("@1 Tool Workshop", S("MV")).."]"..
"list[context;upgrade1;1,3;1,1;]"..
"list[context;upgrade2;2,3;1,1;]"..
"label[1,4;"..S("Upgrade Slots").."]"
if minetest.get_modpath("mcl_formspec") then
workshop_formspec = workshop_formspec..
mcl_formspec.get_itemslot_bg(3,1,1,1)..
mcl_formspec.get_itemslot_bg(1,3,1,1)..
mcl_formspec.get_itemslot_bg(2,3,1,1)..
-- player inventory
"list[current_player;main;0,4.5;9,3;9]"..
mcl_formspec.get_itemslot_bg(0,4.5,9,3)..
"list[current_player;main;0,7.74;9,1;]"..
mcl_formspec.get_itemslot_bg(0,7.74,9,1)
else
workshop_formspec = workshop_formspec..
"list[current_player;main;0,5;8,4;]"
end
-- listrings
workshop_formspec = workshop_formspec..
"listring[current_player;main]"..
"listring[context;src]"..
"listring[current_player;main]"..
"listring[context;upgrade1]"..
"listring[current_player;main]"..
"listring[context;upgrade2]"..
"listring[current_player;main]"
local run = function(pos, node)
local meta = minetest.get_meta(pos)
local inv = meta:get_inventory()
local eu_input = meta:get_int("MV_EU_input")
local machine_name = S("@1 Tool Workshop", S("MV"))
-- Setup meta data if it does not exist.
if not eu_input then
meta:set_int("MV_EU_demand", workshop_demand[1])
meta:set_int("MV_EU_input", 0)
return
end
local EU_upgrade, tube_upgrade = technic.handle_machine_upgrades(meta)
local repairable = false
local srcstack = inv:get_stack("src", 1)
if not srcstack:is_empty() then
local itemdef = minetest.registered_items[srcstack:get_name()]
if itemdef and
(not itemdef.wear_represents or
itemdef.wear_represents == "mechanical_wear") and
srcstack:get_wear() ~= 0 then
repairable = true
end
end
technic.handle_machine_pipeworks(pos, tube_upgrade, function(pos2, x_velocity, z_velocity)
if not repairable then
technic.send_items(pos2, x_velocity, z_velocity, "src")
end
end)
if not repairable then
meta:set_string("infotext", S("@1 Idle", machine_name))
meta:set_int("MV_EU_demand", 0)
return
end
if eu_input < workshop_demand[EU_upgrade+1] then
meta:set_string("infotext", S("@1 Unpowered", machine_name))
elseif eu_input >= workshop_demand[EU_upgrade+1] then
meta:set_string("infotext", S("@1 Active", machine_name) .. "\n" ..
S("Demand: @1", technic.EU_string(workshop_demand[EU_upgrade+1])))
srcstack:add_wear(-1000)
inv:set_stack("src", 1, srcstack)
end
meta:set_int("MV_EU_demand", workshop_demand[EU_upgrade+1])
end
minetest.register_node("technic:tool_workshop", {
description = S("@1 Tool Workshop", S("MV")),
paramtype2 = "facedir",
tiles = {
"technic_workshop_top.png"..tube_entry,
"technic_machine_bottom.png"..tube_entry,
"technic_workshop_side.png"..tube_entry,
"technic_workshop_side.png"..tube_entry,
"technic_workshop_side.png"..tube_entry,
"technic_workshop_side.png"
},
groups = {snappy=2, choppy=2, oddly_breakable_by_hand=2,
technic_machine=1, technic_mv=1, tubedevice=1, tubedevice_receiver=1, axey=2, handy=1},
is_ground_content = false,
_mcl_blast_resistance = 1,
_mcl_hardness = 0.8,
connect_sides = {"bottom", "back", "left", "right"},
sounds = technic.sounds.node_sound_wood_defaults(),
on_construct = function(pos)
local meta = minetest.get_meta(pos)
meta:set_string("infotext", S("@1 Tool Workshop", S("MV")))
meta:set_string("formspec", workshop_formspec)
local inv = meta:get_inventory()
inv:set_size("src", 1)
inv:set_size("upgrade1", 1)
inv:set_size("upgrade2", 1)
end,
can_dig = technic.machine_can_dig,
allow_metadata_inventory_put = technic.machine_inventory_put,
allow_metadata_inventory_take = technic.machine_inventory_take,
on_metadata_inventory_move = technic.machine_on_inventory_move,
on_metadata_inventory_put = technic.machine_on_inventory_put,
on_metadata_inventory_take = technic.machine_on_inventory_take,
tube = {
can_insert = function (pos, node, stack, direction)
return minetest.get_meta(pos):get_inventory():room_for_item("src", stack)
end,
insert_object = function (pos, node, stack, direction)
return minetest.get_meta(pos):get_inventory():add_item("src", stack)
end,
connect_sides = {left = 1, right = 1, back = 1, top = 1, bottom = 1},
},
technic_run = run,
after_place_node = pipeworks.after_place,
after_dig_node = technic.machine_after_dig_node
})
technic.register_machine("MV", "technic:tool_workshop", technic.receiver)

View file

@ -0,0 +1,102 @@
local S = technic.getter
minetest.register_craft({
output = 'technic:wind_mill_frame 5',
recipe = {
{'technic:carbon_steel_ingot', '', 'technic:carbon_steel_ingot'},
{'', 'technic:carbon_steel_ingot', ''},
{'technic:carbon_steel_ingot', '', 'technic:carbon_steel_ingot'},
}
})
minetest.register_craft({
output = 'technic:wind_mill',
recipe = {
{'', 'basic_materials:motor', ''},
{'technic:carbon_steel_ingot', 'technic:carbon_steel_block', 'technic:carbon_steel_ingot'},
{'', 'technic:mv_cable', ''},
}
})
minetest.register_node("technic:wind_mill_frame", {
description = S("Wind Mill Frame"),
drawtype = "glasslike_framed",
tiles = {"technic_carbon_steel_block.png", "default_glass.png"},
sunlight_propagates = true,
groups = {cracky=3, pickaxey=1},
is_ground_content = false,
_mcl_blast_resistance = 1,
_mcl_hardness = 0.8,
sounds = technic.sounds.node_sound_stone_defaults(),
paramtype = "light",
})
local function check_wind_mill(pos)
if pos.y < 30 then
return false
end
pos = {x=pos.x, y=pos.y, z=pos.z}
for i = 1, 20 do
pos.y = pos.y - 1
local node = minetest.get_node_or_nil(pos)
if not node then
-- we reached CONTENT_IGNORE, we can assume, that nothing changed
-- as the user will have to load the block to change it
return
end
if node.name ~= "technic:wind_mill_frame" then
return false
end
end
return true
end
local run = function(pos, node)
local meta = minetest.get_meta(pos)
local machine_name = S("Wind @1 Generator", S("MV"))
local check = check_wind_mill(pos)
if check == false then
meta:set_int("MV_EU_supply", 0)
meta:set_string("infotext", S("@1 Improperly Placed", machine_name))
elseif check == true then
local power = math.min(pos.y * 100, 5000)
meta:set_int("MV_EU_supply", power)
meta:set_string("infotext", S("@1 (@2)", machine_name,
technic.EU_string(power)))
end
-- check == nil: assume nothing has changed
end
minetest.register_node("technic:wind_mill", {
description = S("Wind @1 Generator", S("MV")),
tiles = {"technic_carbon_steel_block.png"},
paramtype2 = "facedir",
groups = {cracky=1, technic_machine=1, technic_mv=1, pickaxey=2},
is_ground_content = false,
_mcl_blast_resistance = 1,
_mcl_hardness = 0.8,
connect_sides = {"top", "bottom", "back", "left", "right"},
sounds = technic.sounds.node_sound_stone_defaults(),
drawtype = "nodebox",
paramtype = "light",
node_box = {
type = "fixed",
fixed = {
{-0.5, -0.5, -0.5, 0.5, 0.5, 0.5}, -- Main box
{-0.1, -0.1, -0.5, 0.1, 0.1, -0.6}, -- Shaft
{-0.1, -1, -0.6, 0.1, 1, -0.7}, -- Vertical blades
{-1, -0.1, -0.6, 1, 0.1, -0.7}, -- Horizontal blades
}
},
on_construct = function(pos)
local meta = minetest.get_meta(pos)
meta:set_string("infotext", S("Wind @1 Generator", S("MV")))
meta:set_int("MV_EU_supply", 0)
end,
technic_run = run,
})
technic.register_machine("MV", "technic:wind_mill", technic.producer)