// Path: src/main/java/tonius/emobile/item/ItemCellphone.java
// public class ItemCellphone extends Item {
//     
//     public ItemCellphone() {
//         this.setMaxStackSize(1);
//         this.setUnlocalizedName("emobile.cellphone");
//         this.setTextureName("emobile:cellphone");
//         this.setCreativeTab(CreativeTabs.tabTools);
//     }
//     
//     public boolean useFuel(ItemStack cellphone, EntityPlayer player) {
//         return new InventoryCellphone(cellphone).useFuel();
//     }
//     
//     @Override
//     public ItemStack onItemRightClick(ItemStack cellphone, World world, EntityPlayer player) {
//         if (!world.isRemote) {
//             player.openGui(EMobile.instance, EMGuiHandler.CELLPHONE_PEARL, world, 0, 0, 0);
//         }
//         
//         return cellphone;
//     }
//     
//     @Override
//     @SideOnly(Side.CLIENT)
//     public void addInformation(ItemStack itemStack, EntityPlayer player, List list, boolean bool) {
//         list.add(String.format(StringUtils.translate("tooltip.cellphone.pearls"), new InventoryCellphone(itemStack).getStoredPearls()));
//     }
//     
// }
// 
// Path: src/main/java/tonius/emobile/util/StackUtils.java
// public class StackUtils {
//     
//     public static NBTTagCompound getNBT(ItemStack itemStack) {
//         if (itemStack.stackTagCompound == null) {
//             itemStack.stackTagCompound = new NBTTagCompound();
//         }
//         return itemStack.stackTagCompound;
//     }
//     
//     public static ItemStack decrementStack(ItemStack itemStack) {
//         if (--itemStack.stackSize <= 0) {
//             itemStack = null;
//         }
//         return itemStack;
//     }
// }


import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.IInventory;
import net.minecraft.item.ItemEnderPearl;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.nbt.NBTTagList;
import tonius.emobile.item.ItemCellphone;
import tonius.emobile.util.StackUtils;
                this.inv[slot] = ItemStack.loadItemStackFromNBT(tag);
            }
        }
    }
    
    public void writeToNBT(NBTTagCompound tagCompound) {
        NBTTagList itemList = new NBTTagList();
        for (int i = 0; i < this.inv.length; i++) {
            ItemStack stack = this.inv[i];
            if (stack != null) {
                NBTTagCompound tag = new NBTTagCompound();
                tag.setByte("Slot", (byte) i);
                stack.writeToNBT(tag);
                itemList.appendTag(tag);
            }
        }
        tagCompound.setTag("Inventory", itemList);
    }
    
    @Override
    public int getSizeInventory() {
        return this.inv.length;
    }
    
    @Override
    public ItemStack getStackInSlot(int slot) {
        return this.inv[slot];
    }
    
    @Override
// Path: src/main/java/tonius/emobile/item/ItemCellphone.java
// public class ItemCellphone extends Item {
//     
//     public ItemCellphone() {
//         this.setMaxStackSize(1);
//         this.setUnlocalizedName("emobile.cellphone");
//         this.setTextureName("emobile:cellphone");
//         this.setCreativeTab(CreativeTabs.tabTools);
//     }
//     
//     public boolean useFuel(ItemStack cellphone, EntityPlayer player) {
//         return new InventoryCellphone(cellphone).useFuel();
//     }
//     
//     @Override
//     public ItemStack onItemRightClick(ItemStack cellphone, World world, EntityPlayer player) {
//         if (!world.isRemote) {
//             player.openGui(EMobile.instance, EMGuiHandler.CELLPHONE_PEARL, world, 0, 0, 0);
//         }
//         
//         return cellphone;
//     }
//     
//     @Override
//     @SideOnly(Side.CLIENT)
//     public void addInformation(ItemStack itemStack, EntityPlayer player, List list, boolean bool) {
//         list.add(String.format(StringUtils.translate("tooltip.cellphone.pearls"), new InventoryCellphone(itemStack).getStoredPearls()));
//     }
//     
// }
// 
// Path: src/main/java/tonius/emobile/util/StackUtils.java
// public class StackUtils {
//     
//     public static NBTTagCompound getNBT(ItemStack itemStack) {
//         if (itemStack.stackTagCompound == null) {
//             itemStack.stackTagCompound = new NBTTagCompound();
//         }
//         return itemStack.stackTagCompound;
//     }
//     
//     public static ItemStack decrementStack(ItemStack itemStack) {
//         if (--itemStack.stackSize <= 0) {
//             itemStack = null;
//         }
//         return itemStack;
//     }
// }


// Path: src/main/java/tonius/emobile/inventory/InventoryCellphone.java
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.IInventory;
import net.minecraft.item.ItemEnderPearl;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.nbt.NBTTagList;
import tonius.emobile.item.ItemCellphone;
import tonius.emobile.util.StackUtils;

                this.inv[slot] = ItemStack.loadItemStackFromNBT(tag);
            }
        }
    }
    
    public void writeToNBT(NBTTagCompound tagCompound) {
        NBTTagList itemList = new NBTTagList();
        for (int i = 0; i < this.inv.length; i++) {
            ItemStack stack = this.inv[i];
            if (stack != null) {
                NBTTagCompound tag = new NBTTagCompound();
                tag.setByte("Slot", (byte) i);
                stack.writeToNBT(tag);
                itemList.appendTag(tag);
            }
        }
        tagCompound.setTag("Inventory", itemList);
    }
    
    @Override
    public int getSizeInventory() {
        return this.inv.length;
    }
    
    @Override
    public ItemStack getStackInSlot(int slot) {
        return this.inv[slot];
    }
    
    @Override
    public ItemStack decrStackSize(int slot, int amount) {