@Override
 public NBTTagCompound writeToNBT(NBTTagCompound tag) {
   super.writeToNBT(tag);
   tag.setTag("tank", tank.writeToNBT(new NBTTagCompound()));
   NBTTagList list = new NBTTagList();
   for (int i = 0; i < stack.length; i++) {
     if (stack[i] != null) {
       NBTTagCompound t = new NBTTagCompound();
       stack[i].writeToNBT(t);
       t.setByte("Slot", (byte) i);
       list.appendTag(t);
     }
   }
   tag.setTag("inventory", list);
   tag.setInteger("progress", progress);
   return tag;
 }