ActuallyAdditions/src/main/java/de/ellpeck/actuallyadditions/booklet/chapter/BookletChapterCoffee.java
canitzp d0363ed81c
Deleted deprecated recipe classes
Signed-off-by: canitzp <canitzp@gmail.com>
2020-10-06 09:01:56 +02:00

36 lines
1.4 KiB
Java

package de.ellpeck.actuallyadditions.booklet.chapter;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import de.ellpeck.actuallyadditions.api.ActuallyAdditionsAPI;
import de.ellpeck.actuallyadditions.api.booklet.IBookletEntry;
import de.ellpeck.actuallyadditions.api.booklet.IBookletPage;
import de.ellpeck.actuallyadditions.booklet.page.BookletPage;
import de.ellpeck.actuallyadditions.booklet.page.PageCoffeeMachine;
import de.ellpeck.actuallyadditions.common.items.ItemCoffee;
import net.minecraft.item.ItemStack;
public class BookletChapterCoffee extends BookletChapter {
public BookletChapterCoffee(String identifier, IBookletEntry entry, ItemStack displayStack, IBookletPage... pages) {
super(identifier, entry, displayStack, getPages(pages));
}
private static IBookletPage[] getPages(IBookletPage... pages) {
List<IBookletPage> allPages = new ArrayList<>();
allPages.addAll(Arrays.asList(pages));
for (CoffeeIngredient ingredient : ActuallyAdditionsAPI.COFFEE_MACHINE_INGREDIENTS) {
BookletPage page = new PageCoffeeMachine(allPages.size() + 1, ingredient);
if (!(ingredient instanceof ItemCoffee.MilkIngredient)) {
page.setNoText();
}
allPages.add(page);
}
return allPages.toArray(new IBookletPage[allPages.size()]);
}
}