Remove material value lookup from global API

This commit is contained in:
Hugues Ross 2020-06-08 20:21:58 -04:00
parent 25319d8053
commit 8aed769b97

View File

@ -94,7 +94,7 @@ end
-- stack: The itemstack to convert
--
-- Returns a table with the material values
function cartographer.get_material_value(stack)
function get_material_value(stack)
local item_name = stack:get_name();
local item_count = stack:get_count();
@ -380,7 +380,7 @@ end
-- Returns a formspec string
function fs.convert(x, y, pos, skin)
local meta = minetest.get_meta(pos);
local value = cartographer.get_material_value(meta:get_inventory():get_stack("input", 1));
local value = get_material_value(meta:get_inventory():get_stack("input", 1));
return gui.container {
x = x,
@ -694,7 +694,7 @@ minetest.register_on_player_receive_fields(function(player, name, fields)
local inv = meta:get_inventory();
local stack = inv:get_stack("input", 1);
local value = cartographer.get_material_value(stack);
local value = get_material_value(stack);
if value.paper + value.pigment > 0 then
meta:set_int("paper", meta:get_int("paper") + value.paper);