From 7d2f3ec6d2a410498ea4bd77c4d35c0c7be8512b Mon Sep 17 00:00:00 2001 From: Calclavia Date: Mon, 27 Jan 2014 22:28:45 +0800 Subject: [PATCH] Made hammer smashing a "crusher" process --- .../resonantinduction/archaic/engineering/ItemHammer.java | 2 +- .../core/resource/ResourceGenerator.java | 6 +----- .../mechanical/process/TileGrinderWheel.java | 8 ++++++-- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/main/java/resonantinduction/archaic/engineering/ItemHammer.java b/src/main/java/resonantinduction/archaic/engineering/ItemHammer.java index 075f19cb..784830a4 100644 --- a/src/main/java/resonantinduction/archaic/engineering/ItemHammer.java +++ b/src/main/java/resonantinduction/archaic/engineering/ItemHammer.java @@ -40,7 +40,7 @@ public class ItemHammer extends ItemRI { if (!world.isRemote && world.rand.nextFloat() < 0.04) { - Resource[] outputs = MachineRecipes.INSTANCE.getOutput(RecipeType.GRINDER, oreName); + Resource[] outputs = MachineRecipes.INSTANCE.getOutput(RecipeType.CRUSHER, oreName); // TODO: Fix multiple outputs. for (Resource resource : outputs) diff --git a/src/main/java/resonantinduction/core/resource/ResourceGenerator.java b/src/main/java/resonantinduction/core/resource/ResourceGenerator.java index 0beb5808..1869d098 100644 --- a/src/main/java/resonantinduction/core/resource/ResourceGenerator.java +++ b/src/main/java/resonantinduction/core/resource/ResourceGenerator.java @@ -74,12 +74,8 @@ public class ResourceGenerator OreDictionary.registerOre("dustRefined" + name, ResonantInduction.itemRefinedDust.getStackFromDust(materialName)); } - // Add rubble to crushing recipes - // TODO: Change this to CRUSHING when the crusher is finished. - MachineRecipes.INSTANCE.addRecipe(RecipeType.GRINDER, "ore" + name, "rubble" + name); + MachineRecipes.INSTANCE.addRecipe(RecipeType.CRUSHER, "ore" + name, "rubble" + name); MachineRecipes.INSTANCE.addRecipe(RecipeType.GRINDER, "rubble" + name, "dust" + name, "dust" + name); - - // Add dust to mixer recipes, dummy item because mixer doesn't produce any items. MachineRecipes.INSTANCE.addRecipe(RecipeType.MIXER, "dust" + name, "dustRefined" + name); } } diff --git a/src/main/java/resonantinduction/mechanical/process/TileGrinderWheel.java b/src/main/java/resonantinduction/mechanical/process/TileGrinderWheel.java index be84dea1..46e8638c 100644 --- a/src/main/java/resonantinduction/mechanical/process/TileGrinderWheel.java +++ b/src/main/java/resonantinduction/mechanical/process/TileGrinderWheel.java @@ -1,5 +1,7 @@ package resonantinduction.mechanical.process; +import org.apache.commons.lang3.ArrayUtils; + import net.minecraft.entity.item.EntityItem; import net.minecraft.item.ItemBlock; import net.minecraft.item.ItemStack; @@ -113,14 +115,16 @@ public class TileGrinderWheel extends TileMechanical implements IRotatable public boolean canGrind(ItemStack itemStack) { - return MachineRecipes.INSTANCE.getOutput(RecipeType.GRINDER, itemStack) == null ? false : MachineRecipes.INSTANCE.getOutput(RecipeType.GRINDER, itemStack).length > 0; + // TODO: We don't have a crusher yet, so our grinder currently crushes ores. + return MachineRecipes.INSTANCE.getOutput(RecipeType.CRUSHER, itemStack).length > 0 || MachineRecipes.INSTANCE.getOutput(RecipeType.GRINDER, itemStack).length > 0; } private boolean doGrind(EntityItem entity) { ItemStack itemStack = entity.getEntityItem(); - Resource[] results = MachineRecipes.INSTANCE.getOutput(RecipeType.GRINDER, itemStack); + // TODO: Remove this later on when crusher if complete. + Resource[] results = ArrayUtils.addAll(MachineRecipes.INSTANCE.getOutput(RecipeType.CRUSHER, itemStack), MachineRecipes.INSTANCE.getOutput(RecipeType.GRINDER, itemStack)); for (Resource resource : results) {