From 1d0687556a52891aeadc0e8d9a58e44c53cb826b Mon Sep 17 00:00:00 2001 From: Zefram <zefram@fysh.org> Date: Fri, 15 Aug 2014 13:25:46 +0200 Subject: [PATCH] Fix music player's sound management --- technic/machines/register/common.lua | 13 +++++-------- 1 files changed, 5 insertions(+), 8 deletions(-) diff --git a/technic/machines/register/common.lua b/technic/machines/register/common.lua index 3933b0c..9e847c4 100644 --- a/technic/machines/register/common.lua +++ b/technic/machines/register/common.lua @@ -52,10 +52,7 @@ local item0 = stack:to_table() if item0 then item0["count"] = "1" - local item1 = pipeworks.tube_item({x=pos.x, y=pos.y, z=pos.z}, item0) - item1:get_luaentity().start_pos = {x=pos.x, y=pos.y, z=pos.z} - item1:setvelocity({x=x_velocity, y=0, z=z_velocity}) - item1:setacceleration({x=0, y=0, z=0}) + 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 @@ -71,15 +68,15 @@ if meta:get_int("cook_time") < result.time / speed then return end - local result = minetest.get_craft_result({method = "cooking", width = 1, items = inv:get_list("src")}) + local result + local afterfuel + result, afterfuel = minetest.get_craft_result({method = "cooking", width = 1, items = inv:get_list("src")}) if result and result.item then meta:set_int("cook_time", 0) -- check if there's room for output in "dst" list if inv:room_for_item("dst", result.item) then - srcstack = inv:get_stack("src", 1) - srcstack:take_item() - inv:set_stack("src", 1, srcstack) + inv:set_stack("src", 1, afterfuel.items[1]) inv:add_item("dst", result.item) end end -- Gitblit v1.8.0