Aktualizovat „basic_machines/recycler.lua“

This commit is contained in:
Milan2018 2020-06-03 13:51:03 +02:00
parent 7b18559fc3
commit 7d80eb8f3f

View file

@ -166,7 +166,7 @@ end
minetest.register_node("basic_machines:recycler", {
description = "Recycler - use to get some ingredients back from crafted things",
tiles = {"recycler.png"},
groups = {cracky=3, mesecon_effector_on = 1},
groups = {cracky=3, mesecon_effector_on = 1, tubedevice = 1, tubedevice_receiver = 1},
sounds = default.node_sound_wood_defaults(),
after_place_node = function(pos, placer)
local meta = minetest.get_meta(pos);
@ -230,6 +230,28 @@ minetest.register_node("basic_machines:recycler", {
recycler_update_meta(pos);
end,
tube = {
insert_object = function(pos, node, stack, direction)
local meta = minetest.get_meta(pos)
local inv = meta:get_inventory()
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}
},
})