aboutsummaryrefslogtreecommitdiff
path: root/src/Java/gtPlusPlus/core/material
diff options
context:
space:
mode:
authorDraknyte1 <Draknyte1@hotmail.com>2016-12-24 13:28:40 +1000
committerDraknyte1 <Draknyte1@hotmail.com>2016-12-24 13:28:40 +1000
commit733e82642363da011097666f91048b4da3c051eb (patch)
tree172489cb7b13f692a097e71f94f15c97677af145 /src/Java/gtPlusPlus/core/material
parent9517bb948d41dfe0fe7a7db7493d083c495076c1 (diff)
downloadGT5-Unofficial-733e82642363da011097666f91048b4da3c051eb.tar.gz
GT5-Unofficial-733e82642363da011097666f91048b4da3c051eb.tar.bz2
GT5-Unofficial-733e82642363da011097666f91048b4da3c051eb.zip
$ Fixed an issue where recipeBuilder() could fail with a null.
+ Added a new constructor to material/MaterialGenerator.java which allows a true/false on what parts get generated. The old constructor was not removed, it just defaults to true for all parts to be generated. - Removed Lithium-7 Rotors, Screws, Rods, Long Rods, Gears, Bolts & Rings as a result of the previous addition. + Added some missing textures.
Diffstat (limited to 'src/Java/gtPlusPlus/core/material')
-rw-r--r--src/Java/gtPlusPlus/core/material/MaterialGenerator.java109
1 files changed, 63 insertions, 46 deletions
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);
+
+ }
+
+ }