2020-09-09 16:49:01 +02:00
|
|
|
package de.ellpeck.actuallyadditions.booklet.chapter;
|
2016-11-10 21:07:15 +01:00
|
|
|
|
2019-05-02 09:10:29 +02:00
|
|
|
import java.util.ArrayList;
|
|
|
|
import java.util.Arrays;
|
|
|
|
import java.util.List;
|
|
|
|
|
2016-11-10 21:07:15 +01:00
|
|
|
import de.ellpeck.actuallyadditions.api.booklet.IBookletEntry;
|
|
|
|
import de.ellpeck.actuallyadditions.api.booklet.IBookletPage;
|
2020-09-09 16:49:01 +02:00
|
|
|
import de.ellpeck.actuallyadditions.booklet.page.PageCrusherRecipe;
|
2020-09-09 16:48:43 +02:00
|
|
|
import de.ellpeck.actuallyadditions.common.crafting.CrusherCrafting;
|
2016-11-10 21:07:15 +01:00
|
|
|
import net.minecraft.item.ItemStack;
|
|
|
|
|
2019-05-02 09:10:29 +02:00
|
|
|
public class BookletChapterCrusher extends BookletChapter {
|
2016-11-10 21:07:15 +01:00
|
|
|
|
2019-05-02 09:10:29 +02:00
|
|
|
public BookletChapterCrusher(String identifier, IBookletEntry entry, ItemStack displayStack, IBookletPage... pages) {
|
2016-11-12 00:29:01 +01:00
|
|
|
super(identifier, entry, displayStack, getPages(pages));
|
|
|
|
}
|
|
|
|
|
2019-05-02 09:10:29 +02:00
|
|
|
private static IBookletPage[] getPages(IBookletPage... pages) {
|
2019-02-27 19:53:05 +01:00
|
|
|
List<IBookletPage> allPages = new ArrayList<>();
|
2016-11-12 00:29:01 +01:00
|
|
|
allPages.addAll(Arrays.asList(pages));
|
|
|
|
|
2019-05-02 09:10:29 +02:00
|
|
|
for (CrusherRecipe recipe : CrusherCrafting.MISC_RECIPES) {
|
|
|
|
allPages.add(new PageCrusherRecipe(allPages.size() + 1, recipe).setNoText());
|
2016-11-12 00:29:01 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
return allPages.toArray(new IBookletPage[allPages.size()]);
|
2016-11-10 21:07:15 +01:00
|
|
|
}
|
|
|
|
}
|