Aktualizovat „basic_machines/recycler.lua“ #18

Merged
milan merged 1 commit from milan2018 into master 2020-06-06 10:01:51 +02:00
Showing only changes of commit 7d80eb8f3f - Show all commits

View file

@ -166,7 +166,7 @@ end
minetest.register_node("basic_machines:recycler", { minetest.register_node("basic_machines:recycler", {
description = "Recycler - use to get some ingredients back from crafted things", description = "Recycler - use to get some ingredients back from crafted things",
tiles = {"recycler.png"}, 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(), sounds = default.node_sound_wood_defaults(),
after_place_node = function(pos, placer) after_place_node = function(pos, placer)
local meta = minetest.get_meta(pos); local meta = minetest.get_meta(pos);
@ -230,6 +230,28 @@ minetest.register_node("basic_machines:recycler", {
recycler_update_meta(pos); recycler_update_meta(pos);
end, 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}
},
}) })