diff --git a/api.lua b/api.lua index f6afec5..3ec17ec 100644 --- a/api.lua +++ b/api.lua @@ -187,7 +187,7 @@ end function unified_inventory.go_home(player) local pos = unified_inventory.home_pos[player:get_player_name()] if pos then - player:setpos(pos) + player:set_pos(pos) end end diff --git a/bags.lua b/bags.lua index 75ea13b..02858c5 100644 --- a/bags.lua +++ b/bags.lua @@ -1,7 +1,9 @@ --- Bags for Minetest +--[[ +Bags for Minetest --- Copyright (c) 2012 cornernote, Brett O'Donnell --- License: GPLv3 +Copyright (c) 2012 cornernote, Brett O'Donnell +License: GPLv3 +--]] local S = unified_inventory.gettext local F = minetest.formspec_escape @@ -118,17 +120,19 @@ local function save_bags_metadata(player, bags_inv) is_empty = false end end + local meta = player:get_meta() if is_empty then - player:set_attribute("unified_inventory:bags", nil) + meta:set_string("unified_inventory:bags", nil) else - player:set_attribute("unified_inventory:bags", + meta:set_string("unified_inventory:bags", minetest.serialize(bags)) end end local function load_bags_metadata(player, bags_inv) local player_inv = player:get_inventory() - local bags_meta = player:get_attribute("unified_inventory:bags") + local meta = player:get_meta() + local bags_meta = meta:get_string("unified_inventory:bags") local bags = bags_meta and minetest.deserialize(bags_meta) or {} local dirty_meta = false if not bags_meta then diff --git a/mod.conf b/mod.conf index 26a8af6..e22e595 100644 --- a/mod.conf +++ b/mod.conf @@ -1 +1,4 @@ name = unified_inventory +depends = default +optional_depends = creative, sfinv, intllib, datastorage, farming +description = Unified Inventory replaces the default survival and creative inventory. It adds a nicer interface and a number of features, such as a crafting guide. diff --git a/register.lua b/register.lua index 6b4454c..a61a4e9 100644 --- a/register.lua +++ b/register.lua @@ -48,7 +48,7 @@ unified_inventory.register_button("home_gui_set", { action = function(player) local player_name = player:get_player_name() if minetest.check_player_privs(player_name, {home=true}) then - unified_inventory.set_home(player, player:getpos()) + unified_inventory.set_home(player, player:get_pos()) local home = unified_inventory.home_pos[player_name] if home ~= nil then minetest.sound_play("dingdong", diff --git a/waypoints.lua b/waypoints.lua index 3f9ee58..b6b729c 100644 --- a/waypoints.lua +++ b/waypoints.lua @@ -174,7 +174,7 @@ minetest.register_on_player_receive_fields(function(player, formname, fields) if fields["set_waypoint"..i] then hit = true - local pos = player:getpos() + local pos = player:get_pos() pos.x = math.floor(pos.x) pos.y = math.floor(pos.y) pos.z = math.floor(pos.z)