mirror of
https://github.com/mt-mods/pipeworks.git
synced 2025-06-29 14:50:41 +02:00
Compare commits
39 Commits
luacheck-b
...
master
Author | SHA1 | Date | |
---|---|---|---|
e0b826576b | |||
858154cb78 | |||
dd660c3c1c | |||
dcc62eb231 | |||
222a865e17 | |||
ba2e4333c5 | |||
7079fff85f | |||
3189da7c9b | |||
a2ffaa9dc3 | |||
63bc754889 | |||
171faec7e9 | |||
2f9f9a7b54 | |||
02322855d5 | |||
b11cb37123 | |||
503c1190ed | |||
5bba517b03 | |||
66070dd801 | |||
7ee74133e1 | |||
c01bd7b888 | |||
e2fdcc4fb2 | |||
e4db1e885e | |||
f7839444cd | |||
93f5fb3d87 | |||
a535bebd2e | |||
be2776fc46 | |||
ee03959a65 | |||
4dd30df37a | |||
946da11206 | |||
77c8026400 | |||
70b521c721 | |||
6d795b7d34 | |||
92249b7941 | |||
e04fb691ad | |||
ac80224371 | |||
34262ed8d5 | |||
5cfe8d893f | |||
975e20f704 | |||
2693e2ecbb | |||
c93df73a5c |
@ -256,8 +256,11 @@ local function run_autocrafter(pos, elapsed)
|
|||||||
local inventory = meta:get_inventory()
|
local inventory = meta:get_inventory()
|
||||||
local craft = get_craft(pos, inventory)
|
local craft = get_craft(pos, inventory)
|
||||||
local output_item = craft.output.item
|
local output_item = craft.output.item
|
||||||
|
-- NALC: existence de limitgroup ?
|
||||||
|
local limitcraft = minetest.get_item_group(output_item:get_name(), "limitcraft") or 0
|
||||||
-- only use crafts that have an actual result
|
-- only use crafts that have an actual result
|
||||||
if output_item:is_empty() then
|
-- NALC: ou si l'item n'est pas dans le group limitcraft
|
||||||
|
if output_item:is_empty() or limitcraft > 0 then
|
||||||
meta:set_string("infotext", S("unconfigured Autocrafter: unknown recipe"))
|
meta:set_string("infotext", S("unconfigured Autocrafter: unknown recipe"))
|
||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
@ -598,11 +601,12 @@ minetest.register_node("pipeworks:autocrafter", {
|
|||||||
if #msg < 3 then return end
|
if #msg < 3 then return end
|
||||||
local inv = meta:get_inventory()
|
local inv = meta:get_inventory()
|
||||||
for y = 0, 2, 1 do
|
for y = 0, 2, 1 do
|
||||||
|
local row = msg[y + 1]
|
||||||
for x = 1, 3, 1 do
|
for x = 1, 3, 1 do
|
||||||
local slot = y * 3 + x
|
local slot = y * 3 + x
|
||||||
if minetest.registered_items[msg[y + 1][x]] then
|
if type(row) == "table" and minetest.registered_items[row[x]] then
|
||||||
inv:set_stack("recipe", slot, ItemStack(
|
inv:set_stack("recipe", slot, ItemStack(
|
||||||
msg[y + 1][x]))
|
row[x]))
|
||||||
else
|
else
|
||||||
inv:set_stack("recipe", slot, ItemStack(""))
|
inv:set_stack("recipe", slot, ItemStack(""))
|
||||||
end
|
end
|
||||||
|
12
common.lua
12
common.lua
@ -15,7 +15,17 @@ pipeworks.rules_all = {{x=0, y=0, z=1},{x=0, y=0, z=-1},{x=1, y=0, z=0},{x=-1, y
|
|||||||
{x=0, y=1, z=0}, {x=0, y=-1, z=0}}
|
{x=0, y=1, z=0}, {x=0, y=-1, z=0}}
|
||||||
|
|
||||||
pipeworks.mesecons_rules={{x=0,y=0,z=1},{x=0,y=0,z=-1},{x=1,y=0,z=0},{x=-1,y=0,z=0},{x=0,y=1,z=0},{x=0,y=-1,z=0}}
|
pipeworks.mesecons_rules={{x=0,y=0,z=1},{x=0,y=0,z=-1},{x=1,y=0,z=0},{x=-1,y=0,z=0},{x=0,y=1,z=0},{x=0,y=-1,z=0}}
|
||||||
pipeworks.digilines_rules={{x=0,y=0,z=1},{x=0,y=0,z=-1},{x=1,y=0,z=0},{x=-1,y=0,z=0},{x=0,y=1,z=0},{x=0,y=-1,z=0}}
|
|
||||||
|
local digilines_enabled = minetest.get_modpath("digilines") ~= nil
|
||||||
|
if digilines_enabled and pipeworks.enable_vertical_digilines_connectivity then
|
||||||
|
pipeworks.digilines_rules=digiline.rules.default
|
||||||
|
else
|
||||||
|
-- These rules break vertical connectivity to deployers, node breakers, dispensers, and digiline filter injectors
|
||||||
|
-- via digiline conducting tubes. Changing them may break some builds on some servers, so the setting was added
|
||||||
|
-- for server admins to be able to revert to the old "broken" behavior as some builds may use it as a "feature".
|
||||||
|
-- See https://github.com/mt-mods/pipeworks/issues/64
|
||||||
|
pipeworks.digilines_rules={{x=0,y=0,z=1},{x=0,y=0,z=-1},{x=1,y=0,z=0},{x=-1,y=0,z=0},{x=0,y=1,z=0},{x=0,y=-1,z=0}}
|
||||||
|
end
|
||||||
|
|
||||||
pipeworks.liquid_texture = minetest.registered_nodes[pipeworks.liquids.water.flowing].tiles[1]
|
pipeworks.liquid_texture = minetest.registered_nodes[pipeworks.liquids.water.flowing].tiles[1]
|
||||||
if type(pipeworks.liquid_texture) == "table" then pipeworks.liquid_texture = pipeworks.liquid_texture.name end
|
if type(pipeworks.liquid_texture) == "table" then pipeworks.liquid_texture = pipeworks.liquid_texture.name end
|
||||||
|
@ -31,6 +31,7 @@ local settings = {
|
|||||||
delete_item_on_clearobject = true,
|
delete_item_on_clearobject = true,
|
||||||
use_real_entities = true,
|
use_real_entities = true,
|
||||||
entity_update_interval = 0,
|
entity_update_interval = 0,
|
||||||
|
enable_vertical_digilines_connectivity = false,
|
||||||
}
|
}
|
||||||
|
|
||||||
pipeworks.toggles = {}
|
pipeworks.toggles = {}
|
||||||
|
@ -451,11 +451,6 @@ for _, data in ipairs({
|
|||||||
if not pipeworks.may_configure(pos, player) then return 0 end
|
if not pipeworks.may_configure(pos, player) then return 0 end
|
||||||
return count
|
return count
|
||||||
end,
|
end,
|
||||||
can_dig = function(pos, player)
|
|
||||||
local meta = minetest.get_meta(pos)
|
|
||||||
local inv = meta:get_inventory()
|
|
||||||
return inv:is_empty("main")
|
|
||||||
end,
|
|
||||||
tube = {connect_sides = {right = 1}},
|
tube = {connect_sides = {right = 1}},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
121
locale/pipeworks.ru.tr
Normal file
121
locale/pipeworks.ru.tr
Normal file
@ -0,0 +1,121 @@
|
|||||||
|
# textdomain: pipeworks
|
||||||
|
|
||||||
|
# License: CC-by-SA 4.0
|
||||||
|
# Author: VinAdmin ovvitalik@gmail.com
|
||||||
|
|
||||||
|
## generic interaction
|
||||||
|
Set=Установить
|
||||||
|
Cancel=Отмена
|
||||||
|
|
||||||
|
## digilines interfacing
|
||||||
|
Channel=Канал
|
||||||
|
|
||||||
|
## init
|
||||||
|
Allow splitting incoming stacks from tubes=Разрешить разделение входящих стопок из трубок
|
||||||
|
|
||||||
|
## autocrafter
|
||||||
|
Unknown item=Неизвестный предмет
|
||||||
|
unconfigured Autocrafter: unknown recipe=ненастроенный автокрафтер: неизвестный рецепт
|
||||||
|
unconfigured Autocrafter=ненастроенный автокрафтер
|
||||||
|
'@1' Autocrafter (@2)='@1' Автокрафтер (@2)
|
||||||
|
Save=Сохранить
|
||||||
|
paused '@1' Autocrafter=приостановлено '@1' Автокрафтер
|
||||||
|
Autocrafter=Автокрафтер
|
||||||
|
|
||||||
|
## compat-furnaces
|
||||||
|
Allow splitting incoming material (not fuel) stacks from tubes=Разрешить разделение стопок поступающего материала (не топлива) из трубок.
|
||||||
|
|
||||||
|
## decorative tubes
|
||||||
|
Airtight steelblock embedded tube=Герметичная встроенная трубка из стального блока
|
||||||
|
Airtight panel embedded tube=Герметичная встроенная в панель трубка
|
||||||
|
|
||||||
|
## devices
|
||||||
|
Pump/Intake Module=Модуль насоса/впуска
|
||||||
|
Valve=Клапан
|
||||||
|
Decorative grating=Декоративная решетка
|
||||||
|
Spigot outlet=Выходной патрубок
|
||||||
|
Airtight Pipe entry/exit=Вход/выход герметичной трубы
|
||||||
|
Flow Sensor=Датчик потока
|
||||||
|
Flow sensor (on)=Датчик расхода (вкл.)
|
||||||
|
empty=пустой
|
||||||
|
@1% full=@1% заполнено
|
||||||
|
Expansion Tank (@1)=Расширительный бак (@1)
|
||||||
|
Fluid Storage Tank (@1)=Резервуар для хранения жидкости (@1)
|
||||||
|
Fountainhead=Источник
|
||||||
|
Straight-only Pipe=Только прямая труба
|
||||||
|
|
||||||
|
## filter-injector
|
||||||
|
(slot #@1 next)=(слот #@1 следующий)
|
||||||
|
@1 Filter-Injector=@1 фильтр-инжектор
|
||||||
|
Sequence slots by Priority=Последовательность слотов по приоритету
|
||||||
|
Sequence slots Randomly=Слоты последовательности Случайный
|
||||||
|
Sequence slots by Rotation=Последовательность слотов по вращению
|
||||||
|
Exact match - off=Точное совпадение – выключено
|
||||||
|
Exact match - on=Точное совпадение - включено
|
||||||
|
Prefer item types:=Предпочитаете типы предметов:
|
||||||
|
Itemwise=По пунктам
|
||||||
|
Stackwise=Стекообразно
|
||||||
|
Digiline=Диджилайн
|
||||||
|
|
||||||
|
## legacy
|
||||||
|
Auto-Tap=Авто-нажатие
|
||||||
|
|
||||||
|
## pipes
|
||||||
|
Pipe Segment=Сегмент трубы
|
||||||
|
Pipe Segment (legacy)=Сегмент трубы (устаревший)
|
||||||
|
|
||||||
|
|
||||||
|
## routing tubes
|
||||||
|
Pneumatic tube segment=Сегмент пневматической трубки
|
||||||
|
Broken Tube=Сломанная трубка
|
||||||
|
High Priority Tube Segment=Сегмент трубы с высоким приоритетом
|
||||||
|
Accelerating Pneumatic Tube Segment=Ускорительный сегмент пневматической трубки
|
||||||
|
Crossing Pneumatic Tube Segment=Пересечение сегмента пневматической трубы
|
||||||
|
One way tube=Односторонняя трубка
|
||||||
|
|
||||||
|
## signal tubes
|
||||||
|
Detecting Pneumatic Tube Segment on=Обнаружение сегмента пневматической трубки включено
|
||||||
|
Detecting Pneumatic Tube Segment=Обнаружение сегмента пневматической трубки
|
||||||
|
Digiline Detecting Pneumatic Tube Segment=Digiline обнаруживает сегмент пневматической трубки
|
||||||
|
Digiline Detecting Tube=Детекторная трубка Digiline
|
||||||
|
Conducting Pneumatic Tube Segment=Проводящий сегмент пневматической трубки
|
||||||
|
Conducting Pneumatic Tube Segment on=Проводящий сегмент пневматической трубки на
|
||||||
|
Digiline Conducting Pneumatic Tube Segment=Сегмент проводящей пневматической трубки Digiline
|
||||||
|
Mesecon and Digiline Conducting Pneumatic Tube Segment=Сегмент токопроводящей пневматической трубки Mesecon и Digiline
|
||||||
|
Mesecon and Digiline Conducting Pneumatic Tube Segment on=Сегмент проводящей пневматической трубки Mesecon и Digiline на
|
||||||
|
Tag Sorting Pneumatic Tube Segment=Сегмент пневматической трубки для сортировки тегов
|
||||||
|
Lua controlled Tube=Трубка, управляемая Lua
|
||||||
|
|
||||||
|
## sorting tubes
|
||||||
|
Sorting Pneumatic Tube Segment=Сортировка сегментов пневматической трубки
|
||||||
|
Sorting pneumatic tube=Сортировочная пневматическая труба
|
||||||
|
|
||||||
|
## teleport tube
|
||||||
|
Receive=Получить
|
||||||
|
Channels are public by default=По умолчанию каналы являются общедоступными
|
||||||
|
Use <player>:<channel> for fully private channels=Используйте <игрок>:<канал> для полностью приватных каналов
|
||||||
|
Use <player>;<channel> for private receivers=Используйте <игрок>;<канал> для частных приемников
|
||||||
|
Teleporting Pneumatic Tube Segment=Сегмент пневматической трубы для телепортации
|
||||||
|
Teleporting Tube=Телепортационная труба
|
||||||
|
Unconfigured Teleportation Tube=Неконфигурированная телепортационная труба
|
||||||
|
Sorry, channel '@1' is reserved for exclusive use by @2=Извините, канал '@1' зарезервирован исключительно для использования @2
|
||||||
|
Sorry, receiving from channel '@1' is reserved for @2=Извините, прием с канала '@1' зарезервирован для @2
|
||||||
|
Teleportation Tube @1 on '@2'=Трубка телепортации @1 на '@2'
|
||||||
|
|
||||||
|
## trashcan
|
||||||
|
Trash Can=Мусорное ведро
|
||||||
|
|
||||||
|
## tube registration
|
||||||
|
Pneumatic tube segment (legacy)=Сегмент пневматической трубы (устаревший)
|
||||||
|
|
||||||
|
## vacuum tubes
|
||||||
|
Radius=Радиус
|
||||||
|
Vacuuming Pneumatic Tube Segment=Сегмент пневматической трубки для вакуумирования
|
||||||
|
Adjustable Vacuuming Tube=Регулируемая вакуумная трубка
|
||||||
|
Adjustable Vacuuming Pneumatic Tube Segment=Регулируемый сегмент вакуумной пневматической трубки
|
||||||
|
Adjustable Vacuuming Pneumatic Tube Segment (@1m)=Регулируемый сегмент вакуумной пневматической трубки (@1m)
|
||||||
|
|
||||||
|
## wielder
|
||||||
|
Node Breaker=Разрушитель узла
|
||||||
|
Deployer=Развертыватель
|
||||||
|
Dispenser=Распылитель
|
@ -67,36 +67,41 @@ end
|
|||||||
minetest.register_on_shutdown(write_entities)
|
minetest.register_on_shutdown(write_entities)
|
||||||
luaentity.entities_index = 0
|
luaentity.entities_index = 0
|
||||||
|
|
||||||
local function get_blockpos(pos)
|
|
||||||
return {x = math.floor(pos.x / 16),
|
|
||||||
y = math.floor(pos.y / 16),
|
|
||||||
z = math.floor(pos.z / 16)}
|
|
||||||
end
|
|
||||||
|
|
||||||
local move_entities_globalstep_part1
|
local move_entities_globalstep_part1
|
||||||
local is_active
|
local is_active
|
||||||
|
|
||||||
if pipeworks.use_real_entities then
|
if pipeworks.use_real_entities then
|
||||||
local active_blocks = {} -- These only contain active blocks near players (i.e., not forceloaded ones)
|
local active_blocks = {} -- These only contain active blocks near players (i.e., not forceloaded ones)
|
||||||
|
|
||||||
|
local function get_blockpos(pos)
|
||||||
|
return {x = math.floor(pos.x / 16),
|
||||||
|
y = math.floor(pos.y / 16),
|
||||||
|
z = math.floor(pos.z / 16)}
|
||||||
|
end
|
||||||
|
|
||||||
move_entities_globalstep_part1 = function(dtime)
|
move_entities_globalstep_part1 = function(dtime)
|
||||||
local active_block_range = tonumber(minetest.settings:get("active_block_range")) or 2
|
local active_block_range = tonumber(minetest.settings:get("active_block_range")) or 2
|
||||||
local new_active_blocks = {}
|
for key in pairs(active_blocks) do
|
||||||
|
active_blocks[key] = nil
|
||||||
|
end
|
||||||
for _, player in ipairs(minetest.get_connected_players()) do
|
for _, player in ipairs(minetest.get_connected_players()) do
|
||||||
local blockpos = get_blockpos(player:get_pos())
|
local blockpos = get_blockpos(player:get_pos())
|
||||||
local minp = vector.subtract(blockpos, active_block_range)
|
local minpx = blockpos.x - active_block_range
|
||||||
local maxp = vector.add(blockpos, active_block_range)
|
local minpy = blockpos.y - active_block_range
|
||||||
|
local minpz = blockpos.z - active_block_range
|
||||||
|
local maxpx = blockpos.x + active_block_range
|
||||||
|
local maxpy = blockpos.y + active_block_range
|
||||||
|
local maxpz = blockpos.z + active_block_range
|
||||||
|
|
||||||
for x = minp.x, maxp.x do
|
for x = minpx, maxpx do
|
||||||
for y = minp.y, maxp.y do
|
for y = minpy, maxpy do
|
||||||
for z = minp.z, maxp.z do
|
for z = minpz, maxpz do
|
||||||
local pos = {x = x, y = y, z = z}
|
local pos = {x = x, y = y, z = z}
|
||||||
new_active_blocks[minetest.hash_node_position(pos)] = pos
|
active_blocks[minetest.hash_node_position(pos)] = true
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
active_blocks = new_active_blocks
|
|
||||||
-- todo: callbacks on block load/unload
|
-- todo: callbacks on block load/unload
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -85,6 +85,14 @@ pipeworks_use_real_entities (Use Real Entities) bool true
|
|||||||
#A value 0.2 or above may cause issues with accelerator tubes.
|
#A value 0.2 or above may cause issues with accelerator tubes.
|
||||||
pipeworks_entity_update_interval (Entity Update Interval) float 0 0 0.8
|
pipeworks_entity_update_interval (Entity Update Interval) float 0 0 0.8
|
||||||
|
|
||||||
|
# Use the default rules from the digilines mod.
|
||||||
|
# If enabled the following devices will connect to digiline networks in the vertical direction:
|
||||||
|
# digiline filter injector, deployer, dispenser, node breaker, autocrafter
|
||||||
|
# This breaks expected behavior with digiline conducting tubes.
|
||||||
|
# If disabled, the devices will not be able to send or recieve digiline signals from the top
|
||||||
|
# or bottom faces, regardless of the node rotation.
|
||||||
|
enable_vertical_digilines_connectivity (Use the default rules from the digilines mod) bool false
|
||||||
|
|
||||||
# if set to true, items passing through teleport tubes will log log where they came from and where they went.
|
# if set to true, items passing through teleport tubes will log log where they came from and where they went.
|
||||||
pipeworks_log_teleport_tubes (Log Teleport Tubes) bool false
|
pipeworks_log_teleport_tubes (Log Teleport Tubes) bool false
|
||||||
|
|
||||||
|
@ -112,7 +112,6 @@ local register_one_tube = function(name, tname, dropname, desc, plain, noctrs, e
|
|||||||
key = "node_sound_wood_defaults",
|
key = "node_sound_wood_defaults",
|
||||||
},
|
},
|
||||||
walkable = true,
|
walkable = true,
|
||||||
stack_max = 99,
|
|
||||||
basename = name,
|
basename = name,
|
||||||
style = style,
|
style = style,
|
||||||
drop = string.format("%s_%s", name, dropname),
|
drop = string.format("%s_%s", name, dropname),
|
||||||
|
@ -251,7 +251,8 @@ if pipeworks.enable_node_breaker then
|
|||||||
local old_stack = ItemStack(stack)
|
local old_stack = ItemStack(stack)
|
||||||
local item_def = minetest.registered_items[stack:get_name()]
|
local item_def = minetest.registered_items[stack:get_name()]
|
||||||
if item_def.on_use then
|
if item_def.on_use then
|
||||||
fakeplayer:set_wielded_item(item_def.on_use(stack, fakeplayer, pointed) or stack)
|
stack = item_def.on_use(stack, fakeplayer, pointed) or stack
|
||||||
|
fakeplayer:set_wielded_item(stack)
|
||||||
else
|
else
|
||||||
local node = minetest.get_node(pointed.under)
|
local node = minetest.get_node(pointed.under)
|
||||||
local node_def = minetest.registered_nodes[node.name]
|
local node_def = minetest.registered_nodes[node.name]
|
||||||
|
Reference in New Issue
Block a user