From c9729e978a1b4cd685912ef06da1cabfa928d7cd Mon Sep 17 00:00:00 2001 From: Aidan Brady Date: Sat, 1 Jun 2013 23:20:15 -0400 Subject: [PATCH] Minor cleanup/fix --- src/minecraft/mekanism/common/Mekanism.java | 65 ++++++++++++++------- 1 file changed, 43 insertions(+), 22 deletions(-) diff --git a/src/minecraft/mekanism/common/Mekanism.java b/src/minecraft/mekanism/common/Mekanism.java index 613fd26d6..b747a038c 100644 --- a/src/minecraft/mekanism/common/Mekanism.java +++ b/src/minecraft/mekanism/common/Mekanism.java @@ -980,60 +980,81 @@ public class Mekanism RecipeHandler.addCombinerRecipe(MekanismUtils.getStackWithSize(ore, 8), MekanismUtils.getStackWithSize(OreDictionary.getOres("oreSilver").get(0), 1)); } } catch(Exception e) {} + /** Here we go through every Metallurgy metal set and add recipes to handle the new metals added - * There is no API way to iterate all the metal types, so we use hardcode :( */ - if(hooks.MetallurgyCoreLoaded){ - try{ + * There is no API way to iterate all the metal types, so we use hardcode :( + */ + if(hooks.MetallurgyCoreLoaded) + { + try { String[] setNames = {"base", "precious", "nether", "fantasy", "ender", "utility"}; - for (String setName : setNames ){ - for (IOreInfo oreInfo : MetallurgyAPI.getMetalSet(setName).getOreList().values()){ - switch (oreInfo.getType()) { + + for(String setName : setNames ) + { + for(IOreInfo oreInfo : MetallurgyAPI.getMetalSet(setName).getOreList().values()) + { + switch(oreInfo.getType()) + { /** Alloy metal don't drop, they are only produced by combining other metals * only adding crusher */ - case ALLOY: { - if (oreInfo.getIngot() != null && oreInfo.getDust() != null){ - RecipeHandler.addCrusherRecipe(MekanismUtils.getStackWithSize(oreInfo.getIngot() ,1), MekanismUtils.getStackWithSize(oreInfo.getDust(),1)); + case ALLOY: + { + if(oreInfo.getIngot() != null && oreInfo.getDust() != null) + { + RecipeHandler.addCrusherRecipe(MekanismUtils.getStackWithSize(oreInfo.getIngot(), 1), MekanismUtils.getStackWithSize(oreInfo.getDust(), 1)); } + break; } - /** DROP-type ores normally drop something else then the ore itself, so here we add + /** DROP-type ores normally drop something else then the ore itself, so here we add * bonus items given by enrichment chamber if silk touch or other way gives the player the ore block * Maybe add combiner recipe, but seems pointless now */ - case DROP: { + case DROP: + { ItemStack ore = oreInfo.getOre(); ItemStack drop = oreInfo.getDrop(); - if(drop != null && ore != null){ + + if(drop != null && ore != null) + { RecipeHandler.addEnrichmentChamberRecipe(MekanismUtils.getStackWithSize(ore, 1), MekanismUtils.getStackWithSize(drop, 12)); //maybe combiner recipe too } + break; } - /** For all other types we don't really care, just try the general stencil*/ - default: { + + /** + * For all other types we don't really care, just try the general stencil + */ + default: + { ItemStack ore = oreInfo.getOre(); ItemStack dust = oreInfo.getDust(); ItemStack ingot = oreInfo.getIngot(); - if (ore != null && dust != null){ - RecipeHandler.addEnrichmentChamberRecipe(MekanismUtils.getStackWithSize(ore ,1), MekanismUtils.getStackWithSize(dust,2)); + + if(ore != null && dust != null) + { + RecipeHandler.addEnrichmentChamberRecipe(MekanismUtils.getStackWithSize(ore, 1), MekanismUtils.getStackWithSize(dust, 2)); + RecipeHandler.addCombinerRecipe(MekanismUtils.getStackWithSize(dust, 8), MekanismUtils.getStackWithSize(ore, 1)); } - if (ingot != null && dust != null){ - RecipeHandler.addCrusherRecipe(MekanismUtils.getStackWithSize(ingot ,1), MekanismUtils.getStackWithSize(dust,1)); + + if(ingot != null && dust != null) + { + RecipeHandler.addCrusherRecipe(MekanismUtils.getStackWithSize(ingot, 1), MekanismUtils.getStackWithSize(dust, 1)); } + break; } } } } - } - - catch(Exception e) {} + } catch(Exception e) {} } } - /** * Adds and registers all entities and tile entities. */