package com.forgeessentials.afterlife;

import java.util.ArrayList;
import java.util.List;

import net.minecraft.inventory.InventoryBasic;
import net.minecraft.item.ItemStack;

public class InventoryGrave extends InventoryBasic {
    private Grave grave;

    public InventoryGrave(Grave grave)
    {
        super(grave.owner + "'s grave.", false, grave.getSize());
        this.grave = grave;
    }

    @Override
    public void openInventory()
    {
        for (int i = 0; i < getSizeInventory(); i++)
        {
            setInventorySlotContents(i, (ItemStack) null);
        }

        for (int i = 0; i < grave.inv.length; i++)
        {
            if (grave.inv[i] != null)
            {
                setInventorySlotContents(i, grave.inv[i].copy());
            }
        }

        super.openInventory();
    }

    @Override
    public void closeInventory()
    {
        List<ItemStack> list = new ArrayList<ItemStack>();
        for (int i = 0; i < getSizeInventory(); i++)
        {
            ItemStack is = getStackInSlot(i);
            if (is != null)
            {
                list.add(is);
            }
        }
        grave.inv = list.toArray(new ItemStack[list.size()]);

        grave.checkGrave();
        grave.setOpen(false);
        super.closeInventory();
    }
}

@@ -44,53 +44,44 @@
 ort 
-java.util.ArrayList;%0Aimport java.util.Lis
+com.forgeessentials.util.UserIden
 t;%0A
-%0A
 impo
@@ -161,16 +161,68 @@
 Stack;%0A%0A
+import java.util.ArrayList;%0Aimport java.util.List;%0A%0A
 public c
@@ -355,19 +355,48 @@
 per(
-grave.owner
+new UserIdent(grave.owner).getUsername()
  + %22

Fix showing UUIDs instead of player names in the grave inventory