mirror of
https://github.com/Ellpeck/ActuallyAdditions.git
synced 2024-11-22 15:18:34 +01:00
Remove NEI integration and fix an event derp
This commit is contained in:
parent
050f963940
commit
21f23c3670
19 changed files with 21 additions and 1369 deletions
|
@ -23,6 +23,7 @@ import net.minecraft.item.EnumRarity;
|
|||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.event.entity.living.LivingDropsEvent;
|
||||
import net.minecraftforge.event.entity.living.LivingEvent;
|
||||
import net.minecraftforge.event.entity.player.PlayerInteractEvent;
|
||||
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
|
||||
import net.minecraftforge.fml.common.gameevent.PlayerEvent;
|
||||
|
@ -70,7 +71,7 @@ public class ItemWingsOfTheBats extends ItemBase{
|
|||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void onPlayerInteractEvent(PlayerInteractEvent event){
|
||||
public void livingUpdateEvent(LivingEvent.LivingUpdateEvent event){
|
||||
if(event.getEntityLiving() instanceof EntityPlayer){
|
||||
EntityPlayer player = (EntityPlayer)event.getEntityLiving();
|
||||
boolean wingsEquipped = ItemWingsOfTheBats.getWingItem(player) != null;
|
||||
|
|
|
@ -26,9 +26,6 @@ import de.ellpeck.actuallyadditions.mod.jei.crusher.CrusherRecipeCategory;
|
|||
import de.ellpeck.actuallyadditions.mod.jei.crusher.CrusherRecipeHandler;
|
||||
import de.ellpeck.actuallyadditions.mod.jei.reconstructor.ReconstructorRecipeCategory;
|
||||
import de.ellpeck.actuallyadditions.mod.jei.reconstructor.ReconstructorRecipeHandler;
|
||||
import de.ellpeck.actuallyadditions.mod.nei.NEIBookletRecipe;
|
||||
import de.ellpeck.actuallyadditions.mod.nei.NEICoffeeMachineRecipe;
|
||||
import de.ellpeck.actuallyadditions.mod.nei.NEIReconstructorRecipe;
|
||||
import de.ellpeck.actuallyadditions.mod.util.Util;
|
||||
import mezz.jei.api.*;
|
||||
import mezz.jei.api.recipe.VanillaRecipeCategoryUid;
|
||||
|
@ -61,23 +58,11 @@ public class JEIActuallyAdditionsPlugin implements IModPlugin{
|
|||
registry.addRecipes(ActuallyAdditionsAPI.CRUSHER_RECIPES);
|
||||
registry.addRecipes(ActuallyAdditionsAPI.RECONSTRUCTOR_LENS_CONVERSION_RECIPES);
|
||||
|
||||
registry.addRecipeClickArea(GuiCoffeeMachine.class, 53, 42, 22, 16, NEICoffeeMachineRecipe.NAME);
|
||||
registry.addRecipeClickArea(GuiCoffeeMachine.class, 53, 42, 22, 16, CoffeeMachineRecipeCategory.NAME);
|
||||
registry.addRecipeClickArea(GuiGrinder.class, 80, 40, 24, 22, CrusherRecipeCategory.NAME);
|
||||
registry.addRecipeClickArea(GuiGrinder.GuiGrinderDouble.class, 51, 40, 74, 22, CrusherRecipeCategory.NAME);
|
||||
registry.addRecipeClickArea(GuiFurnaceDouble.class, 51, 40, 74, 22, VanillaRecipeCategoryUid.SMELTING);
|
||||
|
||||
INbtIgnoreList ignoreList = helpers.getNbtIgnoreList();
|
||||
ignoreList.ignoreNbtTagNames(InitItems.itemDrill, "Energy");
|
||||
ignoreList.ignoreNbtTagNames(InitItems.itemTeleStaff, "Energy");
|
||||
ignoreList.ignoreNbtTagNames(InitItems.itemGrowthRing, "Energy");
|
||||
ignoreList.ignoreNbtTagNames(InitItems.itemMagnetRing, "Energy");
|
||||
ignoreList.ignoreNbtTagNames(InitItems.itemWaterRemovalRing, "Energy");
|
||||
ignoreList.ignoreNbtTagNames(InitItems.itemBattery, "Energy");
|
||||
ignoreList.ignoreNbtTagNames(InitItems.itemBatteryDouble, "Energy");
|
||||
ignoreList.ignoreNbtTagNames(InitItems.itemBatteryTriple, "Energy");
|
||||
ignoreList.ignoreNbtTagNames(InitItems.itemBatteryQuadruple, "Energy");
|
||||
ignoreList.ignoreNbtTagNames(InitItems.itemBatteryQuintuple, "Energy");
|
||||
|
||||
IItemBlacklist blacklist = helpers.getItemBlacklist();
|
||||
blacklist.addItemToBlacklist(new ItemStack(InitBlocks.blockRice));
|
||||
blacklist.addItemToBlacklist(new ItemStack(InitBlocks.blockCanola));
|
||||
|
@ -94,9 +79,9 @@ public class JEIActuallyAdditionsPlugin implements IModPlugin{
|
|||
registry.addRecipeCategoryCraftingItem(new ItemStack(InitBlocks.blockFurnaceDouble), VanillaRecipeCategoryUid.SMELTING);
|
||||
registry.addRecipeCategoryCraftingItem(new ItemStack(InitBlocks.blockGrinder), CrusherRecipeCategory.NAME);
|
||||
registry.addRecipeCategoryCraftingItem(new ItemStack(InitBlocks.blockGrinderDouble), CrusherRecipeCategory.NAME);
|
||||
registry.addRecipeCategoryCraftingItem(new ItemStack(InitBlocks.blockCoffeeMachine), NEICoffeeMachineRecipe.NAME);
|
||||
registry.addRecipeCategoryCraftingItem(new ItemStack(InitBlocks.blockAtomicReconstructor), NEIReconstructorRecipe.NAME);
|
||||
registry.addRecipeCategoryCraftingItem(new ItemStack(InitItems.itemBooklet), NEIBookletRecipe.NAME);
|
||||
registry.addRecipeCategoryCraftingItem(new ItemStack(InitBlocks.blockCoffeeMachine), CoffeeMachineRecipeCategory.NAME);
|
||||
registry.addRecipeCategoryCraftingItem(new ItemStack(InitBlocks.blockAtomicReconstructor), ReconstructorRecipeCategory.NAME);
|
||||
registry.addRecipeCategoryCraftingItem(new ItemStack(InitItems.itemBooklet), BookletRecipeCategory.NAME);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -10,7 +10,6 @@
|
|||
|
||||
package de.ellpeck.actuallyadditions.mod.jei.booklet;
|
||||
|
||||
import de.ellpeck.actuallyadditions.mod.nei.NEIBookletRecipe;
|
||||
import de.ellpeck.actuallyadditions.mod.util.StringUtil;
|
||||
import mezz.jei.api.IGuiHelper;
|
||||
import mezz.jei.api.gui.IDrawable;
|
||||
|
@ -23,6 +22,8 @@ import java.util.Arrays;
|
|||
|
||||
public class BookletRecipeCategory implements IRecipeCategory{
|
||||
|
||||
public static final String NAME = "actuallyadditions.booklet";
|
||||
|
||||
private final IDrawable background;
|
||||
|
||||
public BookletRecipeCategory(IGuiHelper helper){
|
||||
|
@ -32,13 +33,13 @@ public class BookletRecipeCategory implements IRecipeCategory{
|
|||
|
||||
@Override
|
||||
public String getUid(){
|
||||
return NEIBookletRecipe.NAME;
|
||||
return NAME;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String getTitle(){
|
||||
return StringUtil.localize("container.nei."+NEIBookletRecipe.NAME+".name");
|
||||
return StringUtil.localize("container.nei."+NAME+".name");
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -11,8 +11,6 @@
|
|||
package de.ellpeck.actuallyadditions.mod.jei.booklet;
|
||||
|
||||
import de.ellpeck.actuallyadditions.api.booklet.BookletPage;
|
||||
import de.ellpeck.actuallyadditions.api.recipe.CrusherRecipe;
|
||||
import de.ellpeck.actuallyadditions.mod.nei.NEIBookletRecipe;
|
||||
import mezz.jei.api.recipe.IRecipeHandler;
|
||||
import mezz.jei.api.recipe.IRecipeWrapper;
|
||||
|
||||
|
@ -31,7 +29,7 @@ public class BookletRecipeHandler implements IRecipeHandler<BookletPage>{
|
|||
|
||||
@Override
|
||||
public String getRecipeCategoryUid(){
|
||||
return NEIBookletRecipe.NAME;
|
||||
return BookletRecipeCategory.NAME;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -10,7 +10,6 @@
|
|||
|
||||
package de.ellpeck.actuallyadditions.mod.jei.coffee;
|
||||
|
||||
import de.ellpeck.actuallyadditions.mod.nei.NEICoffeeMachineRecipe;
|
||||
import de.ellpeck.actuallyadditions.mod.util.AssetUtil;
|
||||
import de.ellpeck.actuallyadditions.mod.util.StringUtil;
|
||||
import mezz.jei.api.IGuiHelper;
|
||||
|
@ -22,6 +21,8 @@ import net.minecraft.client.Minecraft;
|
|||
|
||||
public class CoffeeMachineRecipeCategory implements IRecipeCategory{
|
||||
|
||||
public static final String NAME = "actuallyadditions.coffee";
|
||||
|
||||
private final IDrawable background;
|
||||
|
||||
public CoffeeMachineRecipeCategory(IGuiHelper helper){
|
||||
|
@ -31,13 +32,13 @@ public class CoffeeMachineRecipeCategory implements IRecipeCategory{
|
|||
|
||||
@Override
|
||||
public String getUid(){
|
||||
return NEICoffeeMachineRecipe.NAME;
|
||||
return NAME;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String getTitle(){
|
||||
return StringUtil.localize("container.nei."+NEICoffeeMachineRecipe.NAME+".name");
|
||||
return StringUtil.localize("container.nei."+NAME+".name");
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -10,9 +10,7 @@
|
|||
|
||||
package de.ellpeck.actuallyadditions.mod.jei.coffee;
|
||||
|
||||
import de.ellpeck.actuallyadditions.api.booklet.BookletPage;
|
||||
import de.ellpeck.actuallyadditions.api.recipe.CoffeeIngredient;
|
||||
import de.ellpeck.actuallyadditions.mod.nei.NEICoffeeMachineRecipe;
|
||||
import mezz.jei.api.recipe.IRecipeHandler;
|
||||
import mezz.jei.api.recipe.IRecipeWrapper;
|
||||
|
||||
|
@ -31,7 +29,7 @@ public class CoffeeMachineRecipeHandler implements IRecipeHandler<CoffeeIngredie
|
|||
|
||||
@Override
|
||||
public String getRecipeCategoryUid(){
|
||||
return NEICoffeeMachineRecipe.NAME;
|
||||
return CoffeeMachineRecipeCategory.NAME;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -11,7 +11,6 @@
|
|||
package de.ellpeck.actuallyadditions.mod.jei.reconstructor;
|
||||
|
||||
import de.ellpeck.actuallyadditions.mod.blocks.InitBlocks;
|
||||
import de.ellpeck.actuallyadditions.mod.nei.NEIReconstructorRecipe;
|
||||
import de.ellpeck.actuallyadditions.mod.util.AssetUtil;
|
||||
import de.ellpeck.actuallyadditions.mod.util.StringUtil;
|
||||
import mezz.jei.api.IGuiHelper;
|
||||
|
@ -24,6 +23,8 @@ import net.minecraft.item.ItemStack;
|
|||
|
||||
public class ReconstructorRecipeCategory implements IRecipeCategory{
|
||||
|
||||
public static final String NAME = "actuallyadditions.reconstructor";
|
||||
|
||||
private static final ItemStack RECONSTRUCTOR = new ItemStack(InitBlocks.blockAtomicReconstructor);
|
||||
private final IDrawable background;
|
||||
|
||||
|
@ -34,13 +35,13 @@ public class ReconstructorRecipeCategory implements IRecipeCategory{
|
|||
|
||||
@Override
|
||||
public String getUid(){
|
||||
return NEIReconstructorRecipe.NAME;
|
||||
return NAME;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String getTitle(){
|
||||
return StringUtil.localize("container.nei."+NEIReconstructorRecipe.NAME+".name");
|
||||
return StringUtil.localize("container.nei."+NAME+".name");
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -11,12 +11,9 @@
|
|||
package de.ellpeck.actuallyadditions.mod.jei.reconstructor;
|
||||
|
||||
import de.ellpeck.actuallyadditions.api.recipe.LensConversionRecipe;
|
||||
import de.ellpeck.actuallyadditions.mod.nei.NEIReconstructorRecipe;
|
||||
import mezz.jei.api.recipe.IRecipeHandler;
|
||||
import mezz.jei.api.recipe.IRecipeWrapper;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public class ReconstructorRecipeHandler implements IRecipeHandler<LensConversionRecipe>{
|
||||
|
||||
@Override
|
||||
|
@ -26,7 +23,7 @@ public class ReconstructorRecipeHandler implements IRecipeHandler<LensConversion
|
|||
|
||||
@Override
|
||||
public String getRecipeCategoryUid(){
|
||||
return NEIReconstructorRecipe.NAME;
|
||||
return ReconstructorRecipeCategory.NAME;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -1,18 +0,0 @@
|
|||
/*
|
||||
* This file ("INEIRecipeHandler.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://ellpeck.de/actaddlicense
|
||||
* View the source code at https://github.com/Ellpeck/ActuallyAdditions
|
||||
*
|
||||
* © 2015-2016 Ellpeck
|
||||
*/
|
||||
|
||||
package de.ellpeck.actuallyadditions.mod.nei;
|
||||
|
||||
import de.ellpeck.actuallyadditions.api.booklet.BookletPage;
|
||||
|
||||
public interface INEIRecipeHandler{
|
||||
|
||||
BookletPage getPageForInfo(int neiIndex);
|
||||
}
|
|
@ -1,75 +0,0 @@
|
|||
/*
|
||||
* This file ("NEIActuallyAdditionsConfig.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://ellpeck.de/actaddlicense
|
||||
* View the source code at https://github.com/Ellpeck/ActuallyAdditions
|
||||
*
|
||||
* © 2015-2016 Ellpeck
|
||||
*/
|
||||
|
||||
package de.ellpeck.actuallyadditions.mod.nei;
|
||||
|
||||
public class NEIActuallyAdditionsConfig/* implements IConfigureNEI*/{
|
||||
|
||||
/*@Override
|
||||
public void loadConfig(){
|
||||
ModUtil.LOGGER.info("Initializing Not Enough Items Plugin...");
|
||||
|
||||
API.registerGuiOverlay(GuiCrafter.class, "crafting");
|
||||
API.registerGuiOverlayHandler(GuiCrafter.class, new DefaultOverlayHandler(), "crafting");
|
||||
|
||||
NEICrusherRecipe crusherRecipe = new NEICrusherRecipe();
|
||||
API.registerRecipeHandler(crusherRecipe);
|
||||
API.registerUsageHandler(crusherRecipe);
|
||||
|
||||
NEICrusherRecipe.Double crusherDoubleRecipe = new NEICrusherRecipe.Double();
|
||||
API.registerRecipeHandler(crusherDoubleRecipe);
|
||||
API.registerUsageHandler(crusherDoubleRecipe);
|
||||
|
||||
NEIFurnaceDoubleRecipe furnaceDoubleRecipe = new NEIFurnaceDoubleRecipe();
|
||||
API.registerRecipeHandler(furnaceDoubleRecipe);
|
||||
API.registerUsageHandler(furnaceDoubleRecipe);
|
||||
|
||||
NEIHairyBallRecipe ballRecipe = new NEIHairyBallRecipe();
|
||||
API.registerRecipeHandler(ballRecipe);
|
||||
API.registerUsageHandler(ballRecipe);
|
||||
|
||||
NEITreasureChestRecipe treasureChestRecipe = new NEITreasureChestRecipe();
|
||||
API.registerRecipeHandler(treasureChestRecipe);
|
||||
API.registerUsageHandler(treasureChestRecipe);
|
||||
|
||||
NEICompostRecipe compostRecipe = new NEICompostRecipe();
|
||||
API.registerRecipeHandler(compostRecipe);
|
||||
API.registerUsageHandler(compostRecipe);
|
||||
|
||||
NEICoffeeMachineRecipe coffeeMachineRecipe = new NEICoffeeMachineRecipe();
|
||||
API.registerRecipeHandler(coffeeMachineRecipe);
|
||||
API.registerUsageHandler(coffeeMachineRecipe);
|
||||
|
||||
NEIReconstructorRecipe reconstructorRecipe = new NEIReconstructorRecipe();
|
||||
API.registerRecipeHandler(reconstructorRecipe);
|
||||
API.registerUsageHandler(reconstructorRecipe);
|
||||
|
||||
NEIBookletRecipe bookletRecipe = new NEIBookletRecipe();
|
||||
API.registerRecipeHandler(bookletRecipe);
|
||||
API.registerUsageHandler(bookletRecipe);
|
||||
|
||||
API.hideItem(new ItemStack(InitBlocks.blockRice));
|
||||
API.hideItem(new ItemStack(InitBlocks.blockCanola));
|
||||
API.hideItem(new ItemStack(InitBlocks.blockFlax));
|
||||
API.hideItem(new ItemStack(InitBlocks.blockCoffee));
|
||||
API.hideItem(new ItemStack(InitBlocks.blockWildPlant, 1, Util.WILDCARD));
|
||||
API.hideItem(new ItemStack(InitBlocks.blockColoredLampOn, 1, Util.WILDCARD));
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName(){
|
||||
return ModUtil.MOD_ID+" NEI Plugin";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getVersion(){
|
||||
return ModUtil.VERSION;
|
||||
}*/
|
||||
}
|
|
@ -1,151 +0,0 @@
|
|||
/*
|
||||
* This file ("NEIBookletRecipe.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://ellpeck.de/actaddlicense
|
||||
* View the source code at https://github.com/Ellpeck/ActuallyAdditions
|
||||
*
|
||||
* © 2015-2016 Ellpeck
|
||||
*/
|
||||
|
||||
package de.ellpeck.actuallyadditions.mod.nei;
|
||||
|
||||
public final class NEIBookletRecipe/* extends TemplateRecipeHandler implements INEIRecipeHandler*/{
|
||||
|
||||
public static final String NAME = "actuallyadditions.booklet";
|
||||
|
||||
/*public NEIBookletRecipe(){
|
||||
RecipeInfo.setGuiOffset(this.getGuiClass(), 0, 0);
|
||||
}
|
||||
|
||||
@Override
|
||||
public BookletPage getPageForInfo(int page){
|
||||
return ((CachedInfoStack)this.arecipes.get(page)).thePage;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void loadTransferRects(){
|
||||
transferRects.add(new RecipeTransferRect(new Rectangle(0, 18, 165, Minecraft.getMinecraft().fontRendererObj.FONT_HEIGHT), NAME));
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
public void loadCraftingRecipes(String outputId, Object... results){
|
||||
if(outputId.equals(NAME) && getClass() == NEIBookletRecipe.class){
|
||||
for(BookletPage page : ActuallyAdditionsAPI.BOOKLET_PAGES_WITH_ITEM_DATA){
|
||||
ItemStack[] stacks = page.getItemStacksForPage();
|
||||
|
||||
//So that you don't see things like Mashed Food more than once
|
||||
ArrayList<ItemStack> nonDoubleStacks = new ArrayList<ItemStack>();
|
||||
for(ItemStack stack : stacks){
|
||||
if(!ItemUtil.contains(nonDoubleStacks, stack, true)){
|
||||
arecipes.add(new CachedInfoStack(stack, page));
|
||||
nonDoubleStacks.add(stack);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else{
|
||||
super.loadCraftingRecipes(outputId, results);
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
public void loadCraftingRecipes(ItemStack result){
|
||||
ArrayList<BookletPage> allPages = BookletUtils.getPagesForStack(result);
|
||||
for(BookletPage page : allPages){
|
||||
CachedInfoStack theRecipe = new CachedInfoStack(result, page);
|
||||
arecipes.add(theRecipe);
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
public void loadUsageRecipes(ItemStack ingredient){
|
||||
ArrayList<BookletPage> allPages = BookletUtils.getPagesForStack(ingredient);
|
||||
for(BookletPage page : allPages){
|
||||
CachedInfoStack theRecipe = new CachedInfoStack(ingredient, page);
|
||||
arecipes.add(theRecipe);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getGuiTexture(){
|
||||
return ModUtil.MOD_ID+":textures/gui/guiFurnaceDouble.png";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getOverlayIdentifier(){
|
||||
return NAME;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawExtras(int recipe){
|
||||
CachedInfoStack stack = (CachedInfoStack)this.arecipes.get(recipe);
|
||||
if(stack.theStack != null){
|
||||
List header = Minecraft.getMinecraft().fontRendererObj.listFormattedStringToWidth(StringUtil.localize("container.nei."+ModUtil.MOD_ID+".booklet.header").replaceAll("<item>", EnumChatFormatting.BLUE+"").replaceAll("<r>", EnumChatFormatting.BLACK+""), 165);
|
||||
for(int i = 0; i < header.size(); i++){
|
||||
GuiDraw.drawString((String)header.get(i), 0, 18+i*(Minecraft.getMinecraft().fontRendererObj.FONT_HEIGHT+1), 0, false);
|
||||
}
|
||||
|
||||
int maxLines = 5;
|
||||
IBookletChapter chapter = stack.thePage.getChapter();
|
||||
String aText = (chapter.getPages()[0] instanceof PagePicture && chapter.getPages().length > 1 ? chapter.getPages()[1] : chapter.getPages()[0]).getText();
|
||||
List text = Minecraft.getMinecraft().fontRendererObj.listFormattedStringToWidth(aText != null ? aText : EnumChatFormatting.DARK_RED+StringUtil.localize("container.nei."+ModUtil.MOD_ID+".booklet.noText"), 165);
|
||||
for(int i = 0; i < Math.min(maxLines, text.size()); i++){
|
||||
GuiDraw.drawString(text.get(i)+(i == maxLines-1 && text.size() > maxLines ? EnumChatFormatting.RESET+""+EnumChatFormatting.BLACK+"..." : ""), 0, 18+25+i*(Minecraft.getMinecraft().fontRendererObj.FONT_HEIGHT+1), 0, false);
|
||||
}
|
||||
GuiDraw.drawString(EnumChatFormatting.ITALIC+chapter.getLocalizedName(), 0, 97, 0, false);
|
||||
GuiDraw.drawString(EnumChatFormatting.ITALIC+"Page "+stack.thePage.getID(), 0, 107, 0, false);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Class<? extends GuiContainer> getGuiClass(){
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawBackground(int recipe){
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawForeground(int recipe){
|
||||
GlStateManager.color(1F, 1F, 1F, 1F);
|
||||
GlStateManager.disableLighting();
|
||||
this.drawExtras(recipe);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int recipiesPerPage(){
|
||||
return 1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getRecipeName(){
|
||||
return StringUtil.localize("container.nei."+NAME+".name");
|
||||
}
|
||||
|
||||
public class CachedInfoStack extends CachedRecipe{
|
||||
|
||||
public ItemStack theStack;
|
||||
public BookletPage thePage;
|
||||
|
||||
public CachedInfoStack(ItemStack theStack, BookletPage thePage){
|
||||
this.theStack = theStack;
|
||||
this.thePage = thePage;
|
||||
}
|
||||
|
||||
@Override
|
||||
public PositionedStack getResult(){
|
||||
if(this.theStack != null){
|
||||
ItemStack newStack = this.theStack.copy();
|
||||
newStack.stackSize = 1;
|
||||
return new PositionedStack(newStack, 0, 0);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}*/
|
||||
}
|
|
@ -1,155 +0,0 @@
|
|||
/*
|
||||
* This file ("NEICoffeeMachineRecipe.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://ellpeck.de/actaddlicense
|
||||
* View the source code at https://github.com/Ellpeck/ActuallyAdditions
|
||||
*
|
||||
* © 2015-2016 Ellpeck
|
||||
*/
|
||||
|
||||
package de.ellpeck.actuallyadditions.mod.nei;
|
||||
|
||||
public final class NEICoffeeMachineRecipe/* extends TemplateRecipeHandler implements INEIRecipeHandler*/{
|
||||
|
||||
public static final String NAME = "actuallyadditions.coffee";
|
||||
|
||||
/*public NEICoffeeMachineRecipe(){
|
||||
super();
|
||||
RecipeInfo.setGuiOffset(this.getGuiClass(), 35, 3);
|
||||
}
|
||||
|
||||
@Override
|
||||
public BookletPage getPageForInfo(int page){
|
||||
return BookletUtils.getFirstPageForStack(new ItemStack(InitBlocks.blockCoffeeMachine));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void loadTransferRects(){
|
||||
transferRects.add(new RecipeTransferRect(new Rectangle(20, 39, 20, 16), NAME));
|
||||
transferRects.add(new RecipeTransferRect(new Rectangle(64, 42, 23, 10), NAME));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void loadCraftingRecipes(String outputId, Object... results){
|
||||
if(outputId.equals(NAME) && getClass() == NEICoffeeMachineRecipe.class){
|
||||
List<CoffeeIngredient> ingredients = ActuallyAdditionsAPI.COFFEE_MACHINE_INGREDIENTS;
|
||||
for(CoffeeIngredient ingredient : ingredients){
|
||||
arecipes.add(new CachedCoffee(ingredient));
|
||||
}
|
||||
}
|
||||
else{
|
||||
super.loadCraftingRecipes(outputId, results);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void loadCraftingRecipes(ItemStack result){
|
||||
List<CoffeeIngredient> ingredients = ActuallyAdditionsAPI.COFFEE_MACHINE_INGREDIENTS;
|
||||
for(CoffeeIngredient ingredient : ingredients){
|
||||
if(result.getItem() instanceof ItemCoffee){
|
||||
arecipes.add(new CachedCoffee(ingredient));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void loadUsageRecipes(ItemStack ingredient){
|
||||
|
||||
List<CoffeeIngredient> ingredients = ActuallyAdditionsAPI.COFFEE_MACHINE_INGREDIENTS;
|
||||
for(CoffeeIngredient ingr : ingredients){
|
||||
if(NEIServerUtils.areStacksSameTypeCrafting(new ItemStack(InitItems.itemMisc, 1, TheMiscItems.CUP.ordinal()), ingredient) || NEIServerUtils.areStacksSameTypeCrafting(new ItemStack(InitItems.itemCoffeeBean), ingredient) || NEIServerUtils.areStacksSameTypeCrafting(ingr.ingredient.copy(), ingredient)){
|
||||
CachedCoffee theRecipe = new CachedCoffee(ingr);
|
||||
theRecipe.setIngredientPermutation(Collections.singletonList(theRecipe.ingredientStack), ingredient);
|
||||
arecipes.add(theRecipe);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getGuiTexture(){
|
||||
return ModUtil.MOD_ID+":textures/gui/guiNEICoffeeMachine.png";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getOverlayIdentifier(){
|
||||
return NAME;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawExtras(int recipe){
|
||||
drawProgressBar(20, 39, 126, 0, 21, 16, 48, 0);
|
||||
drawProgressBar(63, 42, 125, 16, 24, 12, 48, 2);
|
||||
|
||||
CachedCoffee cache = (CachedCoffee)this.arecipes.get(recipe);
|
||||
if(cache.extraText != null){
|
||||
GuiDraw.drawString(StringUtil.localize("container.nei."+ModUtil.MOD_ID+".coffee.special")+":", 2, 4, StringUtil.DECIMAL_COLOR_GRAY_TEXT, false);
|
||||
GuiDraw.drawString(cache.extraText, 2, 16, StringUtil.DECIMAL_COLOR_GRAY_TEXT, false);
|
||||
}
|
||||
|
||||
if(cache.maxAmp > 0){
|
||||
GuiDraw.drawString(StringUtil.localize("container.nei."+ModUtil.MOD_ID+".coffee.maxAmount")+": "+cache.maxAmp, 2, 28, StringUtil.DECIMAL_COLOR_GRAY_TEXT, false);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Class<? extends GuiContainer> getGuiClass(){
|
||||
return GuiCoffeeMachine.class;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawBackground(int recipeIndex){
|
||||
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
GuiDraw.changeTexture(getGuiTexture());
|
||||
GuiDraw.drawTexturedModalRect(0, 0, 0, 0, 126, 88);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int recipiesPerPage(){
|
||||
return 1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getRecipeName(){
|
||||
return StringUtil.localize("container.nei."+NAME+".name");
|
||||
}
|
||||
|
||||
public class CachedCoffee extends CachedRecipe{
|
||||
|
||||
public PositionedStack cup;
|
||||
public PositionedStack coffeeBeans;
|
||||
public PositionedStack result;
|
||||
public PositionedStack ingredientStack;
|
||||
public String extraText;
|
||||
public int maxAmp;
|
||||
|
||||
public CachedCoffee(CoffeeIngredient ingredient){
|
||||
this.cup = new PositionedStack(new ItemStack(InitItems.itemMisc, 1, TheMiscItems.CUP.ordinal()), 45, 39);
|
||||
this.coffeeBeans = new PositionedStack(new ItemStack(InitItems.itemCoffeeBean, TileEntityCoffeeMachine.CACHE_USE), 2, 39);
|
||||
this.ingredientStack = new PositionedStack(ingredient.ingredient.copy(), 90, 21);
|
||||
this.setupResult(ingredient);
|
||||
this.extraText = ingredient.getExtraText();
|
||||
this.maxAmp = ingredient.maxAmplifier;
|
||||
}
|
||||
|
||||
public void setupResult(CoffeeIngredient ingredient){
|
||||
ItemStack result = new ItemStack(InitItems.itemCoffee);
|
||||
CoffeeBrewing.addEffectToStack(result, ingredient);
|
||||
this.result = new PositionedStack(result.copy(), 45, 70);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PositionedStack getResult(){
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<PositionedStack> getIngredients(){
|
||||
ArrayList<PositionedStack> list = new ArrayList<PositionedStack>();
|
||||
list.add(this.ingredientStack);
|
||||
list.add(this.cup);
|
||||
list.add(this.coffeeBeans);
|
||||
return list;
|
||||
}
|
||||
}*/
|
||||
}
|
|
@ -1,111 +0,0 @@
|
|||
/*
|
||||
* This file ("NEICompostRecipe.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://ellpeck.de/actaddlicense
|
||||
* View the source code at https://github.com/Ellpeck/ActuallyAdditions
|
||||
*
|
||||
* © 2015-2016 Ellpeck
|
||||
*/
|
||||
|
||||
package de.ellpeck.actuallyadditions.mod.nei;
|
||||
|
||||
public final class NEICompostRecipe/* extends TemplateRecipeHandler implements INEIRecipeHandler*/{
|
||||
|
||||
public static final String NAME = "actuallyadditions.compost";
|
||||
|
||||
/*public NEICompostRecipe(){
|
||||
super();
|
||||
RecipeInfo.setGuiOffset(this.getGuiClass(), 0, 0);
|
||||
}
|
||||
|
||||
@Override
|
||||
public BookletPage getPageForInfo(int page){
|
||||
return BookletUtils.getFirstPageForStack(new ItemStack(InitBlocks.blockCompost));
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getRecipeName(){
|
||||
return StringUtil.localize("container.nei."+NAME+".name");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void loadTransferRects(){
|
||||
transferRects.add(new RecipeTransferRect(new Rectangle(31+32, 18, 22, 16), NAME));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void loadCraftingRecipes(String outputId, Object... results){
|
||||
if(outputId.equals(NAME) && getClass() == NEICompostRecipe.class){
|
||||
arecipes.add(new CachedCompostRecipe(new ItemStack(InitItems.itemMisc, TileEntityCompost.AMOUNT, TheMiscItems.MASHED_FOOD.ordinal()), new ItemStack(InitItems.itemFertilizer, TileEntityCompost.AMOUNT)));
|
||||
}
|
||||
else{
|
||||
super.loadCraftingRecipes(outputId, results);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void loadCraftingRecipes(ItemStack result){
|
||||
if(NEIServerUtils.areStacksSameType(new ItemStack(InitItems.itemFertilizer), result)){
|
||||
arecipes.add(new CachedCompostRecipe(new ItemStack(InitItems.itemMisc, TileEntityCompost.AMOUNT, TheMiscItems.MASHED_FOOD.ordinal()), new ItemStack(InitItems.itemFertilizer, TileEntityCompost.AMOUNT)));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void loadUsageRecipes(ItemStack ingredient){
|
||||
if(NEIServerUtils.areStacksSameTypeCrafting(new ItemStack(InitItems.itemMisc, TileEntityCompost.AMOUNT, TheMiscItems.MASHED_FOOD.ordinal()), ingredient)){
|
||||
CachedCompostRecipe theRecipe = new CachedCompostRecipe(new ItemStack(InitItems.itemMisc, TileEntityCompost.AMOUNT, TheMiscItems.MASHED_FOOD.ordinal()), new ItemStack(InitItems.itemFertilizer, TileEntityCompost.AMOUNT));
|
||||
theRecipe.setIngredientPermutation(Collections.singletonList(theRecipe.input), ingredient);
|
||||
arecipes.add(theRecipe);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getGuiTexture(){
|
||||
return ModUtil.MOD_ID+":textures/gui/guiNEISimple.png";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getOverlayIdentifier(){
|
||||
return NAME;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Class<? extends GuiContainer> getGuiClass(){
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawBackground(int recipeIndex){
|
||||
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
GuiDraw.changeTexture(getGuiTexture());
|
||||
GuiDraw.drawTexturedModalRect(32, 0, 0, 0, 96, 60);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int recipiesPerPage(){
|
||||
return 2;
|
||||
}
|
||||
|
||||
public class CachedCompostRecipe extends CachedRecipe{
|
||||
|
||||
public PositionedStack result;
|
||||
public PositionedStack input;
|
||||
public int chance;
|
||||
|
||||
public CachedCompostRecipe(ItemStack input, ItemStack result){
|
||||
this.result = new PositionedStack(result, 67+32, 19);
|
||||
this.input = new PositionedStack(input, 5+32, 19);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PositionedStack getResult(){
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public PositionedStack getIngredient(){
|
||||
return input;
|
||||
}
|
||||
}*/
|
||||
}
|
|
@ -1,186 +0,0 @@
|
|||
/*
|
||||
* This file ("NEICrusherRecipe.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://ellpeck.de/actaddlicense
|
||||
* View the source code at https://github.com/Ellpeck/ActuallyAdditions
|
||||
*
|
||||
* © 2015-2016 Ellpeck
|
||||
*/
|
||||
|
||||
package de.ellpeck.actuallyadditions.mod.nei;
|
||||
|
||||
public class NEICrusherRecipe/* extends TemplateRecipeHandler implements INEIRecipeHandler*/{
|
||||
|
||||
/*public NEICrusherRecipe(){
|
||||
RecipeInfo.setGuiOffset(this.getGuiClass(), 0, 0);
|
||||
}
|
||||
|
||||
@Override
|
||||
public BookletPage getPageForInfo(int page){
|
||||
return BookletUtils.getFirstPageForStack(new ItemStack(InitBlocks.blockGrinder));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void loadTransferRects(){
|
||||
transferRects.add(new RecipeTransferRect(new Rectangle(80, 40, 24, 22), this.getBaseName()));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void loadCraftingRecipes(String outputId, Object... results){
|
||||
if(outputId.equals(this.getBaseName()) && (getClass() == NEICrusherRecipe.class || getClass() == Double.class)){
|
||||
for(CrusherRecipe recipe : ActuallyAdditionsAPI.CRUSHER_RECIPES){
|
||||
arecipes.add(new CachedCrush(recipe.getRecipeInputs(), recipe.getRecipeOutputOnes(), recipe.getRecipeOutputTwos(), recipe.outputTwoChance, this));
|
||||
}
|
||||
}
|
||||
else{
|
||||
super.loadCraftingRecipes(outputId, results);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void loadCraftingRecipes(ItemStack result){
|
||||
for(CrusherRecipe recipe : ActuallyAdditionsAPI.CRUSHER_RECIPES){
|
||||
if(ItemUtil.contains(recipe.getRecipeOutputOnes(), result, true) || ItemUtil.contains(recipe.getRecipeOutputTwos(), result, true)){
|
||||
arecipes.add(new CachedCrush(recipe.getRecipeInputs(), recipe.getRecipeOutputOnes(), recipe.getRecipeOutputTwos(), recipe.outputTwoChance, this));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void loadUsageRecipes(ItemStack ingredient){
|
||||
for(CrusherRecipe recipe : ActuallyAdditionsAPI.CRUSHER_RECIPES){
|
||||
if(ItemUtil.contains(recipe.getRecipeInputs(), ingredient, true)){
|
||||
CachedCrush theRecipe = new CachedCrush(recipe.getRecipeInputs(), recipe.getRecipeOutputOnes(), recipe.getRecipeOutputTwos(), recipe.outputTwoChance, this);
|
||||
theRecipe.setIngredientPermutation(Collections.singletonList(theRecipe.ingredient), ingredient);
|
||||
arecipes.add(theRecipe);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getGuiTexture(){
|
||||
return ModUtil.MOD_ID+":textures/gui/guiGrinder.png";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getOverlayIdentifier(){
|
||||
return this.getBaseName();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawExtras(int recipe){
|
||||
drawProgressBar(80, 40, 176, 0, 24, 23, 48, 1);
|
||||
this.drawChanceString(118, 73, recipe);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Class<? extends GuiContainer> getGuiClass(){
|
||||
return GuiGrinder.class;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawBackground(int recipeIndex){
|
||||
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
GuiDraw.changeTexture(getGuiTexture());
|
||||
GuiDraw.drawTexturedModalRect(60, 13, 60, 13, 56, 79);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int recipiesPerPage(){
|
||||
return 1;
|
||||
}
|
||||
|
||||
protected void drawChanceString(int x, int y, int recipe){
|
||||
CachedCrush crush = (CachedCrush)this.arecipes.get(recipe);
|
||||
if(crush.resultTwo != null){
|
||||
int secondChance = crush.secondChance;
|
||||
String secondString = secondChance+"%";
|
||||
GuiDraw.drawString(secondString, x, y, StringUtil.DECIMAL_COLOR_GRAY_TEXT, false);
|
||||
}
|
||||
}
|
||||
|
||||
protected String getBaseName(){
|
||||
return "actuallyadditions."+(this instanceof Double ? "crushingDouble" : "crushing");
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getRecipeName(){
|
||||
return StringUtil.localize("container.nei."+this.getBaseName()+".name");
|
||||
}
|
||||
|
||||
public static class Double extends NEICrusherRecipe{
|
||||
|
||||
@Override
|
||||
public BookletPage getPageForInfo(int page){
|
||||
return BookletUtils.getFirstPageForStack(new ItemStack(InitBlocks.blockGrinderDouble));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void loadTransferRects(){
|
||||
transferRects.add(new RecipeTransferRect(new Rectangle(51, 40, 24, 22), this.getBaseName()));
|
||||
transferRects.add(new RecipeTransferRect(new Rectangle(101, 40, 24, 22), this.getBaseName()));
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getGuiTexture(){
|
||||
return ModUtil.MOD_ID+":textures/gui/guiGrinderDouble.png";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawExtras(int recipe){
|
||||
drawProgressBar(51, 40, 176, 0, 24, 23, 48, 1);
|
||||
this.drawChanceString(66, 93, recipe);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Class<? extends GuiContainer> getGuiClass(){
|
||||
return GuiGrinder.GuiGrinderDouble.class;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawBackground(int recipeIndex){
|
||||
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
GuiDraw.changeTexture(getGuiTexture());
|
||||
GuiDraw.drawTexturedModalRect(33, 20, 33, 20, 110, 70);
|
||||
}
|
||||
}
|
||||
|
||||
public class CachedCrush extends CachedRecipe{
|
||||
|
||||
public PositionedStack ingredient;
|
||||
public PositionedStack resultOne;
|
||||
public PositionedStack resultTwo;
|
||||
public int secondChance;
|
||||
|
||||
public CachedCrush(List<ItemStack> in, List<ItemStack> outOne, List<ItemStack> outTwo, int secondChance, NEICrusherRecipe handler){
|
||||
boolean isDouble = handler instanceof Double;
|
||||
this.ingredient = new PositionedStack(in, isDouble ? 51 : 80, 21);
|
||||
this.resultOne = new PositionedStack(outOne, isDouble ? 38 : 66, 69);
|
||||
if(outTwo != null && !outTwo.isEmpty()){
|
||||
this.resultTwo = new PositionedStack(outTwo, isDouble ? 63 : 94, 69);
|
||||
}
|
||||
this.secondChance = secondChance;
|
||||
}
|
||||
|
||||
@Override
|
||||
public PositionedStack getResult(){
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<PositionedStack> getIngredients(){
|
||||
return this.getCycledIngredients(cycleticks/48, Collections.singletonList(this.ingredient));
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<PositionedStack> getOtherStacks(){
|
||||
ArrayList<PositionedStack> list = new ArrayList<PositionedStack>();
|
||||
list.addAll(this.getCycledIngredients(cycleticks/48, Collections.singletonList(this.resultOne)));
|
||||
if(this.resultTwo != null){
|
||||
list.addAll(this.getCycledIngredients(cycleticks/48, Collections.singletonList(this.resultTwo)));
|
||||
}
|
||||
return list;
|
||||
}
|
||||
}*/
|
||||
}
|
|
@ -1,128 +0,0 @@
|
|||
/*
|
||||
* This file ("NEIFurnaceDoubleRecipe.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://ellpeck.de/actaddlicense
|
||||
* View the source code at https://github.com/Ellpeck/ActuallyAdditions
|
||||
*
|
||||
* © 2015-2016 Ellpeck
|
||||
*/
|
||||
|
||||
package de.ellpeck.actuallyadditions.mod.nei;
|
||||
|
||||
public final class NEIFurnaceDoubleRecipe /*extends TemplateRecipeHandler implements INEIRecipeHandler*/{
|
||||
|
||||
public static final String NAME = "actuallyadditions.furnaceDouble";
|
||||
|
||||
/*public NEIFurnaceDoubleRecipe(){
|
||||
RecipeInfo.setGuiOffset(this.getGuiClass(), 0, 0);
|
||||
}
|
||||
|
||||
@Override
|
||||
public BookletPage getPageForInfo(int page){
|
||||
return BookletUtils.getFirstPageForStack(new ItemStack(InitBlocks.blockFurnaceDouble));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void loadTransferRects(){
|
||||
transferRects.add(new RecipeTransferRect(new Rectangle(51, 40, 24, 22), NAME));
|
||||
transferRects.add(new RecipeTransferRect(new Rectangle(101, 40, 24, 22), NAME));
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
public void loadCraftingRecipes(String outputId, Object... results){
|
||||
if(outputId.equals(NAME) && getClass() == NEIFurnaceDoubleRecipe.class){
|
||||
Map<ItemStack, ItemStack> recipes = FurnaceRecipes.INSTANCE().getSmeltingList();
|
||||
for(Map.Entry<ItemStack, ItemStack> recipe : recipes.entrySet()){
|
||||
arecipes.add(new CachedFurn(recipe.getKey(), recipe.getValue()));
|
||||
}
|
||||
}
|
||||
else{
|
||||
super.loadCraftingRecipes(outputId, results);
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
public void loadCraftingRecipes(ItemStack result){
|
||||
Map<ItemStack, ItemStack> recipes = FurnaceRecipes.INSTANCE().getSmeltingList();
|
||||
for(Map.Entry<ItemStack, ItemStack> recipe : recipes.entrySet()){
|
||||
if(NEIServerUtils.areStacksSameType(recipe.getValue(), result)){
|
||||
arecipes.add(new CachedFurn(recipe.getKey(), recipe.getValue()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
public void loadUsageRecipes(ItemStack ingredient){
|
||||
Map<ItemStack, ItemStack> recipes = FurnaceRecipes.INSTANCE().getSmeltingList();
|
||||
for(Map.Entry<ItemStack, ItemStack> recipe : recipes.entrySet()){
|
||||
if(NEIServerUtils.areStacksSameTypeCrafting(recipe.getKey(), ingredient)){
|
||||
CachedFurn theRecipe = new CachedFurn(recipe.getKey(), recipe.getValue());
|
||||
theRecipe.setIngredientPermutation(Collections.singletonList(theRecipe.ingredient), ingredient);
|
||||
arecipes.add(theRecipe);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getGuiTexture(){
|
||||
return ModUtil.MOD_ID+":textures/gui/guiFurnaceDouble.png";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getOverlayIdentifier(){
|
||||
return NAME;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawExtras(int recipe){
|
||||
drawProgressBar(51, 40, 176, 0, 24, 23, 48, 1);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Class<? extends GuiContainer> getGuiClass(){
|
||||
return GuiFurnaceDouble.class;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawBackground(int recipeIndex){
|
||||
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
GuiDraw.changeTexture(getGuiTexture());
|
||||
GuiDraw.drawTexturedModalRect(46, 20, 46, 20, 84, 70);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int recipiesPerPage(){
|
||||
return 1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getRecipeName(){
|
||||
return StringUtil.localize("container.nei."+NAME+".name");
|
||||
}
|
||||
|
||||
public class CachedFurn extends CachedRecipe{
|
||||
|
||||
public PositionedStack ingredient;
|
||||
public PositionedStack resultOne;
|
||||
|
||||
public CachedFurn(ItemStack in, ItemStack resultOne){
|
||||
in.stackSize = 1;
|
||||
this.ingredient = new PositionedStack(in, 51, 21);
|
||||
this.resultOne = new PositionedStack(resultOne, 50, 69);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PositionedStack getResult(){
|
||||
return resultOne;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<PositionedStack> getIngredients(){
|
||||
return getCycledIngredients(cycleticks/48, Collections.singletonList(ingredient));
|
||||
}
|
||||
}*/
|
||||
}
|
|
@ -1,132 +0,0 @@
|
|||
/*
|
||||
* This file ("NEIHairyBallRecipe.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://ellpeck.de/actaddlicense
|
||||
* View the source code at https://github.com/Ellpeck/ActuallyAdditions
|
||||
*
|
||||
* © 2015-2016 Ellpeck
|
||||
*/
|
||||
|
||||
package de.ellpeck.actuallyadditions.mod.nei;
|
||||
|
||||
public final class NEIHairyBallRecipe/* extends TemplateRecipeHandler implements INEIRecipeHandler*/{
|
||||
|
||||
public static final String NAME = "actuallyadditions.ballOfHair";
|
||||
|
||||
/*public NEIHairyBallRecipe(){
|
||||
super();
|
||||
RecipeInfo.setGuiOffset(this.getGuiClass(), 0, 0);
|
||||
}
|
||||
|
||||
@Override
|
||||
public BookletPage getPageForInfo(int page){
|
||||
return BookletUtils.getFirstPageForStack(new ItemStack(InitItems.itemHairyBall));
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getRecipeName(){
|
||||
return StringUtil.localize("container.nei."+NAME+".name");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void loadTransferRects(){
|
||||
transferRects.add(new RecipeTransferRect(new Rectangle(31+32, 18, 22, 16), NAME));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void loadCraftingRecipes(String outputId, Object... results){
|
||||
if(outputId.equals(NAME) && getClass() == NEIHairyBallRecipe.class){
|
||||
List<BallOfFurReturn> recipes = ActuallyAdditionsAPI.BALL_OF_FUR_RETURN_ITEMS;
|
||||
for(BallOfFurReturn recipe : recipes){
|
||||
arecipes.add(new CachedBallRecipe(new ItemStack(InitItems.itemHairyBall), recipe.returnItem, recipe.itemWeight));
|
||||
}
|
||||
}
|
||||
else{
|
||||
super.loadCraftingRecipes(outputId, results);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void loadCraftingRecipes(ItemStack result){
|
||||
List<BallOfFurReturn> recipes = ActuallyAdditionsAPI.BALL_OF_FUR_RETURN_ITEMS;
|
||||
for(BallOfFurReturn recipe : recipes){
|
||||
if(NEIServerUtils.areStacksSameType(recipe.returnItem, result)){
|
||||
arecipes.add(new CachedBallRecipe(new ItemStack(InitItems.itemHairyBall), recipe.returnItem, recipe.itemWeight));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void loadUsageRecipes(ItemStack ingredient){
|
||||
List<BallOfFurReturn> recipes = ActuallyAdditionsAPI.BALL_OF_FUR_RETURN_ITEMS;
|
||||
for(BallOfFurReturn recipe : recipes){
|
||||
ItemStack stack = new ItemStack(InitItems.itemHairyBall);
|
||||
if(NEIServerUtils.areStacksSameTypeCrafting(stack, ingredient)){
|
||||
CachedBallRecipe theRecipe = new CachedBallRecipe(stack, recipe.returnItem, recipe.itemWeight);
|
||||
theRecipe.setIngredientPermutation(Collections.singletonList(theRecipe.input), ingredient);
|
||||
arecipes.add(theRecipe);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getGuiTexture(){
|
||||
return ModUtil.MOD_ID+":textures/gui/guiNEISimple.png";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getOverlayIdentifier(){
|
||||
return NAME;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawExtras(int rec){
|
||||
CachedBallRecipe recipe = (CachedBallRecipe)this.arecipes.get(rec);
|
||||
if(recipe.result != null){
|
||||
int secondChance = recipe.chance;
|
||||
String secondString = secondChance+"%";
|
||||
GuiDraw.drawString(secondString, 65+32, 45, StringUtil.DECIMAL_COLOR_GRAY_TEXT, false);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Class<? extends GuiContainer> getGuiClass(){
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawBackground(int recipeIndex){
|
||||
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
GuiDraw.changeTexture(getGuiTexture());
|
||||
GuiDraw.drawTexturedModalRect(32, 0, 0, 0, 96, 60);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int recipiesPerPage(){
|
||||
return 2;
|
||||
}
|
||||
|
||||
public class CachedBallRecipe extends CachedRecipe{
|
||||
|
||||
public PositionedStack result;
|
||||
public PositionedStack input;
|
||||
public int chance;
|
||||
|
||||
public CachedBallRecipe(ItemStack input, ItemStack result, int chance){
|
||||
this.result = new PositionedStack(result, 67+32, 19);
|
||||
this.chance = chance;
|
||||
this.input = new PositionedStack(input, 5+32, 19);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PositionedStack getResult(){
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public PositionedStack getIngredient(){
|
||||
return input;
|
||||
}
|
||||
}*/
|
||||
}
|
|
@ -1,172 +0,0 @@
|
|||
/*
|
||||
* This file ("NEIReconstructorRecipe.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://ellpeck.de/actaddlicense
|
||||
* View the source code at https://github.com/Ellpeck/ActuallyAdditions
|
||||
*
|
||||
* © 2015-2016 Ellpeck
|
||||
*/
|
||||
|
||||
package de.ellpeck.actuallyadditions.mod.nei;
|
||||
|
||||
public final class NEIReconstructorRecipe/* extends TemplateRecipeHandler implements INEIRecipeHandler*/{
|
||||
|
||||
public static final String NAME = "actuallyadditions.reconstructor";
|
||||
|
||||
/*public NEIReconstructorRecipe(){
|
||||
super();
|
||||
RecipeInfo.setGuiOffset(this.getGuiClass(), 0, 0);
|
||||
}
|
||||
|
||||
@Override
|
||||
public BookletPage getPageForInfo(int page){
|
||||
return BookletUtils.getFirstPageForStack(new ItemStack(InitBlocks.blockAtomicReconstructor));
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getRecipeName(){
|
||||
return StringUtil.localize("container.nei."+NAME+".name");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void loadTransferRects(){
|
||||
transferRects.add(new RecipeTransferRect(new Rectangle(31+32, 18, 22, 16), NAME));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void loadCraftingRecipes(String outputId, Object... results){
|
||||
if(outputId.equals(NAME) && getClass() == NEIReconstructorRecipe.class){
|
||||
List<LensNoneRecipe> recipes = ActuallyAdditionsAPI.RECONSTRUCTOR_LENS_CONVERSION_RECIPES;
|
||||
//Default Recipes
|
||||
for(LensNoneRecipe recipe : recipes){
|
||||
arecipes.add(new CachedReconstructorRecipe(recipe, false));
|
||||
}
|
||||
//Color Recipes
|
||||
for(Object o : LensColor.CONVERTABLE_BLOCKS){
|
||||
ItemStack stack;
|
||||
if(o instanceof Block){
|
||||
stack = new ItemStack((Block)o);
|
||||
}
|
||||
else{
|
||||
stack = new ItemStack((Item)o);
|
||||
}
|
||||
for(int i = 0; i < 16; i++){
|
||||
ItemStack stackCopy = stack.copy();
|
||||
stackCopy.setItemDamage(i >= 15 ? 0 : i+1);
|
||||
stack.setItemDamage(i);
|
||||
arecipes.add(new CachedReconstructorRecipe(new LensNoneRecipe(stack, stackCopy, LensColor.ENERGY_USE), true));
|
||||
}
|
||||
}
|
||||
}
|
||||
else{
|
||||
super.loadCraftingRecipes(outputId, results);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void loadCraftingRecipes(ItemStack result){
|
||||
List<LensNoneRecipe> recipes = ActuallyAdditionsAPI.RECONSTRUCTOR_LENS_CONVERSION_RECIPES;
|
||||
//Default Recipes
|
||||
for(LensNoneRecipe recipe : recipes){
|
||||
if(ItemUtil.contains(recipe.getOutputs(), result, true)){
|
||||
arecipes.add(new CachedReconstructorRecipe(recipe, false));
|
||||
}
|
||||
}
|
||||
//Color Recipes
|
||||
if(result.getItem() != null && (Util.arrayContains(LensColor.CONVERTABLE_BLOCKS, result.getItem()) >= 0 || Util.arrayContains(LensColor.CONVERTABLE_BLOCKS, Block.getBlockFromItem(result.getItem())) >= 0)){
|
||||
int meta = result.getItemDamage();
|
||||
ItemStack input = result.copy();
|
||||
input.setItemDamage(meta <= 0 ? 15 : meta-1);
|
||||
arecipes.add(new CachedReconstructorRecipe(new LensNoneRecipe(input, result, LensColor.ENERGY_USE), true));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void loadUsageRecipes(ItemStack ingredient){
|
||||
List<LensNoneRecipe> recipes = ActuallyAdditionsAPI.RECONSTRUCTOR_LENS_CONVERSION_RECIPES;
|
||||
//Default Recipes
|
||||
for(LensNoneRecipe recipe : recipes){
|
||||
if(ItemUtil.contains(recipe.getInputs(), ingredient, true)){
|
||||
CachedReconstructorRecipe theRecipe = new CachedReconstructorRecipe(recipe, false);
|
||||
theRecipe.setIngredientPermutation(Collections.singletonList(theRecipe.input), ingredient);
|
||||
arecipes.add(theRecipe);
|
||||
}
|
||||
}
|
||||
//Color Recipes
|
||||
if(ingredient.getItem() != null && (Util.arrayContains(LensColor.CONVERTABLE_BLOCKS, ingredient.getItem()) >= 0 || Util.arrayContains(LensColor.CONVERTABLE_BLOCKS, Block.getBlockFromItem(ingredient.getItem())) >= 0)){
|
||||
int meta = ingredient.getItemDamage();
|
||||
ItemStack output = ingredient.copy();
|
||||
output.setItemDamage(meta >= 15 ? 0 : meta+1);
|
||||
arecipes.add(new CachedReconstructorRecipe(new LensNoneRecipe(ingredient, output, LensColor.ENERGY_USE), true));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getGuiTexture(){
|
||||
return ModUtil.MOD_ID+":textures/gui/guiNEIAtomicReconstructor.png";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getOverlayIdentifier(){
|
||||
return NAME;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Class<? extends GuiContainer> getGuiClass(){
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawBackground(int recipeIndex){
|
||||
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
GuiDraw.changeTexture(getGuiTexture());
|
||||
GuiDraw.drawTexturedModalRect(32, 0, 0, 0, 96, 60);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawForeground(int recipe){
|
||||
if(Minecraft.getMinecraft().currentScreen != null){
|
||||
AssetUtil.renderStackToGui(new ItemStack(InitBlocks.blockAtomicReconstructor), 32+34, 19, 1.0F);
|
||||
}
|
||||
if(((CachedReconstructorRecipe)this.arecipes.get(recipe)).showColorLens){
|
||||
String text = InitItems.itemColorLens.getItemStackDisplayName(new ItemStack(InitItems.itemColorLens));
|
||||
GuiDraw.drawString(text, 0, 44, StringUtil.DECIMAL_COLOR_GRAY_TEXT, false);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int recipiesPerPage(){
|
||||
return 2;
|
||||
}
|
||||
|
||||
public class CachedReconstructorRecipe extends CachedRecipe{
|
||||
|
||||
public PositionedStack result;
|
||||
public PositionedStack input;
|
||||
public boolean showColorLens;
|
||||
|
||||
public CachedReconstructorRecipe(LensNoneRecipe recipe, boolean showColorLens){
|
||||
this.result = new PositionedStack(recipe.getOutputs(), 67+32, 19);
|
||||
this.input = new PositionedStack(recipe.getInputs(), 5+32, 19);
|
||||
this.showColorLens = showColorLens;
|
||||
}
|
||||
|
||||
@Override
|
||||
public PositionedStack getResult(){
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<PositionedStack> getIngredients(){
|
||||
return this.getCycledIngredients(cycleticks/48, Collections.singletonList(this.input));
|
||||
}
|
||||
|
||||
@Override
|
||||
public java.util.List<PositionedStack> getOtherStacks(){
|
||||
ArrayList<PositionedStack> list = new ArrayList<PositionedStack>();
|
||||
list.addAll(this.getCycledIngredients(cycleticks/48, Collections.singletonList(this.result)));
|
||||
return list;
|
||||
}
|
||||
}*/
|
||||
}
|
|
@ -1,68 +0,0 @@
|
|||
/*
|
||||
* This file ("NEIScreenEvents.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://ellpeck.de/actaddlicense
|
||||
* View the source code at https://github.com/Ellpeck/ActuallyAdditions
|
||||
*
|
||||
* © 2015-2016 Ellpeck
|
||||
*/
|
||||
|
||||
package de.ellpeck.actuallyadditions.mod.nei;
|
||||
|
||||
import de.ellpeck.actuallyadditions.mod.booklet.button.TexturedButton;
|
||||
|
||||
public class NEIScreenEvents{
|
||||
|
||||
private static final int NEI_BUTTON_ID = 123782;
|
||||
private TexturedButton neiButton;
|
||||
|
||||
/*@SuppressWarnings("unchecked")
|
||||
@SubscribeEvent
|
||||
public void onInitGuiForNEI(GuiScreenEvent.InitGuiEvent event){
|
||||
if(event.gui instanceof GuiRecipe){
|
||||
int xSize = 176;
|
||||
int ySize = 166;
|
||||
int guiLeft = (event.gui.width-xSize)/2;
|
||||
int guiTop = (event.gui.height-ySize)/2;
|
||||
|
||||
this.neiButton = new TexturedButton(NEI_BUTTON_ID, guiLeft+xSize-24, guiTop+127, 146, 154, 20, 20){
|
||||
@Override
|
||||
public void drawButton(Minecraft minecraft, int x, int y){
|
||||
super.drawButton(minecraft, x, y);
|
||||
if(this.visible && this.hovered){
|
||||
String text = StringUtil.localize("booklet."+ModUtil.MOD_ID+".clickToSeeRecipe");
|
||||
Minecraft.getMinecraft().fontRendererObj.drawString(text, this.xPosition-Minecraft.getMinecraft().fontRendererObj.getStringWidth(text)-1, this.yPosition+this.height/2-Minecraft.getMinecraft().fontRendererObj.FONT_HEIGHT/2, StringUtil.DECIMAL_COLOR_WHITE, true);
|
||||
}
|
||||
}
|
||||
};
|
||||
event.buttonList.add(this.neiButton);
|
||||
|
||||
GuiRecipe theGui = (GuiRecipe)event.gui;
|
||||
|
||||
IRecipeHandler handler = theGui.getCurrentRecipeHandlers().get(theGui.recipetype);
|
||||
this.neiButton.visible = handler instanceof INEIRecipeHandler && ((INEIRecipeHandler)handler).getPageForInfo(theGui.page) != null;
|
||||
}
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void guiPostAction(GuiScreenEvent.ActionPerformedEvent.Post event){
|
||||
if(this.neiButton != null && event.gui instanceof GuiRecipe){
|
||||
GuiRecipe theGui = (GuiRecipe)event.gui;
|
||||
|
||||
IRecipeHandler handler = theGui.getCurrentRecipeHandlers().get(theGui.recipetype);
|
||||
boolean isPage = handler instanceof INEIRecipeHandler && ((INEIRecipeHandler)handler).getPageForInfo(theGui.page) != null;
|
||||
this.neiButton.visible = isPage;
|
||||
|
||||
if(isPage && event.button.id == NEI_BUTTON_ID){
|
||||
BookletPage page = ((INEIRecipeHandler)handler).getPageForInfo(theGui.page);
|
||||
if(page != null){
|
||||
GuiBooklet book = new GuiBooklet(Minecraft.getMinecraft().currentScreen, false, true);
|
||||
Minecraft.getMinecraft().displayGuiScreen(book);
|
||||
BookletUtils.openIndexEntry(book, page.getChapter().getEntry(), ActuallyAdditionsAPI.BOOKLET_ENTRIES.indexOf(page.getChapter().getEntry())/GuiBooklet.CHAPTER_BUTTONS_AMOUNT+1, true);
|
||||
BookletUtils.openChapter(book, page.getChapter(), page);
|
||||
}
|
||||
}
|
||||
}
|
||||
}*/
|
||||
}
|
|
@ -1,134 +0,0 @@
|
|||
/*
|
||||
* This file ("NEITreasureChestRecipe.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://ellpeck.de/actaddlicense
|
||||
* View the source code at https://github.com/Ellpeck/ActuallyAdditions
|
||||
*
|
||||
* © 2015-2016 Ellpeck
|
||||
*/
|
||||
|
||||
package de.ellpeck.actuallyadditions.mod.nei;
|
||||
|
||||
public final class NEITreasureChestRecipe/* extends TemplateRecipeHandler implements INEIRecipeHandler*/{
|
||||
|
||||
public static final String NAME = "actuallyadditions.treasureChest";
|
||||
|
||||
/*public NEITreasureChestRecipe(){
|
||||
super();
|
||||
RecipeInfo.setGuiOffset(this.getGuiClass(), 0, 0);
|
||||
}
|
||||
|
||||
@Override
|
||||
public BookletPage getPageForInfo(int page){
|
||||
return BookletUtils.getFirstPageForStack(new ItemStack(InitBlocks.blockTreasureChest));
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getRecipeName(){
|
||||
return StringUtil.localize("container.nei."+NAME+".name");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void loadTransferRects(){
|
||||
transferRects.add(new RecipeTransferRect(new Rectangle(31+32, 18, 22, 16), NAME));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void loadCraftingRecipes(String outputId, Object... results){
|
||||
if(outputId.equals(NAME) && getClass() == NEITreasureChestRecipe.class){
|
||||
List<TreasureChestLoot> recipes = ActuallyAdditionsAPI.TREASURE_CHEST_LOOT;
|
||||
for(TreasureChestLoot recipe : recipes){
|
||||
arecipes.add(new CachedTreasure(new ItemStack(InitBlocks.blockTreasureChest), recipe.returnItem, recipe.itemWeight, recipe.minAmount, recipe.maxAmount));
|
||||
}
|
||||
}
|
||||
else{
|
||||
super.loadCraftingRecipes(outputId, results);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void loadCraftingRecipes(ItemStack result){
|
||||
List<TreasureChestLoot> recipes = ActuallyAdditionsAPI.TREASURE_CHEST_LOOT;
|
||||
for(TreasureChestLoot recipe : recipes){
|
||||
if(NEIServerUtils.areStacksSameType(recipe.returnItem, result)){
|
||||
arecipes.add(new CachedTreasure(new ItemStack(InitBlocks.blockTreasureChest), recipe.returnItem, recipe.itemWeight, recipe.minAmount, recipe.maxAmount));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void loadUsageRecipes(ItemStack ingredient){
|
||||
List<TreasureChestLoot> recipes = ActuallyAdditionsAPI.TREASURE_CHEST_LOOT;
|
||||
for(TreasureChestLoot recipe : recipes){
|
||||
ItemStack stack = new ItemStack(InitBlocks.blockTreasureChest);
|
||||
if(NEIServerUtils.areStacksSameTypeCrafting(stack, ingredient)){
|
||||
CachedTreasure theRecipe = new CachedTreasure(stack, recipe.returnItem, recipe.itemWeight, recipe.minAmount, recipe.maxAmount);
|
||||
theRecipe.setIngredientPermutation(Collections.singletonList(theRecipe.input), ingredient);
|
||||
arecipes.add(theRecipe);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getGuiTexture(){
|
||||
return ModUtil.MOD_ID+":textures/gui/guiNEISimple.png";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getOverlayIdentifier(){
|
||||
return NAME;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawExtras(int rec){
|
||||
CachedTreasure recipe = (CachedTreasure)this.arecipes.get(rec);
|
||||
if(recipe.result != null){
|
||||
GuiDraw.drawString(recipe.minAmount+"-"+recipe.maxAmount+" "+StringUtil.localize("container.nei."+ModUtil.MOD_ID+".treasureChest.info")+" "+recipe.chance+"%", 55, 45, StringUtil.DECIMAL_COLOR_GRAY_TEXT, false);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Class<? extends GuiContainer> getGuiClass(){
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawBackground(int recipeIndex){
|
||||
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
GuiDraw.changeTexture(getGuiTexture());
|
||||
GuiDraw.drawTexturedModalRect(32, 0, 0, 0, 96, 60);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int recipiesPerPage(){
|
||||
return 2;
|
||||
}
|
||||
|
||||
public class CachedTreasure extends CachedRecipe{
|
||||
|
||||
public PositionedStack result;
|
||||
public PositionedStack input;
|
||||
public int chance;
|
||||
public int minAmount;
|
||||
public int maxAmount;
|
||||
|
||||
public CachedTreasure(ItemStack input, ItemStack result, int chance, int minAmount, int maxAmount){
|
||||
this.result = new PositionedStack(result, 67+32, 19);
|
||||
this.chance = chance;
|
||||
this.input = new PositionedStack(input, 5+32, 19);
|
||||
this.minAmount = minAmount;
|
||||
this.maxAmount = maxAmount;
|
||||
}
|
||||
|
||||
@Override
|
||||
public PositionedStack getResult(){
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public PositionedStack getIngredient(){
|
||||
return input;
|
||||
}
|
||||
}*/
|
||||
}
|
Loading…
Reference in a new issue