forked from mtcontrib/pipeworks
Compare commits
10 Commits
master
...
luacheck-b
Author | SHA1 | Date | |
---|---|---|---|
5d1d74e435 | |||
42dd6bc32b | |||
5366e2343d | |||
69bd905095 | |||
ce43845711 | |||
cca3fbd9f2 | |||
c60558ce1d | |||
41ed024394 | |||
0602e63dd5 | |||
0cc68628d2 |
@ -256,11 +256,8 @@ 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
|
||||||
-- NALC: ou si l'item n'est pas dans le group limitcraft
|
if output_item:is_empty() then
|
||||||
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
|
||||||
@ -601,12 +598,11 @@ 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 type(row) == "table" and minetest.registered_items[row[x]] then
|
if minetest.registered_items[msg[y + 1][x]] then
|
||||||
inv:set_stack("recipe", slot, ItemStack(
|
inv:set_stack("recipe", slot, ItemStack(
|
||||||
row[x]))
|
msg[y + 1][x]))
|
||||||
else
|
else
|
||||||
inv:set_stack("recipe", slot, ItemStack(""))
|
inv:set_stack("recipe", slot, ItemStack(""))
|
||||||
end
|
end
|
||||||
|
12
common.lua
12
common.lua
@ -15,17 +15,7 @@ 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,7 +31,6 @@ 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,6 +451,11 @@ 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}},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,121 +0,0 @@
|
|||||||
# 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,41 +67,36 @@ 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
|
||||||
for key in pairs(active_blocks) do
|
local new_active_blocks = {}
|
||||||
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 minpx = blockpos.x - active_block_range
|
local minp = vector.subtract(blockpos, active_block_range)
|
||||||
local minpy = blockpos.y - active_block_range
|
local maxp = vector.add(blockpos, 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 = minpx, maxpx do
|
for x = minp.x, maxp.x do
|
||||||
for y = minpy, maxpy do
|
for y = minp.y, maxp.y do
|
||||||
for z = minpz, maxpz do
|
for z = minp.z, maxp.z do
|
||||||
local pos = {x = x, y = y, z = z}
|
local pos = {x = x, y = y, z = z}
|
||||||
active_blocks[minetest.hash_node_position(pos)] = true
|
new_active_blocks[minetest.hash_node_position(pos)] = pos
|
||||||
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,14 +85,6 @@ 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,6 +112,7 @@ 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,8 +251,7 @@ 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
|
||||||
stack = item_def.on_use(stack, fakeplayer, pointed) or stack
|
fakeplayer:set_wielded_item(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