diff --git a/basic_machines/chest.lua b/basic_machines/chest.lua index a072764..7e16f51 100644 --- a/basic_machines/chest.lua +++ b/basic_machines/chest.lua @@ -232,12 +232,6 @@ minetest.register_node("techage:chest_ta4", { sounds = default.node_sound_wood_defaults(), }) -minetest.register_craft({ - type = "shapeless", - output = "techage:chest_ta2", - recipe = {"default:chest", "techage:tubeS", "default:steel_ingot"} -}) - techage.register_node("techage:chest_ta2", {"techage:chest_ta3", "techage:chest_ta4"}, { on_pull_item = function(pos, in_dir, num) local meta = minetest.get_meta(pos) @@ -276,3 +270,10 @@ techage.register_node("techage:chest_ta2", {"techage:chest_ta3", "techage:chest_ end end, }) + + +minetest.register_craft({ + type = "shapeless", + output = "techage:chest_ta2", + recipe = {"default:chest", "techage:tubeS", "techage:iron_ingot"} +}) diff --git a/basic_machines/distributor.lua b/basic_machines/distributor.lua index a27f0e3..9ff7970 100644 --- a/basic_machines/distributor.lua +++ b/basic_machines/distributor.lua @@ -417,10 +417,10 @@ local node_name_ta2, node_name_ta3, node_name_ta4 = }) minetest.register_craft({ - output = node_name_ta2, + output = node_name_ta2.." 2", recipe = { - {"group:wood", "default:steel_ingot", "group:wood"}, - {"tubelib:tubeS", "default:mese_crystal", "tubelib:tubeS"}, - {"group:wood", "default:steel_ingot", "group:wood"}, + {"group:wood", "techage:iron_ingot", "group:wood"}, + {"techage:tubeS", "default:mese_crystal", "techage:tubeS"}, + {"group:wood", "techage:iron_ingot", "group:wood"}, }, }) diff --git a/basic_machines/gravelsieve.lua b/basic_machines/gravelsieve.lua index f151634..c6db90b 100644 --- a/basic_machines/gravelsieve.lua +++ b/basic_machines/gravelsieve.lua @@ -260,8 +260,8 @@ local node_name_ta2, node_name_ta3, node_name_ta4 = minetest.register_craft({ output = node_name_ta2, recipe = { - {"group:wood", "default:tin_ingot", "group:wood"}, - {"tubelib:tubeS", "default:steel_ingot", "tubelib:tubeS"}, - {"group:wood", "default:tin_ingot", "group:wood"}, + {"group:wood", "default:mese_crystal", "group:wood"}, + {"techage:tubeS", "techage:sieve", "techage:tubeS"}, + {"group:wood", "techage:iron_ingot", "group:wood"}, }, }) diff --git a/basic_machines/grinder.lua b/basic_machines/grinder.lua index a670980..bd6a496 100644 --- a/basic_machines/grinder.lua +++ b/basic_machines/grinder.lua @@ -254,9 +254,9 @@ local node_name_ta2, node_name_ta3, node_name_ta4 = minetest.register_craft({ output = node_name_ta2, recipe = { - {"group:wood", "default:tin_ingot", "group:wood"}, - {"tubelib:tubeS", "default:mese_crystal", "tubelib:tubeS"}, - {"group:wood", "default:tin_ingot", "group:wood"}, + {"group:wood", "default:mese_crystal", "group:wood"}, + {"techage:tubeS", "techage:hammer_steel", "techage:tubeS"}, + {"group:wood", "techage:iron_ingot", "group:wood"}, }, }) diff --git a/basic_machines/pusher.lua b/basic_machines/pusher.lua index 746ea89..3490f53 100644 --- a/basic_machines/pusher.lua +++ b/basic_machines/pusher.lua @@ -174,8 +174,8 @@ local node_name_ta2, node_name_ta3, node_name_ta4 = minetest.register_craft({ output = node_name_ta2.." 2", recipe = { - {"group:wood", "wool:dark_green", "group:wood"}, - {"tubelib:tubeS", "default:mese_crystal", "tubelib:tubeS"}, - {"group:wood", "wool:dark_green", "group:wood"}, + {"group:wood", "wool:dark_green", "group:wood"}, + {"techage:tubeS", "default:mese_crystal", "techage:tubeS"}, + {"group:wood", "techage:iron_ingot", "group:wood"}, }, }) diff --git a/coal_power_station/gearbox.lua b/coal_power_station/cooler.lua similarity index 100% rename from coal_power_station/gearbox.lua rename to coal_power_station/cooler.lua diff --git a/init.lua b/init.lua index 95674f3..43b3553 100644 --- a/init.lua +++ b/init.lua @@ -2,78 +2,94 @@ techage = { NodeDef = {}, -- node registration info } +if minetest.global_exists("tubelib") then + minetest.log("error", "[techage] Techage can't be used together with the mod tubelib!") +elseif minetest.global_exists("ironage") then + minetest.log("error", "[techage] Techage can't be used together with the mod ironage!") +elseif minetest.global_exists("techpack") then + minetest.log("error", "[techage] Techage can't be used together with the modpack techpack!") +else + techage.max_num_forceload_blocks = tonumber(minetest.setting_get("techage_max_num_forceload_blocks")) or 12 + techage.basalt_stone_enabled = minetest.setting_get("techage_basalt_stone_enabled") == "true" + techage.machine_aging_value = tonumber(minetest.setting_get("techage_machine_aging_value")) or 100 + techage.ore_rarity = tonumber(minetest.setting_get("techage_ore_rarity")) or 1 + techage.modified_recipes_enabled = minetest.setting_get("techage_modified_recipes_enabled") == "true" -techage.max_num_forceload_blocks = tonumber(minetest.setting_get("techage_max_num_forceload_blocks")) or 12 -techage.basalt_stone_enabled = minetest.setting_get("techage_basalt_stone_enabled") == "true" -techage.machine_aging_value = tonumber(minetest.setting_get("techage_machine_aging_value")) or 100 -techage.ore_rarity = tonumber(minetest.setting_get("techage_ore_rarity")) or 1 -techage.modified_recipes_enabled = minetest.setting_get("techage_modified_recipes_enabled") == "true" + local MP = minetest.get_modpath("techage") -local MP = minetest.get_modpath("techage") + -- Load support for intllib. + dofile(MP.."/basis/intllib.lua") --- Load support for intllib. -dofile(MP.."/basis/intllib.lua") + -- Basis features + dofile(MP.."/basis/lib.lua") -- helper functions + dofile(MP.."/basis/guide.lua") -- construction guide + dofile(MP.."/basis/power.lua") -- power distribution + dofile(MP.."/basis/node_states.lua") -- state model + dofile(MP.."/basis/trowel.lua") -- hidden networks + dofile(MP.."/basis/junction.lua") -- network junction box + dofile(MP.."/basis/tubes.lua") -- tubelib replacement + dofile(MP.."/basis/command.lua") -- tubelib replacement + dofile(MP.."/basis/consumer.lua") -- consumer base model + dofile(MP.."/basis/firebox.lua") -- common firebox functions --- Basis features -dofile(MP.."/basis/lib.lua") -- helper functions -dofile(MP.."/basis/guide.lua") -- construction guide -dofile(MP.."/basis/power.lua") -- power distribution -dofile(MP.."/basis/node_states.lua") -dofile(MP.."/basis/trowel.lua") -- hidden networks -dofile(MP.."/basis/junction.lua") -- network junction box -dofile(MP.."/basis/tubes.lua") -- tubelib replacement -dofile(MP.."/basis/command.lua") -- tubelib replacement -dofile(MP.."/basis/consumer.lua") -- consumer base model -dofile(MP.."/basis/steam_pipe.lua") -dofile(MP.."/basis/firebox.lua") + -- Power networks + dofile(MP.."/power/drive_axle.lua") + dofile(MP.."/power/steam_pipe.lua") + dofile(MP.."/power/biogas_pipe.lua") + dofile(MP.."/power/electric_cable.lua") --- Iron Age -dofile(MP.."/iron_age/main.lua") -dofile(MP.."/iron_age/gravelsieve.lua") -dofile(MP.."/iron_age/hammer.lua") -dofile(MP.."/iron_age/lighter.lua") -dofile(MP.."/iron_age/charcoalpile.lua") -dofile(MP.."/iron_age/coalburner.lua") -dofile(MP.."/iron_age/meltingpot.lua") -if techage.modified_recipes_enabled then - dofile(MP.."/iron_age/tools.lua") -end -dofile(MP.."/iron_age/recipes.lua") -dofile(MP.."/iron_age/help.lua") -if minetest.global_exists("wielded_light") then - dofile(MP.."/iron_age/meridium.lua") -end + -- Iron Age + dofile(MP.."/iron_age/main.lua") + dofile(MP.."/iron_age/gravelsieve.lua") + dofile(MP.."/iron_age/hammer.lua") + dofile(MP.."/iron_age/lighter.lua") + dofile(MP.."/iron_age/charcoalpile.lua") + dofile(MP.."/iron_age/coalburner.lua") + dofile(MP.."/iron_age/meltingpot.lua") + if techage.modified_recipes_enabled then + dofile(MP.."/iron_age/tools.lua") + end + dofile(MP.."/iron_age/recipes.lua") + dofile(MP.."/iron_age/help.lua") + if minetest.global_exists("wielded_light") then + dofile(MP.."/iron_age/meridium.lua") + end --- Steam Engine -dofile(MP.."/steam_engine/drive_axle.lua") -dofile(MP.."/steam_engine/firebox.lua") -dofile(MP.."/steam_engine/boiler.lua") -dofile(MP.."/steam_engine/cylinder.lua") -dofile(MP.."/steam_engine/flywheel.lua") -dofile(MP.."/steam_engine/gearbox.lua") -dofile(MP.."/steam_engine/consumer.lua") -dofile(MP.."/steam_engine/battery.lua") + -- Steam Engine + dofile(MP.."/steam_engine/firebox.lua") + dofile(MP.."/steam_engine/boiler.lua") + dofile(MP.."/steam_engine/cylinder.lua") + dofile(MP.."/steam_engine/flywheel.lua") + dofile(MP.."/steam_engine/gearbox.lua") + dofile(MP.."/steam_engine/consumer.lua") + dofile(MP.."/steam_engine/battery.lua") -dofile(MP.."/electric/electric_cable.lua") -dofile(MP.."/electric/test.lua") -dofile(MP.."/electric/generator.lua") -dofile(MP.."/electric/consumer.lua") + -- Basic Machines + dofile(MP.."/basic_machines/pusher.lua") + dofile(MP.."/basic_machines/legacy_nodes.lua") + dofile(MP.."/basic_machines/grinder.lua") + dofile(MP.."/basic_machines/distributor.lua") + dofile(MP.."/basic_machines/gravelsieve.lua") + dofile(MP.."/basic_machines/chest.lua") --- Basic Machines -dofile(MP.."/basic_machines/pusher.lua") -dofile(MP.."/basic_machines/legacy_nodes.lua") -dofile(MP.."/basic_machines/grinder.lua") -dofile(MP.."/basic_machines/distributor.lua") -dofile(MP.."/basic_machines/gravelsieve.lua") -dofile(MP.."/basic_machines/chest.lua") - --- Coal power station -dofile(MP.."/coal_power_station/firebox.lua") + -- Coal power station + dofile(MP.."/coal_power_station/firebox.lua") + --dofile(MP.."/coal_power_station/boiler.lua") + --dofile(MP.."/coal_power_station/generator.lua") + --dofile(MP.."/coal_power_station/turbine.lua") + --dofile(MP.."/coal_power_station/cooler.lua") ---dofile(MP.."/fermenter/biogas_pipe.lua") ---dofile(MP.."/fermenter/gasflare.lua") ---dofile(MP.."/nodes/test.lua") ---dofile(MP.."/mechanic/perf_test.lua") + --dofile(MP.."/test/test.lua") + --dofile(MP.."/test/generator.lua") + --dofile(MP.."/test/consumer.lua") + + + --dofile(MP.."/fermenter/gasflare.lua") + + + --dofile(MP.."/nodes/test.lua") + --dofile(MP.."/mechanic/perf_test.lua") +end \ No newline at end of file diff --git a/iron_age/gravelsieve.lua b/iron_age/gravelsieve.lua index c8a82f2..5dfa2c8 100644 --- a/iron_age/gravelsieve.lua +++ b/iron_age/gravelsieve.lua @@ -336,14 +336,6 @@ minetest.register_craft({ }, }) -minetest.register_craft({ - output = "techage:auto_sieve", - type = "shapeless", - recipe = { - "techage:sieve", "default:mese_crystal", "default:mese_crystal", - }, -}) - minetest.register_craft({ output = "techage:compressed_gravel", recipe = { diff --git a/fermenter/biogas_pipe.lua b/power/biogas_pipe.lua similarity index 99% rename from fermenter/biogas_pipe.lua rename to power/biogas_pipe.lua index 1854203..1550fc4 100644 --- a/fermenter/biogas_pipe.lua +++ b/power/biogas_pipe.lua @@ -8,7 +8,7 @@ LGPLv2.1+ See LICENSE.txt for more information - Biogas pipes + TA4 Biogas pipes ]]-- diff --git a/steam_engine/drive_axle.lua b/power/drive_axle.lua similarity index 95% rename from steam_engine/drive_axle.lua rename to power/drive_axle.lua index 3530330..2aa4eee 100644 --- a/steam_engine/drive_axle.lua +++ b/power/drive_axle.lua @@ -175,3 +175,12 @@ minetest.register_node("techage:axle_on", { groups = {not_in_creative_inventory = 1}, sounds = default.node_sound_wood_defaults(), }) + +minetest.register_craft({ + output = "techage:axle 3", + recipe = { + {"default:junglewood", "", "default:wood"}, + {"", "techage:iron_ingot", ""}, + {"default:wood", "", "default:junglewood"}, + }, +}) diff --git a/electric/electric_cable.lua b/power/electric_cable.lua similarity index 98% rename from electric/electric_cable.lua rename to power/electric_cable.lua index 2fe500b..65523b4 100644 --- a/electric/electric_cable.lua +++ b/power/electric_cable.lua @@ -8,7 +8,7 @@ LGPLv2.1+ See LICENSE.txt for more information - Cable and junction box for electrical power distribution + TA3/TA4 Cable and junction box for electrical power distribution ]]-- diff --git a/basis/steam_pipe.lua b/power/steam_pipe.lua similarity index 94% rename from basis/steam_pipe.lua rename to power/steam_pipe.lua index adb2ea4..16d42ec 100644 --- a/basis/steam_pipe.lua +++ b/power/steam_pipe.lua @@ -113,3 +113,11 @@ minetest.register_node("techage:steam_pipeA", { drop = "techage:steam_pipeS", }) +minetest.register_craft({ + output = "techage:steam_pipeS 3", + recipe = { + {'', '', "default:bronze_ingot"}, + {'', 'techage:iron_ingot', ''}, + {"default:bronze_ingot", '', ''}, + }, +}) diff --git a/sounds/techage_steamengine.ogg b/sounds/techage_steamengine.ogg new file mode 100644 index 0000000..ad98cd9 Binary files /dev/null and b/sounds/techage_steamengine.ogg differ diff --git a/steam_engine/boiler.lua b/steam_engine/boiler.lua index c3e669c..13dca88 100644 --- a/steam_engine/boiler.lua +++ b/steam_engine/boiler.lua @@ -298,3 +298,20 @@ minetest.register_node("techage:boiler2", { sounds = default.node_sound_metal_defaults(), }) +minetest.register_craft({ + output = "techage:boiler1", + recipe = { + {"techage:iron_ingot", "", "techage:iron_ingot"}, + {"default:bronze_ingot", "", "default:bronze_ingot"}, + {"techage:iron_ingot", "default:bronze_ingot", "techage:iron_ingot"}, + }, +}) + +minetest.register_craft({ + output = "techage:boiler2", + recipe = { + {"techage:iron_ingot", "techage:steam_pipeS", "techage:iron_ingot"}, + {"default:bronze_ingot", "", "default:bronze_ingot"}, + {"techage:iron_ingot", "", "techage:iron_ingot"}, + }, +}) diff --git a/steam_engine/cylinder.lua b/steam_engine/cylinder.lua index 72e0334..ed4b022 100644 --- a/steam_engine/cylinder.lua +++ b/steam_engine/cylinder.lua @@ -53,10 +53,19 @@ local function start_cylinder(pos, on) if on and mem.running then consumer.turn_power_on(pos, POWER_CONSUMPTION) swap_node(pos, "techage:cylinder_on") + mem.handle = minetest.sound_play("techage_steamengine", { + pos = pos, + max_hear_distance = 4, + gain = 0.7, + loop = true}) return true else consumer.turn_power_on(pos, 0) swap_node(pos, "techage:cylinder") + if mem.handle then + minetest.sound_stop(mem.handle) + mem.handle = nil + end end return false end @@ -147,3 +156,26 @@ minetest.register_node("techage:cylinder_on", { sounds = default.node_sound_wood_defaults(), }) +minetest.register_craft({ + output = "techage:cylinder", + recipe = { + {"basic_materials:steel_bar", "techage:iron_ingot", "default:wood"}, + {"techage:steam_pipeS", "basic_materials:gear_steel", ""}, + {"default:wood", "techage:iron_ingot", "basic_materials:steel_bar"}, + }, +}) + +minetest.register_lbm({ + label = "[techage] Steam engine sound", + name = "techage:steam_engine", + nodenames = {"techage:cylinder_on"}, + run_at_every_load = true, + action = function(pos, node) + local mem = tubelib2.get_mem(pos) + mem.handle = minetest.sound_play("techage_steamengine", { + pos = pos, + max_hear_distance = 4, + gain = 0.7, + loop = true}) + end +}) diff --git a/steam_engine/firebox.lua b/steam_engine/firebox.lua index 8c08994..6962ab4 100644 --- a/steam_engine/firebox.lua +++ b/steam_engine/firebox.lua @@ -135,3 +135,11 @@ minetest.register_node("techage:firebox_on", { on_rightclick = firebox.on_rightclick, }) +minetest.register_craft({ + output = "techage:firebox", + recipe = { + {'group:stone', 'group:stone', 'group:stone'}, + {'techage:iron_ingot', '', 'techage:iron_ingot'}, + {'group:stone', 'group:stone', 'group:stone'}, + }, +}) diff --git a/steam_engine/flywheel.lua b/steam_engine/flywheel.lua index 74bf475..774a44c 100644 --- a/steam_engine/flywheel.lua +++ b/steam_engine/flywheel.lua @@ -26,7 +26,7 @@ local I,_ = dofile(MP.."/intllib.lua") local STANDBY_TICKS = 4 local COUNTDOWN_TICKS = 4 local CYCLE_TIME = 8 -local POWER_CAPACITY = 8 +local POWER_CAPACITY = 12 local Axle = techage.Axle local generator = techage.generator @@ -149,6 +149,7 @@ minetest.register_node("techage:flywheel", { turn_on = turn_power_on, read_power_consumption = generator.read_power_consumption, power_network = Axle, + power_side = "R", animated_power_network = true, }, @@ -217,6 +218,7 @@ minetest.register_node("techage:flywheel_on", { turn_on = turn_power_on, read_power_consumption = generator.read_power_consumption, power_network = Axle, + power_side = "R", animated_power_network = true, }, @@ -237,3 +239,12 @@ minetest.register_node("techage:flywheel_on", { is_ground_content = false, sounds = default.node_sound_wood_defaults(), }) + +minetest.register_craft({ + output = "techage:flywheel", + recipe = { + {"basic_materials:steel_bar", "dye:red", "default:wood"}, + {"", "basic_materials:gear_steel", "techage:axle"}, + {"default:wood", "techage:iron_ingot", "basic_materials:steel_bar"}, + }, +}) diff --git a/steam_engine/gearbox.lua b/steam_engine/gearbox.lua index 027c660..bddcd85 100644 --- a/steam_engine/gearbox.lua +++ b/steam_engine/gearbox.lua @@ -99,3 +99,11 @@ minetest.register_node("techage:gearbox_on", { sounds = default.node_sound_wood_defaults(), }) +minetest.register_craft({ + output = "techage:gearbox 2", + recipe = { + {"default:junglewood", "techage:axle", "default:wood"}, + {"techage:axle", "techage:iron_ingot", "techage:axle"}, + {"default:wood", "techage:axle", "default:junglewood"}, + }, +})