ActuallyAdditions/src/main/java/de/ellpeck/actuallyadditions/booklet/chapter/BookletChapterCrusher.java
Michael be421af8e2
Big Refactor of the package layout
Ignore this commit for diffs
2020-09-09 15:48:43 +01:00

31 lines
1.2 KiB
Java

package de.ellpeck.actuallyadditions.common.booklet.chapter;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import de.ellpeck.actuallyadditions.api.booklet.IBookletEntry;
import de.ellpeck.actuallyadditions.api.booklet.IBookletPage;
import de.ellpeck.actuallyadditions.api.recipe.CrusherRecipe;
import de.ellpeck.actuallyadditions.common.booklet.page.PageCrusherRecipe;
import de.ellpeck.actuallyadditions.common.crafting.CrusherCrafting;
import net.minecraft.item.ItemStack;
public class BookletChapterCrusher extends BookletChapter {
public BookletChapterCrusher(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 (CrusherRecipe recipe : CrusherCrafting.MISC_RECIPES) {
allPages.add(new PageCrusherRecipe(allPages.size() + 1, recipe).setNoText());
}
return allPages.toArray(new IBookletPage[allPages.size()]);
}
}