1
0
鏡像自 https://github.com/minetest-mods/technic.git 已同步 2025-09-18 13:40:35 +02:00

Handle both pipeworks APIs

The new API function is now renamed to pipeworks.tube_inject_item(),
so use it under that name.  If it is not available, synthesise the new
API in terms of the old one.
此提交包含在:
Zefram
2014-08-14 22:12:53 +01:00
提交者 Novatux
父節點 772c21cb04
當前提交 049129d9b8
共有 4 個檔案被更改,包括 11 行新增4 行删除

查看文件

@@ -119,7 +119,7 @@ end
local function send_items(items, pos, node)
for _, item in pairs(items) do
pipeworks.tube_item(pos, pos, vector.new(0, 1, 0), item)
technic.tube_inject_item(pos, pos, vector.new(0, 1, 0), item)
end
end

查看文件

@@ -13,7 +13,7 @@ local function inject_items (pos)
local item0=stack:to_table()
if item0 then
item0["count"] = "1"
pipeworks.tube_item(pos, pos, vector.new(0, -1, 0), item0)
technic.tube_inject_item(pos, pos, vector.new(0, -1, 0), item0)
stack:take_item(1)
inv:set_stack("main", i, stack)
return
@@ -28,7 +28,7 @@ local function inject_items (pos)
if stack then
local item0=stack:to_table()
if item0 then
pipeworks.tube_item(pos, pos, vector.new(0, -1, 0), item0)
technic.tube_inject_item(pos, pos, vector.new(0, -1, 0), item0)
stack:clear()
inv:set_stack("main", i, stack)
return

查看文件

@@ -52,7 +52,7 @@ function technic.send_items(pos, x_velocity, z_velocity, output_name)
local item0 = stack:to_table()
if item0 then
item0["count"] = "1"
pipeworks.tube_item(pos, pos, vector.new(x_velocity, 0, z_velocity), item0)
technic.tube_inject_item(pos, pos, vector.new(x_velocity, 0, z_velocity), item0)
stack:take_item(1)
inv:set_stack(output_name, i, stack)
return