From 21f23c3670ad477f84fc8ccaa3f29a23095b799b Mon Sep 17 00:00:00 2001 From: Ellpeck Date: Sun, 3 Jul 2016 21:06:44 +0200 Subject: [PATCH] Remove NEI integration and fix an event derp --- .../mod/items/ItemWingsOfTheBats.java | 3 +- .../mod/jei/JEIActuallyAdditionsPlugin.java | 23 +-- .../jei/booklet/BookletRecipeCategory.java | 7 +- .../mod/jei/booklet/BookletRecipeHandler.java | 4 +- .../coffee/CoffeeMachineRecipeCategory.java | 7 +- .../coffee/CoffeeMachineRecipeHandler.java | 4 +- .../ReconstructorRecipeCategory.java | 7 +- .../ReconstructorRecipeHandler.java | 5 +- .../mod/nei/INEIRecipeHandler.java | 18 -- .../mod/nei/NEIActuallyAdditionsConfig.java | 75 ------- .../mod/nei/NEIBookletRecipe.java | 151 -------------- .../mod/nei/NEICoffeeMachineRecipe.java | 155 --------------- .../mod/nei/NEICompostRecipe.java | 111 ----------- .../mod/nei/NEICrusherRecipe.java | 186 ------------------ .../mod/nei/NEIFurnaceDoubleRecipe.java | 128 ------------ .../mod/nei/NEIHairyBallRecipe.java | 132 ------------- .../mod/nei/NEIReconstructorRecipe.java | 172 ---------------- .../mod/nei/NEIScreenEvents.java | 68 ------- .../mod/nei/NEITreasureChestRecipe.java | 134 ------------- 19 files changed, 21 insertions(+), 1369 deletions(-) delete mode 100644 src/main/java/de/ellpeck/actuallyadditions/mod/nei/INEIRecipeHandler.java delete mode 100644 src/main/java/de/ellpeck/actuallyadditions/mod/nei/NEIActuallyAdditionsConfig.java delete mode 100644 src/main/java/de/ellpeck/actuallyadditions/mod/nei/NEIBookletRecipe.java delete mode 100644 src/main/java/de/ellpeck/actuallyadditions/mod/nei/NEICoffeeMachineRecipe.java delete mode 100644 src/main/java/de/ellpeck/actuallyadditions/mod/nei/NEICompostRecipe.java delete mode 100644 src/main/java/de/ellpeck/actuallyadditions/mod/nei/NEICrusherRecipe.java delete mode 100644 src/main/java/de/ellpeck/actuallyadditions/mod/nei/NEIFurnaceDoubleRecipe.java delete mode 100644 src/main/java/de/ellpeck/actuallyadditions/mod/nei/NEIHairyBallRecipe.java delete mode 100644 src/main/java/de/ellpeck/actuallyadditions/mod/nei/NEIReconstructorRecipe.java delete mode 100644 src/main/java/de/ellpeck/actuallyadditions/mod/nei/NEIScreenEvents.java delete mode 100644 src/main/java/de/ellpeck/actuallyadditions/mod/nei/NEITreasureChestRecipe.java diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemWingsOfTheBats.java b/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemWingsOfTheBats.java index ee655ffc3..0fb8f9c4c 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemWingsOfTheBats.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemWingsOfTheBats.java @@ -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; diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/jei/JEIActuallyAdditionsPlugin.java b/src/main/java/de/ellpeck/actuallyadditions/mod/jei/JEIActuallyAdditionsPlugin.java index 472a46e63..ed4176981 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/jei/JEIActuallyAdditionsPlugin.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/jei/JEIActuallyAdditionsPlugin.java @@ -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 diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/jei/booklet/BookletRecipeCategory.java b/src/main/java/de/ellpeck/actuallyadditions/mod/jei/booklet/BookletRecipeCategory.java index 5959295e5..8a7c36300 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/jei/booklet/BookletRecipeCategory.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/jei/booklet/BookletRecipeCategory.java @@ -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"); } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/jei/booklet/BookletRecipeHandler.java b/src/main/java/de/ellpeck/actuallyadditions/mod/jei/booklet/BookletRecipeHandler.java index 63066054c..eedd70b6a 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/jei/booklet/BookletRecipeHandler.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/jei/booklet/BookletRecipeHandler.java @@ -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{ @Override public String getRecipeCategoryUid(){ - return NEIBookletRecipe.NAME; + return BookletRecipeCategory.NAME; } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/jei/coffee/CoffeeMachineRecipeCategory.java b/src/main/java/de/ellpeck/actuallyadditions/mod/jei/coffee/CoffeeMachineRecipeCategory.java index 107ca8404..0104db896 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/jei/coffee/CoffeeMachineRecipeCategory.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/jei/coffee/CoffeeMachineRecipeCategory.java @@ -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"); } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/jei/coffee/CoffeeMachineRecipeHandler.java b/src/main/java/de/ellpeck/actuallyadditions/mod/jei/coffee/CoffeeMachineRecipeHandler.java index 39615477e..8f59b37a4 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/jei/coffee/CoffeeMachineRecipeHandler.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/jei/coffee/CoffeeMachineRecipeHandler.java @@ -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{ @Override @@ -26,7 +23,7 @@ public class ReconstructorRecipeHandler implements IRecipeHandler nonDoubleStacks = new ArrayList(); - 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 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 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("", EnumChatFormatting.BLUE+"").replaceAll("", 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 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; - } - }*/ -} \ No newline at end of file diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/nei/NEICoffeeMachineRecipe.java b/src/main/java/de/ellpeck/actuallyadditions/mod/nei/NEICoffeeMachineRecipe.java deleted file mode 100644 index c16894c90..000000000 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/nei/NEICoffeeMachineRecipe.java +++ /dev/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 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 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 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 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 getIngredients(){ - ArrayList list = new ArrayList(); - list.add(this.ingredientStack); - list.add(this.cup); - list.add(this.coffeeBeans); - return list; - } - }*/ -} \ No newline at end of file diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/nei/NEICompostRecipe.java b/src/main/java/de/ellpeck/actuallyadditions/mod/nei/NEICompostRecipe.java deleted file mode 100644 index 3e0019800..000000000 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/nei/NEICompostRecipe.java +++ /dev/null @@ -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 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; - } - }*/ -} \ No newline at end of file diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/nei/NEICrusherRecipe.java b/src/main/java/de/ellpeck/actuallyadditions/mod/nei/NEICrusherRecipe.java deleted file mode 100644 index a1c6cfb78..000000000 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/nei/NEICrusherRecipe.java +++ /dev/null @@ -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 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 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 in, List outOne, List 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 getIngredients(){ - return this.getCycledIngredients(cycleticks/48, Collections.singletonList(this.ingredient)); - } - - @Override - public List getOtherStacks(){ - ArrayList list = new ArrayList(); - 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; - } - }*/ -} \ No newline at end of file diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/nei/NEIFurnaceDoubleRecipe.java b/src/main/java/de/ellpeck/actuallyadditions/mod/nei/NEIFurnaceDoubleRecipe.java deleted file mode 100644 index edb1ad4c5..000000000 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/nei/NEIFurnaceDoubleRecipe.java +++ /dev/null @@ -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 recipes = FurnaceRecipes.INSTANCE().getSmeltingList(); - for(Map.Entry 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 recipes = FurnaceRecipes.INSTANCE().getSmeltingList(); - for(Map.Entry 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 recipes = FurnaceRecipes.INSTANCE().getSmeltingList(); - for(Map.Entry 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 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 getIngredients(){ - return getCycledIngredients(cycleticks/48, Collections.singletonList(ingredient)); - } - }*/ -} \ No newline at end of file diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/nei/NEIHairyBallRecipe.java b/src/main/java/de/ellpeck/actuallyadditions/mod/nei/NEIHairyBallRecipe.java deleted file mode 100644 index 3f05da9a7..000000000 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/nei/NEIHairyBallRecipe.java +++ /dev/null @@ -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 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 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 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 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; - } - }*/ -} \ No newline at end of file diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/nei/NEIReconstructorRecipe.java b/src/main/java/de/ellpeck/actuallyadditions/mod/nei/NEIReconstructorRecipe.java deleted file mode 100644 index ce3fe9e1f..000000000 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/nei/NEIReconstructorRecipe.java +++ /dev/null @@ -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 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 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 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 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 getIngredients(){ - return this.getCycledIngredients(cycleticks/48, Collections.singletonList(this.input)); - } - - @Override - public java.util.List getOtherStacks(){ - ArrayList list = new ArrayList(); - list.addAll(this.getCycledIngredients(cycleticks/48, Collections.singletonList(this.result))); - return list; - } - }*/ -} \ No newline at end of file diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/nei/NEIScreenEvents.java b/src/main/java/de/ellpeck/actuallyadditions/mod/nei/NEIScreenEvents.java deleted file mode 100644 index 486dfa71c..000000000 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/nei/NEIScreenEvents.java +++ /dev/null @@ -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); - } - } - } - }*/ -} diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/nei/NEITreasureChestRecipe.java b/src/main/java/de/ellpeck/actuallyadditions/mod/nei/NEITreasureChestRecipe.java deleted file mode 100644 index 586e8bd0c..000000000 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/nei/NEITreasureChestRecipe.java +++ /dev/null @@ -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 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 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 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 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; - } - }*/ -} \ No newline at end of file