1
0
mirror of https://github.com/mt-mods/pipeworks.git synced 2025-07-02 16:20:35 +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 craft = get_craft(pos, inventory)
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
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"))
return false
end
@ -389,27 +392,6 @@ minetest.register_node("pipeworks:autocrafter", {
end
end
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
update_meta(meta, false)
minetest.get_node_timer(pos):stop()

View File

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

View File

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

View File

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

View File

@ -340,8 +340,6 @@ local move_entities_globalstep_part2 = function(dtime)
entity._velocity = master_entity:get_velocity()
entity._acceleration = master_entity:get_acceleration()
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.multiply(entity._velocity, dtime)),

View File

@ -261,11 +261,3 @@ if minetest.get_modpath("mesecons_mvps") ~= nil then
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({
output = "pipeworks:nodebreaker_off",
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" },
{ "group:wood", "mesecons:mesecon", "group:wood" },
}