Minor cleanup/fix

This commit is contained in:
Aidan Brady 2013-06-01 23:20:15 -04:00
parent 81674b19aa
commit c9729e978a

View file

@ -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.
*/