forked from mtcontrib/pipeworks
Compare commits
17 Commits
e04fb691ad
...
2021-01-30
Author | SHA1 | Date | |
---|---|---|---|
8322f256c5 | |||
ba7eb19317 | |||
065c953eba | |||
9a63d17e4a | |||
d814357ddf | |||
c2fe5fe956 | |||
9dbaa5f4f6 | |||
d93396600f | |||
c966a8a57d | |||
61b061f669 | |||
fe91d5eb46 | |||
eb1064ca6d | |||
f54e25ec52 | |||
dedb0dd54e | |||
477a024034 | |||
34cb0e7682 | |||
505fc7cc49 |
@ -389,6 +389,27 @@ 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()
|
||||||
|
@ -86,10 +86,9 @@ function pipeworks.table_contains(tbl, element)
|
|||||||
end
|
end
|
||||||
|
|
||||||
function pipeworks.table_extend(tbl, tbl2)
|
function pipeworks.table_extend(tbl, tbl2)
|
||||||
local index = #tbl + 1
|
local oldlength = #tbl
|
||||||
for _, elt in ipairs(tbl2) do
|
for i = 1,#tbl2 do
|
||||||
tbl[index] = elt
|
tbl[oldlength + i] = tbl2[i]
|
||||||
index = index + 1
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -77,10 +77,8 @@ 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})
|
||||||
end
|
elseif pipeworks.may_configure(pos, player) then
|
||||||
|
-- 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
|
||||||
|
6
init.lua
6
init.lua
@ -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 ~= "" then -- wielders and filters
|
if owner ~= "" and owner == name then -- wielders and filters
|
||||||
return owner == name
|
return true
|
||||||
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")
|
||||||
|
|
||||||
print("Pipeworks loaded!")
|
minetest.log("info", "Pipeworks loaded!")
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
# textdomain: pipeworks
|
# textdomain: pipeworks
|
||||||
# License: CC-by-SA 4.0
|
# License: CC-by-SA 4.0
|
||||||
# Author: wzy2006 <3450354617@qq.com>
|
# Author: pevernow <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=49/5000将<player>:<channel>用于完全私人的频道
|
use <player>:<channel> for fully private channels=将<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=投掷器
|
||||||
|
@ -340,6 +340,8 @@ 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)),
|
||||||
|
@ -261,3 +261,11 @@ 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
|
||||||
|
}
|
||||||
|
@ -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 = {
|
||||||
{ "pipeworks:gear", "pipeworks:gear", "pipeworks:gear" },
|
{ "basic_materials:gear_steel", "basic_materials:gear_steel", "basic_materials:gear_steel" },
|
||||||
{ "default:stone", "mesecons:piston", "default:stone" },
|
{ "default:stone", "mesecons:piston", "default:stone" },
|
||||||
{ "group:wood", "mesecons:mesecon", "group:wood" },
|
{ "group:wood", "mesecons:mesecon", "group:wood" },
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user