From f4680232e7edfc2e6029a95494fc72e1ccf460bf Mon Sep 17 00:00:00 2001 From: Jack Harrier Date: Wed, 10 Aug 2016 00:29:06 +0200 Subject: [PATCH] added forgotten function --- technic/machines/HV/nuclear_reactor.lua | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/technic/machines/HV/nuclear_reactor.lua b/technic/machines/HV/nuclear_reactor.lua index ef76536..50afe56 100644 --- a/technic/machines/HV/nuclear_reactor.lua +++ b/technic/machines/HV/nuclear_reactor.lua @@ -262,6 +262,24 @@ local function run(pos, node) end end +-- find least inventory size from inventory +local function least_inventory_size_index(inv) + local least = 100 + local index = 1 + + for i=1, inv:get_size("src"), 1 do + local stack = inv:get_stack("src", i) + + + if stack:get_count() < least then + least = stack:get_count() + index = i + end + end + return index +end + + -- sort fuel rods in equal stacks local function sort_fuel_rods(pos, node, stack, direction) local meta = minetest.get_meta(pos) @@ -282,6 +300,10 @@ local function sort_fuel_rods(pos, node, stack, direction) return stack end + + + + minetest.register_node("technic:hv_nuclear_reactor_core", { description = reactor_desc, tiles = {"technic_hv_nuclear_reactor_core.png"},