Merge pull request #33 from Thomas--S/hp_distributor

Add TA4 High Performance Distributor
This commit is contained in:
Joachim Stolberg 2020-10-03 11:29:14 +02:00 committed by GitHub
commit 20beb85247
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
16 changed files with 220 additions and 112 deletions

View File

@ -99,17 +99,17 @@ local function get_filter_settings(pos)
return FilterCache[hash].ItemFilter, FilterCache[hash].OpenPorts return FilterCache[hash].ItemFilter, FilterCache[hash].OpenPorts
end end
local function blocking_checkbox(pos, filter) local function blocking_checkbox(pos, filter, is_hp)
local cnt = 0 local cnt = 0
local _, open_ports = get_filter_settings(pos) local _, open_ports = get_filter_settings(pos)
local fs_pos = is_hp and "0.25,5" or "3,3.9"
for _,val in ipairs(filter) do for _,val in ipairs(filter) do
if val then cnt = cnt + 1 end if val then cnt = cnt + 1 end
end end
if cnt > 1 and #open_ports > 0 then if cnt > 1 and #open_ports > 0 then
local blocking = M(pos):get_int("blocking") == 1 and "true" or "false" local blocking = M(pos):get_int("blocking") == 1 and "true" or "false"
return "checkbox[3,3.9;blocking;"..S("blocking mode")..";"..blocking.."]".. return "checkbox["..fs_pos..";blocking;"..S("blocking mode")..";"..blocking.."]"..
"tooltip[3,3.9;1,1;"..S("Block configured items for open ports")..";#0C3D32;#FFFFFF]" "tooltip["..fs_pos..";1,1;"..S("Block configured items for open ports")..";#0C3D32;#FFFFFF]"
else else
M(pos):set_int("blocking", 0) -- disable blocking M(pos):set_int("blocking", 0) -- disable blocking
end end
@ -118,11 +118,35 @@ end
local function formspec(self, pos, nvm) local function formspec(self, pos, nvm)
local filter = minetest.deserialize(M(pos):get_string("filter")) or {false,false,false,false} local filter = minetest.deserialize(M(pos):get_string("filter")) or {false,false,false,false}
local blocking = blocking_checkbox(pos, filter) local is_hp = nvm.high_performance == true
local blocking = blocking_checkbox(pos, filter, is_hp)
if is_hp then
return "size[10.5,9.5]"..
"box[0.25,-0.1;9.6,1.1;#005500]"..
"label[0.6,0.2;"..S("Input").."]"..
"list[context;src;1.75,0;8,1;]"..
blocking..
"image_button[0.25,5.8;1,1;"..self:get_state_button_image(nvm)..";state_button;]"..
"tooltip[0.25,5.8;1,1;"..self:get_state_tooltip(nvm).."]"..
"checkbox[0.25,1.2;filter1;On;"..dump(filter[1]).."]"..
"checkbox[0.25,2.2;filter2;On;"..dump(filter[2]).."]"..
"checkbox[0.25,3.2;filter3;On;"..dump(filter[3]).."]"..
"checkbox[0.25,4.2;filter4;On;"..dump(filter[4]).."]"..
"image[1.25,1.2;0.3,1;techage_inv_red.png]"..
"image[1.25,2.2;0.3,1;techage_inv_green.png]"..
"image[1.25,3.2;0.3,1;techage_inv_blue.png]"..
"image[1.25,4.2;0.3,1;techage_inv_yellow.png]"..
"list[context;red;1.75,1.2;8,1;]"..
"list[context;green;1.75,2.2;8,1;]"..
"list[context;blue;1.75,3.2;8,1;]"..
"list[context;yellow;1.75,4.2;8,1;]"..
"list[current_player;main;1.75,5.8;8,4;]"..
"listring[context;src]"..
"listring[current_player;main]"..
default.get_hotbar_bg(1.75,5.8)
else
return "size[10.5,8.5]".. return "size[10.5,8.5]"..
default.gui_bg..
default.gui_bg_img..
default.gui_slots..
"list[context;src;0,0;2,4;]".. "list[context;src;0,0;2,4;]"..
blocking.. blocking..
"image[2,1.5;1,1;techage_form_arrow.png]".. "image[2,1.5;1,1;techage_form_arrow.png]"..
@ -145,6 +169,7 @@ local function formspec(self, pos, nvm)
"listring[current_player;main]".. "listring[current_player;main]"..
default.get_hotbar_bg(1.25,4.8) default.get_hotbar_bg(1.25,4.8)
end end
end
local function allow_metadata_inventory_put(pos, listname, index, stack, player) local function allow_metadata_inventory_put(pos, listname, index, stack, player)
local inv = M(pos):get_inventory() local inv = M(pos):get_inventory()
@ -357,22 +382,24 @@ local function can_dig(pos, player)
return inv:is_empty("src") return inv:is_empty("src")
end end
local get_tiles = function(is_hp)
local variant = is_hp and "_hp" or ""
local tiles = {} local tiles = {}
-- '#' will be replaced by the stage number -- '#' will be replaced by the stage number
-- '{power}' will be replaced by the power PNG -- '{power}' will be replaced by the power PNG
tiles.pas = { tiles.pas = {
-- up, down, right, left, back, front -- up, down, right, left, back, front
"techage_filling_ta#.png^techage_appl_distri.png^techage_frame_ta#_top.png^techage_appl_color_top.png", "techage_filling_ta#.png^techage_appl_distri.png^techage_frame_ta#_top"..variant..".png^techage_appl_color_top.png",
"techage_filling_ta#.png^techage_frame_ta#.png", "techage_filling_ta#.png^techage_frame_ta#_top"..variant..".png^(techage_appl_color_top.png^[transformFY)",
"techage_filling_ta#.png^techage_frame_ta#.png^techage_appl_distri_yellow.png", "techage_filling_ta#.png^techage_frame_ta#"..variant..".png^techage_appl_distri_yellow.png",
"techage_filling_ta#.png^techage_frame_ta#.png^techage_appl_distri_green.png", "techage_filling_ta#.png^techage_frame_ta#"..variant..".png^techage_appl_distri_green.png",
"techage_filling_ta#.png^techage_frame_ta#.png^techage_appl_distri_red.png", "techage_filling_ta#.png^techage_frame_ta#"..variant..".png^techage_appl_distri_red.png",
"techage_filling_ta#.png^techage_frame_ta#.png^techage_appl_distri_blue.png", "techage_filling_ta#.png^techage_frame_ta#"..variant..".png^techage_appl_distri_blue.png",
} }
tiles.act = { tiles.act = {
-- up, down, right, left, back, front -- up, down, right, left, back, front
{ {
image = "techage_filling4_ta#.png^techage_appl_distri4.png^techage_frame4_ta#_top.png^techage_appl_color_top4.png", image = "techage_filling4_ta#.png^techage_appl_distri4.png^techage_frame4_ta#_top"..variant..".png^techage_appl_color_top4.png",
backface_culling = false, backface_culling = false,
animation = { animation = {
type = "vertical_frames", type = "vertical_frames",
@ -381,12 +408,14 @@ tiles.act = {
length = 1.0, length = 1.0,
}, },
}, },
"techage_filling_ta#.png^techage_frame_ta#.png^techage_appl_color_top.png", "techage_filling_ta#.png^techage_frame_ta#_top"..variant..".png^(techage_appl_color_top.png^[transformFY)",
"techage_filling_ta#.png^techage_frame_ta#.png^techage_appl_distri_yellow.png", "techage_filling_ta#.png^techage_frame_ta#"..variant..".png^techage_appl_distri_yellow.png",
"techage_filling_ta#.png^techage_frame_ta#.png^techage_appl_distri_green.png", "techage_filling_ta#.png^techage_frame_ta#"..variant..".png^techage_appl_distri_green.png",
"techage_filling_ta#.png^techage_frame_ta#.png^techage_appl_distri_red.png", "techage_filling_ta#.png^techage_frame_ta#"..variant..".png^techage_appl_distri_red.png",
"techage_filling_ta#.png^techage_frame_ta#.png^techage_appl_distri_blue.png", "techage_filling_ta#.png^techage_frame_ta#"..variant..".png^techage_appl_distri_blue.png",
} }
return tiles
end
local tubing = { local tubing = {
on_pull_item = function(pos, in_dir, num) on_pull_item = function(pos, in_dir, num)
@ -419,8 +448,7 @@ local tubing = {
end, end,
} }
local node_name_ta2, node_name_ta3, node_name_ta4 = local def = {
techage.register_consumer("distributor", S("Distributor"), tiles, {
cycle_time = CYCLE_TIME, cycle_time = CYCLE_TIME,
standby_ticks = STANDBY_TICKS, standby_ticks = STANDBY_TICKS,
formspec = formspec, formspec = formspec,
@ -469,7 +497,38 @@ local node_name_ta2, node_name_ta3, node_name_ta4 =
groups = {choppy=2, cracky=2, crumbly=2}, groups = {choppy=2, cracky=2, crumbly=2},
sounds = default.node_sound_wood_defaults(), sounds = default.node_sound_wood_defaults(),
num_items = {0,4,12,24}, num_items = {0,4,12,24},
}) }
local node_name_ta2, node_name_ta3, node_name_ta4 = techage.register_consumer(
"distributor",
S("Distributor"),
get_tiles(false),
def
)
local hp_def = table.copy(def)
hp_def.after_place_node = function(pos, placer)
local meta = M(pos)
local nvm = techage.get_nvm(pos)
nvm.high_performance = true
local filter = {false,false,false,false}
meta:set_string("filter", minetest.serialize(filter))
local inv = meta:get_inventory()
inv:set_size('src', 8)
inv:set_size('yellow', 8)
inv:set_size('green', 8)
inv:set_size('red', 8)
inv:set_size('blue', 8)
end
hp_def.num_items = {0,0,0,36}
local _, _, node_name_ta4_hp = techage.register_consumer(
"high_performance_distributor", S("High Performance Distributor"),
get_tiles(true),
hp_def,
{false, false, false, true}
)
minetest.register_craft({ minetest.register_craft({
output = node_name_ta2.." 2", output = node_name_ta2.." 2",
@ -497,3 +556,12 @@ minetest.register_craft({
{"", "techage:ta4_wlanchip", ""}, {"", "techage:ta4_wlanchip", ""},
}, },
}) })
minetest.register_craft({
output = node_name_ta4_hp,
recipe = {
{node_name_ta4, "default:copper_ingot"},
{"default:mese_crystal_fragment", node_name_ta4},
},
})

View File

@ -161,6 +161,7 @@ techage.Items = {
ta4_collector = "techage:ta4_collector", ta4_collector = "techage:ta4_collector",
ta4_pusher = "techage:ta4_pusher_pas", ta4_pusher = "techage:ta4_pusher_pas",
ta4_distributor = "techage:ta4_distributor_pas", ta4_distributor = "techage:ta4_distributor_pas",
ta4_high_performance_distributor = "techage:ta4_high_performance_distributor_pas",
ta4_gravelsieve = "techage:ta4_gravelsieve_pas", ta4_gravelsieve = "techage:ta4_gravelsieve_pas",
ta4_grinder = "techage:ta4_grinder_pas", ta4_grinder = "techage:ta4_grinder_pas",
ta4_detector = "techage:ta4_detector_off", ta4_detector = "techage:ta4_detector_off",

View File

@ -184,6 +184,7 @@ techage.manual_DE.aTitel = {
"3,TA4 Kiste / TA4 Chest", "3,TA4 Kiste / TA4 Chest",
"3,TA4 8x2000 Kiste / TA4 8x2000 Chest", "3,TA4 8x2000 Kiste / TA4 8x2000 Chest",
"3,TA4 Verteiler / Distributor", "3,TA4 Verteiler / Distributor",
"3,TA4 Hochleistungs-Verteiler / High Performance Distributor",
"3,TA4 Kiessieb / Gravel Sieve", "3,TA4 Kiessieb / Gravel Sieve",
"3,TA4 Mühle / Grinder", "3,TA4 Mühle / Grinder",
"3,TA4 Steinbrecher / Quarry", "3,TA4 Steinbrecher / Quarry",
@ -1505,6 +1506,12 @@ techage.manual_DE.aText = {
"\n".. "\n"..
"\n".. "\n"..
"\n", "\n",
"Die Funktion entspricht dem normalen TA4 Verteiler\\, mit zwei Unterschieden:\n"..
"Die Verarbeitungsleistung beträgt 36 Items alle 4 s\\, sofern auf allen Seiten TA4 Röhren verwendet werden. Anderenfalls sind es nur 18 Items alle 4 s.\n"..
"Außerdem können pro Ausgang bis zu 8 Items konfiguriert werden.\n"..
"\n"..
"\n"..
"\n",
"Die Funktion entspricht der von TA2.\n".. "Die Funktion entspricht der von TA2.\n"..
"Die Verarbeitungsleistung beträgt 4 Items alle 4 s. Der Block benötigt 5 ku Strom.\n".. "Die Verarbeitungsleistung beträgt 4 Items alle 4 s. Der Block benötigt 5 ku Strom.\n"..
"\n".. "\n"..
@ -1721,6 +1728,7 @@ techage.manual_DE.aItemName = {
"ta4_chest", "ta4_chest",
"ta4_8x2000_chest", "ta4_8x2000_chest",
"ta4_distributor", "ta4_distributor",
"ta4_high_performance_distributor",
"ta4_gravelsieve", "ta4_gravelsieve",
"ta4_grinder", "ta4_grinder",
"ta4_quarry", "ta4_quarry",
@ -1917,5 +1925,6 @@ techage.manual_DE.aPlanTable = {
"", "",
"", "",
"", "",
"",
} }

View File

@ -184,6 +184,7 @@ techage.manual_EN.aTitel = {
"3,TA4 Chest", "3,TA4 Chest",
"3,TA4 8x2000 Chest", "3,TA4 8x2000 Chest",
"3,TA4 Distributor", "3,TA4 Distributor",
"3,TA4 High Performance Distributor",
"3,TA4 Gravel Sieve", "3,TA4 Gravel Sieve",
"3,TA4 Grinder", "3,TA4 Grinder",
"3,TA4 Quarry", "3,TA4 Quarry",
@ -1496,6 +1497,12 @@ techage.manual_EN.aText = {
"\n".. "\n"..
"\n".. "\n"..
"\n", "\n",
"The function corresponds to that of the normal TA4 distributor\\, with two differences:\n"..
"The processing power is 36 items every 4 s\\, provided TA4 tubes are used on all sides. Otherwise there are only 18 items every 4 s.\n"..
"Furthermore\\, up to 8 items can be configured per direction.\n"..
"\n"..
"\n"..
"\n",
"The function corresponds to that of TA2.\n".. "The function corresponds to that of TA2.\n"..
"The processing power is 4 items every 4 s. The block requires 5 ku of electricity.\n".. "The processing power is 4 items every 4 s. The block requires 5 ku of electricity.\n"..
"\n".. "\n"..
@ -1712,6 +1719,7 @@ techage.manual_EN.aItemName = {
"ta4_chest", "ta4_chest",
"ta4_8x2000_chest", "ta4_8x2000_chest",
"ta4_distributor", "ta4_distributor",
"ta4_high_performance_distributor",
"ta4_gravelsieve", "ta4_gravelsieve",
"ta4_grinder", "ta4_grinder",
"ta4_quarry", "ta4_quarry",
@ -1908,5 +1916,6 @@ techage.manual_EN.aPlanTable = {
"", "",
"", "",
"", "",
"",
} }

View File

@ -85,11 +85,13 @@ Grinder=Mühle
Grinding=Mahlen Grinding=Mahlen
Heat=Hitze Heat=Hitze
Heat Exchanger=Wärmetauscher Heat Exchanger=Wärmetauscher
High Performance Distributor=Hochleistungs-Verteiler
Hole size=Lochgröße Hole size=Lochgröße
Hydrogen Cylinder Large=Wasserstoffflasche groß Hydrogen Cylinder Large=Wasserstoffflasche groß
Hydrogen Cylinder Small=Wasserstoffflasche klein Hydrogen Cylinder Small=Wasserstoffflasche klein
In use:=In Benutzung: In use:=In Benutzung:
Injector=Injektor Injector=Injektor
Input=Einspeisung
Insert destination node number(s)=Gebe Zielnummer(n) ein Insert destination node number(s)=Gebe Zielnummer(n) ein
Insert door/gate block number(s)=Gebe Tür-/Tornummer(n) ein Insert door/gate block number(s)=Gebe Tür-/Tornummer(n) ein
Intake=Stromaufnahme Intake=Stromaufnahme
@ -456,4 +458,3 @@ water temperature=Wassertemperatur
wrong catalyst=falscher Katalysator wrong catalyst=falscher Katalysator
wrong storage diameter=Falscher Wärmespeicher-Durchmesser wrong storage diameter=Falscher Wärmespeicher-Durchmesser
##### not used anymore ##### ##### not used anymore #####

View File

@ -83,11 +83,13 @@ Grinder=
Grinding= Grinding=
Heat= Heat=
Heat Exchanger= Heat Exchanger=
High Performance Distributor=
Hole size= Hole size=
Hydrogen Cylinder Large= Hydrogen Cylinder Large=
Hydrogen Cylinder Small= Hydrogen Cylinder Small=
In use:= In use:=
Injector= Injector=
Input=
Insert destination node number(s)= Insert destination node number(s)=
Insert door/gate block number(s)= Insert door/gate block number(s)=
Intake= Intake=

View File

@ -610,6 +610,14 @@ Die Verarbeitungsleistung beträgt 24 Items alle 4 s, sofern auf allen Seiten TA
[ta4_distributor|image] [ta4_distributor|image]
### TA4 Hochleistungs-Verteiler / High Performance Distributor
Die Funktion entspricht dem normalen TA4 Verteiler, mit zwei Unterschieden:
Die Verarbeitungsleistung beträgt 36 Items alle 4 s, sofern auf allen Seiten TA4 Röhren verwendet werden. Anderenfalls sind es nur 18 Items alle 4 s.
Außerdem können pro Ausgang bis zu 8 Items konfiguriert werden.
[ta4_high_performance_distributor|image]
### TA4 Kiessieb / Gravel Sieve ### TA4 Kiessieb / Gravel Sieve
Die Funktion entspricht der von TA2. Die Funktion entspricht der von TA2.

View File

@ -611,6 +611,14 @@ The processing power is 24 items every 4 s, provided TA4 tubes are used on all s
[ta4_distributor|image] [ta4_distributor|image]
### TA4 High Performance Distributor
The function corresponds to that of the normal TA4 distributor, with two differences:
The processing power is 36 items every 4 s, provided TA4 tubes are used on all sides. Otherwise there are only 18 items every 4 s.
Furthermore, up to 8 items can be configured per direction.
[ta4_high_performance_distributor|image]
### TA4 Gravel Sieve ### TA4 Gravel Sieve
The function corresponds to that of TA2. The function corresponds to that of TA2.

View File

@ -183,6 +183,7 @@
- [TA4 Kiste / TA4 Chest](./manual_ta4_DE.md#ta4-kiste--ta4-chest) - [TA4 Kiste / TA4 Chest](./manual_ta4_DE.md#ta4-kiste--ta4-chest)
- [TA4 8x2000 Kiste / TA4 8x2000 Chest](./manual_ta4_DE.md#ta4-8x2000-kiste--ta4-8x2000-chest) - [TA4 8x2000 Kiste / TA4 8x2000 Chest](./manual_ta4_DE.md#ta4-8x2000-kiste--ta4-8x2000-chest)
- [TA4 Verteiler / Distributor](./manual_ta4_DE.md#ta4-verteiler--distributor) - [TA4 Verteiler / Distributor](./manual_ta4_DE.md#ta4-verteiler--distributor)
- [TA4 Hochleistungs-Verteiler / High Performance Distributor](./manual_ta4_DE.md#ta4-hochleistungs-verteiler--high-performance-distributor)
- [TA4 Kiessieb / Gravel Sieve](./manual_ta4_DE.md#ta4-kiessieb--gravel-sieve) - [TA4 Kiessieb / Gravel Sieve](./manual_ta4_DE.md#ta4-kiessieb--gravel-sieve)
- [TA4 Mühle / Grinder](./manual_ta4_DE.md#ta4-mühle--grinder) - [TA4 Mühle / Grinder](./manual_ta4_DE.md#ta4-mühle--grinder)
- [TA4 Steinbrecher / Quarry](./manual_ta4_DE.md#ta4-steinbrecher--quarry) - [TA4 Steinbrecher / Quarry](./manual_ta4_DE.md#ta4-steinbrecher--quarry)

View File

@ -183,6 +183,7 @@
- [TA4 Chest](./manual_ta4_EN.md#ta4-chest) - [TA4 Chest](./manual_ta4_EN.md#ta4-chest)
- [TA4 8x2000 Chest](./manual_ta4_EN.md#ta4-8x2000-chest) - [TA4 8x2000 Chest](./manual_ta4_EN.md#ta4-8x2000-chest)
- [TA4 Distributor](./manual_ta4_EN.md#ta4-distributor) - [TA4 Distributor](./manual_ta4_EN.md#ta4-distributor)
- [TA4 High Performance Distributor](./manual_ta4_EN.md#ta4-high-performance-distributor)
- [TA4 Gravel Sieve](./manual_ta4_EN.md#ta4-gravel-sieve) - [TA4 Gravel Sieve](./manual_ta4_EN.md#ta4-gravel-sieve)
- [TA4 Grinder](./manual_ta4_EN.md#ta4-grinder) - [TA4 Grinder](./manual_ta4_EN.md#ta4-grinder)
- [TA4 Quarry](./manual_ta4_EN.md#ta4-quarry) - [TA4 Quarry](./manual_ta4_EN.md#ta4-quarry)

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB