2015-11-15 15:15:32 +01:00
|
|
|
/*
|
|
|
|
* This file ("BookletChapterReconstructor.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.chapter;
|
|
|
|
|
|
|
|
import ellpeck.actuallyadditions.booklet.entry.BookletEntry;
|
|
|
|
import ellpeck.actuallyadditions.booklet.page.BookletPage;
|
2015-11-15 17:50:31 +01:00
|
|
|
import ellpeck.actuallyadditions.booklet.page.PageCrafting;
|
2015-11-15 15:15:32 +01:00
|
|
|
import ellpeck.actuallyadditions.booklet.page.PageReconstructor;
|
2015-11-15 17:50:31 +01:00
|
|
|
import ellpeck.actuallyadditions.crafting.MiscCrafting;
|
2015-11-15 15:15:32 +01:00
|
|
|
import ellpeck.actuallyadditions.recipe.AtomicReconstructorRecipeHandler;
|
|
|
|
import net.minecraft.item.ItemStack;
|
|
|
|
|
|
|
|
import java.util.ArrayList;
|
|
|
|
import java.util.Arrays;
|
|
|
|
|
|
|
|
public class BookletChapterReconstructor extends BookletChapter{
|
|
|
|
|
|
|
|
public BookletChapterReconstructor(String unlocalizedName, BookletEntry 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));
|
|
|
|
|
2015-11-15 17:50:31 +01:00
|
|
|
allPages.add(new PageCrafting(allPages.size()+1, MiscCrafting.recipesCrystals){
|
|
|
|
@Override
|
|
|
|
public ItemStack[] getItemStacksForPage(){
|
|
|
|
return new ItemStack[0];
|
|
|
|
}
|
|
|
|
}.setNoText());
|
|
|
|
allPages.add(new PageCrafting(allPages.size()+1, MiscCrafting.recipesCrystalBlocks){
|
|
|
|
@Override
|
|
|
|
public ItemStack[] getItemStacksForPage(){
|
|
|
|
return new ItemStack[0];
|
|
|
|
}
|
|
|
|
}.setNoText());
|
|
|
|
|
2015-11-15 15:15:32 +01:00
|
|
|
for(AtomicReconstructorRecipeHandler.Recipe recipe : AtomicReconstructorRecipeHandler.recipes){
|
|
|
|
BookletPage page = new PageReconstructor(allPages.size()+1, recipe.getFirstOutput()).setNoText();
|
|
|
|
allPages.add(page);
|
|
|
|
}
|
|
|
|
|
|
|
|
return allPages.toArray(new BookletPage[allPages.size()]);
|
|
|
|
}
|
|
|
|
}
|