-- perhaps a custom metaclass that errors specially when fakePlayer.<property> is not found?
}
-function pipeworks.tube_item(pos, start_pos, velocity, item)
+function pipeworks.tube_item(pos, item)
+ error("obsolete pipeworks.tube_item() called; change caller to use pipeworks.tube_inject_item() instead")
+end
+
+function pipeworks.tube_inject_item(pos, start_pos, velocity, item)
-- Take item in any format
local stack = ItemStack(item)
local obj = luaentity.add_entity(pos, "pipeworks:tubed_item")
end
local pos = vector.add(frompos, vector.multiply(dir, 1.4))
local start_pos = vector.add(frompos, dir)
- local item1 = pipeworks.tube_item(pos, start_pos, dir, item)
+ local item1 = pipeworks.tube_inject_item(pos, start_pos, dir, item)
return true-- only fire one item, please
end
end
return
end
local item = minetest.deserialize(staticdata)
- pipeworks.tube_item(self.object:getpos(), item.start_pos, item.velocity, item.itemstring)
+ pipeworks.tube_inject_item(self.object:getpos(), item.start_pos, item.velocity, item.itemstring)
self.object:remove()
end,
})
for _, object in ipairs(minetest.get_objects_inside_radius(pos, 2)) do
if not object:is_player() and object:get_luaentity() and object:get_luaentity().name == "__builtin:item" then
if object:get_luaentity().itemstring ~= "" then
- pipeworks.tube_item(pos, pos, vector.new(0, 0, 0), object:get_luaentity().itemstring)
+ pipeworks.tube_inject_item(pos, pos, vector.new(0, 0, 0), object:get_luaentity().itemstring)
end
object:get_luaentity().itemstring = ""
object:remove()
for _,object in ipairs(get_objects_with_square_radius(pos, minetest.env:get_meta(pos):get_int("dist"))) do
if not object:is_player() and object:get_luaentity() and object:get_luaentity().name == "__builtin:item" then
if object:get_luaentity().itemstring ~= "" then
- pipeworks.tube_item(pos, pos, vector.new(0, 0, 0), object:get_luaentity().itemstring)
+ pipeworks.tube_inject_item(pos, pos, vector.new(0, 0, 0), object:get_luaentity().itemstring)
end
object:get_luaentity().itemstring = ""
object:remove()
if data.eject_drops then
for i, stack in ipairs(inv:get_list("main")) do
if not stack:is_empty() then
- pipeworks.tube_item(wielder_pos, wielder_pos, dir, stack)
+ pipeworks.tube_inject_item(wielder_pos, wielder_pos, dir, stack)
inv:set_stack("main", i, ItemStack(""))
end
end