@@ -0,0 +1,1813 @@
+package com.five35.minecraft.deathbox.inventorymanager;%0A%0Aimport java.util.ArrayList;%0Aimport java.util.Arrays;%0Aimport java.util.HashMap;%0Aimport java.util.List;%0Aimport java.util.Map;%0Aimport java.util.Map.Entry;%0Aimport net.minecraft.entity.player.EntityPlayer;%0Aimport net.minecraft.item.ItemStack;%0A%0Apublic class VanillaInventoryManager implements InventoryManager %7B%0A%09static %7B%0A%09%09InventoryManagerRegistry.register(new VanillaInventoryManager(false));%0A%09%09InventoryManagerRegistry.register(new VanillaInventoryManager(true));%0A%09%7D%0A%0A%09private final boolean isArmor;%0A%0A%09private VanillaInventoryManager(final boolean isArmor) %7B%0A%09%09this.isArmor = isArmor;%0A%09%7D%0A%0A%09@Override%0A%09public void clearSlots(final EntityPlayer player) %7B%0A%09%09Arrays.fill(this.getArray(player), null);%0A%09%7D%0A%0A%09@Override%0A%09public List%3CItemStack%3E fillSlots(final EntityPlayer player, final Map%3CInteger, ItemStack%3E slots) %7B%0A%09%09final List%3CItemStack%3E leftovers = new ArrayList%3C%3E();%0A%09%09final ItemStack%5B%5D inventory = this.getArray(player);%0A%0A%09%09for (final Entry%3CInteger, ItemStack%3E entry : slots.entrySet()) %7B%0A%09%09%09if (inventory%5Bentry.getKey()%5D == null) %7B%0A%09%09%09%09inventory%5Bentry.getKey()%5D = entry.getValue();%0A%09%09%09%7D else %7B%0A%09%09%09%09leftovers.add(entry.getValue());%0A%09%09%09%7D%0A%09%09%7D%0A%0A%09%09return leftovers;%0A%09%7D%0A%0A%09private ItemStack%5B%5D getArray(final EntityPlayer player) %7B%0A%09%09return this.isArmor ? player.inventory.armorInventory : player.inventory.mainInventory;%0A%09%7D%0A%0A%09@Override%0A%09public String getName() %7B%0A%09%09return this.isArmor ? %22Minecraft%7CArmor%22 : %22Minecraft%7CMain%22;%0A%09%7D%0A%0A%09@Override%0A%09public Map%3CInteger, ItemStack%3E getSlots(final EntityPlayer player) %7B%0A%09%09final Map%3CInteger, ItemStack%3E slots = new HashMap%3C%3E();%0A%09%09final ItemStack%5B%5D inventory = this.getArray(player);%0A%0A%09%09for (int i = 0; i %3C inventory.length; i++) %7B%0A%09%09%09if (inventory%5Bi%5D != null) %7B%0A%09%09%09%09slots.put(i, inventory%5Bi%5D);%0A%09%09%09%7D%0A%09%09%7D%0A%0A%09%09return slots;%0A%09%7D%0A%7D%0A

add inventory manager for vanilla inventories