From 58b76ff1e568b0990582df5b800537fe9ce51d2f Mon Sep 17 00:00:00 2001 From: LeMagnesium Date: Wed, 26 Aug 2015 15:29:40 +0200 Subject: [PATCH] Add a chatcommand to clear graveyard inventory --- mods/pclasses/inventory.lua | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/mods/pclasses/inventory.lua b/mods/pclasses/inventory.lua index de9c4df1..8e6560a3 100755 --- a/mods/pclasses/inventory.lua +++ b/mods/pclasses/inventory.lua @@ -48,11 +48,21 @@ unified_inventory.register_page("graveyard", { get_formspec = function(player) local pname = player:get_player_name() local form = "label[0,0;Graveyard]" .. - "list[detached:" .. pname .. "_graveyard;graveyard;1,1;7,8]" + "list[detached:" .. pname .. "_graveyard;graveyard;0.5,0.7;7,8]" return {formspec = form, draw_inventory = false} end }) +minetest.register_chatcommand("clear_graveyard", { + description = "Clear Graveyard Inventory", + privs = {}, + func = function(name, param) + local grave_inv = minetest.get_inventory({type = "detached", name = name .. "_graveyard"}) + grave_inv:set_list("graveyard", {}) + return true, "Graveyard flushed" + end, +}) + function pclasses.api.vacuum_graveyard(player) local pname = player:get_player_name() local grave_inv = minetest.get_inventory({type = "detached", name = pname .. "_graveyard"})