diff --git a/technic/config.lua b/technic/config.lua index bb748ec..67f4984 100644 --- a/technic/config.lua +++ b/technic/config.lua @@ -4,7 +4,7 @@ local conf_table = technic.config:to_table() local defaults = { enable_mining_drill = "true", - enable_mining_laser = "true", + enable_mining_laser = "false", enable_flashlight = "false", enable_wind_mill = "false", enable_frames = "false", diff --git a/technic/machines/HV/compressor.lua b/technic/machines/HV/compressor.lua new file mode 100644 index 0000000..12e165b --- /dev/null +++ b/technic/machines/HV/compressor.lua @@ -0,0 +1,12 @@ +-- HV compressor + +minetest.register_craft({ + output = 'technic:hv_compressor', + recipe = { + {'technic:carbon_plate', 'technic:mv_compressor', 'technic:composite_plate'}, + {'pipeworks:tube_1', 'technic:hv_transformer', 'pipeworks:tube_1'}, + {'technic:stainless_steel_ingot', 'technic:hv_cable', 'technic:stainless_steel_ingot'}, + } +}) + +technic.register_compressor({tier = "HV", demand = {1500, 1000, 750}, speed = 5, upgrade = 1, tube = 1}) diff --git a/technic/machines/HV/electric_furnace.lua b/technic/machines/HV/electric_furnace.lua new file mode 100644 index 0000000..57a3cd1 --- /dev/null +++ b/technic/machines/HV/electric_furnace.lua @@ -0,0 +1,18 @@ +-- 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. + +-- FIXME: kpoppel I'd like to introduce an induction heating element here also +minetest.register_craft({ + output = 'technic:hv_electric_furnace', + recipe = { + {'technic:stainless_steel_ingot', 'technic:mv_electric_furnace', 'technic:stainless_steel_ingot'}, + {'pipeworks:tube_1', 'technic:hv_transformer', 'pipeworks:tube_1'}, + {'technic:stainless_steel_ingot', 'technic:hv_cable', 'technic:stainless_steel_ingot'}, + } +}) + +technic.register_electric_furnace({tier="HV", upgrade=1, tube=1, demand={4000, 2500, 1500}, speed=12}) + diff --git a/technic/machines/HV/forcefield.lua b/technic/machines/HV/forcefield.lua index 7395284..29c023d 100644 --- a/technic/machines/HV/forcefield.lua +++ b/technic/machines/HV/forcefield.lua @@ -121,6 +121,12 @@ local function set_forcefield_formspec(meta) end local forcefield_receive_fields = function(pos, formname, fields, sender) + local player_name = sender:get_player_name() + if minetest.is_protected(pos, player_name) then + minetest.chat_send_player(player_name, "You are not allowed to edit this!") + minetest.record_protection_violation(pos, player_name) + return + end local meta = minetest.get_meta(pos) local range = nil if fields.range then diff --git a/technic/machines/HV/grinder.lua b/technic/machines/HV/grinder.lua new file mode 100644 index 0000000..89dfc31 --- /dev/null +++ b/technic/machines/HV/grinder.lua @@ -0,0 +1,13 @@ +-- HV grinder + +minetest.register_craft({ + output = 'technic:hv_grinder', + recipe = { + {'technic:carbon_plate', 'technic:mv_grinder', 'technic:composite_plate'}, + {'pipeworks:tube_1', 'technic:hv_transformer', 'pipeworks:tube_1'}, + {'technic:stainless_steel_ingot', 'technic:hv_cable', 'technic:stainless_steel_ingot'}, + } +}) + +technic.register_grinder({tier="HV", demand={1200, 900, 600}, speed=5, upgrade=1, tube=1}) + diff --git a/technic/machines/HV/init.lua b/technic/machines/HV/init.lua index d7136b4..93cd7b7 100644 --- a/technic/machines/HV/init.lua +++ b/technic/machines/HV/init.lua @@ -15,4 +15,8 @@ dofile(path.."/generator.lua") -- Machines dofile(path.."/quarry.lua") dofile(path.."/forcefield.lua") +dofile(path.."/electric_furnace.lua") +dofile(path.."/grinder.lua") +dofile(path.."/compressor.lua") + diff --git a/technic/machines/HV/quarry.lua b/technic/machines/HV/quarry.lua index b6f9c14..6a5c44b 100644 --- a/technic/machines/HV/quarry.lua +++ b/technic/machines/HV/quarry.lua @@ -60,6 +60,12 @@ local function set_quarry_demand(meta) end local function quarry_receive_fields(pos, formname, fields, sender) + local player_name = sender:get_player_name() + if minetest.is_protected(pos, player_name) then + minetest.chat_send_player(player_name, "You are not allowed to edit this!") + minetest.record_protection_violation(pos, player_name) + return + end local meta = minetest.get_meta(pos) if fields.size and string.find(fields.size, "^[0-9]+$") then local size = tonumber(fields.size) @@ -81,8 +87,12 @@ end local function quarry_handle_purge(pos) local meta = minetest.get_meta(pos) local inv = meta:get_inventory() + local cache = inv:get_list("cache") + if not cache then + return + end local i = 0 - for _,stack in ipairs(inv:get_list("cache")) do + for _,stack in ipairs(cache) do i = i + 1 if stack then local item = stack:to_table() @@ -160,10 +170,11 @@ local function quarry_run(pos, node) end if can_dig then + -- test above blocks if diggable for ay = startpos.y, digpos.y+1, -1 do local checkpos = {x=digpos.x, y=ay, z=digpos.z} local checknode = technic.get_or_load_node(checkpos) or minetest.get_node(checkpos) - if checknode.name ~= "air" then + if checknode.name ~= "air" and checknode.name ~= "vacuum:vacuum" then can_dig = false break end diff --git a/technic/machines/LV/init.lua b/technic/machines/LV/init.lua index fde684d..dd33293 100644 --- a/technic/machines/LV/init.lua +++ b/technic/machines/LV/init.lua @@ -22,3 +22,5 @@ dofile(path.."/extractor.lua") dofile(path.."/compressor.lua") dofile(path.."/music_player.lua") + +dofile(path.."/lamp.lua") diff --git a/technic/machines/LV/lamp.lua b/technic/machines/LV/lamp.lua new file mode 100644 index 0000000..5e8ee8c --- /dev/null +++ b/technic/machines/LV/lamp.lua @@ -0,0 +1,250 @@ +-- LV LED and LV LED Lamp +-- LED - a weak light source, intended primarily as a core component for LED lamps +-- LED Lamp - a powerful light source, illuminating a 7x7x3(H) volume below itself +-- with light bright as the sun. + +local S = technic.getter + + +local illuminate = function(pos, mode) + local loc = {} +-- loc.x, loc.y, loc.z = pos.x, pos.y, pos.z + for y=1,3,1 do + for x=-3,3,1 do + for z = -3,3,1 do + loc = {x = pos.x - x, y = pos.y - y, z = pos.z - z} + if mode then + if minetest.get_node(loc).name == "air" then + minetest.swap_node(loc, {name = "technic:dummy_light_source"}) + end + else + if minetest.get_node(loc).name == "technic:dummy_light_source" then + minetest.swap_node(loc, {name = "air"}) + end + end + end + end + end +end + + +local led_on = function(pos, node) + local meta = minetest.get_meta(pos) + local eu_input = meta:get_int("LV_EU_input") + local machine_name = S("%s LED"):format("LV") + local machine_node = "technic:lv_led" + local demand = 5 + + if eu_input < demand then + technic.swap_node(pos, machine_node) + meta:set_string("infotext", S("%s Unpowered"):format(machine_name)) + elseif eu_input >= demand then + technic.swap_node(pos, machine_node.."_active") + meta:set_string("infotext", S("%s Active"):format(machine_name)) + end + meta:set_int("LV_EU_demand", demand) +end + +local led_off = function(pos, node) + local meta = minetest.get_meta(pos) + local eu_input = meta:get_int("LV_EU_input") + local machine_name = S("%s LED"):format("LV") + local machine_node = "technic:lv_led" + + technic.swap_node(pos, machine_node) + meta:set_string("infotext", S("%s Unpowered"):format(machine_name)) + + meta:set_int("LV_EU_demand", 0) +end + + + +local lamp_on = function(pos, node) + local meta = minetest.get_meta(pos) + local eu_input = meta:get_int("LV_EU_input") + local machine_name = S("%s Lamp"):format("LV") + local machine_node = "technic:lv_lamp" + local demand = 50 + + if eu_input < demand then + technic.swap_node(pos, machine_node) + meta:set_string("infotext", S("%s Unpowered"):format(machine_name)) + illuminate(pos, false) + elseif eu_input >= demand then + technic.swap_node(pos, machine_node.."_active") + meta:set_string("infotext", S("%s Active"):format(machine_name)) + illuminate(pos, true) + end + meta:set_int("LV_EU_demand", demand) +end + +local lamp_off = function(pos, node) + local meta = minetest.get_meta(pos) + local eu_input = meta:get_int("LV_EU_input") + local machine_name = S("%s Lamp"):format("LV") + local machine_node = "technic:lv_lamp" + + illuminate(pos, false) + technic.swap_node(pos, machine_node) + meta:set_string("infotext", S("%s Unpowered"):format(machine_name)) + meta:set_int("LV_EU_demand", 0) +end + + +minetest.register_node("technic:dummy_light_source", { + description = S("Dummy light source node"), + node_box = { + type = "fixed", + fixed = {} + }, + collision_box = { + type = "fixed", + fixed = {} + }, + selection_box = { + type = "fixed", + fixed = {} + }, + drawtype = "airlike", + buildable_to = true, + light_source = 14, + sunlight_propagates = true, + diggable = false, + walkable = false, + groups = { not_in_creative_inventory = 1 } +}) + +minetest.register_node("technic:lv_led", { + description = S("LV LED"), + drawtype = "nodebox", + node_box = { + type = "fixed", + fixed = {0.2,0.2,0.2,-0.2,-0.2,-0.2} + }, + collision_box = { + type = "fixed", + fixed = {0.2,0.2,0.2,-0.2,-0.2,-0.2} + }, + selection_box = { + type = "fixed", + fixed = {0.2,0.2,0.2,-0.2,-0.2,-0.2} + }, + tiles = {"technic_lv_led.png"}, + inventory_image = "technic_lv_led_inv.png", + sunlight_propagates = true, + groups = {cracky=2, technic_machine=1, technic_lv=1}, + connect_sides = {"front", "back", "left", "right", "top", "bottom"}, + can_dig = technic.machine_can_dig, + technic_run = led_on, + on_construct = function(pos) + local meta = minetest.get_meta(pos) + meta:set_string("infotext", S("%s LED"):format("LV")) + end, + drop = "technic:lv_led" +}) + +minetest.register_node("technic:lv_led_active", { + description = S("LV LED Active"), + drawtype = "nodebox", + node_box = { + type = "fixed", + fixed = {0.2,0.2,0.2,-0.2,-0.2,-0.2} + }, + collision_box = { + type = "fixed", + fixed = {0.2,0.2,0.2,-0.2,-0.2,-0.2} + }, + selection_box = { + type = "fixed", + fixed = {0.2,0.2,0.2,-0.2,-0.2,-0.2} + }, + tiles = {"technic_lv_led.png"}, + light_source = 9, + sunlight_propagates = true, + groups = {cracky=2, technic_machine=1, technic_lv=1, not_in_creative_inventory=1}, + connect_sides = {"front", "back", "left", "right", "top", "bottom"}, + can_dig = technic.machine_can_dig, + technic_run = led_on, + technic_on_disable = led_off, + drop = "technic:lv_led" +}) + + +minetest.register_node("technic:lv_lamp", { + description = S("%s Lamp"):format("LV"), + drawtype = "nodebox", + node_box = { + type = "fixed", + fixed = {0.5,0.5,0.5,-0.5,-0.2,-0.5} + }, + collision_box = { + type = "fixed", + fixed = {0.5,0.5,0.5,-0.5,-0.2,-0.5} + }, + selection_box = { + type = "fixed", + fixed = {0.5,0.5,0.5,-0.5,-0.2,-0.5} + }, + tiles = {"technic_lv_lamp_top.png", "technic_lv_lamp_bottom.png", "technic_lv_lamp_side.png", + "technic_lv_lamp_side.png", "technic_lv_lamp_side.png", "technic_lv_lamp_side.png"}, + groups = {cracky=2, technic_machine=1, technic_lv=1}, + connect_sides = {"front", "back", "left", "right", "top",}, + can_dig = technic.machine_can_dig, + technic_run = lamp_on, + on_destruct = lamp_off, + on_construct = function(pos) + local meta = minetest.get_meta(pos) + meta:set_string("infotext", S("%s Lamp"):format("LV")) + end, +}) + + +minetest.register_node("technic:lv_lamp_active", { + description = S("%s Lamp Active"):format("LV"), + drawtype = "nodebox", + node_box = { + type = "fixed", + fixed = {0.5,0.5,0.5,-0.5,-0.2,-0.5} + }, + collision_box = { + type = "fixed", + fixed = {0.5,0.5,0.5,-0.5,-0.2,-0.5} + }, + selection_box = { + type = "fixed", + fixed = {0.5,0.5,0.5,-0.5,-0.2,-0.5} + }, + tiles = {"technic_lv_lamp_top.png", "technic_lv_lamp_bottom.png", "technic_lv_lamp_side.png", + "technic_lv_lamp_side.png", "technic_lv_lamp_side.png", "technic_lv_lamp_side.png"}, + groups = {cracky=2, technic_machine=1, technic_lv=1, not_in_creative_inventory=1}, + connect_sides = {"front", "back", "left", "right", "top"}, + light_source = 1, + can_dig = technic.machine_can_dig, + technic_run = lamp_on, + on_destruct = lamp_off, + technic_on_disable = lamp_off, +}) + +minetest.register_craft({ + output = 'technic:lv_led 2', + recipe = { + {'', 'homedecor:plastic_sheeting', ''}, + {'homedecor:plastic_sheeting', 'technic:doped_silicon_wafer', 'homedecor:plastic_sheeting'}, + {'', 'technic:fine_silver_wire', ''}, + }, +}) + +minetest.register_craft({ + output = 'technic:lv_lamp', + recipe = { + {'default:glass', 'default:glass', 'default:glass'}, + {'technic:lv_led', 'technic:lv_led', 'technic:lv_led'}, + {'mesecons_materials:glue', 'technic:lv_cable', 'mesecons_materials:glue'}, + }, +}) + +technic.register_machine("LV", "technic:lv_lamp", technic.receiver) +technic.register_machine("LV", "technic:lv_lamp_active", technic.receiver) + +technic.register_machine("LV", "technic:lv_led", technic.receiver) +technic.register_machine("LV", "technic:lv_led_active", technic.receiver) diff --git a/technic/machines/init.lua b/technic/machines/init.lua index f2e31c9..57cb9a9 100644 --- a/technic/machines/init.lua +++ b/technic/machines/init.lua @@ -7,6 +7,8 @@ dofile(path.."/LV/init.lua") dofile(path.."/MV/init.lua") dofile(path.."/HV/init.lua") + + dofile(path.."/switching_station.lua") dofile(path.."/power_monitor.lua") dofile(path.."/supply_converter.lua") diff --git a/technic/machines/register/alloy_recipes.lua b/technic/machines/register/alloy_recipes.lua index 8731b8e..70ffec0 100644 --- a/technic/machines/register/alloy_recipes.lua +++ b/technic/machines/register/alloy_recipes.lua @@ -30,6 +30,12 @@ local recipes = { {"technic:raw_latex 4", "technic:coal_dust 2", "technic:rubber 6", 2}, } +if minetest.get_modpath("ethereal") then + table.insert(recipes, {"default:clay", "dye:red", "bakedclay:red"}) + table.insert(recipes, {"default:clay", "dye:orange", "bakedclay:orange"}) + table.insert(recipes, {"default:clay", "dye:grey", "bakedclay:grey"}) +end + for _, data in pairs(recipes) do technic.register_alloy_recipe({input = {data[1], data[2]}, output = data[3], time = data[4]}) end diff --git a/technic/machines/register/centrifuge_recipes.lua b/technic/machines/register/centrifuge_recipes.lua index 4684ba0..6b887fa 100644 --- a/technic/machines/register/centrifuge_recipes.lua +++ b/technic/machines/register/centrifuge_recipes.lua @@ -15,7 +15,7 @@ local recipes = { { "technic:stainless_steel_dust 4", "technic:wrought_iron_dust 3", "technic:chromium_dust" }, { "technic:brass_dust 3", "technic:copper_dust 2", "technic:zinc_dust" }, { "technic:chernobylite_dust", "default:sand", "technic:uranium3_dust" }, - { "default:dirt 4", "default:sand", "default:gravel", "default:clay_lump 2" }, + { "default:dirt 4", "default:sand", "default:gravel", "default:clay_lump 4" }, } local function uranium_dust(p) @@ -32,7 +32,15 @@ if minetest.get_modpath("bushes_classic") then end if minetest.get_modpath("farming") then - table.insert(recipes, { "farming:wheat 4", "farming:seed_wheat 3", "default:dry_shrub 1" }) + if minetest.get_modpath("cottages") then + -- work as a mechanized threshing floor + table.insert(recipes, { "farming:wheat", "farming:seed_wheat", "cottages:straw_mat" }) + table.insert(recipes, { "farming:barley", "farming:seed_barley", "cottages:straw_mat" }) + else + -- work in a less fancy and less efficient manner + table.insert(recipes, { "farming:wheat 4", "farming:seed_wheat 3", "default:dry_shrub 1" }) + table.insert(recipes, { "farming:barley 4", "farming:seed_barley 3", "default:dry_shrub 1" }) + end end for _, data in pairs(recipes) do diff --git a/technic/machines/register/compressor_recipes.lua b/technic/machines/register/compressor_recipes.lua index acb9eca..3711db1 100644 --- a/technic/machines/register/compressor_recipes.lua +++ b/technic/machines/register/compressor_recipes.lua @@ -19,8 +19,15 @@ local recipes = { {"technic:coal_dust 4", "technic:graphite"}, {"technic:carbon_cloth", "technic:carbon_plate"}, {"technic:uranium35_ingot 5", "technic:uranium_fuel"}, + {"technic:graphite 25", "default:diamond"} } +if minetest.get_modpath("ethereal") then + -- the density of charcoal is ~1/10 of coal, otherwise it's pure carbon + table.insert(recipes, {"ethereal:charcoal_lump 10", "default:coal_lump 1"}) +end + + -- defuse the default sandstone recipe, since we have the compressor to take over in a more realistic manner minetest.clear_craft({ recipe = { diff --git a/technic/machines/register/extractor_recipes.lua b/technic/machines/register/extractor_recipes.lua index 54baa61..0747287 100644 --- a/technic/machines/register/extractor_recipes.lua +++ b/technic/machines/register/extractor_recipes.lua @@ -29,6 +29,53 @@ if minetest.get_modpath("dye") then {"bushes:blueberry", unifieddyes and "unifieddyes:magenta_s50 4" or "dye:magenta 4"}, } + if minetest.get_modpath("hunger") and minetest.get_modpath("ethereal") then + table.insert(dye_recipes, {"ethereal:willow_twig 12", "technic:aspirin_pill"}) + end + + if minetest.get_modpath("farming") then + -- Cottonseed oil: a fuel and a potent fertilizer (irl: pesticide) --- + -- hemp oil calls for 8 seeds, but extractor recipes are normally twice as potent + table.insert(dye_recipes, {"farming:seed_cotton 4", "technic:cottonseed_oil"}) + + -- Dyes --- + -- better recipes for farming's crafting methods (twice the output) + table.insert(dye_recipes, {"farming:chili_pepper", "dye:red 4"}) + table.insert(dye_recipes, {"farming:beans", "dye:green 4"}) + table.insert(dye_recipes, {"farming:grapes", "dye:violet 4"}) + table.insert(dye_recipes, {"farming:cocoa_beans", "dye:brown 4"}) + -- Some extra recipes: + -- Himalayan rhubarb root can give yellow dye IRL + table.insert(dye_recipes, {"farming:rhubarb", "dye:yellow 4"}) + table.insert(dye_recipes, {"farming:onion", "dye:yellow 4"}) + table.insert(dye_recipes, {"farming:blueberries", "dye:blue 4"}) + table.insert(dye_recipes, {"farming:raspberries", "dye:red 4"}) + end + + if minetest.get_modpath("ethereal") then + table.insert(dye_recipes, {"ethereal:seaweed", "dye:dark_green 6"}) + table.insert(dye_recipes, {"ethereal:coral2", "dye:cyan 6"}) + table.insert(dye_recipes, {"ethereal:coral3", "dye:orange 6"}) + table.insert(dye_recipes, {"ethereal:coral4", "dye:pink 6"}) + table.insert(dye_recipes, {"ethereal:coral5", "dye:green 6"}) + table.insert(dye_recipes, {"ethereal:fern", "dye:dark_green 4"}) + table.insert(dye_recipes, {"ethereal:snowygrass", "dye:grey 4"}) + table.insert(dye_recipes, {"ethereal:crystalgrass", "dye:blue 4"}) + end + + if minetest.get_modpath("bakedclay") then + table.insert(dye_recipes, {"bakedclay:delphinium", "dye:cyan 8"}) + table.insert(dye_recipes, {"bakedclay:thistle", "dye:magenta 8"}) + table.insert(dye_recipes, {"bakedclay:lazarus", "dye:pink 8"}) + table.insert(dye_recipes, {"bakedclay:mannagrass", "dye:dark_green 8"}) + end + + + if minetest.get_modpath("bonemeal") then + table.insert(dye_recipes, {"bonemeal:bone", "dye:white 8"}) + table.insert(dye_recipes, {"bonemeal:bonemeal", "dye:white 4"}) + end + for _, data in ipairs(dye_recipes) do technic.register_extractor_recipe({input = {data[1]}, output = data[2]}) end diff --git a/technic/machines/register/grinder_recipes.lua b/technic/machines/register/grinder_recipes.lua index ab70724..670372f 100644 --- a/technic/machines/register/grinder_recipes.lua +++ b/technic/machines/register/grinder_recipes.lua @@ -34,6 +34,11 @@ local recipes = { {"default:ice", "default:snowblock"}, } +if minetest.get_modpath("ethereal") then + -- the density of charcoal is ~1/10 of coal, otherwise it's the same graphitic carbon + table.insert(recipes, {"ethereal:charcoal_lump 5", "technic:coal_dust 1"}) +end + -- defuse the sandstone -> 4 sand recipe to avoid infinite sand bugs (also consult the inverse compressor recipe) minetest.clear_craft({ recipe = { diff --git a/technic/machines/switching_station.lua b/technic/machines/switching_station.lua index d645847..fb1fe05 100644 --- a/technic/machines/switching_station.lua +++ b/technic/machines/switching_station.lua @@ -227,6 +227,15 @@ minetest.register_chatcommand("powerctrl", { end }) +local check_timer = function(pos, meta, diff) + if diff > 500000 then + minetest.log("warning", "[technic] disabling switching station @ " .. minetest.pos_to_string(pos)) + meta:set_int("overload", 30) + meta:set_int("active", 0) + meta:set_string("infotext", "Overload detected!") + end +end + minetest.register_abm({ nodenames = {"technic:switching_station"}, label = "Switching Station", -- allows the mtt profiler to profile this abm individually @@ -234,6 +243,7 @@ minetest.register_abm({ chance = 1, action = function(pos, node, active_object_count, active_object_count_wider) if not technic.powerctrl_state then return end + local t0 = minetest.get_us_time() local meta = minetest.get_meta(pos) local meta1 = nil local pos1 = {} @@ -248,6 +258,18 @@ minetest.register_abm({ local RE_nodes local machine_name = S("Switching Station") + local overload = meta:get_int("overload") + if overload > 0 then + meta:set_int("overload", overload - 1) + meta:set_string("infotext", "Overload detected, resetting in " .. overload .. " seconds") + if overload == 1 then + -- re-enable in next step + meta:set_int("active", 1) + end + return + + end + -- Which kind of network are we on: pos1 = {x=pos.x, y=pos.y-1, z=pos.z} @@ -403,6 +425,13 @@ minetest.register_abm({ meta1:set_int(eu_input_str, math.floor(eu_demand * charge_factor)) --dprint("Charging battery:"..math.floor(eu_demand*charge_factor)) end + local t1 = minetest.get_us_time() + local diff = t1 - t0 + if diff > 50000 then + check_timer(pos, meta, diff) + minetest.log("warning", "[technic] [+supply] switching station abm took " .. diff .. " us at " .. minetest.pos_to_string(pos)) + end + return end @@ -426,6 +455,12 @@ minetest.register_abm({ meta1:set_int(eu_input_str, math.floor(eu_supply * charge_factor)) --dprint("Discharging battery:"..math.floor(eu_supply*charge_factor)) end + local t1 = minetest.get_us_time() + local diff = t1 - t0 + if diff > 50000 then + check_timer(pos, meta, diff) + minetest.log("warning", "[technic] [-supply] switching station abm took " .. diff .. " us at " .. minetest.pos_to_string(pos)) + end return end @@ -444,6 +479,13 @@ minetest.register_abm({ meta1:set_int(eu_input_str, 0) end + local t1 = minetest.get_us_time() + local diff = t1 - t0 + if diff > 50000 then + check_timer(pos, meta, diff) + minetest.log("warning", "[technic] switching station abm took " .. diff .. " us at " .. minetest.pos_to_string(pos)) + end + end, }) diff --git a/technic/textures/technic_diamond_seed.png b/technic/textures/technic_diamond_seed.png new file mode 100644 index 0000000..53d88fb Binary files /dev/null and b/technic/textures/technic_diamond_seed.png differ diff --git a/technic/textures/technic_hv_compressor_bottom.png b/technic/textures/technic_hv_compressor_bottom.png new file mode 100644 index 0000000..d6a61ed Binary files /dev/null and b/technic/textures/technic_hv_compressor_bottom.png differ diff --git a/technic/textures/technic_hv_compressor_front.png b/technic/textures/technic_hv_compressor_front.png new file mode 100644 index 0000000..4f488a9 Binary files /dev/null and b/technic/textures/technic_hv_compressor_front.png differ diff --git a/technic/textures/technic_hv_compressor_front_active.png b/technic/textures/technic_hv_compressor_front_active.png new file mode 100644 index 0000000..60de4f9 Binary files /dev/null and b/technic/textures/technic_hv_compressor_front_active.png differ diff --git a/technic/textures/technic_hv_compressor_side.png b/technic/textures/technic_hv_compressor_side.png new file mode 100644 index 0000000..77e2c1f Binary files /dev/null and b/technic/textures/technic_hv_compressor_side.png differ diff --git a/technic/textures/technic_hv_compressor_side_tube.png b/technic/textures/technic_hv_compressor_side_tube.png new file mode 100644 index 0000000..a427128 Binary files /dev/null and b/technic/textures/technic_hv_compressor_side_tube.png differ diff --git a/technic/textures/technic_hv_compressor_top.png b/technic/textures/technic_hv_compressor_top.png new file mode 100644 index 0000000..5279c81 Binary files /dev/null and b/technic/textures/technic_hv_compressor_top.png differ diff --git a/technic/textures/technic_hv_electric_furnace_bottom.png b/technic/textures/technic_hv_electric_furnace_bottom.png new file mode 100644 index 0000000..d6a61ed Binary files /dev/null and b/technic/textures/technic_hv_electric_furnace_bottom.png differ diff --git a/technic/textures/technic_hv_electric_furnace_front.png b/technic/textures/technic_hv_electric_furnace_front.png new file mode 100644 index 0000000..de74673 Binary files /dev/null and b/technic/textures/technic_hv_electric_furnace_front.png differ diff --git a/technic/textures/technic_hv_electric_furnace_front_active.png b/technic/textures/technic_hv_electric_furnace_front_active.png new file mode 100644 index 0000000..adff958 Binary files /dev/null and b/technic/textures/technic_hv_electric_furnace_front_active.png differ diff --git a/technic/textures/technic_hv_electric_furnace_side.png b/technic/textures/technic_hv_electric_furnace_side.png new file mode 100644 index 0000000..77e2c1f Binary files /dev/null and b/technic/textures/technic_hv_electric_furnace_side.png differ diff --git a/technic/textures/technic_hv_electric_furnace_side_tube.png b/technic/textures/technic_hv_electric_furnace_side_tube.png new file mode 100644 index 0000000..a427128 Binary files /dev/null and b/technic/textures/technic_hv_electric_furnace_side_tube.png differ diff --git a/technic/textures/technic_hv_electric_furnace_top.png b/technic/textures/technic_hv_electric_furnace_top.png new file mode 100644 index 0000000..5279c81 Binary files /dev/null and b/technic/textures/technic_hv_electric_furnace_top.png differ diff --git a/technic/textures/technic_hv_grinder_bottom.png b/technic/textures/technic_hv_grinder_bottom.png index fa2c135..9212218 100644 Binary files a/technic/textures/technic_hv_grinder_bottom.png and b/technic/textures/technic_hv_grinder_bottom.png differ diff --git a/technic/textures/technic_hv_grinder_front.png b/technic/textures/technic_hv_grinder_front.png index a5bca0a..db9820e 100644 Binary files a/technic/textures/technic_hv_grinder_front.png and b/technic/textures/technic_hv_grinder_front.png differ diff --git a/technic/textures/technic_hv_grinder_front_active.png b/technic/textures/technic_hv_grinder_front_active.png index 4077630..4886bc2 100644 Binary files a/technic/textures/technic_hv_grinder_front_active.png and b/technic/textures/technic_hv_grinder_front_active.png differ diff --git a/technic/textures/technic_hv_grinder_side.png b/technic/textures/technic_hv_grinder_side.png index c3063c4..26873a2 100644 Binary files a/technic/textures/technic_hv_grinder_side.png and b/technic/textures/technic_hv_grinder_side.png differ diff --git a/technic/textures/technic_hv_grinder_side_tube.png b/technic/textures/technic_hv_grinder_side_tube.png index 43bcca5..ac7183d 100644 Binary files a/technic/textures/technic_hv_grinder_side_tube.png and b/technic/textures/technic_hv_grinder_side_tube.png differ diff --git a/technic/textures/technic_hv_grinder_top.png b/technic/textures/technic_hv_grinder_top.png index e0df36b..c89511f 100644 Binary files a/technic/textures/technic_hv_grinder_top.png and b/technic/textures/technic_hv_grinder_top.png differ diff --git a/technic/textures/technic_lv_lamp_bottom.png b/technic/textures/technic_lv_lamp_bottom.png new file mode 100644 index 0000000..04941a0 Binary files /dev/null and b/technic/textures/technic_lv_lamp_bottom.png differ diff --git a/technic/textures/technic_lv_lamp_side.png b/technic/textures/technic_lv_lamp_side.png new file mode 100644 index 0000000..2ea1117 Binary files /dev/null and b/technic/textures/technic_lv_lamp_side.png differ diff --git a/technic/textures/technic_lv_lamp_top.png b/technic/textures/technic_lv_lamp_top.png new file mode 100644 index 0000000..701baf2 Binary files /dev/null and b/technic/textures/technic_lv_lamp_top.png differ diff --git a/technic/textures/technic_lv_led.png b/technic/textures/technic_lv_led.png new file mode 100644 index 0000000..056a9a4 Binary files /dev/null and b/technic/textures/technic_lv_led.png differ diff --git a/technic/textures/technic_lv_led_inv.png b/technic/textures/technic_lv_led_inv.png new file mode 100644 index 0000000..6f8996c Binary files /dev/null and b/technic/textures/technic_lv_led_inv.png differ diff --git a/technic/tools/chainsaw.lua b/technic/tools/chainsaw.lua index 8245fd6..751f83c 100644 --- a/technic/tools/chainsaw.lua +++ b/technic/tools/chainsaw.lua @@ -51,6 +51,10 @@ if minetest.get_modpath("moretrees") then timber_nodenames["moretrees:spruce_trunk"] = true timber_nodenames["moretrees:willow_trunk"] = true timber_nodenames["moretrees:jungletree_trunk"] = true + timber_nodenames["moretrees:date_palm_trunk"] = true + timber_nodenames["moretrees:date_palm_mfruit_trunk"] = true + timber_nodenames["moretrees:date_palm_ffruit_trunk"] = true + if chainsaw_leaves then timber_nodenames["moretrees:acacia_leaves"] = true @@ -75,6 +79,7 @@ if minetest.get_modpath("moretrees") then timber_nodenames["moretrees:pine_cone"] = true timber_nodenames["moretrees:fir_cone"] = true timber_nodenames["moretrees:apple_blossoms"] = true + timber_nodenames["moretrees:date_palm_leaves"] = true end end diff --git a/technic_chests/register.lua b/technic_chests/register.lua index 145b937..6bf83b0 100644 --- a/technic_chests/register.lua +++ b/technic_chests/register.lua @@ -314,7 +314,7 @@ function technic.chests:definition(name, data) def.can_dig = function(pos,player) local meta = minetest.get_meta(pos); local inv = meta:get_inventory() - return inv:is_empty("main") and default.can_interact_with_node(player, pos) + return inv:is_empty("main") and player and player:is_player() and default.can_interact_with_node(player, pos) end def.on_skeleton_key_use = function(pos, player, newsecret) local meta = minetest.get_meta(pos) diff --git a/technic_cnc/cnc_materials.lua b/technic_cnc/cnc_materials.lua index e63c792..bc6e4aa 100644 --- a/technic_cnc/cnc_materials.lua +++ b/technic_cnc/cnc_materials.lua @@ -21,18 +21,77 @@ technic_cnc.register_all("default:wood", {snappy=2, choppy=2, oddly_breakable_by_hand=2, not_in_creative_inventory=1}, {"default_wood.png"}, S("Wooden")) + +technic_cnc.register_all("default:junglewood", + {snappy=2, choppy=2, oddly_breakable_by_hand=2, not_in_creative_inventory=1}, + {"default_junglewood.png"}, + S("Junglewood")) + +technic_cnc.register_all("default:pine_wood", + {snappy=2, choppy=2, oddly_breakable_by_hand=2, not_in_creative_inventory=1}, + {"default_pine_wood.png"}, + S("Pine")) + +technic_cnc.register_all("default:acacia_wood", + {snappy=2, choppy=2, oddly_breakable_by_hand=2, not_in_creative_inventory=1}, + {"default_acacia_wood.png"}, + S("Acacia")) + +technic_cnc.register_all("default:aspen_wood", + {snappy=2, choppy=2, oddly_breakable_by_hand=2, not_in_creative_inventory=1}, + {"default_aspen_wood.png"}, + S("Aspen")) + -- STONE -------- technic_cnc.register_all("default:stone", - {cracky=3, not_in_creative_inventory=1}, + {cracky=3, stone=1, not_in_creative_inventory=1}, {"default_stone.png"}, S("Stone")) + +technic_cnc.register_all("default:stonebrick", + {crumbly=2, cracky=3, stone=1, not_in_creative_inventory=1}, + {"default_stone_brick.png"}, + S("Stone Brick")) + +technic_cnc.register_all("default:stone_block", + {crumbly=2, cracky=3, stone=1, not_in_creative_inventory=1}, + {"default_stone_block.png"}, + S("Stone Block")) + + +technic_cnc.register_all("default:desert_stone", + {cracky=3, stone=1, not_in_creative_inventory=1}, + {"default_desert_stone.png"}, + S("Desert Stone")) + +technic_cnc.register_all("default:desert_stonebrick", + {crumbly=2, cracky=3, stone=1, not_in_creative_inventory=1}, + {"default_desert_stone_brick.png"}, + S("Desert Stone Brick")) + +technic_cnc.register_all("default:desert_stone_block", + {crumbly=2, cracky=3, stone=1, not_in_creative_inventory=1}, + {"default_desert_stone_block.png"}, + S("Desert Stone Block")) + -- COBBLE --------- technic_cnc.register_all("default:cobble", - {cracky=3, not_in_creative_inventory=1}, + {cracky=3, stone=1, not_in_creative_inventory=1}, {"default_cobble.png"}, S("Cobble")) + +technic_cnc.register_all("default:mossycobble", + {cracky=3, stone=1, not_in_creative_inventory=1}, + {"default_mossycobble.png"}, + S("Mossy Cobblestone")) + +technic_cnc.register_all("default:desert_cobble", + {cracky=3, stone=1, not_in_creative_inventory=1}, + {"default_desert_cobble.png"}, + S("Desert Cobble")) + -- BRICK -------- technic_cnc.register_all("default:brick", @@ -47,12 +106,58 @@ technic_cnc.register_all("default:sandstone", {"default_sandstone.png"}, S("Sandstone")) +technic_cnc.register_all("default:sandstonebrick", + {crumbly=2, cracky=3, not_in_creative_inventory=1}, + {"default_sandstone_brick.png"}, + S("Sandstone Brick")) + +technic_cnc.register_all("default:sandstone_block", + {crumbly=2, cracky=3, not_in_creative_inventory=1}, + {"default_sandstone_block.png"}, + S("Sandstone Block")) + + +technic_cnc.register_all("default:desert_sandstone", + {crumbly=2, cracky=3, not_in_creative_inventory=1}, + {"default_desert_sandstone.png"}, + S("Desert Sandstone")) + +technic_cnc.register_all("default:desert_sandstone_brick", + {crumbly=2, cracky=3, not_in_creative_inventory=1}, + {"default_desert_sandstone_brick.png"}, + S("Desert Sandstone Brick")) + +technic_cnc.register_all("default:desert_sandstone_block", + {crumbly=2, cracky=3, not_in_creative_inventory=1}, + {"default_desert_sandstone_block.png"}, + S("Desert Sandstone Block")) + + +technic_cnc.register_all("default:silver_sandstone", + {crumbly=2, cracky=3, not_in_creative_inventory=1}, + {"default_silver_sandstone.png"}, + S("Silver Sandstone")) + +technic_cnc.register_all("default:silver_sandstone_brick", + {crumbly=2, cracky=3, not_in_creative_inventory=1}, + {"default_silver_sandstone_brick.png"}, + S("Silver Sandstone Brick")) + +technic_cnc.register_all("default:silver_sandstone_block", + {crumbly=2, cracky=3, not_in_creative_inventory=1}, + {"default_silver_sandstone_block.png"}, + S("Silver Sandstone Block")) + + + + -- LEAVES --------- technic_cnc.register_all("default:leaves", {snappy=2, choppy=2, oddly_breakable_by_hand=3, not_in_creative_inventory=1}, {"default_leaves.png"}, S("Leaves")) + -- TREE ------- technic_cnc.register_all("default:tree", @@ -60,6 +165,29 @@ technic_cnc.register_all("default:tree", {"default_tree.png"}, S("Tree")) +-- ICE +------- +technic_cnc.register_all("default:ice", + {cracky=3, puts_out_fire=1, cools_lava=1, not_in_creative_inventory=1}, + {"default_ice.png"}, + S("Ice")) + + +-- OBSIDIAN +----------- +technic_cnc.register_all("default:obsidian_block", + {cracky=1, level=2, not_in_creative_inventory=1}, + {"default_obsidian_block.png"}, + S("Obsidian")) + + +-- WROUGHT IRON +--------------- +technic_cnc.register_all("default:steelblock", + {cracky=1, level=2, not_in_creative_inventory=1}, + {"technic_wrought_iron_block.png"}, + S("Wrought Iron")) + -- Bronze -------- technic_cnc.register_all("default:bronzeblock", @@ -67,10 +195,23 @@ technic_cnc.register_all("default:bronzeblock", {"default_bronze_block.png"}, S("Bronze")) +-- Zinc +-------- +technic_cnc.register_all("technic:zinc_block", + {cracky=1, level=2, not_in_creative_inventory=1}, + {"technic_zinc_block.png"}, + S("Zinc")) local steeltex = "default_steel_block.png" local steelname = "Steel" +-- Cast Iron +------------ +technic_cnc.register_all("technic:cast_iron_block", + {cracky=1, level=2, not_in_creative_inventory=1}, + {"technic_cast_iron_block.png"}, + S("Cast Iron")) + if technic_cnc.technic_modpath then steeltex = "technic_wrought_iron_block.png" steelname = "Wrought Iron" @@ -105,8 +246,6 @@ if technic_cnc.technic_modpath then S("Blast-resistant concrete")) end --- STEEL ---------------- technic_cnc.register_all("default:steelblock", {cracky=1, level=2, not_in_creative_inventory=1}, {steeltex}, @@ -129,3 +268,148 @@ technic_cnc.register_all("basic_materials:brass_block", {cracky=1, level=2, not_in_creative_inventory=1}, {"basic_materials_brass_block.png"}, S("Brass block")) +-- Brass +-------- +technic_cnc.register_all("technic:brass_block", + {cracky=1, level=2, not_in_creative_inventory=1}, + {"technic_brass_block.png"}, + S("Brass")) + +-- Copper +--------- +technic_cnc.register_all("default:copperblock", + {cracky=1, level=2, not_in_creative_inventory=1}, + {"default_copper_block.png"}, + S("Copper")) + +-- Tin +------ +technic_cnc.register_all("default:tinblock", + {cracky=1, level=2, not_in_creative_inventory=1}, + {"default_tin_block.png"}, + S("Tin")) + +-- Gold +------- +technic_cnc.register_all("default:goldblock", + {cracky=1, level=2, not_in_creative_inventory=1}, + {"default_gold_block.png"}, + S("Gold")) + + + + +if minetest.get_modpath("ethereal") then + -- Glostone + ------------ + technic_cnc.register_all("ethereal:glostone", + {cracky=1, not_in_creative_inventory=1, light_source=13}, + {"glostone.png"}, + S("Glo Stone")) + + -- Crystal block + ---------------- + technic_cnc.register_all("ethereal:crystal_block", + {snappy=2, choppy=2, oddly_breakable_by_hand=2, not_in_creative_inventory=1}, + {"crystal_block.png"}, + S("Crystal")) + + -- Misc. Wood types + ------------------- + technic_cnc.register_all("ethereal:banana_wood", + {snappy=2, choppy=2, oddly_breakable_by_hand=2, not_in_creative_inventory=1}, + {"banana_wood.png"}, + S("Banana Wood")) + + technic_cnc.register_all("ethereal:birch_wood", + {snappy=2, choppy=2, oddly_breakable_by_hand=2, not_in_creative_inventory=1}, + {"moretrees_birch_wood.png"}, + S("Birch Wood")) + + technic_cnc.register_all("ethereal:frost_wood", + {snappy=2, choppy=2, oddly_breakable_by_hand=2, not_in_creative_inventory=1}, + {"frost_wood.png"}, + S("Frost Wood")) + + technic_cnc.register_all("ethereal:palm_wood", + {snappy=2, choppy=2, oddly_breakable_by_hand=2, not_in_creative_inventory=1}, + {"moretrees_palm_wood.png"}, + S("Palm Wood")) + + technic_cnc.register_all("ethereal:willow_wood", + {snappy=2, choppy=2, oddly_breakable_by_hand=2, not_in_creative_inventory=1}, + {"willow_wood.png"}, + S("Willow Wood")) + + technic_cnc.register_all("ethereal:yellow_wood", + {snappy=2, choppy=2, oddly_breakable_by_hand=2, not_in_creative_inventory=1}, + {"yellow_wood.png"}, + S("Healing Tree Wood")) + + technic_cnc.register_all("ethereal:redwood_wood", + {snappy=2, choppy=2, oddly_breakable_by_hand=2, not_in_creative_inventory=1}, + {"redwood_wood.png"}, + S("Redwood")) +end + + +if minetest.get_modpath("moreblocks") then + -- Tiles + ------------ + technic_cnc.register_all("moreblocks:stone_tile", + {stone=1, cracky=3, not_in_creative_inventory=1}, + {"moreblocks_stone_tile.png"}, + S("Stone Tile")) + + technic_cnc.register_all("moreblocks:split_stone_tile", + {stone=1, cracky=3, not_in_creative_inventory=1}, + {"moreblocks_split_stone_tile.png"}, + S("Split Stone Tile")) + + technic_cnc.register_all("moreblocks:checker_stone_tile", + {stone=1, cracky=3, not_in_creative_inventory=1}, + {"moreblocks_checker_stone_tile.png"}, + S("Checker Stone Tile")) + + technic_cnc.register_all("moreblocks:cactus_checker", + {stone=1, cracky=3, not_in_creative_inventory=1}, + {"moreblocks_cactus_checker.png"}, + S("Cactus Checker")) + + -- Bricks + ------------ + technic_cnc.register_all("moreblocks:cactus_brick", + {cracky=3, not_in_creative_inventory=1}, + {"moreblocks_cactus_brick.png"}, + S("Cactus Brick")) + + technic_cnc.register_all("moreblocks:grey_bricks", + {cracky=3, not_in_creative_inventory=1}, + {"moreblocks_grey_bricks.png"}, + S("Grey Bricks")) + + -- Metals + ------------ + technic_cnc.register_all("moreblocks:copperpatina", + {cracky=1, level=2, not_in_creative_inventory=1}, + {"moreblocks_copperpatina.png"}, + S("Copper Patina")) + + -- Clay + ------------ + technic_cnc.register_all("bakedclay:red", + {cracky=3, not_in_creative_inventory=1}, + {"baked_clay_red.png"}, + S("Red Clay")) + + technic_cnc.register_all("bakedclay:orange", + {cracky=3, not_in_creative_inventory=1}, + {"baked_clay_orange.png"}, + S("Orange Clay")) + + technic_cnc.register_all("bakedclay:grey", + {cracky=3, not_in_creative_inventory=1}, + {"baked_clay_grey.png"}, + S("Grey Clay")) + +end