2015-09-24 23:42:03 +02:00
|
|
|
/*
|
|
|
|
* This file ("BookletChapterCoffee.java") is part of the Actually Additions Mod for Minecraft.
|
|
|
|
* It is created and owned by Ellpeck and distributed
|
|
|
|
* under the Actually Additions License to be found at
|
2016-01-03 16:05:51 +01:00
|
|
|
* http://ellpeck.de/actaddlicense/
|
2015-09-24 23:42:03 +02:00
|
|
|
* View the source code at https://github.com/Ellpeck/ActuallyAdditions
|
|
|
|
*
|
2016-01-03 16:05:51 +01:00
|
|
|
* © 2016 Ellpeck
|
2015-09-24 23:42:03 +02:00
|
|
|
*/
|
|
|
|
|
2016-01-05 04:47:35 +01:00
|
|
|
package de.ellpeck.actuallyadditions.mod.booklet.chapter;
|
|
|
|
|
|
|
|
import de.ellpeck.actuallyadditions.api.ActuallyAdditionsAPI;
|
2016-01-05 14:57:50 +01:00
|
|
|
import de.ellpeck.actuallyadditions.api.booklet.BookletPage;
|
|
|
|
import de.ellpeck.actuallyadditions.api.booklet.IBookletEntry;
|
2016-01-05 04:47:35 +01:00
|
|
|
import de.ellpeck.actuallyadditions.api.recipe.coffee.CoffeeIngredient;
|
2016-01-05 14:57:50 +01:00
|
|
|
import de.ellpeck.actuallyadditions.mod.booklet.page.BookletPageAA;
|
2016-01-05 04:47:35 +01:00
|
|
|
import de.ellpeck.actuallyadditions.mod.booklet.page.PageCoffeeRecipe;
|
|
|
|
import de.ellpeck.actuallyadditions.mod.items.ItemCoffee;
|
2015-09-24 23:42:03 +02:00
|
|
|
import net.minecraft.item.ItemStack;
|
|
|
|
|
|
|
|
import java.util.ArrayList;
|
2015-09-27 02:22:37 +02:00
|
|
|
import java.util.Arrays;
|
2015-09-24 23:42:03 +02:00
|
|
|
|
|
|
|
public class BookletChapterCoffee extends BookletChapter{
|
|
|
|
|
2016-01-05 14:57:50 +01:00
|
|
|
public BookletChapterCoffee(String unlocalizedName, IBookletEntry entry, ItemStack displayStack, BookletPage... pages){
|
2015-09-24 23:42:03 +02:00
|
|
|
super(unlocalizedName, entry, displayStack, getPages(pages));
|
|
|
|
}
|
|
|
|
|
|
|
|
@SuppressWarnings("unchecked")
|
|
|
|
private static BookletPage[] getPages(BookletPage... pages){
|
|
|
|
ArrayList<BookletPage> allPages = new ArrayList<BookletPage>();
|
|
|
|
allPages.addAll(Arrays.asList(pages));
|
|
|
|
|
2016-01-05 04:47:35 +01:00
|
|
|
for(CoffeeIngredient ingredient : ActuallyAdditionsAPI.coffeeMachineIngredients){
|
2016-01-05 14:57:50 +01:00
|
|
|
BookletPageAA page = new PageCoffeeRecipe(allPages.size()+1, ingredient);
|
2015-09-24 23:42:03 +02:00
|
|
|
if(!(ingredient instanceof ItemCoffee.MilkIngredient)){
|
|
|
|
page.setNoText();
|
|
|
|
}
|
|
|
|
allPages.add(page);
|
|
|
|
}
|
|
|
|
|
|
|
|
return allPages.toArray(new BookletPage[allPages.size()]);
|
|
|
|
}
|
|
|
|
}
|