Aktualizovat „basic_machines/technic_power.lua“

This commit is contained in:
Milan2018 2020-04-23 19:50:39 +02:00
parent 9a1dc059b3
commit 28b49865f6

View file

@ -271,6 +271,23 @@ minetest.register_node("basic_machines:battery_0", {
if meta:get_int("upgrade")~=0 then return false else return true end
end
tube = {
insert_object = function(pos, node, stack, direction)
local meta = minetest.get_meta(pos)
local inv = meta:get_inventory()
return inv:add_item("fuel", stack)
end,
can_insert = function(pos, node, stack, direction)
local meta = minetest.get_meta(pos)
local inv = meta:get_inventory()
if meta:get_int("split_material_stacks") == 1 then
stack = stack:peek_item(1)
end
return inv:room_for_item("fuel", stack)
end,
input_inventory = "upgrade",
connect_sides = {left = 1, right = 1, back = 1, front = 1, bottom = 1, top = 1}
},
})
@ -389,6 +406,23 @@ minetest.register_node("basic_machines:generator", {
if meta:get_int("upgrade")~=0 then return false else return true end
end
tube = {
insert_object = function(pos, node, stack, direction)
local meta = minetest.get_meta(pos)
local inv = meta:get_inventory()
return inv:add_item("fuel", stack)
end,
can_insert = function(pos, node, stack, direction)
local meta = minetest.get_meta(pos)
local inv = meta:get_inventory()
if meta:get_int("split_material_stacks") == 1 then
stack = stack:peek_item(1)
end
return inv:room_for_item("fuel", stack)
end,
input_inventory = "upgrade",
connect_sides = {left = 1, right = 1, back = 1, front = 1, bottom = 1, top = 1}
},
})