summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--technic/crafts.lua15
-rw-r--r--technic/items.lua6
-rw-r--r--technic/machines/register/common.lua32
-rw-r--r--technic/textures/technic_control_logic_unit_adv.pngbin0 -> 623 bytes
4 files changed, 47 insertions, 6 deletions
diff --git a/technic/crafts.lua b/technic/crafts.lua
index 14bafd3..4c8b799 100644
--- a/technic/crafts.lua
+++ b/technic/crafts.lua
@@ -8,6 +8,12 @@ minetest.clear_craft({
output = "default:bronze_ingot"
})
+minetest.register_craft({
+ type = "shapeless",
+ output = "default:bronze_ingot 9" ,
+ recipe = {"default:bronzeblock"}
+})
+
-- Accelerator tube
if pipeworks.enable_accelerator_tube then
minetest.clear_craft({
@@ -160,6 +166,15 @@ minetest.register_craft({
})
minetest.register_craft({
+ output = 'technic:control_logic_unit_adv',
+ recipe = {
+ {'technic:fine_gold_wire', 'technic:fine_gold_wire', 'technic:fine_gold_wire'},
+ {'technic:silicon_wafer', 'technic:silicon_wafer', 'technic:silicon_wafer'},
+ {'default:copper_ingot', 'technic:chromium_ingot', 'default:copper_ingot'},
+ }
+})
+
+minetest.register_craft({
output = 'technic:mixed_metal_ingot 9',
recipe = {
{'technic:stainless_steel_ingot', 'technic:stainless_steel_ingot', 'technic:stainless_steel_ingot'},
diff --git a/technic/items.lua b/technic/items.lua
index a0edb96..ec12a8f 100644
--- a/technic/items.lua
+++ b/technic/items.lua
@@ -115,6 +115,12 @@ minetest.register_craftitem( "technic:control_logic_unit", {
inventory_image = "technic_control_logic_unit.png",
})
+minetest.register_craftitem( "technic:control_logic_unit_adv", {
+ description = S("Advanced Control Logic Unit"),
+ inventory_image = "technic_control_logic_unit_adv.png",
+})
+
+
minetest.register_craftitem("technic:mixed_metal_ingot", {
description = S("Mixed Metal Ingot"),
inventory_image = "technic_mixed_metal_ingot.png",
diff --git a/technic/machines/register/common.lua b/technic/machines/register/common.lua
index dfa2948..f872fa2 100644
--- a/technic/machines/register/common.lua
+++ b/technic/machines/register/common.lua
@@ -19,16 +19,20 @@ function technic.handle_machine_upgrades(meta)
if upg_item1 == "technic:control_logic_unit" then
tube_upgrade = tube_upgrade + 1
+ elseif upg_item1 == "technic:control_logic_unit_adv" then
+ tube_upgrade = tube_upgrade + 6
elseif upg_item1 == "technic:battery" then
EU_upgrade = EU_upgrade + 1
end
if upg_item2 == "technic:control_logic_unit" then
tube_upgrade = tube_upgrade + 1
+ elseif upg_item2 == "technic:control_logic_unit_adv" then
+ tube_upgrade = tube_upgrade + 6
elseif upg_item2 == "technic:battery" then
EU_upgrade = EU_upgrade + 1
end
-
+
return EU_upgrade, tube_upgrade
end
@@ -39,6 +43,7 @@ local function on_machine_upgrade(meta, stack)
meta:set_int("public", 1)
return 1
elseif stack_name ~= "technic:control_logic_unit"
+ and stack_name ~= "technic:control_logic_unit_adv"
and stack_name ~= "technic:battery" then
return 0
end
@@ -60,7 +65,7 @@ local function on_machine_downgrade(meta, stack, list)
end
-function technic.send_items(pos, x_velocity, z_velocity, output_name)
+function technic.send_items(pos, x_velocity, z_velocity, output_name, full)
-- Send items on their way in the pipe system.
if output_name == nil then
output_name = "dst"
@@ -68,20 +73,28 @@ function technic.send_items(pos, x_velocity, z_velocity, output_name)
local meta = minetest.get_meta(pos)
local inv = meta:get_inventory()
+
local i = 0
for _, stack in ipairs(inv:get_list(output_name)) do
i = i + 1
if stack then
local item0 = stack:to_table()
if item0 then
- item0["count"] = "1"
- technic.tube_inject_item(pos, pos, vector.new(x_velocity, 0, z_velocity), item0)
- stack:take_item(1)
+ if full then
+ technic.tube_inject_item(pos, pos, vector.new(x_velocity, 0, z_velocity), item0)
+ stack:clear()
+ else
+ item0["count"] = "1"
+ technic.tube_inject_item(pos, pos, vector.new(x_velocity, 0, z_velocity), item0)
+ stack:take_item(1)
+ end
inv:set_stack(output_name, i, stack)
return
end
end
end
+
+
end
@@ -128,11 +141,18 @@ function technic.handle_machine_pipeworks(pos, tube_upgrade, send_function)
if minetest.get_item_group(node1.name, "tubedevice") > 0 then
output_tube_connected = true
end
+
+ local send_stack = false
+ if tube_upgrade > 2 then
+ send_stack = true
+ tube_upgrade = tube_upgrade % 5
+ end
+
local tube_time = meta:get_int("tube_time") + tube_upgrade
if tube_time >= 2 then
tube_time = 0
if output_tube_connected then
- send_function(pos, x_velocity, z_velocity)
+ send_function(pos, x_velocity, z_velocity, nil, send_stack)
end
end
meta:set_int("tube_time", tube_time)
diff --git a/technic/textures/technic_control_logic_unit_adv.png b/technic/textures/technic_control_logic_unit_adv.png
new file mode 100644
index 0000000..d5508d5
--- /dev/null
+++ b/technic/textures/technic_control_logic_unit_adv.png
Binary files differ