diff options
Diffstat (limited to 'src/Java/gtPlusPlus')
8 files changed, 170 insertions, 32 deletions
diff --git a/src/Java/gtPlusPlus/core/item/ModItems.java b/src/Java/gtPlusPlus/core/item/ModItems.java index 6b85e90d08..9e82297bc3 100644 --- a/src/Java/gtPlusPlus/core/item/ModItems.java +++ b/src/Java/gtPlusPlus/core/item/ModItems.java @@ -381,6 +381,7 @@ public final class ModItems { //Steels + MaterialGenerator.generateDusts(ALLOY.EGLIN_STEEL_BASE); MaterialGenerator.generate(ALLOY.EGLIN_STEEL); MaterialGenerator.generate(ALLOY.MARAGING250); MaterialGenerator.generate(ALLOY.MARAGING300); diff --git a/src/Java/gtPlusPlus/core/item/base/BaseItemComponent.java b/src/Java/gtPlusPlus/core/item/base/BaseItemComponent.java index 54be041972..22db669020 100644 --- a/src/Java/gtPlusPlus/core/item/base/BaseItemComponent.java +++ b/src/Java/gtPlusPlus/core/item/base/BaseItemComponent.java @@ -168,7 +168,7 @@ public class BaseItemComponent extends Item{ @Override public void onUpdate(final ItemStack iStack, final World world, final Entity entityHolding, final int p_77663_4_, final boolean p_77663_5_) { if (this.componentMaterial != null){ - EntityUtils.applyRadiationDamageToEntity(this.componentMaterial.vRadioationLevel, world, entityHolding); + EntityUtils.applyRadiationDamageToEntity(this.componentMaterial.vRadiationLevel, world, entityHolding); } } diff --git a/src/Java/gtPlusPlus/core/item/base/dusts/BaseItemDust.java b/src/Java/gtPlusPlus/core/item/base/dusts/BaseItemDust.java index eb86f995d3..adc9f8a62a 100644 --- a/src/Java/gtPlusPlus/core/item/base/dusts/BaseItemDust.java +++ b/src/Java/gtPlusPlus/core/item/base/dusts/BaseItemDust.java @@ -29,7 +29,11 @@ public class BaseItemDust extends Item{ private final int mTier; private final Material dustInfo; - public BaseItemDust(final String unlocalizedName, final String materialName, final Material matInfo, final int colour, final String pileSize, final int tier, final int sRadioactivity) { + public BaseItemDust(final String unlocalizedName, final String materialName, final Material matInfo, final int colour, final String pileSize, final int tier, final int sRadioactivity){ + this(unlocalizedName, materialName, matInfo, colour, pileSize, tier, sRadioactivity, true); + } + + public BaseItemDust(String unlocalizedName, String materialName, Material matInfo, int colour, String pileSize, int tier, int sRadioactivity, boolean addRecipes) { this.setUnlocalizedName(unlocalizedName); this.setUnlocalizedName(unlocalizedName); this.setMaxStackSize(64); @@ -67,8 +71,10 @@ public class BaseItemDust extends Item{ if ((temp != null) && !temp.equals("")){ GT_OreDictUnificator.registerOre(temp, ItemUtils.getSimpleStack(this)); } - this.addFurnaceRecipe(); - this.addMacerationRecipe(); + if (addRecipes){ + this.addFurnaceRecipe(); + this.addMacerationRecipe(); + } } private String getCorrectTexture(final String pileSize){ @@ -264,13 +270,13 @@ public class BaseItemDust extends Item{ Utils.LOG_INFO("Found "+input2.getDisplayName()); } }*/ - + int timeTaken = 250*this.mTier*20; - + if (this.mTier <= 4){ timeTaken = 50*this.mTier*20; } - + GT_Values.RA.addBlastRecipe( input1, input2, diff --git a/src/Java/gtPlusPlus/core/material/ALLOY.java b/src/Java/gtPlusPlus/core/material/ALLOY.java index d7a4bd4d3c..63ceb2e272 100644 --- a/src/Java/gtPlusPlus/core/material/ALLOY.java +++ b/src/Java/gtPlusPlus/core/material/ALLOY.java @@ -506,6 +506,23 @@ public final class ALLOY { new MaterialStack(ELEMENT.getInstance().HYDROGEN, 10) }); //Material Stacks with Percentage of required elements. + public static final Material EGLIN_STEEL_BASE = new Material( + "Eglin Steel Base Compound", //Material Name + MaterialState.SOLID, //State + new short[]{139,69,19, 0}, //Material Colour + -1, //Melting Point in C + -1, //Boiling Point in C + -1, + -1, + false, //Uses Blast furnace? + //Material Stacks with Percentage of required elements. + new MaterialStack[]{ + new MaterialStack(ELEMENT.getInstance().NICKEL, 5), + new MaterialStack(ELEMENT.getInstance().ALUMINIUM, 1), + new MaterialStack(ELEMENT.getInstance().CHROMIUM, 1), + new MaterialStack(ELEMENT.getInstance().IRON, 23) + }); + public static final Material EGLIN_STEEL = new Material( "Eglin Steel", //Material Name MaterialState.SOLID, //State @@ -517,10 +534,10 @@ public final class ALLOY { true, //Uses Blast furnace? //Material Stacks with Percentage of required elements. new MaterialStack[]{ - new MaterialStack(ALLOY.STEEL, 20), + new MaterialStack(ALLOY.EGLIN_STEEL_BASE, 10), new MaterialStack(ELEMENT.getInstance().SULFUR, 1), - new MaterialStack(ELEMENT.getInstance().NICKEL, 5), new MaterialStack(ELEMENT.getInstance().SILICON, 4), + new MaterialStack(ELEMENT.getInstance().CARBON, 1) }); diff --git a/src/Java/gtPlusPlus/core/material/Material.java b/src/Java/gtPlusPlus/core/material/Material.java index b5fd2da087..c4f49706e8 100644 --- a/src/Java/gtPlusPlus/core/material/Material.java +++ b/src/Java/gtPlusPlus/core/material/Material.java @@ -38,7 +38,7 @@ public class Material { private final boolean usesBlastFurnace; public final boolean isRadioactive; - public final byte vRadioationLevel; + public final byte vRadiationLevel; private final int meltingPointK; private final int boilingPointK; @@ -179,11 +179,11 @@ public class Material { //Sets the Rad level if (radiationLevel != 0){ this.isRadioactive = true; - this.vRadioationLevel = (byte) radiationLevel; + this.vRadiationLevel = (byte) radiationLevel; } else { this.isRadioactive = false; - this.vRadioationLevel = (byte) radiationLevel; + this.vRadiationLevel = (byte) radiationLevel; } //Sets the materials 'tier'. Will probably replace this logic. diff --git a/src/Java/gtPlusPlus/core/material/MaterialGenerator.java b/src/Java/gtPlusPlus/core/material/MaterialGenerator.java index d4ed2c3be8..fd53a9be4d 100644 --- a/src/Java/gtPlusPlus/core/material/MaterialGenerator.java +++ b/src/Java/gtPlusPlus/core/material/MaterialGenerator.java @@ -33,7 +33,6 @@ public class MaterialGenerator { generate(matInfo, generateEverything, true); } - @SuppressWarnings("unused") public static void generate(final Material matInfo, final boolean generateEverything, final boolean generateBlastSmelterRecipes){ final String unlocalizedName = matInfo.getUnlocalizedName(); final String materialName = matInfo.getLocalizedName(); @@ -47,8 +46,8 @@ public class MaterialGenerator { } int sRadiation = 0; - if (ItemUtils.isRadioactive(materialName)){ - sRadiation = matInfo.vRadioationLevel; + if (ItemUtils.isRadioactive(materialName) || matInfo.vRadiationLevel != 0){ + sRadiation = matInfo.vRadiationLevel; } if (matInfo.getState() == MaterialState.SOLID){ @@ -128,6 +127,35 @@ public class MaterialGenerator { RecipeGen_ShapedCrafting.generateRecipes(matInfo); } + + public static void generateDusts(final Material matInfo){ + final String unlocalizedName = matInfo.getUnlocalizedName(); + final String materialName = matInfo.getLocalizedName(); + final short[] C = matInfo.getRGBA(); + final int Colour = Utils.rgbtoHexValue(C[0], C[1], C[2]); + int materialTier = matInfo.vTier; //TODO + + if ((materialTier > 10) || (materialTier <= 0)){ + materialTier = 2; + } + + int sRadiation = 0; + if (ItemUtils.isRadioactive(materialName) || matInfo.vRadiationLevel != 0){ + sRadiation = matInfo.vRadiationLevel; + } + + if (matInfo.getState() == MaterialState.SOLID){ + Item temp; + temp = new BaseItemDust("itemDust"+unlocalizedName, materialName, matInfo, Colour, "Dust", materialTier, sRadiation, false); + temp = new BaseItemDust("itemDustTiny"+unlocalizedName, materialName, matInfo, Colour, "Tiny", materialTier, sRadiation, false); + temp = new BaseItemDust("itemDustSmall"+unlocalizedName, materialName, matInfo, Colour, "Small", materialTier, sRadiation, false); + } + + //Add A jillion Recipes - old code + RecipeGen_DustGeneration.addMixerRecipe_Standalone(matInfo); + RecipeGen_Fluids.generateRecipes(matInfo); + } + public static void generateNuclearMaterial(final Material matInfo){ generateNuclearMaterial(matInfo, true); } @@ -140,8 +168,8 @@ public class MaterialGenerator { final int Colour = Utils.rgbtoHexValue(C[0], C[1], C[2]); int sRadiation = 0; - if (matInfo.vRadioationLevel != 0){ - sRadiation = matInfo.vRadioationLevel; + if (matInfo.vRadiationLevel != 0){ + sRadiation = matInfo.vRadiationLevel; } Item temp; diff --git a/src/Java/gtPlusPlus/core/util/item/ItemUtils.java b/src/Java/gtPlusPlus/core/util/item/ItemUtils.java index 1fcfa71fe8..b98a54cb6d 100644 --- a/src/Java/gtPlusPlus/core/util/item/ItemUtils.java +++ b/src/Java/gtPlusPlus/core/util/item/ItemUtils.java @@ -25,6 +25,7 @@ import gtPlusPlus.core.util.array.Pair; import gtPlusPlus.core.util.materials.MaterialUtils; import gtPlusPlus.core.util.reflect.ReflectionUtils; import gtPlusPlus.core.util.wrapper.var; +import gtPlusPlus.xmod.gregtech.loaders.RecipeGen_DustGeneration; import net.minecraft.block.Block; import net.minecraft.item.Item; import net.minecraft.item.Item.ToolMaterial; @@ -320,6 +321,9 @@ public class ItemUtils { new BaseItemDustUnique("itemDust"+unlocalizedName, materialName, Colour, "Dust") }; } + + RecipeGen_DustGeneration.generateRecipes(material); + return output; } diff --git a/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_DustGeneration.java b/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_DustGeneration.java index 9f6310a8b7..a8a4cf963f 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_DustGeneration.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_DustGeneration.java @@ -157,41 +157,123 @@ public class RecipeGen_DustGeneration implements Runnable{ } } - + //Add mixer Recipe if (GT_Values.RA.addMixerRecipe( - input1, input2, - input3, input4, - oxygen, - null, - outputStacks, - (int) Math.max(material.getMass() * 2L * 1, 1), - 2 * material.vVoltageMultiplier)) //Was 6, but let's try 2. This makes Potin LV, for example. + input1, input2, + input3, input4, + oxygen, + null, + outputStacks, + (int) Math.max(material.getMass() * 2L * 1, 1), + 2 * material.vVoltageMultiplier)) //Was 6, but let's try 2. This makes Potin LV, for example. { Utils.LOG_INFO("Dust Mixer Recipe: "+material.getLocalizedName()+" - Success"); } else { Utils.LOG_INFO("Dust Mixer Recipe: "+material.getLocalizedName()+" - Failed"); } - + //Add Shapeless recipe for low tier alloys. if (tVoltageMultiplier <= 30){ if (RecipeUtils.addShapedGregtechRecipe(inputStacks, outputStacks)){ - Utils.LOG_INFO("Dust Shapeless Recipe: "+material.getLocalizedName()+" - Success"); - } - else { - Utils.LOG_INFO("Dust Shapeless Recipe: "+material.getLocalizedName()+" - Failed"); - } - } + Utils.LOG_INFO("Dust Shapeless Recipe: "+material.getLocalizedName()+" - Success"); + } + else { + Utils.LOG_INFO("Dust Shapeless Recipe: "+material.getLocalizedName()+" - Failed"); } } } + } + } + + + } + + public static boolean addMixerRecipe_Standalone(Material material){ + final ItemStack[] inputStacks = material.getMaterialComposites(); + final ItemStack outputStacks = material.getDust(material.smallestStackSizeWhenProcessing); + //Is this a composite? + if ((inputStacks != null)){ + //Is this a composite? + Utils.LOG_INFO("mixer length: "+inputStacks.length); + if ((inputStacks.length >= 1) && (inputStacks.length <= 4)){ + //Log Input items + Utils.LOG_WARNING(ItemUtils.getArrayStackNames(inputStacks)); + final long[] inputStackSize = material.vSmallestRatio; + Utils.LOG_INFO("mixer is stacksizeVar not null? "+(inputStackSize != null)); + //Is smallest ratio invalid? + if (inputStackSize != null){ + //set stack sizes on an input ItemStack[] + for (short x=0;x<inputStacks.length;x++){ + if ((inputStacks[x] != null) && (inputStackSize[x] != 0)){ + inputStacks[x].stackSize = (int) inputStackSize[x]; + } + } + //Relog input values, with stack sizes + Utils.LOG_INFO(ItemUtils.getArrayStackNames(inputStacks)); + + //Get us four ItemStacks to input into the mixer + ItemStack input1, input2, input3, input4; + input1 = (inputStacks.length >= 1) ? (input1 = (inputStacks[0] == null) ? null : inputStacks[0]) : null; + input2 = (inputStacks.length >= 2) ? (input2 = (inputStacks[1] == null) ? null : inputStacks[1]) : null; + input3 = (inputStacks.length >= 3) ? (input3 = (inputStacks[2] == null) ? null : inputStacks[2]) : null; + input4 = (inputStacks.length >= 4) ? (input4 = (inputStacks[3] == null) ? null : inputStacks[3]) : null; + + //Add mixer Recipe + + FluidStack oxygen = GT_Values.NF; + if (material.getComposites() != null){ + for (final MaterialStack x : material.getComposites()){ + if (!material.getComposites().isEmpty()){ + if (x != null){ + if (x.getStackMaterial() != null){ + if (x.getStackMaterial().getDust(1) == null){ + if (x.getStackMaterial().getState() == MaterialState.GAS){ + oxygen = x.getStackMaterial().getFluid(1000); + } + } + } + } + } + } + } + //Add mixer Recipe + if (GT_Values.RA.addMixerRecipe( + input1, input2, + input3, input4, + oxygen, + null, + outputStacks, + (int) Math.max(material.getMass() * 2L * 1, 1), + 2 * material.vVoltageMultiplier)) //Was 6, but let's try 2. This makes Potin LV, for example. + { + Utils.LOG_INFO("Dust Mixer Recipe: "+material.getLocalizedName()+" - Success"); + return true; + } + else { + Utils.LOG_INFO("Dust Mixer Recipe: "+material.getLocalizedName()+" - Failed"); + return false; + } + } + else { + Utils.LOG_INFO("inputStackSize == NUll - "+material.getLocalizedName()); + } + } + else { + Utils.LOG_INFO("InputStacks is out range 1-4 - "+material.getLocalizedName()); + } + } + else { + Utils.LOG_INFO("InputStacks == NUll - "+material.getLocalizedName()); + } + return false; } } |