@Override
  public void writeToNBT(NBTTagCompound nbttagcompound) {
    super.writeToNBT(nbttagcompound);

    Utils.writeStacksToNBT(nbttagcompound, "Items", items);

    if (box.isInitialized()) {
      NBTTagCompound boxStore = new NBTTagCompound();
      box.writeToNBT(boxStore);
      nbttagcompound.setTag("box", boxStore);
    }

    if (path != null) {
      NBTTagList list = new NBTTagList();

      for (BlockIndex i : path) {
        NBTTagCompound c = new NBTTagCompound();
        i.writeTo(c);
        list.appendTag(c);
      }

      nbttagcompound.setTag("path", list);
    }

    nbttagcompound.setBoolean("done", done);
  }
  @Override
  public void writeToNBT(NBTTagCompound nbttagcompound) {
    super.writeToNBT(nbttagcompound);

    Utils.writeStacksToNBT(nbttagcompound, "items", items);

    nbttagcompound.setFloat("energyStored", energyStored);

    NBTTagList list = new NBTTagList();

    for (AssemblyRecipe recipe : plannedOutput) {
      NBTTagCompound cpt = new NBTTagCompound();
      recipe.output.writeToNBT(cpt);
      list.appendTag(cpt);
    }

    nbttagcompound.setTag("planned", list);

    if (currentRecipe != null) {
      NBTTagCompound recipe = new NBTTagCompound();
      currentRecipe.output.writeToNBT(recipe);
      nbttagcompound.setTag("recipe", recipe);
    }
  }