summaryrefslogtreecommitdiff
path: root/compat.lua
diff options
context:
space:
mode:
authorAuke Kok <sofar@foo-projects.org>2016-03-27 16:30:23 -0700
committerAuke Kok <sofar@foo-projects.org>2016-03-27 16:30:23 -0700
commitc61c090ac43f2bc6a1b34692df11c4f4eecae71a (patch)
treeed911e9a12bdf0fd116e4306220ee595ad1b524c /compat.lua
parent6de437b83d99cdc49dc7899b3bf4fc6f94054d92 (diff)
downloadpipeworks-c61c090ac43f2bc6a1b34692df11c4f4eecae71a.tar
pipeworks-c61c090ac43f2bc6a1b34692df11c4f4eecae71a.tar.gz
pipeworks-c61c090ac43f2bc6a1b34692df11c4f4eecae71a.tar.bz2
pipeworks-c61c090ac43f2bc6a1b34692df11c4f4eecae71a.tar.xz
pipeworks-c61c090ac43f2bc6a1b34692df11c4f4eecae71a.zip
Work with NodeTimer based furnaces.
If we insert items through tubes, we must start the furnace timer otherwise it will never start operating. This shouldn't break older versions, as not having a timer function should just cancel out.
Diffstat (limited to 'compat.lua')
-rw-r--r--compat.lua8
1 files changed, 8 insertions, 0 deletions
diff --git a/compat.lua b/compat.lua
index c89e492..9c956e6 100644
--- a/compat.lua
+++ b/compat.lua
@@ -15,6 +15,10 @@ minetest.override_item("default:furnace", {
insert_object = function(pos, node, stack, direction)
local meta = minetest.get_meta(pos)
local inv = meta:get_inventory()
+ local timer = minetest.get_node_timer(pos)
+ if not timer:is_started() then
+ timer:start(1.0)
+ end
if direction.y == 1 then
return inv:add_item("fuel",stack)
else
@@ -60,6 +64,10 @@ minetest.override_item("default:furnace_active", {
insert_object = function(pos,node,stack,direction)
local meta = minetest.get_meta(pos)
local inv = meta:get_inventory()
+ local timer = minetest.get_node_timer(pos)
+ if not timer:is_started() then
+ timer:start(1.0)
+ end
if direction.y == 1 then
return inv:add_item("fuel", stack)
else