mirror of
https://github.com/Ellpeck/ActuallyAdditions.git
synced 2024-06-26 06:31:43 +02:00
40 lines
1.5 KiB
Java
40 lines
1.5 KiB
Java
|
/*
|
||
|
* This file ("BookletChapterCrusher.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
|
||
|
* http://github.com/Ellpeck/ActuallyAdditions/blob/master/README.md
|
||
|
* View the source code at https://github.com/Ellpeck/ActuallyAdditions
|
||
|
*
|
||
|
* © 2015 Ellpeck
|
||
|
*/
|
||
|
|
||
|
package ellpeck.actuallyadditions.booklet;
|
||
|
|
||
|
import ellpeck.actuallyadditions.booklet.page.BookletPage;
|
||
|
import ellpeck.actuallyadditions.booklet.page.PageCrusherRecipe;
|
||
|
import ellpeck.actuallyadditions.crafting.CrusherCrafting;
|
||
|
import ellpeck.actuallyadditions.recipe.CrusherRecipeRegistry;
|
||
|
import net.minecraft.item.ItemStack;
|
||
|
|
||
|
import java.util.ArrayList;
|
||
|
import java.util.Arrays;
|
||
|
|
||
|
public class BookletChapterCrusher extends BookletChapter{
|
||
|
|
||
|
public BookletChapterCrusher(String unlocalizedName, BookletIndexEntry entry, ItemStack displayStack, BookletPage... pages){
|
||
|
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));
|
||
|
|
||
|
for(CrusherRecipeRegistry.CrusherRecipe recipe : CrusherCrafting.miscRecipes){
|
||
|
allPages.add(new PageCrusherRecipe(allPages.size()+1, recipe).setNoText());
|
||
|
}
|
||
|
|
||
|
return allPages.toArray(new BookletPage[allPages.size()]);
|
||
|
}
|
||
|
}
|