Remove material value lookup from global API
This commit is contained in:
parent
25319d8053
commit
8aed769b97
@ -94,7 +94,7 @@ end
|
|||||||
-- stack: The itemstack to convert
|
-- stack: The itemstack to convert
|
||||||
--
|
--
|
||||||
-- Returns a table with the material values
|
-- 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_name = stack:get_name();
|
||||||
local item_count = stack:get_count();
|
local item_count = stack:get_count();
|
||||||
|
|
||||||
@ -380,7 +380,7 @@ end
|
|||||||
-- Returns a formspec string
|
-- Returns a formspec string
|
||||||
function fs.convert(x, y, pos, skin)
|
function fs.convert(x, y, pos, skin)
|
||||||
local meta = minetest.get_meta(pos);
|
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 {
|
return gui.container {
|
||||||
x = x,
|
x = x,
|
||||||
@ -694,7 +694,7 @@ minetest.register_on_player_receive_fields(function(player, name, fields)
|
|||||||
local inv = meta:get_inventory();
|
local inv = meta:get_inventory();
|
||||||
local stack = inv:get_stack("input", 1);
|
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
|
if value.paper + value.pigment > 0 then
|
||||||
meta:set_int("paper", meta:get_int("paper") + value.paper);
|
meta:set_int("paper", meta:get_int("paper") + value.paper);
|
||||||
|
Loading…
Reference in New Issue
Block a user