From 276a6a37f3c1422bcece9850e04eca1bf409ec7a Mon Sep 17 00:00:00 2001 From: Joachim Stolberg Date: Mon, 8 Mar 2021 21:27:51 +0100 Subject: [PATCH] Revice TA4 Injector, add TA3 Injector --- basic_machines/autocrafter.lua | 8 ++ basic_machines/chest.lua | 8 ++ basic_machines/electronic_fab.lua | 8 ++ basic_machines/legacy_nodes.lua | 10 +++ basic_machines/mods_support.lua | 16 ++++ basic_machines/ta4_injector.lua | 133 ++++++++++++++++++++++++------ basis/command.lua | 8 ++ doc/items.lua | 1 + doc/manual_DE.lua | 20 +++-- doc/manual_EN.lua | 19 ++++- furnace/furnace_top.lua | 8 ++ locale/techage.de.tr | 4 + locale/template.txt | 4 + manuals/manual_ta3_DE.md | 14 ++++ manuals/manual_ta3_EN.md | 14 ++++ manuals/manual_ta4_DE.md | 6 +- manuals/manual_ta4_EN.md | 6 +- manuals/toc_DE.md | 1 + manuals/toc_EN.md | 1 + power/ta4_cable.lua | 2 +- 20 files changed, 246 insertions(+), 45 deletions(-) diff --git a/basic_machines/autocrafter.lua b/basic_machines/autocrafter.lua index 9bfc575..1b937c9 100644 --- a/basic_machines/autocrafter.lua +++ b/basic_machines/autocrafter.lua @@ -347,6 +347,14 @@ tiles.act = { } local tubing = { + on_inv_request = function(pos, in_dir, access_type) + if access_type == "push" then + local meta = minetest.get_meta(pos) + if meta:get_int("push_dir") == in_dir or in_dir == 5 then + return meta:get_inventory(), "src" + end + end + end, on_pull_item = function(pos, in_dir, num) local meta = minetest.get_meta(pos) if meta:get_int("pull_dir") == in_dir then diff --git a/basic_machines/chest.lua b/basic_machines/chest.lua index 6d5837f..fd1882c 100644 --- a/basic_machines/chest.lua +++ b/basic_machines/chest.lua @@ -149,6 +149,10 @@ minetest.register_node("techage:chest_ta3", { }) techage.register_node({"techage:chest_ta2", "techage:chest_ta3"}, { + on_inv_request = function(pos, in_dir, access_type) + local meta = minetest.get_meta(pos) + return meta:get_inventory(), "main" + end, on_pull_item = function(pos, in_dir, num, item_name) local meta = minetest.get_meta(pos) local inv = meta:get_inventory() @@ -332,6 +336,10 @@ minetest.register_node("techage:chest_ta4", { techage.register_node({"techage:chest_ta4"}, { + on_inv_request = function(pos, in_dir, access_type) + local meta = minetest.get_meta(pos) + return meta:get_inventory(), "main" + end, on_pull_item = function(pos, in_dir, num, item_name) local meta = minetest.get_meta(pos) local inv = meta:get_inventory() diff --git a/basic_machines/electronic_fab.lua b/basic_machines/electronic_fab.lua index d5f962d..0db86a6 100644 --- a/basic_machines/electronic_fab.lua +++ b/basic_machines/electronic_fab.lua @@ -171,6 +171,14 @@ tiles.act = { } local tubing = { + on_inv_request = function(pos, in_dir, access_type) + if access_type == "push" then + local meta = minetest.get_meta(pos) + if meta:get_int("push_dir") == in_dir or in_dir == 5 then + return meta:get_inventory(), "src" + end + end + end, on_pull_item = function(pos, in_dir, num) local meta = minetest.get_meta(pos) if meta:get_int("pull_dir") == in_dir then diff --git a/basic_machines/legacy_nodes.lua b/basic_machines/legacy_nodes.lua index 8bdcf26..20468cb 100644 --- a/basic_machines/legacy_nodes.lua +++ b/basic_machines/legacy_nodes.lua @@ -30,6 +30,10 @@ end techage.register_node({"default:chest", "default:chest_open"}, { + on_inv_request = function(pos, in_dir, access_type) + local meta = minetest.get_meta(pos) + return meta:get_inventory(), "main" + end, on_pull_item = function(pos, in_dir, num) local meta = minetest.get_meta(pos) local inv = meta:get_inventory() @@ -48,6 +52,12 @@ techage.register_node({"default:chest", "default:chest_open"}, { }) techage.register_node({"default:chest_locked", "default:chest_locked_open"}, { + on_inv_request = function(pos, in_dir, access_type) + local meta = minetest.get_meta(pos) + if is_owner(pos, meta) then + return meta:get_inventory(), "main" + end + end, on_pull_item = function(pos, in_dir, num) local meta = minetest.get_meta(pos) if is_owner(pos, meta) then diff --git a/basic_machines/mods_support.lua b/basic_machines/mods_support.lua index 3c1e2bc..bebf06b 100644 --- a/basic_machines/mods_support.lua +++ b/basic_machines/mods_support.lua @@ -34,6 +34,10 @@ end ------------------------------------------------------------------------------ techage.register_node({"digtron:inventory"}, { + on_inv_request = function(pos, in_dir, access_type) + local meta = minetest.get_meta(pos) + return meta:get_inventory(), "main" + end, on_pull_item = function(pos, in_dir, num) local meta = minetest.get_meta(pos) local inv = meta:get_inventory() @@ -52,6 +56,10 @@ techage.register_node({"digtron:inventory"}, { }) techage.register_node({"digtron:fuelstore"}, { + on_inv_request = function(pos, in_dir, access_type) + local meta = minetest.get_meta(pos) + return meta:get_inventory(), "fuel" + end, on_pull_item = function(pos, in_dir, num) local meta = minetest.get_meta(pos) local inv = meta:get_inventory() @@ -70,6 +78,10 @@ techage.register_node({"digtron:fuelstore"}, { }) techage.register_node({"digtron:combined_storage"}, { + on_inv_request = function(pos, in_dir, access_type) + local meta = minetest.get_meta(pos) + return meta:get_inventory(), "main" + end, on_pull_item = function(pos, in_dir, num) local meta = minetest.get_meta(pos) local inv = meta:get_inventory() @@ -97,6 +109,10 @@ techage.register_node({"digtron:combined_storage"}, { ------------------------------------------------------------------------------ techage.register_node({"protector:chest"}, { + on_inv_request = function(pos, in_dir, access_type) + local meta = minetest.get_meta(pos) + return meta:get_inventory(), "main" + end, on_pull_item = function(pos, in_dir, num) local meta = minetest.get_meta(pos) local inv = meta:get_inventory() diff --git a/basic_machines/ta4_injector.lua b/basic_machines/ta4_injector.lua index 39435ca..61c264f 100644 --- a/basic_machines/ta4_injector.lua +++ b/basic_machines/ta4_injector.lua @@ -18,27 +18,29 @@ local S = techage.S -- Consumer Related Data local CRD = function(pos) return (minetest.registered_nodes[techage.get_node_lvm(pos).name] or {}).consumer end +local tooltip = S("Switch to pull mode \nto pull items out of inventory slots \naccording the injector configuration") local STANDBY_TICKS = 2 -local COUNTDOWN_TICKS = 4 -local CYCLE_TIME = 3 +local COUNTDOWN_TICKS = 3 +local CYCLE_TIME = 4 local function formspec(self, pos, nvm) - if CRD(pos).stage == 4 then -- TA4 node? - return "size[8,7.2]".. - default.gui_bg.. - default.gui_bg_img.. - default.gui_slots.. - "box[0,-0.1;7.8,0.5;#c6e8ff]".. - "label[3,-0.1;"..minetest.colorize("#000000", S("Injector")).."]".. - techage.question_mark_help(8, S("Configure up to 8 items \nto be pushed by the injector")).. - "list[context;filter;0,0.8;8,1;]".. - "image_button[3.5,2;1,1;".. self:get_state_button_image(nvm) ..";state_button;]".. - "tooltip[3.5,2;1,1;"..self:get_state_tooltip(nvm).."]".. - "list[current_player;main;0,3.5;8,4;]".. - "listring[context;filter]".. - "listring[current_player;main]" - end + local pull_mode = dump(nvm.pull_mode or false) + return "size[8,7.2]".. + default.gui_bg.. + default.gui_bg_img.. + default.gui_slots.. + "box[0,-0.1;7.8,0.5;#c6e8ff]".. + "label[3,-0.1;"..minetest.colorize("#000000", S("Injector")).."]".. + techage.question_mark_help(8, S("Configure up to 8 items \nto be pushed by the injector")).. + "list[context;filter;0,0.8;8,1;]".. + "image_button[2,2;1,1;".. self:get_state_button_image(nvm) ..";state_button;]".. + "tooltip[2,2;1,1;"..self:get_state_tooltip(nvm).."]".. + "checkbox[3.5,1.9;pull_mode;"..S("pull mode")..";"..pull_mode.."]".. + "tooltip[3.5,1.9;2,0.8;"..tooltip..";#0C3D32;#FFFFFF]".. + "list[current_player;main;0,3.5;8,4;]".. + "listring[context;filter]".. + "listring[current_player;main]" end local function allow_metadata_inventory_put(pos, listname, index, stack, player) @@ -53,8 +55,10 @@ local function allow_metadata_inventory_put(pos, listname, index, stack, player) local inv = M(pos):get_inventory() local list = inv:get_list(listname) - if list[index]:get_count() == 0 then - stack:set_count(1) + local cdr = CRD(pos) + if list[index]:get_count() < cdr.num_items then + local num = math.min(cdr.num_items - list[index]:get_count(), stack:get_count()) + list[index]:get_count() + stack:set_count(num) inv:set_stack(listname, index, stack) return 0 end @@ -76,6 +80,67 @@ local function allow_metadata_inventory_take(pos, listname, index, stack, player return 0 end +local function pull_items(pos, out_dir, idx, name, num) + local inv, listname = techage.get_inv_access(pos, out_dir, "pull") + if inv and listname then + if idx and idx ~= 0 then + local stack = inv:get_stack(listname, idx) + if stack and not stack:is_empty() and stack:get_name() == name then + local taken = stack:take_item(num) + inv:set_stack(listname, idx, stack) + return (taken:get_count() > 0) and taken or nil + end + else + local taken = inv:remove_item(listname, {name = name, count = num}) + return (taken:get_count() > 0) and taken or nil + end + else + return techage.pull_items(pos, out_dir, num, name) + end +end + +local function push_items(pos, out_dir, idx, items) + local inv, listname, callafter, dpos = techage.get_inv_access(pos, out_dir, "push") + if inv and listname then + if idx and idx ~= 0 then + local stack = inv:get_stack(listname, idx) + if stack:item_fits(items) then + stack:add_item(items) + inv:set_stack(listname, idx, stack) + if callafter then + callafter(dpos) + end + return true + end + else + if inv:room_for_item(listname, items) then + inv:add_item(listname, items) + if callafter then + callafter(dpos) + end + return true + end + end + else + return techage.push_items(pos, out_dir, items, idx) + end +end + +local function unpull_items(pos, out_dir, idx, items) + local inv, listname = techage.get_inv_access(pos, out_dir, "unpull") + if inv and listname then + if idx and idx ~= 0 then + local stack = inv:get_stack(listname, idx) + stack:add_item(items) + inv:set_stack(listname, idx, stack) + else + inv:add_item(listname, items) + end + else + techage.unpull_items(pos, out_dir, items) + end +end + local function pushing(pos, crd, meta, nvm) local pull_dir = meta:get_int("pull_dir") local push_dir = meta:get_int("push_dir") @@ -86,14 +151,16 @@ local function pushing(pos, crd, meta, nvm) for idx, item in ipairs(filter) do local name = item:get_name() - if name ~= "" then - local items = techage.pull_items(pos, pull_dir, 1, name) + local num = math.min(item:get_count(), crd.num_items) + if name ~= "" and num > 0 then + local items = pull_items(pos, pull_dir, nvm.pull_mode and idx, name, num) if items ~= nil then pulled = true - if techage.push_items(pos, push_dir, items, idx) then + if push_items(pos, push_dir, not nvm.pull_mode and idx, items) then pushed = true else -- place item back - techage.unpull_items(pos, pull_dir, items) + unpull_items(pos, pull_dir, nvm.pull_mode and idx, items) + pulled = false end end end @@ -119,6 +186,9 @@ local function on_receive_fields(pos, formname, fields, player) return end local nvm = techage.get_nvm(pos) + if fields.pull_mode then + nvm.pull_mode = fields.pull_mode == "true" + end CRD(pos).State:state_button_event(pos, nvm, fields) M(pos):set_string("formspec", formspec(CRD(pos).State, pos, nvm)) end @@ -174,7 +244,7 @@ local tubing = { end, } -local _, _, node_name_ta4 = +local _, node_name_ta3, node_name_ta4 = techage.register_consumer("injector", S("Injector"), tiles, { cycle_time = CYCLE_TIME, standby_ticks = STANDBY_TICKS, @@ -193,6 +263,7 @@ local _, _, node_name_ta4 = allow_metadata_inventory_put = allow_metadata_inventory_put, allow_metadata_inventory_take = allow_metadata_inventory_take, + allow_metadata_inventory_move = function() return 0 end, on_receive_fields = on_receive_fields, node_timer = keep_running, on_rotate = screwdriver.disallow, @@ -200,8 +271,17 @@ local _, _, node_name_ta4 = groups = {choppy=2, cracky=2, crumbly=2}, is_ground_content = false, sounds = default.node_sound_wood_defaults(), - num_items = {0,2,6,12}, - }, {false, false, false, true}) + num_items = {0,0,1,4}, + }, {false, false, true, true}) + +minetest.register_craft({ + output = node_name_ta3, + recipe = { + {"", "default:steel_ingot", ""}, + {"", "techage:ta3_pusher_pas", ""}, + {"", "basic_materials:ic", ""}, + }, +}) minetest.register_craft({ output = node_name_ta4, @@ -211,4 +291,3 @@ minetest.register_craft({ {"", "basic_materials:ic", ""}, }, }) - diff --git a/basis/command.lua b/basis/command.lua index d06b02f..ad5b945 100644 --- a/basis/command.lua +++ b/basis/command.lua @@ -250,6 +250,7 @@ end -- Param names: List of node names like {"techage:pusher_off", "techage:pusher_on"} -- Param node_definition: A table according to: -- { +-- on_inv_request = func(pos, in_dir, access_type) -- on_pull_item = func(pos, in_dir, num, (opt.) item_name), -- on_push_item = func(pos, in_dir, item), -- on_unpull_item = func(pos, in_dir, item), @@ -366,6 +367,13 @@ end -- Client side Push/Pull item functions ------------------------------------------------------------------- +function techage.get_inv_access(pos, out_dir, access_type) + local npos, in_dir, name = get_dest_node(pos, out_dir) + if npos and NodeDef[name] and NodeDef[name].on_inv_request then + return NodeDef[name].on_inv_request(npos, in_dir, access_type) + end +end + function techage.pull_items(pos, out_dir, num, item_name) local npos, in_dir, name = get_dest_node(pos, out_dir) if npos and NodeDef[name] and NodeDef[name].on_pull_item then diff --git a/doc/items.lua b/doc/items.lua index c4ddef0..5888b87 100644 --- a/doc/items.lua +++ b/doc/items.lua @@ -116,6 +116,7 @@ techage.Items = { ta3_mesecons_converter = "techage:ta3_mesecons_converter", ta3_valve = "techage:ta3_valve_closed", ta3_motor = "techage:ta3_motor_off", + ta3_injector = "techage:ta3_injector_pas", ---------------------------- techage_ta4 = "techage_ta4.png", ta4_windturbine = "techage:ta4_wind_turbine", diff --git a/doc/manual_DE.lua b/doc/manual_DE.lua index e373fb2..f4a99b5 100644 --- a/doc/manual_DE.lua +++ b/doc/manual_DE.lua @@ -120,6 +120,7 @@ techage.manual_DE.aTitel = { "3,TA3 Kiessieb / Gravel Sieve", "3,TA3 Kieswaschanlage / Gravel Rinser", "3,TA3 Mühle / Grinder", + "3,TA3 Injektor / Injector", "2,Werkzeuge", "3,Techage Info Tool", "3,TechAge Programmer", @@ -917,7 +918,6 @@ techage.manual_DE.aText = { " = on/off if is true\n".. "\n".. "'' ist die Nummer des Blocks\\, zu dem das Kommando gesendet werden soll.\n".. - "\n".. "'' ist ein boolescher Ausdruck\\, bei dem Eingabenummern ausgewertet werden. \n".. "\n".. "*Beispiele für den Input Ausdruck*\n".. @@ -1100,6 +1100,16 @@ techage.manual_DE.aText = { "\n".. "\n".. "\n", + "Der Injektor ist ein TA3 Schieber mit speziellen Eigenschaften. Er besitzt ein Menü zur Konfiguration. Hier können bis zu 8 Items konfiguriert werden. Er entnimmt nur diese Items einer Kiste um sie an Maschinen mit Rezepturen weiterzugeben (Autocrafter\\, Industrieofen und Elektronikfabrik).\n".. + "\n".. + "Beim Weitergeben wird in der Zielmaschine pro Item nur eine Position im Inventar genutzt. Sind bspw. nur die ersten drei Einträge im Injektor konfiguriert\\, so werden auch nur die ersten drei Speicherplätze im Inventar der Maschine belegt. Damit wir ein Überlauf im Inventar der Maschine verhindert.\n".. + "\n".. + "Der Injektor kann auch auf \"Ziehe-Modus\" umgeschaltet werden. Dann zieht er nur Items von den Positionen aus der Kiste\\, die in der Konfiguration des Injektors definiert sind. Hier müssen also Item-Typ und Position überein stimmen. Damit können geziehlt Speicherplätze im Inventar einer Kiste geleert werden.\n".. + "\n".. + "Die Verarbeitungsleistung beträgt bis zu 8 mal ein Item alle 4 Sekunden.\n".. + "\n".. + "\n".. + "\n", "", "Das Techage Info Tool (Schraubenschlüssel) hat verschiedene Funktionen. Er zeigt die Uhrzeit\\, die Position\\, die Temperatur und das Biome an\\, wenn auf einen unbekannten Block geklickt wird.\n".. "Wird auf einen TechAge Block mit Kommandoschnittstelle geklickt\\, werden alle verfügbaren Daten abgerufen (siehe auch \"Logik-/Schalt-Blöcke\").\n".. @@ -1593,11 +1603,9 @@ techage.manual_DE.aText = { "\n".. "\n".. "\n", - "Der Injektor ist ein TA4 Schieber mit speziellen Eigenschaften. Er besitzt ein Menü zur Konfiguration. Hier können bis zu 8 Items konfiguriert werden. Er entnimmt nur diese Items einer Kiste (TA4 Kiste oder TA4 8x2000 Kiste) um sie an Maschinen mit Rezepturen weiterzugeben (Autocrafter\\, Industrieofen und Elektronikfabrik). \n".. + "Die Funktion entspricht der von TA3. \n".. "\n".. - "Beim Weitergeben wird in der Zielmaschine pro Item nur eine Position im Inventar genutzt. Sind bspw. nur die ersten drei Einträge im Injektor konfiguriert\\, so werden auch nur die ersten drei Speicherplätze im Inventar der Maschine belegt. Damit wir ein Überlauf im Inventar der Maschine verhindert. \n".. - "\n".. - "Die Verarbeitungsleistung beträgt bis zu 8 Items alle 3 Sekunden.\n".. + "Die Verarbeitungsleistung beträgt bis zu 8 mal vier Items alle 4 Sekunden.\n".. "\n".. "\n".. "\n", @@ -1745,6 +1753,7 @@ techage.manual_DE.aItemName = { "ta3_gravelsieve", "ta3_gravelrinser", "ta3_grinder", + "ta3_injector", "", "ta3_end_wrench", "ta3_programmer", @@ -1949,6 +1958,7 @@ techage.manual_DE.aPlanTable = { "", "", "", + "", "ta4_windturbine", "", "", diff --git a/doc/manual_EN.lua b/doc/manual_EN.lua index f0c3a14..bc9bf19 100644 --- a/doc/manual_EN.lua +++ b/doc/manual_EN.lua @@ -119,6 +119,7 @@ techage.manual_EN.aTitel = { "3,TA3 Gravel Sieve", "3,TA3 Gravel Rinser", "3,TA3 Grinder", + "3,TA3 Injector", "2,Tools", "3,Techage Info Tool", "3,TechAge Programmer", @@ -1076,6 +1077,16 @@ techage.manual_EN.aText = { "\n".. "\n".. "\n", + "The injector is a TA3 pusher with special properties. It has a menu for configuration. Up to 8 items can be configured here. He only takes these items from a chest to pass them on to machines with recipes (autocrafter\\, industrial furnace and electronic fab).\n".. + "\n".. + "When passing on\\, only one position in the inventory is used in the target machine. If\\, for example\\, only the first three entries are configured in the injector\\, only the first three storage locations in the machine's inventory are used. So that an overflow in the machine inventory is prevented.\n".. + "\n".. + "The injector can also be switched to \"pull mode\". Then he only pulls items out of the chest from the positions that are defined in the configuration of the injector. In this case\\, item type and position must match. This allows to empty specific inventory entries of a chest. \n".. + "\n".. + "The processing power is up to 8 times one item every 4 seconds.\n".. + "\n".. + "\n".. + "\n", "", "The Techage Info Tool (wrench) has several functions. It shows the time\\, position\\, temperature and biome when an unknown block is clicked on.\n".. "If you click on a TechAge block with command interface\\, all available data will be shown (see also \"Logic / switching blocks\").\n".. @@ -1570,11 +1581,9 @@ techage.manual_EN.aText = { "\n".. "\n".. "\n", - "The injector is a TA4 pusher with special properties. It has a menu for configuration. Up to 8 items can be configured here. He only takes these items from a chest (TA4 chest or TA4 8x2000 chest) to pass them on to machines with recipes (autocrafter\\, industrial furnace and electronic fab).\n".. + "The function corresponds to that of TA3.\n".. "\n".. - "When passing on\\, only one position in the inventory is used in the target machine. If\\, for example\\, only the first three entries are configured in the injector\\, only the first three storage locations in the machine's inventory are used. So that an overflow in the machine inventory is prevented.\n".. - "\n".. - "The processing power is up to 8 items every 3 seconds.\n".. + "The processing power is up to 8 times four items every 4 seconds.\n".. "\n".. "\n".. "\n", @@ -1720,6 +1729,7 @@ techage.manual_EN.aItemName = { "ta3_gravelsieve", "ta3_gravelrinser", "ta3_grinder", + "ta3_injector", "", "ta3_end_wrench", "ta3_programmer", @@ -1923,6 +1933,7 @@ techage.manual_EN.aPlanTable = { "", "", "", + "", "ta4_windturbine", "", "", diff --git a/furnace/furnace_top.lua b/furnace/furnace_top.lua index 1c894e9..52e7642 100644 --- a/furnace/furnace_top.lua +++ b/furnace/furnace_top.lua @@ -220,6 +220,14 @@ tiles.pas = { tiles.act = tiles.pas local tubing = { + on_inv_request = function(pos, in_dir, access_type) + if access_type == "push" then + local meta = minetest.get_meta(pos) + if meta:get_int("push_dir") == in_dir or in_dir == 5 then + return meta:get_inventory(), "src" + end + end + end, on_pull_item = function(pos, in_dir, num) local meta = minetest.get_meta(pos) if meta:get_int("pull_dir") == in_dir then diff --git a/locale/techage.de.tr b/locale/techage.de.tr index eade8b8..ea4a3cd 100644 --- a/locale/techage.de.tr +++ b/locale/techage.de.tr @@ -963,6 +963,10 @@ TA4 Reactor=TA4 Reaktor Configure up to 8 items @nto be pushed by the injector=Konfiguriere bis zu 8 Gegenstände \n die vom Injektor weitergegeben werden sollen Injector=Injektor +Switch to pull mode @nto pull items out of inventory slots @naccording the injector configuration=Wechsle in den "Ziehe-Modus",@num Items gemäß der Injektor-Konfiguration@naus einem Inventar zu ziehen + +pull mode= Ziehe-Modus + ### ta4_liquid_filter.lua ### TA4 Liquid Filter Filler=TA4 Flüssigkeitsfilter Einfüllstutzen diff --git a/locale/template.txt b/locale/template.txt index aec339c..dc26867 100644 --- a/locale/template.txt +++ b/locale/template.txt @@ -963,6 +963,10 @@ TA4 Reactor= Configure up to 8 items @nto be pushed by the injector= Injector= +Switch to pull mode @nto pull items out of inventory slots @naccording the injector configuration= + +pull mode= + ### ta4_liquid_filter.lua ### TA4 Liquid Filter Filler= diff --git a/manuals/manual_ta3_DE.md b/manuals/manual_ta3_DE.md index 9d096bd..aeadede 100644 --- a/manuals/manual_ta3_DE.md +++ b/manuals/manual_ta3_DE.md @@ -788,6 +788,20 @@ Die Verarbeitungsleistung beträgt 2 Items alle 4 s. Der Block benötigt 6 ku St [ta3_grinder|image] +### TA3 Injektor / Injector + +Der Injektor ist ein TA3 Schieber mit speziellen Eigenschaften. Er besitzt ein Menü zur Konfiguration. Hier können bis zu 8 Items konfiguriert werden. Er entnimmt nur diese Items einer Kiste um sie an Maschinen mit Rezepturen weiterzugeben (Autocrafter, Industrieofen und Elektronikfabrik). + +Beim Weitergeben wird in der Zielmaschine pro Item nur eine Position im Inventar genutzt. Sind bspw. nur die ersten drei Einträge im Injektor konfiguriert, so werden auch nur die ersten drei Speicherplätze im Inventar der Maschine belegt. Damit wir ein Überlauf im Inventar der Maschine verhindert. + +Der Injektor kann auch auf "Ziehe-Modus" umgeschaltet werden. Dann zieht er nur Items von den Positionen aus der Kiste, die in der Konfiguration des Injektors definiert sind. Hier müssen also Item-Typ und Position überein stimmen. Damit können geziehlt Speicherplätze im Inventar einer Kiste geleert werden. + +Die Verarbeitungsleistung beträgt bis zu 8 mal ein Item alle 4 Sekunden. + +[ta3_injector|image] + + + ## Werkzeuge diff --git a/manuals/manual_ta3_EN.md b/manuals/manual_ta3_EN.md index 21cd66e..085d8cc 100644 --- a/manuals/manual_ta3_EN.md +++ b/manuals/manual_ta3_EN.md @@ -763,6 +763,20 @@ The processing power is 2 items every 4 s. The block requires 6 ku of electricit [ta3_grinder|image] +### TA3 Injector + +The injector is a TA3 pusher with special properties. It has a menu for configuration. Up to 8 items can be configured here. He only takes these items from a chest to pass them on to machines with recipes (autocrafter, industrial furnace and electronic fab). + +When passing on, only one position in the inventory is used in the target machine. If, for example, only the first three entries are configured in the injector, only the first three storage locations in the machine's inventory are used. So that an overflow in the machine inventory is prevented. + +The injector can also be switched to "pull mode". Then he only pulls items out of the chest from the positions that are defined in the configuration of the injector. In this case, item type and position must match. This allows to empty specific inventory entries of a chest. + +The processing power is up to 8 times one item every 4 seconds. + +[ta3_injector|image] + + + ## Tools diff --git a/manuals/manual_ta4_DE.md b/manuals/manual_ta4_DE.md index dd59e7e..b5699e4 100644 --- a/manuals/manual_ta4_DE.md +++ b/manuals/manual_ta4_DE.md @@ -657,11 +657,9 @@ Die Verarbeitungsleistung beträgt ein Chip alle 6 s. Der Block benötigt hierf ### TA4 Injektor / Injector -Der Injektor ist ein TA4 Schieber mit speziellen Eigenschaften. Er besitzt ein Menü zur Konfiguration. Hier können bis zu 8 Items konfiguriert werden. Er entnimmt nur diese Items einer Kiste (TA4 Kiste oder TA4 8x2000 Kiste) um sie an Maschinen mit Rezepturen weiterzugeben (Autocrafter, Industrieofen und Elektronikfabrik). +Die Funktion entspricht der von TA3. -Beim Weitergeben wird in der Zielmaschine pro Item nur eine Position im Inventar genutzt. Sind bspw. nur die ersten drei Einträge im Injektor konfiguriert, so werden auch nur die ersten drei Speicherplätze im Inventar der Maschine belegt. Damit wir ein Überlauf im Inventar der Maschine verhindert. - -Die Verarbeitungsleistung beträgt bis zu 8 Items alle 3 Sekunden. +Die Verarbeitungsleistung beträgt bis zu 8 mal vier Items alle 4 Sekunden. [ta4_injector|image] diff --git a/manuals/manual_ta4_EN.md b/manuals/manual_ta4_EN.md index 9f7b76d..99e4be5 100644 --- a/manuals/manual_ta4_EN.md +++ b/manuals/manual_ta4_EN.md @@ -658,11 +658,9 @@ The processing power is one chip every 6 s. The block requires 12 ku of electric ### TA4 Injector -The injector is a TA4 pusher with special properties. It has a menu for configuration. Up to 8 items can be configured here. He only takes these items from a chest (TA4 chest or TA4 8x2000 chest) to pass them on to machines with recipes (autocrafter, industrial furnace and electronic fab). +The function corresponds to that of TA3. -When passing on, only one position in the inventory is used in the target machine. If, for example, only the first three entries are configured in the injector, only the first three storage locations in the machine's inventory are used. So that an overflow in the machine inventory is prevented. - -The processing power is up to 8 items every 3 seconds. +The processing power is up to 8 times four items every 4 seconds. [ta4_injector|image] diff --git a/manuals/toc_DE.md b/manuals/toc_DE.md index c40c255..2bd89d9 100644 --- a/manuals/toc_DE.md +++ b/manuals/toc_DE.md @@ -119,6 +119,7 @@ - [TA3 Kiessieb / Gravel Sieve](./manual_ta3_DE.md#ta3-kiessieb--gravel-sieve) - [TA3 Kieswaschanlage / Gravel Rinser](./manual_ta3_DE.md#ta3-kieswaschanlage--gravel-rinser) - [TA3 Mühle / Grinder](./manual_ta3_DE.md#ta3-mühle--grinder) + - [TA3 Injektor / Injector](./manual_ta3_DE.md#ta3-injektor--injector) - [Werkzeuge](./manual_ta3_DE.md#werkzeuge) - [Techage Info Tool](./manual_ta3_DE.md#techage-info-tool) - [TechAge Programmer](./manual_ta3_DE.md#techage-programmer) diff --git a/manuals/toc_EN.md b/manuals/toc_EN.md index 6fa7de1..3dc4098 100644 --- a/manuals/toc_EN.md +++ b/manuals/toc_EN.md @@ -118,6 +118,7 @@ - [TA3 Gravel Sieve](./manual_ta3_EN.md#ta3-gravel-sieve) - [TA3 Gravel Rinser](./manual_ta3_EN.md#ta3-gravel-rinser) - [TA3 Grinder](./manual_ta3_EN.md#ta3-grinder) + - [TA3 Injector](./manual_ta3_EN.md#ta3-injector) - [Tools](./manual_ta3_EN.md#tools) - [Techage Info Tool](./manual_ta3_EN.md#techage-info-tool) - [TechAge Programmer](./manual_ta3_EN.md#techage-programmer) diff --git a/power/ta4_cable.lua b/power/ta4_cable.lua index 1e169bc..e8df022 100644 --- a/power/ta4_cable.lua +++ b/power/ta4_cable.lua @@ -139,7 +139,7 @@ minetest.register_node("techage:ta4_power_box", { connect_back = {{-1/16, -1/16, 0, 1/16, 1/16, 1/2}}, connect_front = {{-1/16, -1/16, -1/2, 1/16, 1/16, 0}}, }, - connects_to = {"techage:ta4_power_cableA", "techage:ta4_power_cableS"}, + connects_to = {"techage:ta4_power_cableA", "techage:ta4_power_cableS", "techage:ta4_solar_inverter"}, after_place_node = function(pos, placer, itemstack, pointed_thing) Cable:after_place_node(pos)