From 9ad7a6e572933eb7c5280a93df061755bb35639c Mon Sep 17 00:00:00 2001 From: Ellpeck Date: Wed, 23 Sep 2015 18:21:57 +0200 Subject: [PATCH] Removed NEI Recipe Handlers (for now, because I was unhappy with them) --- .../nei/CoffeeMachineRecipeHandler.java | 168 ---------------- .../nei/CompostRecipeHandler.java | 119 ----------- .../nei/CrusherRecipeHandler.java | 190 ------------------ .../nei/FurnaceDoubleRecipeHandler.java | 138 ------------- .../nei/HairyBallRecipeHandler.java | 138 ------------- .../nei/NEIActuallyAdditionsConfig.java | 28 --- .../nei/TreasureChestRecipeHandler.java | 140 ------------- .../textures/gui/guiNEICoffeeMachine.png | Bin 2386 -> 0 bytes .../textures/gui/guiNEISimple.png | Bin 1786 -> 0 bytes 9 files changed, 921 deletions(-) delete mode 100644 src/main/java/ellpeck/actuallyadditions/nei/CoffeeMachineRecipeHandler.java delete mode 100644 src/main/java/ellpeck/actuallyadditions/nei/CompostRecipeHandler.java delete mode 100644 src/main/java/ellpeck/actuallyadditions/nei/CrusherRecipeHandler.java delete mode 100644 src/main/java/ellpeck/actuallyadditions/nei/FurnaceDoubleRecipeHandler.java delete mode 100644 src/main/java/ellpeck/actuallyadditions/nei/HairyBallRecipeHandler.java delete mode 100644 src/main/java/ellpeck/actuallyadditions/nei/TreasureChestRecipeHandler.java delete mode 100644 src/main/resources/assets/actuallyadditions/textures/gui/guiNEICoffeeMachine.png delete mode 100644 src/main/resources/assets/actuallyadditions/textures/gui/guiNEISimple.png diff --git a/src/main/java/ellpeck/actuallyadditions/nei/CoffeeMachineRecipeHandler.java b/src/main/java/ellpeck/actuallyadditions/nei/CoffeeMachineRecipeHandler.java deleted file mode 100644 index a97954d67..000000000 --- a/src/main/java/ellpeck/actuallyadditions/nei/CoffeeMachineRecipeHandler.java +++ /dev/null @@ -1,168 +0,0 @@ -/* - * This file ("CoffeeMachineRecipeHandler.java") is part of the Actually Additions Mod for Minecraft. - * It is created and owned by Ellpeck and distributed - * under the Actually Additions License to be found at - * http://github.com/Ellpeck/ActuallyAdditions/blob/master/README.md - * View the source code at https://github.com/Ellpeck/ActuallyAdditions - * - * © 2015 Ellpeck - */ - -package ellpeck.actuallyadditions.nei; - -import codechicken.lib.gui.GuiDraw; -import codechicken.nei.NEIServerUtils; -import codechicken.nei.PositionedStack; -import codechicken.nei.recipe.RecipeInfo; -import codechicken.nei.recipe.TemplateRecipeHandler; -import ellpeck.actuallyadditions.config.values.ConfigIntValues; -import ellpeck.actuallyadditions.inventory.gui.GuiCoffeeMachine; -import ellpeck.actuallyadditions.items.InitItems; -import ellpeck.actuallyadditions.items.ItemCoffee; -import ellpeck.actuallyadditions.items.metalists.TheMiscItems; -import ellpeck.actuallyadditions.util.ModUtil; -import ellpeck.actuallyadditions.util.StringUtil; -import net.minecraft.client.gui.inventory.GuiContainer; -import net.minecraft.item.ItemStack; -import org.lwjgl.opengl.GL11; - -import java.awt.*; -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; - -public class CoffeeMachineRecipeHandler extends TemplateRecipeHandler{ - - public static final String NAME = "actuallyadditions.coffee"; - - public CoffeeMachineRecipeHandler(){ - super(); - RecipeInfo.setGuiOffset(this.getGuiClass(), 35, 3); - } - - 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(ItemCoffee.Ingredient ingredient){ - this.cup = new PositionedStack(new ItemStack(InitItems.itemMisc, 1, TheMiscItems.CUP.ordinal()), 45, 39); - this.coffeeBeans = new PositionedStack(new ItemStack(InitItems.itemCoffeeBean, ConfigIntValues.COFFEE_CACHE_USED_PER_ITEM.getValue()), 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(ItemCoffee.Ingredient ingredient){ - ItemStack result = new ItemStack(InitItems.itemCoffee); - ItemCoffee.addEffectToStack(result, ingredient); - this.result = new PositionedStack(result.copy(), 45, 70); - } - - @Override - public List getIngredients(){ - ArrayList list = new ArrayList(); - list.add(this.ingredientStack); - list.add(this.cup); - list.add(this.coffeeBeans); - return list; - } - - @Override - public PositionedStack getResult(){ - return result; - } - } - - @Override - public int recipiesPerPage(){ - return 1; - } - - @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 Class getGuiClass(){ - return GuiCoffeeMachine.class; - } - - @Override - public String getRecipeName(){ - return StringUtil.localize("container.nei."+NAME+".name"); - } - - @Override - public void loadCraftingRecipes(String outputId, Object... results){ - if(outputId.equals(NAME) && getClass() == CoffeeMachineRecipeHandler.class){ - ArrayList ingredients = ItemCoffee.ingredients; - for(ItemCoffee.Ingredient ingredient : ingredients){ - arecipes.add(new CachedCoffee(ingredient)); - } - } - else super.loadCraftingRecipes(outputId, results); - } - - @Override - public void loadCraftingRecipes(ItemStack result){ - ArrayList ingredients = ItemCoffee.ingredients; - for(ItemCoffee.Ingredient ingredient : ingredients){ - if(result.getItem() instanceof ItemCoffee) arecipes.add(new CachedCoffee(ingredient)); - } - } - - @Override - public void loadUsageRecipes(ItemStack ingredient){ - - ArrayList ingredients = ItemCoffee.ingredients; - for(ItemCoffee.Ingredient 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_LOWER + ":textures/gui/guiNEICoffeeMachine.png"; - } - - @Override - public void drawBackground(int recipeIndex){ - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - GuiDraw.changeTexture(getGuiTexture()); - GuiDraw.drawTexturedModalRect(0, 0, 0, 0, 126, 88); - } - - @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_LOWER+".coffee.special") + ":", 2, 4, StringUtil.DECIMAL_COLOR_GRAY_TEXT, false); - GuiDraw.drawString(cache.extraText, 2, 16, StringUtil.DECIMAL_COLOR_GRAY_TEXT, false); - } - GuiDraw.drawString(StringUtil.localize("container.nei."+ModUtil.MOD_ID_LOWER+".coffee.shift"), 1, 75, StringUtil.DECIMAL_COLOR_GRAY_TEXT, false); - - if(cache.maxAmp > 0){ - GuiDraw.drawString(StringUtil.localize("container.nei."+ModUtil.MOD_ID_LOWER+".coffee.maxAmount") + ": " + cache.maxAmp, 2, 28, StringUtil.DECIMAL_COLOR_GRAY_TEXT, false); - } - } - - @Override - public String getOverlayIdentifier(){ - return NAME; - } -} \ No newline at end of file diff --git a/src/main/java/ellpeck/actuallyadditions/nei/CompostRecipeHandler.java b/src/main/java/ellpeck/actuallyadditions/nei/CompostRecipeHandler.java deleted file mode 100644 index 44b1248c6..000000000 --- a/src/main/java/ellpeck/actuallyadditions/nei/CompostRecipeHandler.java +++ /dev/null @@ -1,119 +0,0 @@ -/* - * This file ("CompostRecipeHandler.java") is part of the Actually Additions Mod for Minecraft. - * It is created and owned by Ellpeck and distributed - * under the Actually Additions License to be found at - * http://github.com/Ellpeck/ActuallyAdditions/blob/master/README.md - * View the source code at https://github.com/Ellpeck/ActuallyAdditions - * - * © 2015 Ellpeck - */ - -package ellpeck.actuallyadditions.nei; - -import codechicken.lib.gui.GuiDraw; -import codechicken.nei.NEIServerUtils; -import codechicken.nei.PositionedStack; -import codechicken.nei.recipe.RecipeInfo; -import codechicken.nei.recipe.TemplateRecipeHandler; -import ellpeck.actuallyadditions.config.values.ConfigIntValues; -import ellpeck.actuallyadditions.items.InitItems; -import ellpeck.actuallyadditions.items.metalists.TheMiscItems; -import ellpeck.actuallyadditions.util.ModUtil; -import ellpeck.actuallyadditions.util.StringUtil; -import net.minecraft.client.gui.inventory.GuiContainer; -import net.minecraft.item.ItemStack; -import org.lwjgl.opengl.GL11; - -import java.awt.*; -import java.util.Collections; - -public class CompostRecipeHandler extends TemplateRecipeHandler{ - - public static final String NAME = "actuallyadditions.compost"; - - public CompostRecipeHandler(){ - super(); - RecipeInfo.setGuiOffset(this.getGuiClass(), 0, 0); - } - - 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 getIngredient(){ - return input; - } - - @Override - public PositionedStack getResult(){ - return result; - } - } - - @Override - public int recipiesPerPage(){ - return 2; - } - - @Override - public Class getGuiClass(){ - return null; - } - - @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() == CompostRecipeHandler.class){ - arecipes.add(new CachedCompostRecipe(new ItemStack(InitItems.itemMisc, ConfigIntValues.COMPOST_AMOUNT.getValue(), TheMiscItems.MASHED_FOOD.ordinal()), new ItemStack(InitItems.itemFertilizer, ConfigIntValues.COMPOST_AMOUNT.getValue()))); - } - 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, ConfigIntValues.COMPOST_AMOUNT.getValue(), TheMiscItems.MASHED_FOOD.ordinal()), new ItemStack(InitItems.itemFertilizer, ConfigIntValues.COMPOST_AMOUNT.getValue()))); - } - - @Override - public void loadUsageRecipes(ItemStack ingredient){ - if(NEIServerUtils.areStacksSameTypeCrafting(new ItemStack(InitItems.itemMisc, ConfigIntValues.COMPOST_AMOUNT.getValue(), TheMiscItems.MASHED_FOOD.ordinal()), ingredient)){ - CachedCompostRecipe theRecipe = new CachedCompostRecipe(new ItemStack(InitItems.itemMisc, ConfigIntValues.COMPOST_AMOUNT.getValue(), TheMiscItems.MASHED_FOOD.ordinal()), new ItemStack(InitItems.itemFertilizer, ConfigIntValues.COMPOST_AMOUNT.getValue())); - theRecipe.setIngredientPermutation(Collections.singletonList(theRecipe.input), ingredient); - arecipes.add(theRecipe); - } - } - - @Override - public String getGuiTexture(){ - return ModUtil.MOD_ID_LOWER + ":textures/gui/guiNEISimple.png"; - } - - @Override - public void drawBackground(int recipeIndex){ - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - GuiDraw.changeTexture(getGuiTexture()); - GuiDraw.drawTexturedModalRect(32, 0, 0, 0, 96, 60); - } - - @Override - public String getOverlayIdentifier(){ - return NAME; - } -} \ No newline at end of file diff --git a/src/main/java/ellpeck/actuallyadditions/nei/CrusherRecipeHandler.java b/src/main/java/ellpeck/actuallyadditions/nei/CrusherRecipeHandler.java deleted file mode 100644 index ace06b6e9..000000000 --- a/src/main/java/ellpeck/actuallyadditions/nei/CrusherRecipeHandler.java +++ /dev/null @@ -1,190 +0,0 @@ -/* - * This file ("CrusherRecipeHandler.java") is part of the Actually Additions Mod for Minecraft. - * It is created and owned by Ellpeck and distributed - * under the Actually Additions License to be found at - * http://github.com/Ellpeck/ActuallyAdditions/blob/master/README.md - * View the source code at https://github.com/Ellpeck/ActuallyAdditions - * - * © 2015 Ellpeck - */ - -package ellpeck.actuallyadditions.nei; - -import codechicken.lib.gui.GuiDraw; -import codechicken.nei.NEIServerUtils; -import codechicken.nei.PositionedStack; -import codechicken.nei.recipe.RecipeInfo; -import codechicken.nei.recipe.TemplateRecipeHandler; -import ellpeck.actuallyadditions.inventory.gui.GuiGrinder; -import ellpeck.actuallyadditions.recipe.CrusherRecipeManualRegistry; -import ellpeck.actuallyadditions.util.ModUtil; -import ellpeck.actuallyadditions.util.StringUtil; -import net.minecraft.client.gui.inventory.GuiContainer; -import net.minecraft.item.ItemStack; -import org.lwjgl.opengl.GL11; - -import java.awt.*; -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; - -public class CrusherRecipeHandler extends TemplateRecipeHandler{ - - public static class CrusherDoubleRecipeHandler extends CrusherRecipeHandler{ - - @Override - public Class getGuiClass(){ - return GuiGrinder.GuiGrinderDouble.class; - } - - @Override - public void loadTransferRects(){ - transferRects.add(new RecipeTransferRect(new Rectangle(51, 40, 24, 22), this.getName())); - transferRects.add(new RecipeTransferRect(new Rectangle(101, 40, 24, 22), this.getName())); - } - - @Override - public String getGuiTexture(){ - return ModUtil.MOD_ID_LOWER+":textures/gui/guiGrinderDouble.png"; - } - - @Override - public void drawBackground(int recipeIndex){ - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - GuiDraw.changeTexture(getGuiTexture()); - GuiDraw.drawTexturedModalRect(33, 20, 33, 20, 110, 70); - } - - @Override - public void drawExtras(int recipe){ - drawProgressBar(51, 40, 176, 0, 24, 23, 48, 1); - this.drawChanceString(66, 93, recipe); - } - } - - public CrusherRecipeHandler(){ - RecipeInfo.setGuiOffset(this.getGuiClass(), 0, 0); - } - - public class CachedCrush extends CachedRecipe{ - - public PositionedStack ingredient; - public PositionedStack resultOne; - public PositionedStack resultTwo; - public int secondChance; - - public CachedCrush(ItemStack in, ItemStack resultOne, ItemStack resultTwo, int secondChance, CrusherRecipeHandler handler){ - boolean isDouble = handler instanceof CrusherDoubleRecipeHandler; - in.stackSize = 1; - this.ingredient = new PositionedStack(in, isDouble ? 51 : 80, 21); - this.resultOne = new PositionedStack(resultOne, isDouble ? 38 : 66, 69); - if(resultTwo != null) this.resultTwo = new PositionedStack(resultTwo, isDouble ? 63 : 94, 69); - this.secondChance = secondChance; - } - - @Override - public List getIngredients(){ - return getCycledIngredients(cycleticks/48, Collections.singletonList(ingredient)); - } - - @Override - public PositionedStack getResult(){ - return resultOne; - } - - @Override - public List getOtherStacks(){ - ArrayList list = new ArrayList(); - if(this.resultTwo != null) list.add(this.resultTwo); - return list; - } - } - - @Override - public int recipiesPerPage(){ - return 1; - } - - @Override - public void loadTransferRects(){ - transferRects.add(new RecipeTransferRect(new Rectangle(80, 40, 24, 22), this.getName())); - } - - @Override - public Class getGuiClass(){ - return GuiGrinder.class; - } - - @Override - public String getRecipeName(){ - return StringUtil.localize("container.nei."+this.getName()+".name"); - } - - @Override - public void loadCraftingRecipes(String outputId, Object... results){ - if(outputId.equals(this.getName()) && (getClass() == CrusherRecipeHandler.class || getClass() == CrusherDoubleRecipeHandler.class)){ - ArrayList recipes = CrusherRecipeManualRegistry.recipes; - for(CrusherRecipeManualRegistry.CrusherRecipe recipe : recipes){ - arecipes.add(new CachedCrush(recipe.input, recipe.firstOutput, recipe.secondOutput, recipe.secondChance, this)); - } - } - else super.loadCraftingRecipes(outputId, results); - } - - @Override - public void loadCraftingRecipes(ItemStack result){ - ArrayList recipes = CrusherRecipeManualRegistry.recipes; - for(CrusherRecipeManualRegistry.CrusherRecipe recipe : recipes){ - if(NEIServerUtils.areStacksSameType(recipe.firstOutput, result) || NEIServerUtils.areStacksSameType(recipe.secondOutput, result)) - arecipes.add(new CachedCrush(recipe.input, recipe.firstOutput, recipe.secondOutput, recipe.secondChance, this)); - } - } - - @Override - public void loadUsageRecipes(ItemStack ingredient){ - ArrayList recipes = CrusherRecipeManualRegistry.recipes; - for(CrusherRecipeManualRegistry.CrusherRecipe recipe : recipes){ - if(NEIServerUtils.areStacksSameTypeCrafting(recipe.input, ingredient)){ - CachedCrush theRecipe = new CachedCrush(recipe.input, recipe.firstOutput, recipe.secondOutput, recipe.secondChance, this); - theRecipe.setIngredientPermutation(Collections.singletonList(theRecipe.ingredient), ingredient); - arecipes.add(theRecipe); - } - } - } - - @Override - public String getGuiTexture(){ - return ModUtil.MOD_ID_LOWER+":textures/gui/guiGrinder.png"; - } - - @Override - public void drawBackground(int recipeIndex){ - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - GuiDraw.changeTexture(getGuiTexture()); - GuiDraw.drawTexturedModalRect(60, 13, 60, 13, 56, 79); - } - - @Override - public void drawExtras(int recipe){ - drawProgressBar(80, 40, 176, 0, 24, 23, 48, 1); - this.drawChanceString(118, 73, recipe); - } - - @Override - public String getOverlayIdentifier(){ - return this.getName(); - } - - protected String getName(){ - return "actuallyadditions."+(this instanceof CrusherDoubleRecipeHandler ? "crushingDouble" : "crushing"); - } - - 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); - } - } -} \ No newline at end of file diff --git a/src/main/java/ellpeck/actuallyadditions/nei/FurnaceDoubleRecipeHandler.java b/src/main/java/ellpeck/actuallyadditions/nei/FurnaceDoubleRecipeHandler.java deleted file mode 100644 index 96c33fe4f..000000000 --- a/src/main/java/ellpeck/actuallyadditions/nei/FurnaceDoubleRecipeHandler.java +++ /dev/null @@ -1,138 +0,0 @@ -/* - * This file ("FurnaceDoubleRecipeHandler.java") is part of the Actually Additions Mod for Minecraft. - * It is created and owned by Ellpeck and distributed - * under the Actually Additions License to be found at - * http://github.com/Ellpeck/ActuallyAdditions/blob/master/README.md - * View the source code at https://github.com/Ellpeck/ActuallyAdditions - * - * © 2015 Ellpeck - */ - -package ellpeck.actuallyadditions.nei; - -import codechicken.lib.gui.GuiDraw; -import codechicken.nei.NEIServerUtils; -import codechicken.nei.PositionedStack; -import codechicken.nei.recipe.RecipeInfo; -import codechicken.nei.recipe.TemplateRecipeHandler; -import ellpeck.actuallyadditions.inventory.gui.GuiFurnaceDouble; -import ellpeck.actuallyadditions.util.ModUtil; -import ellpeck.actuallyadditions.util.StringUtil; -import net.minecraft.client.gui.inventory.GuiContainer; -import net.minecraft.item.ItemStack; -import net.minecraft.item.crafting.FurnaceRecipes; -import org.lwjgl.opengl.GL11; - -import java.awt.*; -import java.util.Collections; -import java.util.List; -import java.util.Map; - -public class FurnaceDoubleRecipeHandler extends TemplateRecipeHandler{ - - public static final String NAME = "actuallyadditions.furnaceDouble"; - - public FurnaceDoubleRecipeHandler(){ - RecipeInfo.setGuiOffset(this.getGuiClass(), 0, 0); - } - - 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 List getIngredients(){ - return getCycledIngredients(cycleticks/48, Collections.singletonList(ingredient)); - } - - @Override - public PositionedStack getResult(){ - return resultOne; - } - } - - @Override - public Class getGuiClass(){ - return GuiFurnaceDouble.class; - } - - @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)); - } - - @Override - public String getGuiTexture(){ - return ModUtil.MOD_ID_LOWER+":textures/gui/guiFurnaceDouble.png"; - } - - @Override - public void drawBackground(int recipeIndex){ - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - GuiDraw.changeTexture(getGuiTexture()); - GuiDraw.drawTexturedModalRect(46, 20, 46, 20, 84, 70); - } - - @Override - public void drawExtras(int recipe){ - drawProgressBar(51, 40, 176, 0, 24, 23, 48, 1); - } - - @Override - public int recipiesPerPage(){ - return 1; - } - - @Override - public String getRecipeName(){ - return StringUtil.localize("container.nei."+NAME+".name"); - } - - @SuppressWarnings("unchecked") - @Override - public void loadCraftingRecipes(String outputId, Object... results){ - if(outputId.equals(NAME) && getClass() == FurnaceDoubleRecipeHandler.class){ - Map recipes = (Map)FurnaceRecipes.smelting().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 = (Map)FurnaceRecipes.smelting().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 = (Map)FurnaceRecipes.smelting().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 getOverlayIdentifier(){ - return NAME; - } -} \ No newline at end of file diff --git a/src/main/java/ellpeck/actuallyadditions/nei/HairyBallRecipeHandler.java b/src/main/java/ellpeck/actuallyadditions/nei/HairyBallRecipeHandler.java deleted file mode 100644 index 1fd8f3542..000000000 --- a/src/main/java/ellpeck/actuallyadditions/nei/HairyBallRecipeHandler.java +++ /dev/null @@ -1,138 +0,0 @@ -/* - * This file ("HairyBallRecipeHandler.java") is part of the Actually Additions Mod for Minecraft. - * It is created and owned by Ellpeck and distributed - * under the Actually Additions License to be found at - * http://github.com/Ellpeck/ActuallyAdditions/blob/master/README.md - * View the source code at https://github.com/Ellpeck/ActuallyAdditions - * - * © 2015 Ellpeck - */ - -package ellpeck.actuallyadditions.nei; - -import codechicken.lib.gui.GuiDraw; -import codechicken.nei.NEIServerUtils; -import codechicken.nei.PositionedStack; -import codechicken.nei.recipe.RecipeInfo; -import codechicken.nei.recipe.TemplateRecipeHandler; -import ellpeck.actuallyadditions.recipe.HairyBallHandler; -import ellpeck.actuallyadditions.util.ModUtil; -import ellpeck.actuallyadditions.util.StringUtil; -import net.minecraft.client.gui.inventory.GuiContainer; -import net.minecraft.item.ItemStack; -import org.lwjgl.opengl.GL11; - -import java.awt.*; -import java.util.ArrayList; -import java.util.Collections; - -public class HairyBallRecipeHandler extends TemplateRecipeHandler{ - - public static final String NAME = "actuallyadditions.ballOfHair"; - - public HairyBallRecipeHandler(){ - super(); - RecipeInfo.setGuiOffset(this.getGuiClass(), 0, 0); - } - - 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 getIngredient(){ - return input; - } - - @Override - public PositionedStack getResult(){ - return result; - } - } - - @Override - public int recipiesPerPage(){ - return 2; - } - - @Override - public Class getGuiClass(){ - return null; - } - - @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() == HairyBallRecipeHandler.class){ - ArrayList recipes = HairyBallHandler.returns; - for(HairyBallHandler.Return recipe : recipes){ - arecipes.add(new CachedBallRecipe(recipe.inputItem, recipe.returnItem, recipe.itemWeight)); - } - } - else super.loadCraftingRecipes(outputId, results); - } - - @Override - public void loadCraftingRecipes(ItemStack result){ - ArrayList recipes = HairyBallHandler.returns; - for(HairyBallHandler.Return recipe : recipes){ - if(NEIServerUtils.areStacksSameType(recipe.returnItem, result)) arecipes.add(new CachedBallRecipe(recipe.inputItem, recipe.returnItem, recipe.itemWeight)); - } - } - - @Override - public void loadUsageRecipes(ItemStack ingredient){ - ArrayList recipes = HairyBallHandler.returns; - for(HairyBallHandler.Return recipe : recipes){ - if(NEIServerUtils.areStacksSameTypeCrafting(recipe.inputItem, ingredient)){ - CachedBallRecipe theRecipe = new CachedBallRecipe(recipe.inputItem, recipe.returnItem, recipe.itemWeight); - theRecipe.setIngredientPermutation(Collections.singletonList(theRecipe.input), ingredient); - arecipes.add(theRecipe); - } - } - } - - @Override - public String getGuiTexture(){ - return ModUtil.MOD_ID_LOWER + ":textures/gui/guiNEISimple.png"; - } - - @Override - public void drawBackground(int recipeIndex){ - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - GuiDraw.changeTexture(getGuiTexture()); - GuiDraw.drawTexturedModalRect(32, 0, 0, 0, 96, 60); - } - - @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 String getOverlayIdentifier(){ - return NAME; - } -} \ No newline at end of file diff --git a/src/main/java/ellpeck/actuallyadditions/nei/NEIActuallyAdditionsConfig.java b/src/main/java/ellpeck/actuallyadditions/nei/NEIActuallyAdditionsConfig.java index c89a6025f..a956cf7e7 100644 --- a/src/main/java/ellpeck/actuallyadditions/nei/NEIActuallyAdditionsConfig.java +++ b/src/main/java/ellpeck/actuallyadditions/nei/NEIActuallyAdditionsConfig.java @@ -28,34 +28,6 @@ public class NEIActuallyAdditionsConfig implements IConfigureNEI{ API.registerGuiOverlay(GuiCrafter.class, "crafting"); API.registerGuiOverlayHandler(GuiCrafter.class, new DefaultOverlayHandler(), "crafting"); - CrusherRecipeHandler crusherRecipeHandler = new CrusherRecipeHandler(); - API.registerRecipeHandler(crusherRecipeHandler); - API.registerUsageHandler(crusherRecipeHandler); - - CrusherRecipeHandler.CrusherDoubleRecipeHandler crusherDoubleRecipeHandler = new CrusherRecipeHandler.CrusherDoubleRecipeHandler(); - API.registerRecipeHandler(crusherDoubleRecipeHandler); - API.registerUsageHandler(crusherDoubleRecipeHandler); - - FurnaceDoubleRecipeHandler furnaceDoubleRecipeHandler = new FurnaceDoubleRecipeHandler(); - API.registerRecipeHandler(furnaceDoubleRecipeHandler); - API.registerUsageHandler(furnaceDoubleRecipeHandler); - - HairyBallRecipeHandler ballRecipeHandler = new HairyBallRecipeHandler(); - API.registerRecipeHandler(ballRecipeHandler); - API.registerUsageHandler(ballRecipeHandler); - - TreasureChestRecipeHandler treasureRecipeHandler = new TreasureChestRecipeHandler(); - API.registerRecipeHandler(treasureRecipeHandler); - API.registerUsageHandler(treasureRecipeHandler); - - CompostRecipeHandler compostRecipeHandler = new CompostRecipeHandler(); - API.registerRecipeHandler(compostRecipeHandler); - API.registerUsageHandler(compostRecipeHandler); - - CoffeeMachineRecipeHandler coffeeMachineRecipeHandler = new CoffeeMachineRecipeHandler(); - API.registerRecipeHandler(coffeeMachineRecipeHandler); - API.registerUsageHandler(coffeeMachineRecipeHandler); - API.hideItem(new ItemStack(InitBlocks.blockRice)); API.hideItem(new ItemStack(InitBlocks.blockCanola)); API.hideItem(new ItemStack(InitBlocks.blockFlax)); diff --git a/src/main/java/ellpeck/actuallyadditions/nei/TreasureChestRecipeHandler.java b/src/main/java/ellpeck/actuallyadditions/nei/TreasureChestRecipeHandler.java deleted file mode 100644 index 2cc12e7af..000000000 --- a/src/main/java/ellpeck/actuallyadditions/nei/TreasureChestRecipeHandler.java +++ /dev/null @@ -1,140 +0,0 @@ -/* - * This file ("TreasureChestRecipeHandler.java") is part of the Actually Additions Mod for Minecraft. - * It is created and owned by Ellpeck and distributed - * under the Actually Additions License to be found at - * http://github.com/Ellpeck/ActuallyAdditions/blob/master/README.md - * View the source code at https://github.com/Ellpeck/ActuallyAdditions - * - * © 2015 Ellpeck - */ - -package ellpeck.actuallyadditions.nei; - -import codechicken.lib.gui.GuiDraw; -import codechicken.nei.NEIServerUtils; -import codechicken.nei.PositionedStack; -import codechicken.nei.recipe.RecipeInfo; -import codechicken.nei.recipe.TemplateRecipeHandler; -import ellpeck.actuallyadditions.recipe.TreasureChestHandler; -import ellpeck.actuallyadditions.util.ModUtil; -import ellpeck.actuallyadditions.util.StringUtil; -import net.minecraft.client.gui.inventory.GuiContainer; -import net.minecraft.item.ItemStack; -import org.lwjgl.opengl.GL11; - -import java.awt.*; -import java.util.ArrayList; -import java.util.Collections; - -public class TreasureChestRecipeHandler extends TemplateRecipeHandler{ - - public static final String NAME = "actuallyadditions.treasureChest"; - - public TreasureChestRecipeHandler(){ - super(); - RecipeInfo.setGuiOffset(this.getGuiClass(), 0, 0); - } - - 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 getIngredient(){ - return input; - } - - @Override - public PositionedStack getResult(){ - return result; - } - } - - @Override - public int recipiesPerPage(){ - return 2; - } - - @Override - public Class getGuiClass(){ - return null; - } - - @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() == TreasureChestRecipeHandler.class){ - ArrayList recipes = TreasureChestHandler.returns; - for(TreasureChestHandler.Return recipe : recipes){ - arecipes.add(new CachedTreasure(recipe.input, recipe.returnItem, recipe.itemWeight, recipe.minAmount, recipe.maxAmount)); - } - } - else super.loadCraftingRecipes(outputId, results); - } - - @Override - public void loadCraftingRecipes(ItemStack result){ - ArrayList recipes = TreasureChestHandler.returns; - for(TreasureChestHandler.Return recipe : recipes){ - if(NEIServerUtils.areStacksSameType(recipe.returnItem, result)) arecipes.add(new CachedTreasure(recipe.input, recipe.returnItem, recipe.itemWeight, recipe.minAmount, recipe.maxAmount)); - } - } - - @Override - public void loadUsageRecipes(ItemStack ingredient){ - ArrayList recipes = TreasureChestHandler.returns; - for(TreasureChestHandler.Return recipe : recipes){ - if(NEIServerUtils.areStacksSameTypeCrafting(recipe.input, ingredient)){ - CachedTreasure theRecipe = new CachedTreasure(recipe.input, 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_LOWER + ":textures/gui/guiNEISimple.png"; - } - - @Override - public void drawBackground(int recipeIndex){ - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - GuiDraw.changeTexture(getGuiTexture()); - GuiDraw.drawTexturedModalRect(32, 0, 0, 0, 96, 60); - } - - @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_LOWER+".treasureChest.info")+" "+recipe.chance+"%", 65+10, 45, StringUtil.DECIMAL_COLOR_GRAY_TEXT, false); - } - } - - @Override - public String getOverlayIdentifier(){ - return NAME; - } -} \ No newline at end of file diff --git a/src/main/resources/assets/actuallyadditions/textures/gui/guiNEICoffeeMachine.png b/src/main/resources/assets/actuallyadditions/textures/gui/guiNEICoffeeMachine.png deleted file mode 100644 index 45b997d4a4fa9d1831856d05dbf7e801f91d9fbe..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2386 zcmeAS@N?(olHy`uVBq!ia0y~yU<5K58911MRQ8&P5Fo{p?&#~tz_78O`%fY(0|PTd zfKP}kP~6*!WY>SNRmic#@4AmHkJr_`vWhuJ!>^|7P`00Bq{=9cfEZ*c2!SJ-s zb~@JwB@dvgSq&3Hrge03c6b6g(;C!P>Ij}>x$~Z5$A12FiCa$pXL5DC{WjHLOY1+= z^aG1#Obz||YtIAItEve$j1TK$r}m${Q52@1p89i7P2JkK=f%8?XL%}qU6)$%I$=T7 zwfz3i)2HA6tivL*aAoeV^i}^~ZI6_Z=?hn!7Wz}DukQRxJ;wVM%w>|d1b;>U&&>b5 z?Ef=`pnzDWNq3p5@3H^kRh~U};|8{{ZiU5yA6!Z~C88Y`M7S}#N`@U-?)p{kSN-Wi z!8`g7_Qr{(Zk#o>f3=kj>%IH;H`Q?QaCZprk7|v$y85P;-@j))*LX4_+v*=ip3q+9 zeISL!<=*sqi$%Lwe7p`w0R>Jltw?gwX(-w+$GzY*Unb+(^!;y*KYm_#i6=n(!hFWF zbqt|BCo+r|ST5ef_C)`|5?RGn5))T9&Xu-$ak#MCTEW^-X(!@Gj(1&@r3)U++DqH6NqJyU&f`M`q<+nyT5aIep+D`ndx z)X=za;dR%`MIr+Hd53f&^d6tP<}Y^OpxVZhj*Q)}p9Sr>A-hG~Nce(;git{3KgaFP zz78pSzp&=X%gG(GoiMXu+16U7TcrwnG{VnX6;$7zb4T&A>xR7n$GS^pF8nPCW3sTb zG0|zdzWTx8M3zxW8Dzz{fP5yJP>y zyOJM*Std+8&FWLh#`EU#o5wv1otxEnDSwIG@OpFFDr=|bpQE!{|Yy` zIJ6xeWc-)B&y+fc+5LUPn(Gb6g@2uoI^dbJ)%vM_bNYew8K&)W?biF>&ucjOhJDV# z12Xr{e|zAQ#&EQJj-Epu+ZWapd*-4$f>z!KJOhq)L@-R9)53b8yq&e+VG=l2z5EU_ zz1V%2X-9!!h@q00gQ|KWKav4M@OO4qV9awC zctjR6F!1dHVMfvYW|x415+$w?CBgY=CFO}lsSE{)nRz98d8s7|CVB>Xrm3w)sSFHE z37#&FAr*0NuiW)Yb`)U??A`ZY`}lsNS;Ydb88=F(dnS#$