1
0
mirror of https://github.com/mt-mods/pipeworks.git synced 2025-07-06 10:10:34 +02:00

7 Commits

8 changed files with 47 additions and 72 deletions

View File

@ -67,8 +67,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
@ -389,27 +392,6 @@ minetest.register_node("pipeworks:autocrafter", {
end end
end end
after_recipe_change(pos,inv) after_recipe_change(pos,inv)
elseif msg == "get_recipe" then
local meta = minetest.get_meta(pos)
local inv = meta:get_inventory()
local recipe = {}
for y=0,2,1 do
local row = {}
for x=1,3,1 do
local slot = y*3+x
table.insert(row, inv:get_stack("recipe",slot):get_name())
end
table.insert(recipe, row)
end
local setchan = meta:get_string("channel")
local output = inv:get_stack("output", 1)
digiline:receptor_send(pos, digiline.rules.default, setchan, {
recipe = recipe,
result = {
name = output:get_name(),
count = output:get_count(),
}
})
elseif msg == "off" then elseif msg == "off" then
update_meta(meta, false) update_meta(meta, false)
minetest.get_node_timer(pos):stop() minetest.get_node_timer(pos):stop()

View File

@ -86,9 +86,10 @@ function pipeworks.table_contains(tbl, element)
end end
function pipeworks.table_extend(tbl, tbl2) function pipeworks.table_extend(tbl, tbl2)
local oldlength = #tbl local index = #tbl + 1
for i = 1,#tbl2 do for _, elt in ipairs(tbl2) do
tbl[oldlength + i] = tbl2[i] tbl[index] = elt
index = index + 1
end end
end end

View File

@ -77,8 +77,10 @@ minetest.register_on_player_receive_fields(function(player, formname, fields)
pipeworks.after_place(pos) pipeworks.after_place(pos)
end) end)
minetest.sound_play(sound, {gain = 0.3, pos = pos, max_hear_distance = 10}) minetest.sound_play(sound, {gain = 0.3, pos = pos, max_hear_distance = 10})
elseif pipeworks.may_configure(pos, player) then end
-- Pipeworks Switch -- Pipeworks Switch
if pipeworks.may_configure(pos, player) and not fields.quit then
fs_helpers.on_receive_fields(pos, fields) fs_helpers.on_receive_fields(pos, fields)
minetest.show_formspec(player:get_player_name(), "pipeworks:chest_formspec", get_chest_formspec(pos)) minetest.show_formspec(player:get_player_name(), "pipeworks:chest_formspec", get_chest_formspec(pos))
end end

View File

@ -71,8 +71,8 @@ function pipeworks.may_configure(pos, player)
local meta = minetest.get_meta(pos) local meta = minetest.get_meta(pos)
local owner = meta:get_string("owner") local owner = meta:get_string("owner")
if owner ~= "" and owner == name then -- wielders and filters if owner ~= "" then -- wielders and filters
return true return owner == name
end end
return not minetest.is_protected(pos, name) return not minetest.is_protected(pos, name)
end end
@ -150,4 +150,4 @@ end
minetest.register_alias("pipeworks:pipe", "pipeworks:pipe_110000_empty") minetest.register_alias("pipeworks:pipe", "pipeworks:pipe_110000_empty")
minetest.log("info", "Pipeworks loaded!") print("Pipeworks loaded!")

View File

@ -1,6 +1,6 @@
# textdomain: pipeworks # textdomain: pipeworks
# License: CC-by-SA 4.0 # License: CC-by-SA 4.0
# Author: pevernow <3450354617@qq.com> # Author: wzy2006 <3450354617@qq.com>
## digilines interfacing ## digilines interfacing
Channel=频道 Channel=频道
@ -12,23 +12,23 @@ Allow splitting incoming stacks from tubes=允许从管道中拆分传入堆栈
Unknown item=通道 Unknown item=通道
unconfigured Autocrafter: unknown recipe=未配置的自动工作台: 未知配方 unconfigured Autocrafter: unknown recipe=未配置的自动工作台: 未知配方
unconfigured Autocrafter=未配置的自动工作台 unconfigured Autocrafter=未配置的自动工作台
'@1' Autocrafter (@2)=自动工作台 '@1' (@2) '@1' Autocrafter (@2)=自动建造者 '@1' (@2)
Save=保存 Save=保存
paused '@1' Autocrafter=暂停的自动工作台 paused '@1' Autocrafter=暂停的自动建造者
Autocrafter=自动工作台 Autocrafter=自动建造者
## compat-furnaces ## compat-furnaces
Allow splitting incoming material (not fuel) stacks from tubes=允许从管子中分离进来的材料(不是燃料)堆 Allow splitting incoming material (not fuel) stacks from tubes=允许从管子中分离进来的材料(不是燃料)堆
## decorative tubes ## decorative tubes
Airtight steelblock embedded tube=密封嵌入式铁块管道 Airtight steelblock embedded tube=密封管集成到一块钢中
Airtight panel embedded tube=密封嵌入式片状管道 Airtight panel embedded tube=密封面板嵌入式
## devices ## devices
Pump/Intake Module=泵/进气模块 Pump/Intake Module=泵/进气模块
Valve=阀门 Valve=阀门
Decorative grating=Decorative grating Decorative grating=Decorative grating
Spigot outlet=龙头 Spigot outlet=出气口
Airtight Pipe entry/exit=密闭管进/出 Airtight Pipe entry/exit=密闭管进/出
Flow Sensor=流量传感器 Flow Sensor=流量传感器
Flow sensor (on)=流量传感器(上) Flow sensor (on)=流量传感器(上)
@ -49,7 +49,7 @@ Exact match - on=完全匹配-开启
Prefer item types:=偏好物品类型 : Prefer item types:=偏好物品类型 :
Itemwise=逐项 Itemwise=逐项
Stackwise=堆叠方式 Stackwise=堆叠方式
Digiline=Digiline Digiline=digiline
## legacy ## legacy
Auto-Tap=自动轴阀 Auto-Tap=自动轴阀
@ -60,35 +60,35 @@ Pipe Segment (legacy)=管道(旧版)
## routing tubes ## routing tubes
Pneumatic tube segment=普通管道 Pneumatic tube segment=空气管道
Broken Tube=断管 Broken Tube=断管
High Priority Tube Segment=高优先级管段 High Priority Tube Segment=高优先级管段
Accelerating Pneumatic Tube Segment=加速管道 Accelerating Pneumatic Tube Segment=加速气动管道
Crossing Pneumatic Tube Segment=定向管道 Crossing Pneumatic Tube Segment=交叉气动管道
One way tube=单向管 One way tube=单向管
## signal tubes ## signal tubes
Detecting Pneumatic Tube Segment on=检测管道(运行中) Detecting Pneumatic Tube Segment on=带有传感器的气动软管段(运行中)
Detecting Pneumatic Tube Segment=检测管道 Detecting Pneumatic Tube Segment=检测气动管道
Digiline Detecting Pneumatic Tube Segment=Digiline检测管道 Digiline Detecting Pneumatic Tube Segment=Digiline检测气动管道
Digiline Detecting Tube=Digiline检测管 Digiline Detecting Tube=Digiline检测管
Conducting Pneumatic Tube Segment=传导管道 Conducting Pneumatic Tube Segment=传导空气管道
Conducting Pneumatic Tube Segment on=传导管道(运行中) Conducting Pneumatic Tube Segment on=导通气动管道
Digiline Conducting Pneumatic Tube Segment=Digiline传导式气动管道 Digiline Conducting Pneumatic Tube Segment=Digiline传导式气动管道
Mesecon and Digiline Conducting Pneumatic Tube Segment=Mesecon和Digiline传导管道 Mesecon and Digiline Conducting Pneumatic Tube Segment=Mesecon和Digiline传导气动管道
Mesecon and Digiline Conducting Pneumatic Tube Segment on=Mesecon和Digiline传导管道运行中 Mesecon and Digiline Conducting Pneumatic Tube Segment on=Mesecon和Digiline传导气动管道(运行中)
## sorting tubes ## sorting tubes
Sorting Pneumatic Tube Segment=分类管道 Sorting Pneumatic Tube Segment=排序气动管道
Sorting pneumatic tube=分类管道 Sorting pneumatic tube=分选气动管
## teleport tube ## teleport tube
Receive=接收 Receive=接收
channels are public by default=频道默认为公开 channels are public by default=频道默认为公开
use <player>:<channel> for fully private channels=将<player>:<channel>用于完全私人的频道 use <player>:<channel> for fully private channels=49/5000将<player>:<channel>用于完全私人的频道
use <player>;<channel> for private receivers=使用<player>;<channel>作为私人接收器 use <player>;<channel> for private receivers=使用<player>;<channel>进行私人接
Teleporting Pneumatic Tube Segment=传送管道 Teleporting Pneumatic Tube Segment=传送气动管道
unconfigured Teleportation Tube=未配置的传送管 unconfigured Teleportation Tube=未配置的传送管
Sorry, channel '@1' is reserved for exclusive use by @2=抱歉,频道‘@1保留供@2专用 Sorry, channel '@1' is reserved for exclusive use by @2=抱歉,频道‘@1保留供@2专用
Sorry, receiving from channel '@1' is reserved for @2=抱歉,从频道'@1'接收的内容已保留给'@2' Sorry, receiving from channel '@1' is reserved for @2=抱歉,从频道'@1'接收的内容已保留给'@2'
Teleportation Tube @1 on '@2'=传送管'@1'在'@2'上 Teleportation Tube @1 on '@2'=传送管'@1'在'@2'上
@ -97,14 +97,14 @@ Teleportation Tube @1 on '@2'=传送管'@1'在'@2'上
Trash Can=垃圾箱 Trash Can=垃圾箱
## tube registration ## tube registration
Pneumatic tube segment (legacy)=普通管道(旧式) Pneumatic tube segment (legacy)=空气管道(旧式)
## vacuum tubes ## vacuum tubes
Vacuuming Pneumatic Tube Segment=拾取管道 Vacuuming Pneumatic Tube Segment=吸尘气动管道
Adjustable Vacuuming Pneumatic Tube Segment=高级拾取管道 Adjustable Vacuuming Pneumatic Tube Segment=可调式真空气动管道
Adjustable Vacuuming Pneumatic Tube Segment (@1m)=高级拾取管道(@1m) Adjustable Vacuuming Pneumatic Tube Segment (@1m)=可调式吸尘气动管道(@1m)
## wielder ## wielder
Node Breaker=方块破坏 Node Breaker=节点断路
Deployer=放置器 Deployer=部署者
Dispenser=投掷器 Dispenser=饮水机

View File

@ -340,8 +340,6 @@ local move_entities_globalstep_part2 = function(dtime)
entity._velocity = master_entity:get_velocity() entity._velocity = master_entity:get_velocity()
entity._acceleration = master_entity:get_acceleration() entity._acceleration = master_entity:get_acceleration()
else else
entity._velocity = entity._velocity or vector.new(0,0,0)
entity._acceleration = entity._acceleration or vector.new(0,0,0)
entity._pos = vector.add(vector.add( entity._pos = vector.add(vector.add(
entity._pos, entity._pos,
vector.multiply(entity._velocity, dtime)), vector.multiply(entity._velocity, dtime)),

View File

@ -261,11 +261,3 @@ if minetest.get_modpath("mesecons_mvps") ~= nil then
end end
end) end)
end end
-- Expose teleport tube database API for other mods
pipeworks.tptube = {
hash = hash,
save_tube_db = save_tube_db,
get_db = function() return tp_tube_db or read_tube_db() end,
tp_tube_db_version = tp_tube_db_version
}

View File

@ -378,7 +378,7 @@ if pipeworks.enable_node_breaker then
minetest.register_craft({ minetest.register_craft({
output = "pipeworks:nodebreaker_off", output = "pipeworks:nodebreaker_off",
recipe = { recipe = {
{ "basic_materials:gear_steel", "basic_materials:gear_steel", "basic_materials:gear_steel" }, { "pipeworks:gear", "pipeworks:gear", "pipeworks:gear" },
{ "default:stone", "mesecons:piston", "default:stone" }, { "default:stone", "mesecons:piston", "default:stone" },
{ "group:wood", "mesecons:mesecon", "group:wood" }, { "group:wood", "mesecons:mesecon", "group:wood" },
} }