17 Commits

Author SHA1 Message Date
8322f256c5 Merge branch 'master' into 'master'
Prevent the symptoms of Issue #33

See merge request VanessaE/pipeworks!31
2020-12-18 21:44:11 +00:00
ba7eb19317 Prevent the symptoms of Issue #33
Try to prevent the crash from issue #33 by
replaving nil velocity or acceleration with (0,0,0).
This does not fix the underlying cause of them being nil,
but should prevent the crash.
2020-12-18 19:28:07 +01:00
065c953eba use the right gear item in node breaker 2020-10-28 12:30:48 -04:00
9a63d17e4a Merge branch 'm_disable_print_message' into 'master'
Log the "Pipeworks loaded!" message to infostream instead of printing it

See merge request VanessaE/pipeworks!30
2020-10-17 18:55:24 +00:00
d814357ddf Merge branch 'm_table_extends_clean' into 'master'
Make pipeworks.table_extend easier to read

See merge request VanessaE/pipeworks!29
2020-10-17 18:55:01 +00:00
c2fe5fe956 Make pipeworks.table_extend easier to read
In my opinion this clarifies that tbl2 is attached at the end of tbl
2020-10-17 20:50:20 +02:00
9dbaa5f4f6 Log the "Pipeworks loaded!" message to infostream instead of printing it 2020-10-17 20:46:44 +02:00
d93396600f Merge branch 'protected-access-to-wielders' into 'master'
Allow protected access to wielder inventories.

Closes #40

See merge request VanessaE/pipeworks!27
2020-09-24 15:33:17 +00:00
c966a8a57d Allow players with the protection_bypass privilege or access to
the protection to access wielder node inventories.

Fixes #40.
2020-09-24 05:12:32 -06:00
61b061f669 Merge branch 'avoid-protection-check-on-chest-close' into 'master'
Avoid protection check on chest close.

Closes #23

See merge request VanessaE/pipeworks!26
2020-09-11 09:45:04 +00:00
fe91d5eb46 Avoid protection check on chest close.
Fixes #23.
2020-09-10 23:12:11 -06:00
eb1064ca6d Merge branch 'patch-1' into 'master'
Update pipeworks.zh_CN.tr

See merge request VanessaE/pipeworks!25
2020-09-05 07:14:04 +00:00
f54e25ec52 Update pipeworks.zh_CN.tr 2020-09-05 06:25:58 +00:00
dedb0dd54e Merge branch 'tptube-api' into 'master'
Expose teleport tube database API

See merge request VanessaE/pipeworks!24
2020-08-10 17:54:28 +00:00
SX
477a024034 Expose teleport tube database API 2020-08-09 23:09:31 +03:00
34cb0e7682 Merge branch 'master' into 'master'
Add "get_recipe" digiline command for querying the current autocrafter recipe.

See merge request VanessaE/pipeworks!23
2020-07-30 00:40:41 +00:00
505fc7cc49 Add "get_recipe" digiline command for querying the current autocrafter recipe.
Useful for having the player teach the luacontroller how to craft various items.
2020-07-23 01:49:37 +02:00
8 changed files with 71 additions and 43 deletions

View File

@ -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()

View File

@ -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

View File

@ -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

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 ~= "" 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!")

View File

@ -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=投掷器

View File

@ -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)),

View File

@ -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
}

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 = {
{ "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" },
} }