Revice TA4 Injector, add TA3 Injector

This commit is contained in:
Joachim Stolberg 2021-03-08 21:27:51 +01:00
parent 5d3b4213ab
commit 276a6a37f3
20 changed files with 246 additions and 45 deletions

View File

@ -347,6 +347,14 @@ tiles.act = {
} }
local tubing = { 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) on_pull_item = function(pos, in_dir, num)
local meta = minetest.get_meta(pos) local meta = minetest.get_meta(pos)
if meta:get_int("pull_dir") == in_dir then if meta:get_int("pull_dir") == in_dir then

View File

@ -149,6 +149,10 @@ minetest.register_node("techage:chest_ta3", {
}) })
techage.register_node({"techage:chest_ta2", "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) on_pull_item = function(pos, in_dir, num, item_name)
local meta = minetest.get_meta(pos) local meta = minetest.get_meta(pos)
local inv = meta:get_inventory() local inv = meta:get_inventory()
@ -332,6 +336,10 @@ minetest.register_node("techage:chest_ta4", {
techage.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) on_pull_item = function(pos, in_dir, num, item_name)
local meta = minetest.get_meta(pos) local meta = minetest.get_meta(pos)
local inv = meta:get_inventory() local inv = meta:get_inventory()

View File

@ -171,6 +171,14 @@ tiles.act = {
} }
local tubing = { 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) on_pull_item = function(pos, in_dir, num)
local meta = minetest.get_meta(pos) local meta = minetest.get_meta(pos)
if meta:get_int("pull_dir") == in_dir then if meta:get_int("pull_dir") == in_dir then

View File

@ -30,6 +30,10 @@ end
techage.register_node({"default:chest", "default:chest_open"}, { 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) on_pull_item = function(pos, in_dir, num)
local meta = minetest.get_meta(pos) local meta = minetest.get_meta(pos)
local inv = meta:get_inventory() 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"}, { 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) on_pull_item = function(pos, in_dir, num)
local meta = minetest.get_meta(pos) local meta = minetest.get_meta(pos)
if is_owner(pos, meta) then if is_owner(pos, meta) then

View File

@ -34,6 +34,10 @@ end
------------------------------------------------------------------------------ ------------------------------------------------------------------------------
techage.register_node({"digtron:inventory"}, { 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) on_pull_item = function(pos, in_dir, num)
local meta = minetest.get_meta(pos) local meta = minetest.get_meta(pos)
local inv = meta:get_inventory() local inv = meta:get_inventory()
@ -52,6 +56,10 @@ techage.register_node({"digtron:inventory"}, {
}) })
techage.register_node({"digtron:fuelstore"}, { 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) on_pull_item = function(pos, in_dir, num)
local meta = minetest.get_meta(pos) local meta = minetest.get_meta(pos)
local inv = meta:get_inventory() local inv = meta:get_inventory()
@ -70,6 +78,10 @@ techage.register_node({"digtron:fuelstore"}, {
}) })
techage.register_node({"digtron:combined_storage"}, { 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) on_pull_item = function(pos, in_dir, num)
local meta = minetest.get_meta(pos) local meta = minetest.get_meta(pos)
local inv = meta:get_inventory() local inv = meta:get_inventory()
@ -97,6 +109,10 @@ techage.register_node({"digtron:combined_storage"}, {
------------------------------------------------------------------------------ ------------------------------------------------------------------------------
techage.register_node({"protector:chest"}, { 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) on_pull_item = function(pos, in_dir, num)
local meta = minetest.get_meta(pos) local meta = minetest.get_meta(pos)
local inv = meta:get_inventory() local inv = meta:get_inventory()

View File

@ -18,27 +18,29 @@ local S = techage.S
-- Consumer Related Data -- Consumer Related Data
local CRD = function(pos) return (minetest.registered_nodes[techage.get_node_lvm(pos).name] or {}).consumer end 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 STANDBY_TICKS = 2
local COUNTDOWN_TICKS = 4 local COUNTDOWN_TICKS = 3
local CYCLE_TIME = 3 local CYCLE_TIME = 4
local function formspec(self, pos, nvm) local function formspec(self, pos, nvm)
if CRD(pos).stage == 4 then -- TA4 node? local pull_mode = dump(nvm.pull_mode or false)
return "size[8,7.2]".. return "size[8,7.2]"..
default.gui_bg.. default.gui_bg..
default.gui_bg_img.. default.gui_bg_img..
default.gui_slots.. default.gui_slots..
"box[0,-0.1;7.8,0.5;#c6e8ff]".. "box[0,-0.1;7.8,0.5;#c6e8ff]"..
"label[3,-0.1;"..minetest.colorize("#000000", S("Injector")).."]".. "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")).. 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;]".. "list[context;filter;0,0.8;8,1;]"..
"image_button[3.5,2;1,1;".. self:get_state_button_image(nvm) ..";state_button;]".. "image_button[2,2;1,1;".. self:get_state_button_image(nvm) ..";state_button;]"..
"tooltip[3.5,2;1,1;"..self:get_state_tooltip(nvm).."]".. "tooltip[2,2;1,1;"..self:get_state_tooltip(nvm).."]"..
"list[current_player;main;0,3.5;8,4;]".. "checkbox[3.5,1.9;pull_mode;"..S("pull mode")..";"..pull_mode.."]"..
"listring[context;filter]".. "tooltip[3.5,1.9;2,0.8;"..tooltip..";#0C3D32;#FFFFFF]"..
"listring[current_player;main]" "list[current_player;main;0,3.5;8,4;]"..
end "listring[context;filter]"..
"listring[current_player;main]"
end end
local function allow_metadata_inventory_put(pos, listname, index, stack, player) 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 inv = M(pos):get_inventory()
local list = inv:get_list(listname) local list = inv:get_list(listname)
if list[index]:get_count() == 0 then local cdr = CRD(pos)
stack:set_count(1) 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) inv:set_stack(listname, index, stack)
return 0 return 0
end end
@ -76,6 +80,67 @@ local function allow_metadata_inventory_take(pos, listname, index, stack, player
return 0 return 0
end 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 function pushing(pos, crd, meta, nvm)
local pull_dir = meta:get_int("pull_dir") local pull_dir = meta:get_int("pull_dir")
local push_dir = meta:get_int("push_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 for idx, item in ipairs(filter) do
local name = item:get_name() local name = item:get_name()
if name ~= "" then local num = math.min(item:get_count(), crd.num_items)
local items = techage.pull_items(pos, pull_dir, 1, name) if name ~= "" and num > 0 then
local items = pull_items(pos, pull_dir, nvm.pull_mode and idx, name, num)
if items ~= nil then if items ~= nil then
pulled = true 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 pushed = true
else -- place item back 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 end
end end
@ -119,6 +186,9 @@ local function on_receive_fields(pos, formname, fields, player)
return return
end end
local nvm = techage.get_nvm(pos) 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) CRD(pos).State:state_button_event(pos, nvm, fields)
M(pos):set_string("formspec", formspec(CRD(pos).State, pos, nvm)) M(pos):set_string("formspec", formspec(CRD(pos).State, pos, nvm))
end end
@ -174,7 +244,7 @@ local tubing = {
end, end,
} }
local _, _, node_name_ta4 = local _, node_name_ta3, node_name_ta4 =
techage.register_consumer("injector", S("Injector"), tiles, { techage.register_consumer("injector", S("Injector"), tiles, {
cycle_time = CYCLE_TIME, cycle_time = CYCLE_TIME,
standby_ticks = STANDBY_TICKS, standby_ticks = STANDBY_TICKS,
@ -193,6 +263,7 @@ local _, _, node_name_ta4 =
allow_metadata_inventory_put = allow_metadata_inventory_put, allow_metadata_inventory_put = allow_metadata_inventory_put,
allow_metadata_inventory_take = allow_metadata_inventory_take, allow_metadata_inventory_take = allow_metadata_inventory_take,
allow_metadata_inventory_move = function() return 0 end,
on_receive_fields = on_receive_fields, on_receive_fields = on_receive_fields,
node_timer = keep_running, node_timer = keep_running,
on_rotate = screwdriver.disallow, on_rotate = screwdriver.disallow,
@ -200,8 +271,17 @@ local _, _, node_name_ta4 =
groups = {choppy=2, cracky=2, crumbly=2}, groups = {choppy=2, cracky=2, crumbly=2},
is_ground_content = false, is_ground_content = false,
sounds = default.node_sound_wood_defaults(), sounds = default.node_sound_wood_defaults(),
num_items = {0,2,6,12}, num_items = {0,0,1,4},
}, {false, false, false, true}) }, {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({ minetest.register_craft({
output = node_name_ta4, output = node_name_ta4,
@ -211,4 +291,3 @@ minetest.register_craft({
{"", "basic_materials:ic", ""}, {"", "basic_materials:ic", ""},
}, },
}) })

View File

@ -250,6 +250,7 @@ end
-- Param names: List of node names like {"techage:pusher_off", "techage:pusher_on"} -- Param names: List of node names like {"techage:pusher_off", "techage:pusher_on"}
-- Param node_definition: A table according to: -- 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_pull_item = func(pos, in_dir, num, (opt.) item_name),
-- on_push_item = func(pos, in_dir, item), -- on_push_item = func(pos, in_dir, item),
-- on_unpull_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 -- 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) function techage.pull_items(pos, out_dir, num, item_name)
local npos, in_dir, name = get_dest_node(pos, out_dir) local npos, in_dir, name = get_dest_node(pos, out_dir)
if npos and NodeDef[name] and NodeDef[name].on_pull_item then if npos and NodeDef[name] and NodeDef[name].on_pull_item then

View File

@ -116,6 +116,7 @@ techage.Items = {
ta3_mesecons_converter = "techage:ta3_mesecons_converter", ta3_mesecons_converter = "techage:ta3_mesecons_converter",
ta3_valve = "techage:ta3_valve_closed", ta3_valve = "techage:ta3_valve_closed",
ta3_motor = "techage:ta3_motor_off", ta3_motor = "techage:ta3_motor_off",
ta3_injector = "techage:ta3_injector_pas",
---------------------------- ----------------------------
techage_ta4 = "techage_ta4.png", techage_ta4 = "techage_ta4.png",
ta4_windturbine = "techage:ta4_wind_turbine", ta4_windturbine = "techage:ta4_wind_turbine",

View File

@ -120,6 +120,7 @@ techage.manual_DE.aTitel = {
"3,TA3 Kiessieb / Gravel Sieve", "3,TA3 Kiessieb / Gravel Sieve",
"3,TA3 Kieswaschanlage / Gravel Rinser", "3,TA3 Kieswaschanlage / Gravel Rinser",
"3,TA3 Mühle / Grinder", "3,TA3 Mühle / Grinder",
"3,TA3 Injektor / Injector",
"2,Werkzeuge", "2,Werkzeuge",
"3,Techage Info Tool", "3,Techage Info Tool",
"3,TechAge Programmer", "3,TechAge Programmer",
@ -917,7 +918,6 @@ techage.manual_DE.aText = {
" <output> = on/off if <input-expression> is true\n".. " <output> = on/off if <input-expression> is true\n"..
"\n".. "\n"..
"'<output>' ist die Nummer des Blocks\\, zu dem das Kommando gesendet werden soll.\n".. "'<output>' ist die Nummer des Blocks\\, zu dem das Kommando gesendet werden soll.\n"..
"\n"..
"'<input-expression>' ist ein boolescher Ausdruck\\, bei dem Eingabenummern ausgewertet werden. \n".. "'<input-expression>' ist ein boolescher Ausdruck\\, bei dem Eingabenummern ausgewertet werden. \n"..
"\n".. "\n"..
"*Beispiele für den Input Ausdruck*\n".. "*Beispiele für den Input Ausdruck*\n"..
@ -1100,6 +1100,16 @@ techage.manual_DE.aText = {
"\n".. "\n"..
"\n".. "\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".. "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".. "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".. "\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".. "\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".. "Die Verarbeitungsleistung beträgt bis zu 8 mal vier Items alle 4 Sekunden.\n"..
"\n"..
"Die Verarbeitungsleistung beträgt bis zu 8 Items alle 3 Sekunden.\n"..
"\n".. "\n"..
"\n".. "\n"..
"\n", "\n",
@ -1745,6 +1753,7 @@ techage.manual_DE.aItemName = {
"ta3_gravelsieve", "ta3_gravelsieve",
"ta3_gravelrinser", "ta3_gravelrinser",
"ta3_grinder", "ta3_grinder",
"ta3_injector",
"", "",
"ta3_end_wrench", "ta3_end_wrench",
"ta3_programmer", "ta3_programmer",
@ -1949,6 +1958,7 @@ techage.manual_DE.aPlanTable = {
"", "",
"", "",
"", "",
"",
"ta4_windturbine", "ta4_windturbine",
"", "",
"", "",

View File

@ -119,6 +119,7 @@ techage.manual_EN.aTitel = {
"3,TA3 Gravel Sieve", "3,TA3 Gravel Sieve",
"3,TA3 Gravel Rinser", "3,TA3 Gravel Rinser",
"3,TA3 Grinder", "3,TA3 Grinder",
"3,TA3 Injector",
"2,Tools", "2,Tools",
"3,Techage Info Tool", "3,Techage Info Tool",
"3,TechAge Programmer", "3,TechAge Programmer",
@ -1076,6 +1077,16 @@ techage.manual_EN.aText = {
"\n".. "\n"..
"\n".. "\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".. "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".. "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".. "\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".. "\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".. "The processing power is up to 8 times four items every 4 seconds.\n"..
"\n"..
"The processing power is up to 8 items every 3 seconds.\n"..
"\n".. "\n"..
"\n".. "\n"..
"\n", "\n",
@ -1720,6 +1729,7 @@ techage.manual_EN.aItemName = {
"ta3_gravelsieve", "ta3_gravelsieve",
"ta3_gravelrinser", "ta3_gravelrinser",
"ta3_grinder", "ta3_grinder",
"ta3_injector",
"", "",
"ta3_end_wrench", "ta3_end_wrench",
"ta3_programmer", "ta3_programmer",
@ -1923,6 +1933,7 @@ techage.manual_EN.aPlanTable = {
"", "",
"", "",
"", "",
"",
"ta4_windturbine", "ta4_windturbine",
"", "",
"", "",

View File

@ -220,6 +220,14 @@ tiles.pas = {
tiles.act = tiles.pas tiles.act = tiles.pas
local tubing = { 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) on_pull_item = function(pos, in_dir, num)
local meta = minetest.get_meta(pos) local meta = minetest.get_meta(pos)
if meta:get_int("pull_dir") == in_dir then if meta:get_int("pull_dir") == in_dir then

View File

@ -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 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 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.lua ###
TA4 Liquid Filter Filler=TA4 Flüssigkeitsfilter Einfüllstutzen TA4 Liquid Filter Filler=TA4 Flüssigkeitsfilter Einfüllstutzen

View File

@ -963,6 +963,10 @@ TA4 Reactor=
Configure up to 8 items @nto be pushed by the injector= Configure up to 8 items @nto be pushed by the injector=
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.lua ###
TA4 Liquid Filter Filler= TA4 Liquid Filter Filler=

View File

@ -788,6 +788,20 @@ Die Verarbeitungsleistung beträgt 2 Items alle 4 s. Der Block benötigt 6 ku St
[ta3_grinder|image] [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 ## Werkzeuge

View File

@ -763,6 +763,20 @@ The processing power is 2 items every 4 s. The block requires 6 ku of electricit
[ta3_grinder|image] [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 ## Tools

View File

@ -657,11 +657,9 @@ Die Verarbeitungsleistung beträgt ein Chip alle 6 s. Der Block benötigt hierf
### TA4 Injektor / Injector ### 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 mal vier Items alle 4 Sekunden.
Die Verarbeitungsleistung beträgt bis zu 8 Items alle 3 Sekunden.
[ta4_injector|image] [ta4_injector|image]

View File

@ -658,11 +658,9 @@ The processing power is one chip every 6 s. The block requires 12 ku of electric
### TA4 Injector ### 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 times four items every 4 seconds.
The processing power is up to 8 items every 3 seconds.
[ta4_injector|image] [ta4_injector|image]

View File

@ -119,6 +119,7 @@
- [TA3 Kiessieb / Gravel Sieve](./manual_ta3_DE.md#ta3-kiessieb--gravel-sieve) - [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 Kieswaschanlage / Gravel Rinser](./manual_ta3_DE.md#ta3-kieswaschanlage--gravel-rinser)
- [TA3 Mühle / Grinder](./manual_ta3_DE.md#ta3-mühle--grinder) - [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) - [Werkzeuge](./manual_ta3_DE.md#werkzeuge)
- [Techage Info Tool](./manual_ta3_DE.md#techage-info-tool) - [Techage Info Tool](./manual_ta3_DE.md#techage-info-tool)
- [TechAge Programmer](./manual_ta3_DE.md#techage-programmer) - [TechAge Programmer](./manual_ta3_DE.md#techage-programmer)

View File

@ -118,6 +118,7 @@
- [TA3 Gravel Sieve](./manual_ta3_EN.md#ta3-gravel-sieve) - [TA3 Gravel Sieve](./manual_ta3_EN.md#ta3-gravel-sieve)
- [TA3 Gravel Rinser](./manual_ta3_EN.md#ta3-gravel-rinser) - [TA3 Gravel Rinser](./manual_ta3_EN.md#ta3-gravel-rinser)
- [TA3 Grinder](./manual_ta3_EN.md#ta3-grinder) - [TA3 Grinder](./manual_ta3_EN.md#ta3-grinder)
- [TA3 Injector](./manual_ta3_EN.md#ta3-injector)
- [Tools](./manual_ta3_EN.md#tools) - [Tools](./manual_ta3_EN.md#tools)
- [Techage Info Tool](./manual_ta3_EN.md#techage-info-tool) - [Techage Info Tool](./manual_ta3_EN.md#techage-info-tool)
- [TechAge Programmer](./manual_ta3_EN.md#techage-programmer) - [TechAge Programmer](./manual_ta3_EN.md#techage-programmer)

View File

@ -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_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}}, 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) after_place_node = function(pos, placer, itemstack, pointed_thing)
Cable:after_place_node(pos) Cable:after_place_node(pos)