diff --git a/src/main/java/ellpeck/actuallyadditions/inventory/GuiHandler.java b/src/main/java/ellpeck/actuallyadditions/inventory/GuiHandler.java index 9cc97eae1..ced525025 100644 --- a/src/main/java/ellpeck/actuallyadditions/inventory/GuiHandler.java +++ b/src/main/java/ellpeck/actuallyadditions/inventory/GuiHandler.java @@ -81,9 +81,9 @@ public class GuiHandler implements IGuiHandler{ case CRAFTER: return new GuiCrafter(entityPlayer); case GRINDER: - return new GuiGrinder(entityPlayer.inventory, tile, false); + return new GuiGrinder(entityPlayer.inventory, tile); case GRINDER_DOUBLE: - return new GuiGrinder(entityPlayer.inventory, tile, true); + return new GuiGrinder.GuiGrinderDouble(entityPlayer.inventory, tile); case FURNACE_DOUBLE: return new GuiFurnaceDouble(entityPlayer.inventory, tile); case INPUTTER: diff --git a/src/main/java/ellpeck/actuallyadditions/inventory/gui/GuiGrinder.java b/src/main/java/ellpeck/actuallyadditions/inventory/gui/GuiGrinder.java index 4ac9f9597..595196f5c 100644 --- a/src/main/java/ellpeck/actuallyadditions/inventory/gui/GuiGrinder.java +++ b/src/main/java/ellpeck/actuallyadditions/inventory/gui/GuiGrinder.java @@ -16,12 +16,22 @@ import java.util.Collections; @SideOnly(Side.CLIENT) public class GuiGrinder extends GuiContainer{ + public static class GuiGrinderDouble extends GuiGrinder{ + public GuiGrinderDouble(InventoryPlayer inventory, TileEntityBase tile){ + super(inventory, tile, true); + } + } + private static final ResourceLocation resLoc = AssetUtil.getGuiLocation("guiGrinder"); private static final ResourceLocation resLocDouble = AssetUtil.getGuiLocation("guiGrinderDouble"); private TileEntityGrinder tileGrinder; private boolean isDouble; - public GuiGrinder(InventoryPlayer inventory, TileEntityBase tile, boolean isDouble){ + public GuiGrinder(InventoryPlayer inventoryPlayer, TileEntityBase tile){ + this(inventoryPlayer, tile, false); + } + + private GuiGrinder(InventoryPlayer inventory, TileEntityBase tile, boolean isDouble){ super(new ContainerGrinder(inventory, tile, isDouble)); this.tileGrinder = (TileEntityGrinder)tile; this.isDouble = isDouble; diff --git a/src/main/java/ellpeck/actuallyadditions/nei/CoffeeMachineRecipeHandler.java b/src/main/java/ellpeck/actuallyadditions/nei/CoffeeMachineRecipeHandler.java index 1d134e88e..ad864cc00 100644 --- a/src/main/java/ellpeck/actuallyadditions/nei/CoffeeMachineRecipeHandler.java +++ b/src/main/java/ellpeck/actuallyadditions/nei/CoffeeMachineRecipeHandler.java @@ -27,7 +27,7 @@ public class CoffeeMachineRecipeHandler extends TemplateRecipeHandler{ public CoffeeMachineRecipeHandler(){ super(); - RecipeInfo.setGuiOffset(this.getGuiClass(), 32, 3); + RecipeInfo.setGuiOffset(this.getGuiClass(), 35, 3); } public class CachedCoffee extends CachedRecipe{ @@ -76,8 +76,8 @@ public class CoffeeMachineRecipeHandler extends TemplateRecipeHandler{ @Override public void loadTransferRects(){ - transferRects.add(new RecipeTransferRect(new Rectangle(21, 39, 22, 16), NAME)); - transferRects.add(new RecipeTransferRect(new Rectangle(67, 42, 22, 10), NAME)); + transferRects.add(new RecipeTransferRect(new Rectangle(20, 39, 20, 16), NAME)); + transferRects.add(new RecipeTransferRect(new Rectangle(64, 42, 23, 10), NAME)); } @Override @@ -136,7 +136,7 @@ public class CoffeeMachineRecipeHandler extends TemplateRecipeHandler{ @Override public void drawExtras(int recipe){ - drawProgressBar(21, 39, 126, 0, 21, 16, 48, 0); + 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); diff --git a/src/main/java/ellpeck/actuallyadditions/nei/CompostRecipeHandler.java b/src/main/java/ellpeck/actuallyadditions/nei/CompostRecipeHandler.java index 4bb42739a..0a6634161 100644 --- a/src/main/java/ellpeck/actuallyadditions/nei/CompostRecipeHandler.java +++ b/src/main/java/ellpeck/actuallyadditions/nei/CompostRecipeHandler.java @@ -92,7 +92,7 @@ public class CompostRecipeHandler extends TemplateRecipeHandler{ @Override public String getGuiTexture(){ - return ModUtil.MOD_ID_LOWER + ":textures/gui/guiNEICompost.png"; + return ModUtil.MOD_ID_LOWER + ":textures/gui/GuiNEISimple.png"; } @Override diff --git a/src/main/java/ellpeck/actuallyadditions/nei/CrusherRecipeHandler.java b/src/main/java/ellpeck/actuallyadditions/nei/CrusherRecipeHandler.java index 4ff756f4a..00e0bc669 100644 --- a/src/main/java/ellpeck/actuallyadditions/nei/CrusherRecipeHandler.java +++ b/src/main/java/ellpeck/actuallyadditions/nei/CrusherRecipeHandler.java @@ -21,10 +21,21 @@ import java.util.List; public class CrusherRecipeHandler extends TemplateRecipeHandler{ - public static final String NAME = "actuallyadditions.crushing"; + 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())); + } + } public CrusherRecipeHandler(){ - super(); RecipeInfo.setGuiOffset(this.getGuiClass(), 0, 0); } @@ -45,7 +56,7 @@ public class CrusherRecipeHandler extends TemplateRecipeHandler{ @Override public List getIngredients(){ - return getCycledIngredients(cycleticks / 48, Collections.singletonList(ingredient)); + return getCycledIngredients(cycleticks/48, Collections.singletonList(ingredient)); } @Override @@ -68,7 +79,7 @@ public class CrusherRecipeHandler extends TemplateRecipeHandler{ @Override public void loadTransferRects(){ - transferRects.add(new RecipeTransferRect(new Rectangle(80, 40, 24, 22), NAME)); + transferRects.add(new RecipeTransferRect(new Rectangle(80, 40, 24, 22), this.getName())); } @Override @@ -78,12 +89,12 @@ public class CrusherRecipeHandler extends TemplateRecipeHandler{ @Override public String getRecipeName(){ - return StatCollector.translateToLocal("container.nei." + NAME + ".name"); + return StatCollector.translateToLocal("container.nei."+this.getName()+".name"); } @Override public void loadCraftingRecipes(String outputId, Object... results){ - if(outputId.equals(NAME) && getClass() == CrusherRecipeHandler.class){ + 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)); @@ -96,7 +107,8 @@ public class CrusherRecipeHandler extends TemplateRecipeHandler{ 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)); + if(NEIServerUtils.areStacksSameType(recipe.firstOutput, result) || NEIServerUtils.areStacksSameType(recipe.secondOutput, result)) + arecipes.add(new CachedCrush(recipe.input, recipe.firstOutput, recipe.secondOutput, recipe.secondChance)); } } @@ -114,7 +126,7 @@ public class CrusherRecipeHandler extends TemplateRecipeHandler{ @Override public String getGuiTexture(){ - return ModUtil.MOD_ID_LOWER + ":textures/gui/guiGrinder.png"; + return ModUtil.MOD_ID_LOWER+":textures/gui/guiGrinder.png"; } @Override @@ -131,13 +143,17 @@ public class CrusherRecipeHandler extends TemplateRecipeHandler{ CachedCrush crush = (CachedCrush)this.arecipes.get(recipe); if(crush.resultTwo != null){ int secondChance = crush.secondChance; - String secondString = secondChance + "%"; + String secondString = secondChance+"%"; GuiDraw.drawString(secondString, 118, 73, StringUtil.DECIMAL_COLOR_GRAY_TEXT, false); } } @Override public String getOverlayIdentifier(){ - return NAME; + return this.getName(); + } + + protected String getName(){ + return "actuallyadditions."+(this instanceof CrusherDoubleRecipeHandler ? "crushingDouble" : "crushing"); } } \ 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 index 9ceaa2d57..90ee8fba2 100644 --- a/src/main/java/ellpeck/actuallyadditions/nei/HairyBallRecipeHandler.java +++ b/src/main/java/ellpeck/actuallyadditions/nei/HairyBallRecipeHandler.java @@ -102,7 +102,7 @@ public class HairyBallRecipeHandler extends TemplateRecipeHandler{ @Override public String getGuiTexture(){ - return ModUtil.MOD_ID_LOWER + ":textures/gui/guiNEIHairyBall.png"; + return ModUtil.MOD_ID_LOWER + ":textures/gui/GuiNEISimple.png"; } @Override diff --git a/src/main/java/ellpeck/actuallyadditions/nei/NEIActuallyAdditionsConfig.java b/src/main/java/ellpeck/actuallyadditions/nei/NEIActuallyAdditionsConfig.java index fe200806e..9f4fdd279 100644 --- a/src/main/java/ellpeck/actuallyadditions/nei/NEIActuallyAdditionsConfig.java +++ b/src/main/java/ellpeck/actuallyadditions/nei/NEIActuallyAdditionsConfig.java @@ -22,6 +22,10 @@ public class NEIActuallyAdditionsConfig implements IConfigureNEI{ API.registerRecipeHandler(crusherRecipeHandler); API.registerUsageHandler(crusherRecipeHandler); + CrusherRecipeHandler.CrusherDoubleRecipeHandler crusherDoubleRecipeHandler = new CrusherRecipeHandler.CrusherDoubleRecipeHandler(); + API.registerRecipeHandler(crusherDoubleRecipeHandler); + API.registerUsageHandler(crusherDoubleRecipeHandler); + HairyBallRecipeHandler ballRecipeHandler = new HairyBallRecipeHandler(); API.registerRecipeHandler(ballRecipeHandler); API.registerUsageHandler(ballRecipeHandler); diff --git a/src/main/java/ellpeck/actuallyadditions/nei/TreasureChestRecipeHandler.java b/src/main/java/ellpeck/actuallyadditions/nei/TreasureChestRecipeHandler.java index e8c62f3a3..5734b4239 100644 --- a/src/main/java/ellpeck/actuallyadditions/nei/TreasureChestRecipeHandler.java +++ b/src/main/java/ellpeck/actuallyadditions/nei/TreasureChestRecipeHandler.java @@ -106,7 +106,7 @@ public class TreasureChestRecipeHandler extends TemplateRecipeHandler{ @Override public String getGuiTexture(){ - return ModUtil.MOD_ID_LOWER + ":textures/gui/guiNEITreasure.png"; + return ModUtil.MOD_ID_LOWER + ":textures/gui/GuiNEISimple.png"; } @Override diff --git a/src/main/resources/assets/actuallyadditions/lang/en_US.lang b/src/main/resources/assets/actuallyadditions/lang/en_US.lang index 783c2e04e..316844d7c 100644 --- a/src/main/resources/assets/actuallyadditions/lang/en_US.lang +++ b/src/main/resources/assets/actuallyadditions/lang/en_US.lang @@ -597,6 +597,7 @@ container.actuallyadditions.enervator.name=Enervator container.actuallyadditions.xpSolidifier.name=Experience Solidifier container.nei.actuallyadditions.crushing.name=Crusher +container.nei.actuallyadditions.crushingDouble.name=Double Crusher container.nei.actuallyadditions.ballOfHair.name=Ball Of Hair Usage container.nei.actuallyadditions.compost.name=Compost diff --git a/src/main/resources/assets/actuallyadditions/textures/gui/guiNEICoffeeMachine.png b/src/main/resources/assets/actuallyadditions/textures/gui/guiNEICoffeeMachine.png index 9316922ce..45b997d4a 100644 Binary files a/src/main/resources/assets/actuallyadditions/textures/gui/guiNEICoffeeMachine.png and b/src/main/resources/assets/actuallyadditions/textures/gui/guiNEICoffeeMachine.png differ diff --git a/src/main/resources/assets/actuallyadditions/textures/gui/guiNEIHairyBall.png b/src/main/resources/assets/actuallyadditions/textures/gui/guiNEIHairyBall.png deleted file mode 100644 index 8f0ac2bc8..000000000 Binary files a/src/main/resources/assets/actuallyadditions/textures/gui/guiNEIHairyBall.png and /dev/null differ diff --git a/src/main/resources/assets/actuallyadditions/textures/gui/guiNEICompost.png b/src/main/resources/assets/actuallyadditions/textures/gui/guiNEISimple.png similarity index 100% rename from src/main/resources/assets/actuallyadditions/textures/gui/guiNEICompost.png rename to src/main/resources/assets/actuallyadditions/textures/gui/guiNEISimple.png diff --git a/src/main/resources/assets/actuallyadditions/textures/gui/guiNEITreasure.png b/src/main/resources/assets/actuallyadditions/textures/gui/guiNEITreasure.png deleted file mode 100644 index 8f0ac2bc8..000000000 Binary files a/src/main/resources/assets/actuallyadditions/textures/gui/guiNEITreasure.png and /dev/null differ