2015-08-30 05:11:05 +02:00
|
|
|
|
/*
|
|
|
|
|
* 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
|
|
|
|
|
*
|
|
|
|
|
* <EFBFBD> 2015 Ellpeck
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
package ellpeck.actuallyadditions.booklet;
|
|
|
|
|
|
2015-09-10 21:25:34 +02:00
|
|
|
|
import ellpeck.actuallyadditions.booklet.page.BookletPage;
|
2015-08-30 05:11:05 +02:00
|
|
|
|
import ellpeck.actuallyadditions.booklet.page.PageCrusherRecipe;
|
|
|
|
|
import ellpeck.actuallyadditions.recipe.CrusherRecipeManualRegistry;
|
2015-09-10 21:25:34 +02:00
|
|
|
|
import net.minecraft.item.ItemStack;
|
2015-08-30 05:11:05 +02:00
|
|
|
|
|
|
|
|
|
import java.util.ArrayList;
|
2015-09-13 22:57:51 +02:00
|
|
|
|
import java.util.Arrays;
|
2015-08-30 05:11:05 +02:00
|
|
|
|
|
|
|
|
|
public class BookletChapterCrusher extends BookletChapter{
|
|
|
|
|
|
2015-09-10 21:25:34 +02:00
|
|
|
|
public BookletChapterCrusher(String unlocalizedName, BookletIndexEntry entry, ItemStack displayStack, BookletPage... pages){
|
|
|
|
|
super(unlocalizedName, entry, displayStack, getAllPages(pages));
|
2015-08-30 05:11:05 +02:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@SuppressWarnings("unchecked")
|
2015-09-10 21:25:34 +02:00
|
|
|
|
private static BookletPage[] getAllPages(BookletPage... pages){
|
|
|
|
|
ArrayList<BookletPage> list = new ArrayList<BookletPage>();
|
2015-08-30 05:11:05 +02:00
|
|
|
|
list.addAll(Arrays.asList(pages));
|
|
|
|
|
for(CrusherRecipeManualRegistry.CrusherRecipe rec : CrusherRecipeManualRegistry.recipes){
|
|
|
|
|
list.add(new PageCrusherRecipe(list.size()+1, rec));
|
|
|
|
|
}
|
2015-09-10 21:25:34 +02:00
|
|
|
|
return list.toArray(new BookletPage[list.size()]);
|
2015-08-30 05:11:05 +02:00
|
|
|
|
}
|
|
|
|
|
}
|