forked from mtcontrib/pipeworks
Compare commits
19 Commits
ac80224371
...
2021-01-30
Author | SHA1 | Date | |
---|---|---|---|
8322f256c5 | |||
ba7eb19317 | |||
065c953eba | |||
9a63d17e4a | |||
d814357ddf | |||
c2fe5fe956 | |||
9dbaa5f4f6 | |||
d93396600f | |||
c966a8a57d | |||
61b061f669 | |||
fe91d5eb46 | |||
eb1064ca6d | |||
f54e25ec52 | |||
dedb0dd54e | |||
477a024034 | |||
34cb0e7682 | |||
505fc7cc49 | |||
cb58a646cf | |||
e3135c53f0 |
@ -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!")
|
||||||
|
110
locale/pipeworks.zh_CN.tr
Normal file
110
locale/pipeworks.zh_CN.tr
Normal file
@ -0,0 +1,110 @@
|
|||||||
|
# textdomain: pipeworks
|
||||||
|
# License: CC-by-SA 4.0
|
||||||
|
# Author: pevernow <3450354617@qq.com>
|
||||||
|
|
||||||
|
## 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=暂停的自动工作台
|
||||||
|
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=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=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传导管道(运行中)
|
||||||
|
|
||||||
|
## sorting tubes
|
||||||
|
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=未配置的传送管道
|
||||||
|
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
|
||||||
|
Vacuuming Pneumatic Tube Segment=拾取管道
|
||||||
|
Adjustable Vacuuming Pneumatic Tube Segment=高级拾取管道
|
||||||
|
Adjustable Vacuuming Pneumatic Tube Segment (@1m)=高级拾取管道(@1m)
|
||||||
|
|
||||||
|
## wielder
|
||||||
|
Node Breaker=方块破坏器
|
||||||
|
Deployer=放置器
|
||||||
|
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