public void writeToNBT(NBTTagCompound compound) {
NBTTagCompound nbt = new NBTTagCompound();
// Write the ingredients.
NBTTagList list1 = new NBTTagList();
for( ItemStack stack : this ) {
NBTTagCompound tag = new NBTTagCompound();
Utils.writeItemStackToNBT( nbt, stack, "ingredient" );
list1.appendTag( tag );
}
nbt.setTag( "ingredientList", list1 );
// Write the recipes
NBTTagList list2 = new NBTTagList();
for( ItemsReference key : recipes.keySet() ) {
NBTTagCompound tag = new NBTTagCompound();
Utils.writeItemStackToNBT( nbt, key.toItemStack(), "key" );
recipes.get( key ).writeToNBT( tag );
list2.appendTag( tag );
}
nbt.setTag( "recipes", list2 );
compound.setTag( "projectList", nbt );
}