2017-04-11 05:13:44 +02:00
|
|
|
-- this file is basically a modified copy of
|
|
|
|
-- minetest_game/mods/default/furnaces.lua
|
|
|
|
|
2022-04-02 01:50:21 +02:00
|
|
|
local def = table.copy(minetest.registered_nodes["default:furnace"])
|
|
|
|
--local def_active = table.copy(minetest.registered_nodes["default:furnace_active"])
|
2017-04-11 05:13:44 +02:00
|
|
|
|
2021-02-03 18:06:56 +01:00
|
|
|
local tube_entry = "^pipeworks_tube_connection_stony.png"
|
2017-04-11 14:58:19 +02:00
|
|
|
|
2022-04-02 02:20:48 +02:00
|
|
|
local groups = def.groups
|
2022-04-02 01:50:21 +02:00
|
|
|
groups["tubedevice"] = 1
|
|
|
|
groups["tubedevice_receiver"] = 1
|
|
|
|
local groups_active = table.copy(groups)
|
|
|
|
groups_active["not_in_creative_inventory"] = 1
|
2017-04-11 05:13:44 +02:00
|
|
|
|
|
|
|
--
|
|
|
|
-- Node definitions
|
|
|
|
--
|
|
|
|
|
2022-04-02 01:50:21 +02:00
|
|
|
minetest.override_item("default:furnace", {
|
2017-04-11 05:13:44 +02:00
|
|
|
tiles = {
|
2017-04-11 14:58:19 +02:00
|
|
|
"default_furnace_top.png"..tube_entry,
|
|
|
|
"default_furnace_bottom.png"..tube_entry,
|
|
|
|
"default_furnace_side.png"..tube_entry,
|
|
|
|
"default_furnace_side.png"..tube_entry,
|
|
|
|
"default_furnace_side.png"..tube_entry,
|
2017-04-11 05:13:44 +02:00
|
|
|
"default_furnace_front.png"
|
|
|
|
},
|
2022-04-02 01:50:21 +02:00
|
|
|
groups = groups,
|
2017-04-11 05:13:44 +02:00
|
|
|
tube = {
|
|
|
|
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
|
|
|
|
return inv:add_item("src", stack)
|
|
|
|
end
|
|
|
|
end,
|
|
|
|
can_insert = function(pos,node,stack,direction)
|
|
|
|
local meta = minetest.get_meta(pos)
|
|
|
|
local inv = meta:get_inventory()
|
|
|
|
if direction.y == 1 then
|
|
|
|
return inv:room_for_item("fuel", stack)
|
|
|
|
else
|
|
|
|
if meta:get_int("split_material_stacks") == 1 then
|
|
|
|
stack = stack:peek_item(1)
|
|
|
|
end
|
|
|
|
return inv:room_for_item("src", stack)
|
|
|
|
end
|
|
|
|
end,
|
|
|
|
input_inventory = "dst",
|
|
|
|
connect_sides = {left = 1, right = 1, back = 1, front = 1, bottom = 1, top = 1}
|
|
|
|
},
|
|
|
|
|
|
|
|
after_place_node = pipeworks.after_place,
|
2018-09-17 17:44:15 +02:00
|
|
|
after_dig_node = pipeworks.after_dig,
|
|
|
|
on_rotate = pipeworks.on_rotate
|
2017-04-11 05:13:44 +02:00
|
|
|
})
|
|
|
|
|
2022-04-02 01:50:21 +02:00
|
|
|
minetest.override_item("default:furnace_active", {
|
2017-04-11 05:13:44 +02:00
|
|
|
tiles = {
|
2017-04-11 14:58:19 +02:00
|
|
|
"default_furnace_top.png"..tube_entry,
|
|
|
|
"default_furnace_bottom.png"..tube_entry,
|
|
|
|
"default_furnace_side.png"..tube_entry,
|
|
|
|
"default_furnace_side.png"..tube_entry,
|
|
|
|
"default_furnace_side.png"..tube_entry,
|
2017-04-11 05:13:44 +02:00
|
|
|
{
|
|
|
|
image = "default_furnace_front_active.png",
|
|
|
|
backface_culling = false,
|
|
|
|
animation = {
|
|
|
|
type = "vertical_frames",
|
|
|
|
aspect_w = 16,
|
|
|
|
aspect_h = 16,
|
|
|
|
length = 1.5
|
|
|
|
},
|
|
|
|
}
|
|
|
|
},
|
2022-04-02 01:50:21 +02:00
|
|
|
groups = groups_active,
|
2017-04-11 05:13:44 +02:00
|
|
|
tube = {
|
|
|
|
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
|
|
|
|
return inv:add_item("src", stack)
|
|
|
|
end
|
|
|
|
end,
|
|
|
|
can_insert = function(pos, node, stack, direction)
|
|
|
|
local meta = minetest.get_meta(pos)
|
|
|
|
local inv = meta:get_inventory()
|
|
|
|
if direction.y == 1 then
|
|
|
|
return inv:room_for_item("fuel", stack)
|
|
|
|
else
|
|
|
|
return inv:room_for_item("src", stack)
|
|
|
|
end
|
|
|
|
end,
|
|
|
|
input_inventory = "dst",
|
|
|
|
connect_sides = {left = 1, right = 1, back = 1, front = 1, bottom = 1, top = 1}
|
|
|
|
},
|
|
|
|
|
|
|
|
after_place_node = pipeworks.after_place,
|
2018-09-17 17:44:15 +02:00
|
|
|
after_dig_node = pipeworks.after_dig,
|
|
|
|
on_rotate = pipeworks.on_rotate
|
2017-04-11 05:13:44 +02:00
|
|
|
})
|
|
|
|
|