From 83c6494166fcebefc0cd6f6868032fb814c35ff5 Mon Sep 17 00:00:00 2001 From: ShadowNinja Date: Sat, 19 Mar 2016 21:34:56 -0400 Subject: [PATCH] Use connected nodeboxes for cables --- technic/legacy.lua | 9 +- technic/machines/HV/battery_box.lua | 2 +- technic/machines/HV/cables.lua | 4 +- technic/machines/HV/forcefield.lua | 7 +- technic/machines/HV/generator.lua | 2 +- technic/machines/HV/nuclear_reactor.lua | 7 +- technic/machines/HV/quarry.lua | 5 +- technic/machines/HV/solar_array.lua | 2 +- technic/machines/LV/alloy_furnace.lua | 6 +- technic/machines/LV/battery_box.lua | 6 +- technic/machines/LV/cables.lua | 4 +- technic/machines/LV/cnc.lua | 37 ++-- technic/machines/LV/compressor.lua | 6 +- technic/machines/LV/electric_furnace.lua | 2 +- technic/machines/LV/extractor.lua | 2 +- technic/machines/LV/generator.lua | 2 +- technic/machines/LV/geothermal.lua | 10 +- technic/machines/LV/grinder.lua | 2 +- technic/machines/LV/music_player.lua | 6 +- technic/machines/LV/solar_array.lua | 2 +- technic/machines/LV/solar_panel.lua | 24 ++- technic/machines/LV/water_mill.lua | 8 +- technic/machines/MV/alloy_furnace.lua | 2 +- technic/machines/MV/battery_box.lua | 2 +- technic/machines/MV/cables.lua | 10 +- technic/machines/MV/centrifuge.lua | 6 +- technic/machines/MV/compressor.lua | 2 +- technic/machines/MV/electric_furnace.lua | 4 +- technic/machines/MV/extractor.lua | 2 +- technic/machines/MV/generator.lua | 2 +- technic/machines/MV/grinder.lua | 4 +- technic/machines/MV/power_radiator.lua | 19 +- technic/machines/MV/solar_array.lua | 2 +- technic/machines/MV/tool_workshop.lua | 6 +- technic/machines/MV/wind_mill.lua | 5 +- technic/machines/register/battery_box.lua | 4 +- technic/machines/register/cables.lua | 206 +++++---------------- technic/machines/register/generator.lua | 10 +- technic/machines/register/machine_base.lua | 12 +- technic/machines/register/solar_array.lua | 3 +- technic/machines/supply_converter.lua | 16 +- technic/machines/switching_station.lua | 15 +- 42 files changed, 193 insertions(+), 294 deletions(-) diff --git a/technic/legacy.lua b/technic/legacy.lua index 8360a71..3600ec1 100644 --- a/technic/legacy.lua +++ b/technic/legacy.lua @@ -22,9 +22,6 @@ technic.legacy_nodenames = { ["technic:compressor"] = "technic:lv_compressor", ["technic:compressor_active"] = "technic:lv_compressor_active", ["technic:hv_battery_box"] = "technic:hv_battery_box0", - ["technic:hv_cable"] = "technic:hv_cable0", - ["technic:lv_cable"] = "technic:lv_cable0", - ["technic:mv_cable"] = "technic:mv_cable0", ["technic:mv_battery_box"] = "technic:mv_battery_box0", ["technic:generator"] = "technic:lv_generator", ["technic:generator_active"] = "technic:lv_generator_active", @@ -36,3 +33,9 @@ for old, new in pairs(technic.legacy_nodenames) do minetest.register_alias(old, new) end +for i = 0, 63 do + minetest.register_alias("technic:hv_cable"..i, "technic:hv_cable") + minetest.register_alias("technic:mv_cable"..i, "technic:mv_cable") + minetest.register_alias("technic:lv_cable"..i, "technic:lv_cable") +end + diff --git a/technic/machines/HV/battery_box.lua b/technic/machines/HV/battery_box.lua index 1e054ec..9093ba9 100644 --- a/technic/machines/HV/battery_box.lua +++ b/technic/machines/HV/battery_box.lua @@ -4,7 +4,7 @@ minetest.register_craft({ recipe = { {'technic:mv_battery_box0', 'technic:mv_battery_box0', 'technic:mv_battery_box0'}, {'technic:mv_battery_box0', 'technic:hv_transformer', 'technic:mv_battery_box0'}, - {'', 'technic:hv_cable0', ''}, + {'', 'technic:hv_cable', ''}, } }) diff --git a/technic/machines/HV/cables.lua b/technic/machines/HV/cables.lua index 25297c8..0b86a23 100644 --- a/technic/machines/HV/cables.lua +++ b/technic/machines/HV/cables.lua @@ -1,9 +1,9 @@ minetest.register_craft({ - output = 'technic:hv_cable0 3', + output = 'technic:hv_cable 3', recipe = { {'homedecor:plastic_sheeting', 'homedecor:plastic_sheeting', 'homedecor:plastic_sheeting'}, - {'technic:mv_cable0', 'technic:mv_cable0', 'technic:mv_cable0'}, + {'technic:mv_cable', 'technic:mv_cable', 'technic:mv_cable'}, {'homedecor:plastic_sheeting', 'homedecor:plastic_sheeting', 'homedecor:plastic_sheeting'}, } }) diff --git a/technic/machines/HV/forcefield.lua b/technic/machines/HV/forcefield.lua index 0f0836d..3bf93b0 100644 --- a/technic/machines/HV/forcefield.lua +++ b/technic/machines/HV/forcefield.lua @@ -15,7 +15,7 @@ minetest.register_craft({ recipe = { {"default:mese", "technic:motor", "default:mese" }, {"technic:deployer_off", "technic:machine_casing", "technic:deployer_off"}, - {"default:mese", "technic:hv_cable0", "default:mese" }, + {"default:mese", "technic:hv_cable", "default:mese" }, } }) @@ -195,7 +195,7 @@ end minetest.register_node("technic:forcefield_emitter_off", { description = S("%s Forcefield Emitter"):format("HV"), tiles = {"technic_forcefield_emitter_off.png"}, - groups = {cracky = 1, technic_machine = 1}, + groups = {cracky = 1, technic_machine = 1, technic_hv = 1}, on_receive_fields = forcefield_receive_fields, on_construct = function(pos) local meta = minetest.get_meta(pos) @@ -215,7 +215,8 @@ minetest.register_node("technic:forcefield_emitter_off", { minetest.register_node("technic:forcefield_emitter_on", { description = S("%s Forcefield Emitter"):format("HV"), tiles = {"technic_forcefield_emitter_on.png"}, - groups = {cracky = 1, technic_machine = 1, not_in_creative_inventory=1}, + groups = {cracky = 1, technic_machine = 1, technic_hv = 1, + not_in_creative_inventory=1}, drop = "technic:forcefield_emitter_off", on_receive_fields = forcefield_receive_fields, on_destruct = function(pos) diff --git a/technic/machines/HV/generator.lua b/technic/machines/HV/generator.lua index aa83590..3fb494b 100644 --- a/technic/machines/HV/generator.lua +++ b/technic/machines/HV/generator.lua @@ -5,7 +5,7 @@ minetest.register_craft({ recipe = { {'technic:carbon_plate', 'technic:mv_generator', 'technic:composite_plate'}, {'pipeworks:tube_1', 'technic:hv_transformer', 'pipeworks:tube_1'}, - {'technic:stainless_steel_ingot', 'technic:hv_cable0', 'technic:stainless_steel_ingot'}, + {'technic:stainless_steel_ingot', 'technic:hv_cable', 'technic:stainless_steel_ingot'}, } }) diff --git a/technic/machines/HV/nuclear_reactor.lua b/technic/machines/HV/nuclear_reactor.lua index 3aa1ba8..b39acb0 100644 --- a/technic/machines/HV/nuclear_reactor.lua +++ b/technic/machines/HV/nuclear_reactor.lua @@ -24,7 +24,7 @@ minetest.register_craft({ recipe = { {'technic:carbon_plate', 'default:obsidian_glass', 'technic:carbon_plate'}, {'technic:composite_plate', 'technic:machine_casing', 'technic:composite_plate'}, - {'technic:stainless_steel_ingot', 'technic:hv_cable0', 'technic:stainless_steel_ingot'}, + {'technic:stainless_steel_ingot', 'technic:hv_cable', 'technic:stainless_steel_ingot'}, } }) @@ -260,7 +260,7 @@ minetest.register_node("technic:hv_nuclear_reactor_core", { tiles = {"technic_hv_nuclear_reactor_core.png", "technic_hv_nuclear_reactor_core.png", "technic_hv_nuclear_reactor_core.png", "technic_hv_nuclear_reactor_core.png", "technic_hv_nuclear_reactor_core.png", "technic_hv_nuclear_reactor_core.png"}, - groups = {cracky=1, technic_machine=1}, + groups = {cracky=1, technic_machine=1, technic_hv=1}, legacy_facedir_simple = true, sounds = default.node_sound_wood_defaults(), drawtype="nodebox", @@ -294,7 +294,8 @@ minetest.register_node("technic:hv_nuclear_reactor_core_active", { tiles = {"technic_hv_nuclear_reactor_core.png", "technic_hv_nuclear_reactor_core.png", "technic_hv_nuclear_reactor_core.png", "technic_hv_nuclear_reactor_core.png", "technic_hv_nuclear_reactor_core.png", "technic_hv_nuclear_reactor_core.png"}, - groups = {cracky=1, technic_machine=1, radioactive=11000, not_in_creative_inventory=1}, + groups = {cracky=1, technic_machine=1, technic_hv=1, + radioactive=11000, not_in_creative_inventory=1}, legacy_facedir_simple = true, sounds = default.node_sound_wood_defaults(), drop="technic:hv_nuclear_reactor_core", diff --git a/technic/machines/HV/quarry.lua b/technic/machines/HV/quarry.lua index 60805cc..8255676 100644 --- a/technic/machines/HV/quarry.lua +++ b/technic/machines/HV/quarry.lua @@ -5,7 +5,7 @@ minetest.register_craft({ recipe = { {"technic:carbon_plate", "pipeworks:filter", "technic:composite_plate"}, {"technic:motor", "technic:machine_casing", "technic:diamond_drill_head"}, - {"technic:carbon_steel_block", "technic:hv_cable0", "technic:carbon_steel_block"}}, + {"technic:carbon_steel_block", "technic:hv_cable", "technic:carbon_steel_block"}}, output = "technic:quarry", }) @@ -213,7 +213,8 @@ minetest.register_node("technic:quarry", { "technic_carbon_steel_block.png^default_tool_mesepick.png", "technic_carbon_steel_block.png"), paramtype2 = "facedir", - groups = {cracky=2, tubedevice=1, technic_machine = 1}, + groups = {cracky=2, tubedevice=1, technic_machine=1, technic_hv=1}, + connect_sides = {"bottom", "front", "left", "right"}, tube = { connect_sides = {top = 1}, }, diff --git a/technic/machines/HV/solar_array.lua b/technic/machines/HV/solar_array.lua index 414291a..c7de7c8 100644 --- a/technic/machines/HV/solar_array.lua +++ b/technic/machines/HV/solar_array.lua @@ -6,7 +6,7 @@ minetest.register_craft({ recipe = { {'technic:solar_array_mv', 'technic:solar_array_mv', 'technic:solar_array_mv'}, {'technic:carbon_plate', 'technic:hv_transformer', 'technic:composite_plate'}, - {'', 'technic:hv_cable0', ''}, + {'', 'technic:hv_cable', ''}, } }) diff --git a/technic/machines/LV/alloy_furnace.lua b/technic/machines/LV/alloy_furnace.lua index bdf2f31..5e4f7c4 100644 --- a/technic/machines/LV/alloy_furnace.lua +++ b/technic/machines/LV/alloy_furnace.lua @@ -4,9 +4,9 @@ minetest.register_craft({ output = 'technic:lv_alloy_furnace', recipe = { - {'default:brick', 'default:brick', 'default:brick'}, - {'default:brick', 'technic:machine_casing', 'default:brick'}, - {'default:brick', 'technic:lv_cable0', 'default:brick'}, + {'default:brick', 'default:brick', 'default:brick'}, + {'default:brick', 'technic:machine_casing', 'default:brick'}, + {'default:brick', 'technic:lv_cable', 'default:brick'}, } }) diff --git a/technic/machines/LV/battery_box.lua b/technic/machines/LV/battery_box.lua index 429bcd6..066bc9d 100644 --- a/technic/machines/LV/battery_box.lua +++ b/technic/machines/LV/battery_box.lua @@ -2,9 +2,9 @@ minetest.register_craft({ output = 'technic:lv_battery_box0', recipe = { - {'group:wood', 'group:wood', 'group:wood'}, - {'technic:battery', 'technic:machine_casing', 'technic:battery'}, - {'technic:battery', 'technic:lv_cable0', 'technic:battery'}, + {'group:wood', 'group:wood', 'group:wood'}, + {'technic:battery', 'technic:machine_casing', 'technic:battery'}, + {'technic:battery', 'technic:lv_cable', 'technic:battery'}, } }) diff --git a/technic/machines/LV/cables.lua b/technic/machines/LV/cables.lua index e18eae1..d4ed880 100644 --- a/technic/machines/LV/cables.lua +++ b/technic/machines/LV/cables.lua @@ -1,8 +1,8 @@ -minetest.register_alias("lv_cable", "technic:lv_cable0") +minetest.register_alias("lv_cable", "technic:lv_cable") minetest.register_craft({ - output = 'technic:lv_cable0 6', + output = 'technic:lv_cable 6', recipe = { {'default:paper', 'default:paper', 'default:paper'}, {'default:copper_ingot', 'default:copper_ingot', 'default:copper_ingot'}, diff --git a/technic/machines/LV/cnc.lua b/technic/machines/LV/cnc.lua index dd67e9b..58ec6ba 100644 --- a/technic/machines/LV/cnc.lua +++ b/technic/machines/LV/cnc.lua @@ -9,6 +9,17 @@ local S = technic.getter + +minetest.register_craft({ + output = 'technic:cnc', + recipe = { + {'default:glass', 'technic:diamond_drill_head', 'default:glass'}, + {'technic:control_logic_unit', 'technic:machine_casing', 'technic:motor'}, + {'technic:carbon_steel_ingot', 'technic:lv_cable', 'technic:carbon_steel_ingot'}, + }, +}) + + local shape = {} local onesize_products = { slope = 2, @@ -174,16 +185,9 @@ minetest.register_node("technic:cnc", { description = S("%s CNC Machine"):format("LV"), tiles = {"technic_cnc_top.png", "technic_cnc_bottom.png", "technic_cnc_side.png", "technic_cnc_side.png", "technic_cnc_side.png", "technic_cnc_front.png"}, - drawtype = "nodebox", - paramtype = "light", + groups = {cracky=2, technic_machine=1, technic_lv=1}, + connect_sides = {"bottom", "back", "left", "right"}, paramtype2 = "facedir", - node_box = { - type = "fixed", - fixed = { - {-0.5, -0.5, -0.5, 0.5, 0.5, 0.5}, - }, - }, - groups = {cracky=2, technic_machine=1}, legacy_facedir_simple = true, on_construct = function(pos) local meta = minetest.get_meta(pos) @@ -207,9 +211,10 @@ minetest.register_node("technic:cnc_active", { description = S("%s CNC Machine"):format("LV"), tiles = {"technic_cnc_top_active.png", "technic_cnc_bottom.png", "technic_cnc_side.png", "technic_cnc_side.png", "technic_cnc_side.png", "technic_cnc_front_active.png"}, + groups = {cracky=2, technic_machine=1, technic_lv=1, not_in_creative_inventory=1}, + connect_sides = {"bottom", "back", "left", "right"}, paramtype2 = "facedir", drop = "technic:cnc", - groups = {cracky=2, technic_machine=1, not_in_creative_inventory=1}, legacy_facedir_simple = true, can_dig = technic.machine_can_dig, allow_metadata_inventory_put = technic.machine_inventory_put, @@ -223,15 +228,3 @@ minetest.register_node("technic:cnc_active", { technic.register_machine("LV", "technic:cnc", technic.receiver) technic.register_machine("LV", "technic:cnc_active", technic.receiver) -------------------------- --- CNC Machine Recipe -------------------------- -minetest.register_craft({ - output = 'technic:cnc', - recipe = { - {'default:glass', 'technic:diamond_drill_head', 'default:glass'}, - {'technic:control_logic_unit', 'technic:machine_casing', 'technic:motor'}, - {'technic:carbon_steel_ingot', 'technic:lv_cable0', 'technic:carbon_steel_ingot'}, - }, -}) - diff --git a/technic/machines/LV/compressor.lua b/technic/machines/LV/compressor.lua index e2bde40..67b9f79 100644 --- a/technic/machines/LV/compressor.lua +++ b/technic/machines/LV/compressor.lua @@ -4,9 +4,9 @@ minetest.register_alias("compressor", "technic:lv_compressor") minetest.register_craft({ output = 'technic:lv_compressor', recipe = { - {'default:stone', 'technic:motor', 'default:stone'}, - {'mesecons:piston', 'technic:machine_casing', 'mesecons:piston'}, - {'technic:fine_silver_wire', 'technic:lv_cable0', 'technic:fine_silver_wire'}, + {'default:stone', 'technic:motor', 'default:stone'}, + {'mesecons:piston', 'technic:machine_casing', 'mesecons:piston'}, + {'technic:fine_silver_wire', 'technic:lv_cable', 'technic:fine_silver_wire'}, } }) diff --git a/technic/machines/LV/electric_furnace.lua b/technic/machines/LV/electric_furnace.lua index cc4daff..768f04a 100644 --- a/technic/machines/LV/electric_furnace.lua +++ b/technic/machines/LV/electric_furnace.lua @@ -7,7 +7,7 @@ minetest.register_craft({ recipe = { {'default:cobble', 'default:cobble', 'default:cobble'}, {'default:cobble', 'technic:machine_casing', 'default:cobble'}, - {'default:cobble', 'technic:lv_cable0', 'default:cobble'}, + {'default:cobble', 'technic:lv_cable', 'default:cobble'}, } }) diff --git a/technic/machines/LV/extractor.lua b/technic/machines/LV/extractor.lua index 363d2e3..55d0140 100644 --- a/technic/machines/LV/extractor.lua +++ b/technic/machines/LV/extractor.lua @@ -6,7 +6,7 @@ minetest.register_craft({ recipe = { {'technic:treetap', 'technic:motor', 'technic:treetap'}, {'technic:treetap', 'technic:machine_casing', 'technic:treetap'}, - {'', 'technic:lv_cable0', ''}, + {'', 'technic:lv_cable', ''}, } }) diff --git a/technic/machines/LV/generator.lua b/technic/machines/LV/generator.lua index 999dbc5..dc9815f 100644 --- a/technic/machines/LV/generator.lua +++ b/technic/machines/LV/generator.lua @@ -10,7 +10,7 @@ minetest.register_craft({ recipe = { {'default:stone', 'default:furnace', 'default:stone'}, {'default:stone', 'technic:machine_casing', 'default:stone'}, - {'default:stone', 'technic:lv_cable0', 'default:stone'}, + {'default:stone', 'technic:lv_cable', 'default:stone'}, } }) diff --git a/technic/machines/LV/geothermal.lua b/technic/machines/LV/geothermal.lua index e88d3c9..27f4abc 100644 --- a/technic/machines/LV/geothermal.lua +++ b/technic/machines/LV/geothermal.lua @@ -10,9 +10,9 @@ local S = technic.getter minetest.register_craft({ output = 'technic:geothermal', recipe = { - {'technic:granite', 'default:diamond', 'technic:granite'}, + {'technic:granite', 'default:diamond', 'technic:granite'}, {'technic:fine_copper_wire', 'technic:machine_casing', 'technic:fine_copper_wire'}, - {'technic:granite', 'technic:lv_cable0', 'technic:granite'}, + {'technic:granite', 'technic:lv_cable', 'technic:granite'}, } }) @@ -82,8 +82,9 @@ minetest.register_node("technic:geothermal", { description = S("Geothermal %s Generator"):format("LV"), tiles = {"technic_geothermal_top.png", "technic_machine_bottom.png", "technic_geothermal_side.png", "technic_geothermal_side.png", "technic_geothermal_side.png", "technic_geothermal_side.png"}, + groups = {snappy=2, choppy=2, oddly_breakable_by_hand=2, + technic_machine=1, technic_lv=1}, paramtype2 = "facedir", - groups = {snappy=2, choppy=2, oddly_breakable_by_hand=2, technic_machine=1}, legacy_facedir_simple = true, sounds = default.node_sound_wood_defaults(), on_construct = function(pos) @@ -99,7 +100,8 @@ minetest.register_node("technic:geothermal_active", { tiles = {"technic_geothermal_top_active.png", "technic_machine_bottom.png", "technic_geothermal_side.png", "technic_geothermal_side.png", "technic_geothermal_side.png", "technic_geothermal_side.png"}, paramtype2 = "facedir", - groups = {snappy=2, choppy=2, oddly_breakable_by_hand=2, not_in_creative_inventory=1}, + 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 = default.node_sound_wood_defaults(), drop = "technic:geothermal", diff --git a/technic/machines/LV/grinder.lua b/technic/machines/LV/grinder.lua index da9ea29..9e45bf4 100644 --- a/technic/machines/LV/grinder.lua +++ b/technic/machines/LV/grinder.lua @@ -5,7 +5,7 @@ minetest.register_craft({ recipe = { {'default:desert_stone', 'default:diamond', 'default:desert_stone'}, {'default:desert_stone', 'technic:machine_casing', 'default:desert_stone'}, - {'technic:granite', 'technic:lv_cable0', 'technic:granite'}, + {'technic:granite', 'technic:lv_cable', 'technic:granite'}, } }) diff --git a/technic/machines/LV/music_player.lua b/technic/machines/LV/music_player.lua index dc7e2d0..262fe5f 100644 --- a/technic/machines/LV/music_player.lua +++ b/technic/machines/LV/music_player.lua @@ -9,7 +9,7 @@ minetest.register_craft({ recipe = { {'technic:chromium_ingot', 'default:diamond', 'technic:chromium_ingot'}, {'default:diamond', 'technic:machine_casing', 'default:diamond'}, - {'default:mossycobble', 'technic:lv_cable0', 'default:mossycobble'}, + {'default:mossycobble', 'technic:lv_cable', 'default:mossycobble'}, } }) @@ -94,7 +94,9 @@ minetest.register_node("technic:music_player", { description = S("%s Music Player"):format("LV"), tiles = {"technic_music_player_top.png", "technic_machine_bottom.png", "technic_music_player_side.png", "technic_music_player_side.png", "technic_music_player_side.png", "technic_music_player_side.png"}, - groups = {snappy=2, choppy=2, oddly_breakable_by_hand=2, technic_machine=1}, + groups = {snappy=2, choppy=2, oddly_breakable_by_hand=2, + technic_machine=1, technic_lv=1}, + connect_sides = {"bottom"}, sounds = default.node_sound_wood_defaults(), on_construct = function(pos) local meta = minetest.get_meta(pos) diff --git a/technic/machines/LV/solar_array.lua b/technic/machines/LV/solar_array.lua index 4d2c3b3..8c1b8f4 100644 --- a/technic/machines/LV/solar_array.lua +++ b/technic/machines/LV/solar_array.lua @@ -10,7 +10,7 @@ minetest.register_craft({ recipe = { {'technic:solar_panel', 'technic:solar_panel', 'technic:solar_panel'}, {'technic:carbon_steel_ingot', 'technic:lv_transformer', 'technic:carbon_steel_ingot'}, - {'', 'technic:lv_cable0', ''}, + {'', 'technic:lv_cable', ''}, } }) diff --git a/technic/machines/LV/solar_panel.lua b/technic/machines/LV/solar_panel.lua index 41dff95..fc2fce0 100644 --- a/technic/machines/LV/solar_panel.lua +++ b/technic/machines/LV/solar_panel.lua @@ -4,6 +4,17 @@ local S = technic.getter + +minetest.register_craft({ + output = 'technic:solar_panel', + recipe = { + {'technic:doped_silicon_wafer', 'technic:doped_silicon_wafer', 'technic:doped_silicon_wafer'}, + {'technic:fine_silver_wire', 'technic:lv_cable', 'mesecons_materials:glue'}, + + } +}) + + local run = function(pos, node) -- The action here is to make the solar panel prodice power -- Power is dependent on the light level and the height above ground @@ -35,7 +46,9 @@ end minetest.register_node("technic:solar_panel", { tiles = {"technic_solar_panel_top.png", "technic_solar_panel_bottom.png", "technic_solar_panel_side.png", "technic_solar_panel_side.png", "technic_solar_panel_side.png", "technic_solar_panel_side.png"}, - groups = {snappy=2, choppy=2, oddly_breakable_by_hand=2, technic_machine=1}, + groups = {snappy=2, choppy=2, oddly_breakable_by_hand=2, + technic_machine=1, technic_lv=1}, + connect_sides = {"bottom"}, sounds = default.node_sound_wood_defaults(), description = S("Small Solar %s Generator"):format("LV"), active = false, @@ -54,14 +67,5 @@ minetest.register_node("technic:solar_panel", { technic_run = run, }) -minetest.register_craft({ - output = 'technic:solar_panel', - recipe = { - {'technic:doped_silicon_wafer', 'technic:doped_silicon_wafer', 'technic:doped_silicon_wafer'}, - {'technic:fine_silver_wire', 'technic:lv_cable0', 'mesecons_materials:glue'}, - - } -}) - technic.register_machine("LV", "technic:solar_panel", technic.producer) diff --git a/technic/machines/LV/water_mill.lua b/technic/machines/LV/water_mill.lua index 9088d1d..c853310 100644 --- a/technic/machines/LV/water_mill.lua +++ b/technic/machines/LV/water_mill.lua @@ -11,7 +11,7 @@ minetest.register_craft({ recipe = { {'technic:marble', 'default:diamond', 'technic:marble'}, {'group:wood', 'technic:machine_casing', 'group:wood'}, - {'technic:marble', 'technic:lv_cable0', 'technic:marble'}, + {'technic:marble', 'technic:lv_cable', 'technic:marble'}, } }) @@ -72,7 +72,8 @@ minetest.register_node("technic:water_mill", { "technic_water_mill_side.png", "technic_water_mill_side.png", "technic_water_mill_side.png", "technic_water_mill_side.png"}, paramtype2 = "facedir", - groups = {snappy=2, choppy=2, oddly_breakable_by_hand=2, technic_machine=1}, + groups = {snappy=2, choppy=2, oddly_breakable_by_hand=2, + technic_machine=1, technic_lv=1}, legacy_facedir_simple = true, sounds = default.node_sound_wood_defaults(), on_construct = function(pos) @@ -89,7 +90,8 @@ minetest.register_node("technic:water_mill_active", { "technic_water_mill_side.png", "technic_water_mill_side.png", "technic_water_mill_side.png", "technic_water_mill_side.png"}, paramtype2 = "facedir", - groups = {snappy=2, choppy=2, oddly_breakable_by_hand=2, technic_machine=1, not_in_creative_inventory=1}, + 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 = default.node_sound_wood_defaults(), drop = "technic:water_mill", diff --git a/technic/machines/MV/alloy_furnace.lua b/technic/machines/MV/alloy_furnace.lua index a1918fd..eaddee0 100644 --- a/technic/machines/MV/alloy_furnace.lua +++ b/technic/machines/MV/alloy_furnace.lua @@ -5,7 +5,7 @@ minetest.register_craft({ 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_cable0', 'technic:stainless_steel_ingot'}, + {'technic:stainless_steel_ingot', 'technic:mv_cable', 'technic:stainless_steel_ingot'}, } }) diff --git a/technic/machines/MV/battery_box.lua b/technic/machines/MV/battery_box.lua index 45437c1..d84ec15 100644 --- a/technic/machines/MV/battery_box.lua +++ b/technic/machines/MV/battery_box.lua @@ -5,7 +5,7 @@ minetest.register_craft({ 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_cable0', ''}, + {'', 'technic:mv_cable', ''}, } }) diff --git a/technic/machines/MV/cables.lua b/technic/machines/MV/cables.lua index b1a34c8..0c1f457 100644 --- a/technic/machines/MV/cables.lua +++ b/technic/machines/MV/cables.lua @@ -1,12 +1,12 @@ -minetest.register_alias("mv_cable", "technic:mv_cable0") +minetest.register_alias("mv_cable", "technic:mv_cable") minetest.register_craft({ - output = 'technic:mv_cable0 3', + output = 'technic:mv_cable 3', recipe ={ - {'technic:rubber', 'technic:rubber', 'technic:rubber'}, - {'technic:lv_cable0', 'technic:lv_cable0', 'technic:lv_cable0'}, - {'technic:rubber', 'technic:rubber', 'technic:rubber'}, + {'technic:rubber', 'technic:rubber', 'technic:rubber'}, + {'technic:lv_cable', 'technic:lv_cable', 'technic:lv_cable'}, + {'technic:rubber', 'technic:rubber', 'technic:rubber'}, } }) diff --git a/technic/machines/MV/centrifuge.lua b/technic/machines/MV/centrifuge.lua index 5bf24bf..a0aad64 100644 --- a/technic/machines/MV/centrifuge.lua +++ b/technic/machines/MV/centrifuge.lua @@ -1,9 +1,9 @@ minetest.register_craft({ output = "technic:mv_centrifuge", recipe = { - { "technic:motor", "technic:copper_plate", "technic:diamond_drill_head" }, - { "technic:copper_plate", "technic:machine_casing", "technic:copper_plate" }, - { "pipeworks:one_way_tube", "technic:mv_cable0", "pipeworks:mese_filter" }, + {"technic: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" }, } }) diff --git a/technic/machines/MV/compressor.lua b/technic/machines/MV/compressor.lua index 5b36cc5..d97739e 100644 --- a/technic/machines/MV/compressor.lua +++ b/technic/machines/MV/compressor.lua @@ -5,7 +5,7 @@ minetest.register_craft({ 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_cable0', 'technic:stainless_steel_ingot'}, + {'technic:stainless_steel_ingot', 'technic:mv_cable', 'technic:stainless_steel_ingot'}, } }) diff --git a/technic/machines/MV/electric_furnace.lua b/technic/machines/MV/electric_furnace.lua index 1f6b1c2..b1d2dee 100644 --- a/technic/machines/MV/electric_furnace.lua +++ b/technic/machines/MV/electric_furnace.lua @@ -9,8 +9,8 @@ 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_cable0', 'technic:stainless_steel_ingot'}, + {'pipeworks:tube_1', 'technic:mv_transformer', 'pipeworks:tube_1'}, + {'technic:stainless_steel_ingot', 'technic:mv_cable', 'technic:stainless_steel_ingot'}, } }) diff --git a/technic/machines/MV/extractor.lua b/technic/machines/MV/extractor.lua index fdef5b2..9066bca 100644 --- a/technic/machines/MV/extractor.lua +++ b/technic/machines/MV/extractor.lua @@ -5,7 +5,7 @@ minetest.register_craft({ 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_cable0', 'technic:stainless_steel_ingot'}, + {'technic:stainless_steel_ingot', 'technic:mv_cable', 'technic:stainless_steel_ingot'}, } }) diff --git a/technic/machines/MV/generator.lua b/technic/machines/MV/generator.lua index 4ae24b8..db9d59f 100644 --- a/technic/machines/MV/generator.lua +++ b/technic/machines/MV/generator.lua @@ -5,7 +5,7 @@ minetest.register_craft({ 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_cable0', 'technic:stainless_steel_ingot'}, + {'technic:stainless_steel_ingot', 'technic:mv_cable', 'technic:stainless_steel_ingot'}, } }) diff --git a/technic/machines/MV/grinder.lua b/technic/machines/MV/grinder.lua index dac536c..19ab372 100644 --- a/technic/machines/MV/grinder.lua +++ b/technic/machines/MV/grinder.lua @@ -4,8 +4,8 @@ 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_cable0', 'technic:stainless_steel_ingot'}, + {'pipeworks:tube_1', 'technic:mv_transformer', 'pipeworks:tube_1'}, + {'technic:stainless_steel_ingot', 'technic:mv_cable', 'technic:stainless_steel_ingot'}, } }) diff --git a/technic/machines/MV/power_radiator.lua b/technic/machines/MV/power_radiator.lua index 560f8a9..9349e66 100644 --- a/technic/machines/MV/power_radiator.lua +++ b/technic/machines/MV/power_radiator.lua @@ -12,6 +12,16 @@ local power_radius = 12 + +minetest.register_craft({ + output = 'technic:power_radiator 1', + recipe = { + {'technic:stainless_steel_ingot', 'technic:mv_transformer', 'technic:stainless_steel_ingot'}, + {'technic:copper_coil', 'technic:machine_casing', 'technic:copper_coil'}, + {'technic:rubber', 'technic:mv_cable', 'technic:rubber'}, + } +}) + ------------------------------------------------------------------ -- API for inductive powered nodes: -- Use the functions below to set the corresponding callbacks @@ -135,15 +145,6 @@ minetest.register_node("technic:power_radiator", { end }) -minetest.register_craft({ - output = 'technic:power_radiator 1', - recipe = { - {'technic:stainless_steel_ingot', 'technic:mv_transformer', 'technic:stainless_steel_ingot'}, - {'technic:copper_coil', 'technic:machine_casing', 'technic:copper_coil'}, - {'technic:rubber', 'technic:mv_cable0', 'technic:rubber'}, - } -}) - minetest.register_abm({ nodenames = {"technic:power_radiator"}, interval = 1, diff --git a/technic/machines/MV/solar_array.lua b/technic/machines/MV/solar_array.lua index 227d8ee..4077a5c 100644 --- a/technic/machines/MV/solar_array.lua +++ b/technic/machines/MV/solar_array.lua @@ -4,7 +4,7 @@ minetest.register_craft({ recipe = { {'technic:solar_array_lv', 'technic:solar_array_lv', 'technic:solar_array_lv'}, {'technic:carbon_steel_ingot', 'technic:mv_transformer', 'technic:carbon_steel_ingot'}, - {'', 'technic:mv_cable0', ''}, + {'', 'technic:mv_cable', ''}, } }) diff --git a/technic/machines/MV/tool_workshop.lua b/technic/machines/MV/tool_workshop.lua index 318b1ec..4076cc1 100644 --- a/technic/machines/MV/tool_workshop.lua +++ b/technic/machines/MV/tool_workshop.lua @@ -10,7 +10,7 @@ minetest.register_craft({ recipe = { {'group:wood', 'default:diamond', 'group:wood'}, {'mesecons_pistons:piston_sticky_off', 'technic:machine_casing', 'technic:carbon_cloth'}, - {'default:obsidian', 'technic:mv_cable0', 'default:obsidian'}, + {'default:obsidian', 'technic:mv_cable', 'default:obsidian'}, } }) @@ -85,7 +85,9 @@ minetest.register_node("technic:tool_workshop", { paramtype2 = "facedir", tiles = {"technic_workshop_top.png", "technic_machine_bottom.png", "technic_workshop_side.png", "technic_workshop_side.png", "technic_workshop_side.png", "technic_workshop_side.png"}, - groups = {snappy=2, choppy=2, oddly_breakable_by_hand=2, technic_machine=1, tubedevice=1, tubedevice_receiver=1}, + 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 = default.node_sound_wood_defaults(), on_construct = function(pos) local meta = minetest.get_meta(pos) diff --git a/technic/machines/MV/wind_mill.lua b/technic/machines/MV/wind_mill.lua index c553051..40ecdd6 100644 --- a/technic/machines/MV/wind_mill.lua +++ b/technic/machines/MV/wind_mill.lua @@ -15,7 +15,7 @@ minetest.register_craft({ recipe = { {'', 'technic:motor', ''}, {'technic:carbon_steel_ingot', 'technic:carbon_steel_block', 'technic:carbon_steel_ingot'}, - {'', 'technic:mv_cable0', ''}, + {'', 'technic:mv_cable', ''}, } }) @@ -62,7 +62,8 @@ minetest.register_node("technic:wind_mill", { description = S("Wind %s Generator"):format("MV"), tiles = {"technic_carbon_steel_block.png"}, paramtype2 = "facedir", - groups = {cracky=1, technic_machine=1}, + groups = {cracky=1, technic_machine=1, technic_mv=1}, + connect_sides = {"top", "bottom", "back", "left", "right"}, sounds = default.node_sound_stone_defaults(), drawtype = "nodebox", paramtype = "light", diff --git a/technic/machines/register/battery_box.lua b/technic/machines/register/battery_box.lua index 82edca0..cde4816 100644 --- a/technic/machines/register/battery_box.lua +++ b/technic/machines/register/battery_box.lua @@ -159,7 +159,8 @@ function technic.register_battery_box(data) end for i = 0, 8 do - local groups = {snappy=2, choppy=2, oddly_breakable_by_hand=2, technic_machine=1} + local groups = {snappy=2, choppy=2, oddly_breakable_by_hand=2, + technic_machine=1, ["technic_"..ltier]=1} if i ~= 0 then groups.not_in_creative_inventory = 1 end @@ -178,6 +179,7 @@ function technic.register_battery_box(data) "technic_"..ltier.."_battery_box_side.png^technic_power_meter"..i..".png", "technic_"..ltier.."_battery_box_side.png^technic_power_meter"..i..".png"}, groups = groups, + connect_sides = {"bottom"}, tube = data.tube and tube or nil, paramtype2 = "facedir", sounds = default.node_sound_wood_defaults(), diff --git a/technic/machines/register/cables.lua b/technic/machines/register/cables.lua index a1e7bc8..28984c0 100644 --- a/technic/machines/register/cables.lua +++ b/technic/machines/register/cables.lua @@ -1,177 +1,65 @@ local S = technic.getter -local cable_itstr_to_tier = {} +local cable_tier = {} + +function technic.is_tier_cable(name, tier) + return cable_tier[name] == tier +end + +function technic.get_cable_tier(name) + return cable_tier[name] +end + +local function clear_networks() + technic.networks = {} +end function technic.register_cable(tier, size) local ltier = string.lower(tier) + cable_tier["technic:"..ltier.."_cable"] = tier - for x1 = 0, 1 do - for x2 = 0, 1 do - for y1 = 0, 1 do - for y2 = 0, 1 do - for z1 = 0, 1 do - for z2 = 0, 1 do - local id = technic.get_cable_id({x1, x2, y1, y2, z1, z2}) + local groups = {snappy=2, choppy=2, oddly_breakable_by_hand=2} - cable_itstr_to_tier["technic:"..ltier.."_cable"..id] = tier + local node_box = { + type = "connected", + fixed = {-size, -size, -size, size, size, size}, + connect_top = {-size, -size, -size, size, 0.5, size}, -- y+ + connect_bottom = {-size, -0.5, -size, size, size, size}, -- y- + connect_front = {-size, -size, -0.5, size, size, size}, -- z- + connect_back = {-size, -size, size, size, size, 0.5 }, -- z+ + connect_left = {-0.5, -size, -size, size, size, size}, -- x- + connect_right = {-size, -size, -size, 0.5, size, size}, -- x+ + } - local groups = {snappy=2, choppy=2, oddly_breakable_by_hand=2} - if id ~= 0 then - groups.not_in_creative_inventory = 1 - end - - minetest.register_node("technic:"..ltier.."_cable"..id, { - description = S("%s Cable"):format(tier), - tiles = {"technic_"..ltier.."_cable.png"}, - inventory_image = "technic_"..ltier.."_cable_wield.png", - wield_image = "technic_"..ltier.."_cable_wield.png", - groups = groups, - sounds = default.node_sound_wood_defaults(), - drop = "technic:"..ltier.."_cable0", - paramtype = "light", - sunlight_propagates = true, - drawtype = "nodebox", - node_box = { - type = "fixed", - fixed = technic.gen_cable_nodebox(x1, y1, z1, x2, y2, z2, size) - }, - on_construct = function() - technic.networks = {} - end, - on_destruct = function() - technic.networks = {} - end, - after_place_node = function(pos) - local node = minetest.get_node(pos) - technic.update_cables(pos, technic.get_cable_tier(node.name)) - end, - after_dig_node = function(pos, oldnode) - local tier = technic.get_cable_tier(oldnode.name) - technic.update_cables(pos, tier, true) - end - }) - end - end - end - end - end - end + minetest.register_node("technic:"..ltier.."_cable", { + description = S("%s Cable"):format(tier), + tiles = {"technic_"..ltier.."_cable.png"}, + inventory_image = "technic_"..ltier.."_cable_wield.png", + wield_image = "technic_"..ltier.."_cable_wield.png", + groups = groups, + sounds = default.node_sound_wood_defaults(), + drop = "technic:"..ltier.."_cable", + paramtype = "light", + sunlight_propagates = true, + drawtype = "nodebox", + node_box = node_box, + connects_to = {"technic:"..ltier.."_cable", + "group:technic_"..ltier, "group:technic_all_tiers"}, + on_construct = clear_networks, + on_destruct = clear_networks, + }) end -minetest.register_on_placenode(function(pos, node) + +local function clear_nets_if_machine(pos, node) for tier, machine_list in pairs(technic.machines) do if machine_list[node.name] ~= nil then - technic.update_cables(pos, tier, true) - technic.networks = {} + return clear_networks() end end -end) - - -minetest.register_on_dignode(function(pos, node) - for tier, machine_list in pairs(technic.machines) do - if machine_list[node.name] ~= nil then - technic.update_cables(pos, tier, true) - technic.networks = {} - end - end -end) - -function technic.get_cable_id(links) - return (links[6] * 1) + (links[5] * 2) - + (links[4] * 4) + (links[3] * 8) - + (links[2] * 16) + (links[1] * 32) end -function technic.update_cables(pos, tier, no_set, secondrun) - local link_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+1, z=pos.z}, - {x=pos.x, y=pos.y-1, z=pos.z}, - {x=pos.x, y=pos.y, z=pos.z+1}, - {x=pos.x, y=pos.y, z=pos.z-1}} - - local links = {0, 0, 0, 0, 0, 0} - - for i, link_pos in pairs(link_positions) do - local connect_type = technic.cables_should_connect(pos, link_pos, tier) - if connect_type then - links[i] = 1 - -- Have cables next to us update theirselves, - -- but only once. (We don't want to update the entire - -- network or start an infinite loop of updates) - if not secondrun and connect_type == "cable" then - technic.update_cables(link_pos, tier, false, true) - end - end - end - -- We don't want to set ourselves if we have been removed or we are - -- updating a machine - if not no_set then - minetest.set_node(pos, {name="technic:"..string.lower(tier) - .."_cable"..technic.get_cable_id(links)}) - - end -end - - -function technic.is_tier_cable(name, tier) - return cable_itstr_to_tier[name] and cable_itstr_to_tier[name] == tier -end - - -function technic.get_cable_tier(name) - return cable_itstr_to_tier[name] -end - - -function technic.cables_should_connect(pos1, pos2, tier) - local name = minetest.get_node(pos2).name - - if name == "technic:switching_station" then - return pos2.y == pos1.y + 1 and "machine" or false - elseif name == "technic:supply_converter" then - return math.abs(pos2.y - pos1.y) == 1 and "machine" or false - elseif technic.is_tier_cable(name, tier) then - return "cable" - elseif technic.machines[tier][name] then - return "machine" - end - return false -end - - -function technic.gen_cable_nodebox(x1, y1, z1, x2, y2, z2, size) - -- Nodeboxes - local box_center = {-size, -size, -size, size, size, size} - local box_y1 = {-size, -size, -size, size, 0.5, size} -- y+ - local box_x1 = {-size, -size, -size, 0.5, size, size} -- x+ - local box_z1 = {-size, -size, size, size, size, 0.5} -- z+ - local box_z2 = {-size, -size, -0.5, size, size, size} -- z- - local box_y2 = {-size, -0.5, -size, size, size, size} -- y- - local box_x2 = {-0.5, -size, -size, size, size, size} -- x- - - local box = {box_center} - if x1 == 1 then - table.insert(box, box_x1) - end - if y1 == 1 then - table.insert(box, box_y1) - end - if z1 == 1 then - table.insert(box, box_z1) - end - if x2 == 1 then - table.insert(box, box_x2) - end - if y2 == 1 then - table.insert(box, box_y2) - end - if z2 == 1 then - table.insert(box, box_z2) - end - return box -end +minetest.register_on_placenode(clear_nets_if_machine) +minetest.register_on_dignode(clear_nets_if_machine) diff --git a/technic/machines/register/generator.lua b/technic/machines/register/generator.lua index 31c1cef..2cdc336 100644 --- a/technic/machines/register/generator.lua +++ b/technic/machines/register/generator.lua @@ -18,14 +18,14 @@ function technic.register_generator(data) local tier = data.tier local ltier = string.lower(tier) - local groups = {snappy=2, choppy=2, oddly_breakable_by_hand=2, technic_machine=1} - local active_groups = {snappy=2, choppy=2, oddly_breakable_by_hand=2, technic_machine=1, not_in_creative_inventory=1} + local groups = {snappy=2, choppy=2, oddly_breakable_by_hand=2, + technic_machine=1, ["technic_"..ltier]=1} if data.tube then groups.tubedevice = 1 groups.tubedevice_receiver = 1 - active_groups.tubedevice = 1 - active_groups.tubedevice_receiver = 1 end + local active_groups = {not_in_creative_inventory = 1} + for k, v in pairs(groups) do active_groups[k] = v end local generator_formspec = "invsize[8,9;]".. @@ -93,6 +93,7 @@ function technic.register_generator(data) "technic_"..ltier.."_generator_side.png", "technic_"..ltier.."_generator_front.png"}, paramtype2 = "facedir", groups = groups, + connect_sides = {"bottom", "back", "left", "right"}, legacy_facedir_simple = true, sounds = default.node_sound_wood_defaults(), tube = data.tube and tube or nil, @@ -122,6 +123,7 @@ function technic.register_generator(data) "technic_"..ltier.."_generator_side.png", "technic_"..ltier.."_generator_front_active.png"}, paramtype2 = "facedir", groups = active_groups, + connect_sides = {"bottom"}, legacy_facedir_simple = true, sounds = default.node_sound_wood_defaults(), tube = data.tube and tube or nil, diff --git a/technic/machines/register/machine_base.lua b/technic/machines/register/machine_base.lua index 0c46261..8cf851b 100644 --- a/technic/machines/register/machine_base.lua +++ b/technic/machines/register/machine_base.lua @@ -15,6 +15,8 @@ local tube = { connect_sides = {left = 1, right = 1, back = 1, top = 1, bottom = 1}, } +local connect_default = {"bottom", "back", "left", "right"} + local function round(v) return math.floor(v + 0.5) end @@ -27,15 +29,13 @@ function technic.register_base_machine(data) local tier = data.tier local ltier = string.lower(tier) - local groups = {cracky = 2, technic_machine = 1} - local active_groups = {cracky = 2, technic_machine = 1, not_in_creative_inventory = 1} + local groups = {cracky = 2, technic_machine = 1, ["technic_"..ltier] = 1} if data.tube then groups.tubedevice = 1 groups.tubedevice_receiver = 1 - active_groups.tubedevice = 1 - active_groups.tubedevice_receiver = 1 end - + local active_groups = {not_in_creative_inventory = 1} + for k, v in pairs(groups) do active_groups[k] = v end local formspec = "invsize[8,9;]".. @@ -145,6 +145,7 @@ function technic.register_base_machine(data) paramtype2 = "facedir", groups = groups, tube = data.tube and tube or nil, + connect_sides = data.connect_sides or connect_default, legacy_facedir_simple = true, sounds = default.node_sound_wood_defaults(), on_construct = function(pos) @@ -179,6 +180,7 @@ function technic.register_base_machine(data) paramtype2 = "facedir", drop = "technic:"..ltier.."_"..machine_name, groups = active_groups, + connect_sides = data.connect_sides or connect_default, legacy_facedir_simple = true, sounds = default.node_sound_wood_defaults(), tube = data.tube and tube or nil, diff --git a/technic/machines/register/solar_array.lua b/technic/machines/register/solar_array.lua index 39f50d2..cc6ffc8 100644 --- a/technic/machines/register/solar_array.lua +++ b/technic/machines/register/solar_array.lua @@ -42,7 +42,8 @@ function technic.register_solar_array(data) tiles = {"technic_"..ltier.."_solar_array_top.png", "technic_"..ltier.."_solar_array_bottom.png", "technic_"..ltier.."_solar_array_side.png", "technic_"..ltier.."_solar_array_side.png", "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}, + groups = {snappy=2, choppy=2, oddly_breakable_by_hand=2, technic_machine=1, ["technic_"..ltier]=1}, + connect_sides = {"bottom"}, sounds = default.node_sound_wood_defaults(), description = S("Arrayed Solar %s Generator"):format(tier), active = false, diff --git a/technic/machines/supply_converter.lua b/technic/machines/supply_converter.lua index ffcd40d..055885d 100644 --- a/technic/machines/supply_converter.lua +++ b/technic/machines/supply_converter.lua @@ -49,14 +49,10 @@ minetest.register_node("technic:supply_converter", { tiles = {"technic_supply_converter_top.png", "technic_supply_converter_bottom.png", "technic_supply_converter_side.png", "technic_supply_converter_side.png", "technic_supply_converter_side.png", "technic_supply_converter_side.png"}, - groups = {snappy=2, choppy=2, oddly_breakable_by_hand=2, technic_machine=1}, + groups = {snappy=2, choppy=2, oddly_breakable_by_hand=2, + technic_machine=1, technic_all_tiers=1}, + connect_sides = {"top", "bottom"}, sounds = default.node_sound_wood_defaults(), - drawtype = "nodebox", - paramtype = "light", - node_box = { - type = "fixed", - fixed = {-0.5, -0.5, -0.5, 0.5, 0.5, 0.5}, - }, on_construct = function(pos) local meta = minetest.get_meta(pos) meta:set_string("infotext", S("Supply Converter")) @@ -68,9 +64,9 @@ minetest.register_node("technic:supply_converter", { minetest.register_craft({ output = 'technic:supply_converter 1', recipe = { - {'technic:fine_gold_wire', 'technic:rubber', 'technic:doped_silicon_wafer'}, - {'technic:mv_transformer', 'technic:machine_casing', 'technic:lv_transformer'}, - {'technic:mv_cable0', 'technic:rubber', 'technic:lv_cable0'}, + {'technic:fine_gold_wire', 'technic:rubber', 'technic:doped_silicon_wafer'}, + {'technic:mv_transformer', 'technic:machine_casing', 'technic:lv_transformer'}, + {'technic:mv_cable', 'technic:rubber', 'technic:lv_cable'}, } }) diff --git a/technic/machines/switching_station.lua b/technic/machines/switching_station.lua index d6f23a3..dda08e8 100644 --- a/technic/machines/switching_station.lua +++ b/technic/machines/switching_station.lua @@ -38,9 +38,9 @@ local S = technic.getter minetest.register_craft({ output = "technic:switching_station", recipe = { - {"", "technic:lv_transformer", ""}, - {"default:copper_ingot", "technic:machine_casing", "default:copper_ingot"}, - {"technic:lv_cable0", "technic:lv_cable0", "technic:lv_cable0"} + {"", "technic:lv_transformer", ""}, + {"default:copper_ingot", "technic:machine_casing", "default:copper_ingot"}, + {"technic:lv_cable", "technic:lv_cable", "technic:lv_cable"} } }) @@ -49,14 +49,9 @@ minetest.register_node("technic:switching_station",{ tiles = {"technic_water_mill_top_active.png", "technic_water_mill_top_active.png", "technic_water_mill_top_active.png", "technic_water_mill_top_active.png", "technic_water_mill_top_active.png", "technic_water_mill_top_active.png"}, - groups = {snappy=2, choppy=2, oddly_breakable_by_hand=2}, + groups = {snappy=2, choppy=2, oddly_breakable_by_hand=2, technic_all_tiers=1}, + connect_sides = {"bottom"}, sounds = default.node_sound_wood_defaults(), - drawtype = "nodebox", - paramtype = "light", - node_box = { - type = "fixed", - fixed = {-0.5, -0.5, -0.5, 0.5, 0.5, 0.5}, - }, on_construct = function(pos) local meta = minetest.get_meta(pos) meta:set_string("infotext", S("Switching Station"))