From a41f73cf7ae32ae3a6614e260b0948c9815b4f95 Mon Sep 17 00:00:00 2001 From: Ellpeck Date: Wed, 16 Dec 2015 20:06:12 +0100 Subject: [PATCH] Fix some bugs with the crusher --- .../actuallyadditions/crafting/CrusherCrafting.java | 2 +- .../actuallyadditions/tile/TileEntityGrinder.java | 12 ++++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/src/main/java/ellpeck/actuallyadditions/crafting/CrusherCrafting.java b/src/main/java/ellpeck/actuallyadditions/crafting/CrusherCrafting.java index 36a4382be..fea3bd998 100644 --- a/src/main/java/ellpeck/actuallyadditions/crafting/CrusherCrafting.java +++ b/src/main/java/ellpeck/actuallyadditions/crafting/CrusherCrafting.java @@ -77,7 +77,7 @@ public class CrusherCrafting{ CrusherRecipeRegistry.addRecipe(new ItemStack(Blocks.gravel), new ItemStack(Items.flint), new ItemStack(Items.flint), 50); CrusherRecipeRegistry.addRecipe("stone", "cobblestone", 1); - CrusherRecipeRegistry.addRecipe(new ItemStack(InitItems.itemFoods, 1, TheFoods.RICE.ordinal()), new ItemStack(Items.sugar, 1, 2)); + CrusherRecipeRegistry.addRecipe(new ItemStack(InitItems.itemFoods, 1, TheFoods.RICE.ordinal()), new ItemStack(Items.sugar, 2)); miscRecipes.add(Util.GetRecipes.lastCrusherRecipe()); CrusherRecipeRegistry.addRecipe(new ItemStack(Blocks.tallgrass, 1, Util.WILDCARD), new ItemStack(InitItems.itemMisc, 1, TheMiscItems.GREEN_DYE.ordinal())); diff --git a/src/main/java/ellpeck/actuallyadditions/tile/TileEntityGrinder.java b/src/main/java/ellpeck/actuallyadditions/tile/TileEntityGrinder.java index 796a1fe77..1b9ac0028 100644 --- a/src/main/java/ellpeck/actuallyadditions/tile/TileEntityGrinder.java +++ b/src/main/java/ellpeck/actuallyadditions/tile/TileEntityGrinder.java @@ -171,6 +171,12 @@ public class TileEntityGrinder extends TileEntityInventoryBase implements IEnerg List outputTwos = CrusherRecipeRegistry.getOutputTwos(this.slots[theInput]); ItemStack outputTwo = outputTwos == null ? null : outputTwos.get(0); if(outputOne != null){ + if(outputOne.getItemDamage() == Util.WILDCARD){ + outputOne.setItemDamage(0); + } + if(outputTwo != null && outputTwo.getItemDamage() == Util.WILDCARD){ + outputTwo.setItemDamage(0); + } if((this.slots[theFirstOutput] == null || (this.slots[theFirstOutput].isItemEqual(outputOne) && this.slots[theFirstOutput].stackSize <= this.slots[theFirstOutput].getMaxStackSize()-outputOne.stackSize)) && (outputTwo == null || (this.slots[theSecondOutput] == null || (this.slots[theSecondOutput].isItemEqual(outputTwo) && this.slots[theSecondOutput].stackSize <= this.slots[theSecondOutput].getMaxStackSize()-outputTwo.stackSize)))){ return true; } @@ -193,6 +199,9 @@ public class TileEntityGrinder extends TileEntityInventoryBase implements IEnerg if(outputOnes != null){ ItemStack outputOne = outputOnes.get(0); if(outputOne != null){ + if(outputOne.getItemDamage() == Util.WILDCARD){ + outputOne.setItemDamage(0); + } if(this.slots[theFirstOutput] == null){ this.slots[theFirstOutput] = outputOne.copy(); } @@ -206,6 +215,9 @@ public class TileEntityGrinder extends TileEntityInventoryBase implements IEnerg if(outputTwos != null){ ItemStack outputTwo = outputTwos.get(0); if(outputTwo != null){ + if(outputTwo.getItemDamage() == Util.WILDCARD){ + outputTwo.setItemDamage(0); + } int rand = Util.RANDOM.nextInt(100)+1; if(rand <= CrusherRecipeRegistry.getOutputTwoChance(this.slots[theInput])){ if(this.slots[theSecondOutput] == null){