diff options
Diffstat (limited to 'src/Java')
-rw-r--r-- | src/Java/gtPlusPlus/core/item/ModItems.java | 2 | ||||
-rw-r--r-- | src/Java/gtPlusPlus/core/material/MaterialGenerator.java | 109 | ||||
-rw-r--r-- | src/Java/gtPlusPlus/core/util/recipe/RecipeUtils.java | 5 |
3 files changed, 68 insertions, 48 deletions
diff --git a/src/Java/gtPlusPlus/core/item/ModItems.java b/src/Java/gtPlusPlus/core/item/ModItems.java index fd5f7896c2..0060841291 100644 --- a/src/Java/gtPlusPlus/core/item/ModItems.java +++ b/src/Java/gtPlusPlus/core/item/ModItems.java @@ -241,7 +241,7 @@ public final class ModItems { //The large neutron-absorption cross-section of lithium-6 (about 940 barns[5]) as compared with the very small //neutron cross-section of lithium-7 (about 45 millibarns) makes high separation of lithium-7 from natural lithium a //strong requirement for the possible use in lithium fluoride reactors. - MaterialGenerator.generate(ELEMENT.getInstance().LITHIUM7); + MaterialGenerator.generate(ELEMENT.getInstance().LITHIUM7, false); //Production of 233U (through the neutron irradiation of 232Th) invariably produces small amounts of 232U as an impurity //because of parasitic (n,2n) reactions on uranium-233 itself, or on protactinium-233, or on thorium-232: MaterialGenerator.generate(ELEMENT.getInstance().URANIUM232); diff --git a/src/Java/gtPlusPlus/core/material/MaterialGenerator.java b/src/Java/gtPlusPlus/core/material/MaterialGenerator.java index ec6527be50..693a54e5b6 100644 --- a/src/Java/gtPlusPlus/core/material/MaterialGenerator.java +++ b/src/Java/gtPlusPlus/core/material/MaterialGenerator.java @@ -23,75 +23,92 @@ import net.minecraft.item.Item; public class MaterialGenerator { - @SuppressWarnings("unused") public static void generate(final Material matInfo){ + generate(matInfo, true); + } + + public static void generate(final Material matInfo, boolean generateEverything){ String unlocalizedName = matInfo.getUnlocalizedName(); String materialName = matInfo.getLocalizedName(); short[] C = matInfo.getRGBA(); int Colour = Utils.rgbtoHexValue(C[0], C[1], C[2]); boolean hotIngot = matInfo.requiresBlastFurnace(); int materialTier = matInfo.vTier; //TODO - + if (materialTier > 10 || materialTier <= 0){ materialTier = 2; } - + int sRadiation = 0; if (ItemUtils.isRadioactive(materialName)){ sRadiation = ItemUtils.getRadioactivityLevel(materialName); } - - if (sRadiation >= 1){ - Item temp; - Block tempBlock; - tempBlock = new BlockBaseModular(unlocalizedName, materialName,BlockTypes.STANDARD, Colour); - temp = new BaseItemIngot("itemIngot"+unlocalizedName, materialName, Colour, sRadiation); - - temp = new BaseItemDust("itemDust"+unlocalizedName, materialName, matInfo, Colour, "Dust", materialTier, sRadiation); - temp = new BaseItemDust("itemDustTiny"+unlocalizedName, materialName, matInfo, Colour, "Tiny", materialTier, sRadiation); - temp = new BaseItemDust("itemDustSmall"+unlocalizedName, materialName, matInfo, Colour, "Small", materialTier, sRadiation); - temp = new BaseItemNugget(matInfo); - temp = new BaseItemPlate(matInfo); - temp = new BaseItemRod(matInfo); - temp = new BaseItemRodLong(matInfo); - } - - else { + + if (generateEverything == true){ + if (sRadiation >= 1){ + Item temp; + Block tempBlock; + tempBlock = new BlockBaseModular(unlocalizedName, materialName,BlockTypes.STANDARD, Colour); + temp = new BaseItemIngot("itemIngot"+unlocalizedName, materialName, Colour, sRadiation); + + temp = new BaseItemDust("itemDust"+unlocalizedName, materialName, matInfo, Colour, "Dust", materialTier, sRadiation); + temp = new BaseItemDust("itemDustTiny"+unlocalizedName, materialName, matInfo, Colour, "Tiny", materialTier, sRadiation); + temp = new BaseItemDust("itemDustSmall"+unlocalizedName, materialName, matInfo, Colour, "Small", materialTier, sRadiation); + temp = new BaseItemNugget(matInfo); + temp = new BaseItemPlate(matInfo); + temp = new BaseItemRod(matInfo); + temp = new BaseItemRodLong(matInfo); + } + + else { + Item temp; + Block tempBlock; + tempBlock = new BlockBaseModular(unlocalizedName, materialName,BlockTypes.STANDARD, Colour); + tempBlock = new BlockBaseModular(unlocalizedName, materialName,BlockTypes.FRAME, Colour); + temp = new BaseItemIngot("itemIngot"+unlocalizedName, materialName, Colour, sRadiation); + if (hotIngot){ + Item tempIngot = temp; + temp = new BaseItemIngotHot("itemHotIngot"+unlocalizedName, materialName, ItemUtils.getSimpleStack(tempIngot, 1), materialTier); + } + temp = new BaseItemDust("itemDust"+unlocalizedName, materialName, matInfo, Colour, "Dust", materialTier, sRadiation); + temp = new BaseItemDust("itemDustTiny"+unlocalizedName, materialName, matInfo, Colour, "Tiny", materialTier, sRadiation); + temp = new BaseItemDust("itemDustSmall"+unlocalizedName, materialName, matInfo, Colour, "Small", materialTier, sRadiation); + temp = new BaseItemNugget(matInfo); + temp = new BaseItemPlate(matInfo); + temp = new BaseItemPlateDouble(matInfo); + temp = new BaseItemBolt(matInfo); + temp = new BaseItemRod(matInfo); + temp = new BaseItemRodLong(matInfo); + temp = new BaseItemRing(matInfo); + temp = new BaseItemScrew(matInfo); + temp = new BaseItemRotor(matInfo); + temp = new BaseItemGear(matInfo); + } + } else { Item temp; Block tempBlock; tempBlock = new BlockBaseModular(unlocalizedName, materialName,BlockTypes.STANDARD, Colour); tempBlock = new BlockBaseModular(unlocalizedName, materialName,BlockTypes.FRAME, Colour); temp = new BaseItemIngot("itemIngot"+unlocalizedName, materialName, Colour, sRadiation); - if (hotIngot){ - Item tempIngot = temp; - temp = new BaseItemIngotHot("itemHotIngot"+unlocalizedName, materialName, ItemUtils.getSimpleStack(tempIngot, 1), materialTier); - } temp = new BaseItemDust("itemDust"+unlocalizedName, materialName, matInfo, Colour, "Dust", materialTier, sRadiation); temp = new BaseItemDust("itemDustTiny"+unlocalizedName, materialName, matInfo, Colour, "Tiny", materialTier, sRadiation); temp = new BaseItemDust("itemDustSmall"+unlocalizedName, materialName, matInfo, Colour, "Small", materialTier, sRadiation); temp = new BaseItemNugget(matInfo); temp = new BaseItemPlate(matInfo); temp = new BaseItemPlateDouble(matInfo); - temp = new BaseItemBolt(matInfo); - temp = new BaseItemRod(matInfo); - temp = new BaseItemRodLong(matInfo); - temp = new BaseItemRing(matInfo); - temp = new BaseItemScrew(matInfo); - temp = new BaseItemRotor(matInfo); - temp = new BaseItemGear(matInfo); - } - - - - - //Add A jillion Recipes - old code - RecipeGen_Plates.generateRecipes(matInfo); - RecipeGen_Extruder.generateRecipes(matInfo); - RecipeGen_ShapedCrafting.generateRecipes(matInfo); - RecipeGen_DustGeneration.generateRecipes(matInfo); - if (matInfo != ALLOY.ENERGYCRYSTAL && matInfo != ALLOY.BLOODSTEEL) - RecipeGen_BlastSmelter.generateARecipe(matInfo); - - } -} + + } + + + //Add A jillion Recipes - old code + RecipeGen_Plates.generateRecipes(matInfo); + RecipeGen_Extruder.generateRecipes(matInfo); + RecipeGen_ShapedCrafting.generateRecipes(matInfo); + RecipeGen_DustGeneration.generateRecipes(matInfo); + if (matInfo != ALLOY.ENERGYCRYSTAL && matInfo != ALLOY.BLOODSTEEL) + RecipeGen_BlastSmelter.generateARecipe(matInfo); + + } + + } diff --git a/src/Java/gtPlusPlus/core/util/recipe/RecipeUtils.java b/src/Java/gtPlusPlus/core/util/recipe/RecipeUtils.java index d3aebdc759..5951d29c7e 100644 --- a/src/Java/gtPlusPlus/core/util/recipe/RecipeUtils.java +++ b/src/Java/gtPlusPlus/core/util/recipe/RecipeUtils.java @@ -23,7 +23,10 @@ public class RecipeUtils { public static boolean recipeBuilder(Object slot_1, Object slot_2, Object slot_3, Object slot_4, Object slot_5, Object slot_6, Object slot_7, Object slot_8, Object slot_9, ItemStack resultItem){ ArrayList<Object> validSlots = new ArrayList<Object>(); - + if (resultItem == null){ + return false; + } + Utils.LOG_INFO("Trying to add a recipe for "+resultItem.toString()); String a,b,c,d,e,f,g,h,i; if (slot_1 == null){ a = " ";} else { a = "1";validSlots.add('1');validSlots.add(slot_1);} |