summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorhdastwb <hdastwb@hdastwb.heliohost.org>2014-07-18 20:19:15 -0400
committerhdastwb <hdastwb@hdastwb.heliohost.org>2014-07-18 20:19:15 -0400
commitdd468c3aaa42478c6873f0a350a7e6e10a817ee9 (patch)
tree3a2e1f7b9df7bb09378b49177627e3ff97b7e931
parent69487e530bbc56a1990fe519749b8e44e1dd5092 (diff)
parent6ec12b51cbf80f85be18db8e59dcb444b50c52ca (diff)
Merge pull request #152 from goblin/coal_alloy_return_bucket
alloy furnaces and generators should not eat fuel buckets
-rw-r--r--technic/machines/LV/coal_alloy_furnace.lua7
-rw-r--r--technic/machines/register/common.lua8
-rw-r--r--technic/machines/register/generator.lua8
3 files changed, 11 insertions, 12 deletions
diff --git a/technic/machines/LV/coal_alloy_furnace.lua b/technic/machines/LV/coal_alloy_furnace.lua
index d1b7fae..a149921 100644
--- a/technic/machines/LV/coal_alloy_furnace.lua
+++ b/technic/machines/LV/coal_alloy_furnace.lua
@@ -142,10 +142,11 @@ minetest.register_abm({
-- Next take a hard look at the fuel situation
local fuel = nil
+ local afterfuel
local fuellist = inv:get_list("fuel")
if fuellist then
- fuel = minetest.get_craft_result({method = "fuel", width = 1, items = fuellist})
+ fuel, afterfuel = minetest.get_craft_result({method = "fuel", width = 1, items = fuellist})
end
if fuel.time <= 0 then
@@ -158,9 +159,7 @@ minetest.register_abm({
meta:set_string("fuel_totaltime", fuel.time)
meta:set_string("fuel_time", 0)
- local stack = inv:get_stack("fuel", 1)
- stack:take_item()
- inv:set_stack("fuel", 1, stack)
+ inv:set_stack("fuel", 1, afterfuel.items[1])
end,
})
diff --git a/technic/machines/register/common.lua b/technic/machines/register/common.lua
index 3933b0c..a3702ab 100644
--- a/technic/machines/register/common.lua
+++ b/technic/machines/register/common.lua
@@ -71,15 +71,15 @@ function technic.smelt_item(meta, result, speed)
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
diff --git a/technic/machines/register/generator.lua b/technic/machines/register/generator.lua
index ec1ea79..64f75be 100644
--- a/technic/machines/register/generator.lua
+++ b/technic/machines/register/generator.lua
@@ -51,7 +51,9 @@ function technic.register_generator(data)
local inv = meta:get_inventory()
if not inv:is_empty("src") then
local fuellist = inv:get_list("src")
- local fuel = minetest.get_craft_result(
+ local fuel
+ local afterfuel
+ fuel, afterfuel = minetest.get_craft_result(
{method = "fuel", width = 1,
items = fuellist})
if not fuel or fuel.time == 0 then
@@ -61,9 +63,7 @@ function technic.register_generator(data)
end
meta:set_int("burn_time", fuel.time)
meta:set_int("burn_totaltime", fuel.time)
- local stack = inv:get_stack("src", 1)
- stack:take_item()
- inv:set_stack("src", 1, stack)
+ inv:set_stack("src", 1, afterfuel.items[1])
technic.swap_node(pos, "technic:"..ltier.."_generator_active")
meta:set_int(tier.."_EU_supply", data.supply)
else