package com.five35.minecraft.deathbox;

import java.util.HashMap;
import java.util.Map;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;

public class DeathBoxTileEntity extends TileEntity {
	private final Map<Integer, ItemStack> inventory = new HashMap<>();
	private String ownerName;

	public String getOwnerName() {
		return this.ownerName;
	}

	public void pop() {
		// drop contents on ground
	}

	public void recover(final EntityPlayer player) {
		// add items to player, dropping stacks for conflicting slots

		// destroy death box
	}

	public void setOwnerName(final String ownerName) {
		this.ownerName = ownerName;
	}
}

@@ -278,36 +278,312 @@
 ate 
-final Map%3CInteger, ItemStack
+static void arrayToMap(final ItemStack%5B%5D array, final Map%3CInteger, ItemStack%3E map) %7B%0A%09%09for (int i = 0; i %3C array.length; i++) %7B%0A%09%09%09final ItemStack stack = array%5Bi%5D;%0A%0A%09%09%09if (stack != null) %7B%0A%09%09%09%09map.put(i, stack.copy());%0A%09%09%09%09array%5Bi%5D = null;%0A%09%09%09%7D%0A%09%09%7D%0A%09%7D%0A%0A%09private final Map%3CString, Map%3CInteger, ItemStack%3E
 %3E in
@@ -588,17 +588,19 @@
 inventor
-y
+ies
  = new H
@@ -980,11 +980,472 @@
 Name;%0A%09%7D
+%0A%0A%09public void store(final EntityPlayer player) %7B%0A%09%09final Map%3CInteger, ItemStack%3E mainInventory = new HashMap%3C%3E();%0A%09%09final Map%3CInteger, ItemStack%3E armorInventory = new HashMap%3C%3E();%0A%0A%09%09this.inventories.put(%22mainInventory%22, mainInventory);%0A%09%09this.inventories.put(%22armorInventory%22, armorInventory);%0A%0A%09%09DeathBoxTileEntity.arrayToMap(player.inventory.mainInventory, mainInventory);%0A%09%09DeathBoxTileEntity.arrayToMap(player.inventory.armorInventory, armorInventory);%0A%09%7D
 %0A%7D%0A

implement moving a player's inventory into a death box