aboutsummaryrefslogtreecommitdiff
path: root/src/Java/gtPlusPlus/core
diff options
context:
space:
mode:
authorDraknyte1 <Draknyte1@hotmail.com>2016-10-24 06:03:19 +1000
committerDraknyte1 <Draknyte1@hotmail.com>2016-10-24 06:03:19 +1000
commit4937f40b30d4d2ce381332b0ab5b83ddabb274b0 (patch)
treef95bf560f71e03476ff11a144329d646aba1886a /src/Java/gtPlusPlus/core
parent6105925bfec6d55b22a88e89e6d9e2549390bd86 (diff)
downloadGT5-Unofficial-4937f40b30d4d2ce381332b0ab5b83ddabb274b0.tar.gz
GT5-Unofficial-4937f40b30d4d2ce381332b0ab5b83ddabb274b0.tar.bz2
GT5-Unofficial-4937f40b30d4d2ce381332b0ab5b83ddabb274b0.zip
+ Basically rewrote dust recipe handling.
$ Fixed Ring recipes using a Wrench instead of a Hard hammer. % Adjusted some Alloy compositions, however, this has caused some overlaps which will need to be adjusted again. (Zeron, Hastelloy X/W, MS 300/350)
Diffstat (limited to 'src/Java/gtPlusPlus/core')
-rw-r--r--src/Java/gtPlusPlus/core/item/base/dusts/BaseItemDust.java75
-rw-r--r--src/Java/gtPlusPlus/core/material/ALLOY.java59
-rw-r--r--src/Java/gtPlusPlus/core/material/Material.java38
-rw-r--r--src/Java/gtPlusPlus/core/util/item/UtilsItems.java2
4 files changed, 62 insertions, 112 deletions
diff --git a/src/Java/gtPlusPlus/core/item/base/dusts/BaseItemDust.java b/src/Java/gtPlusPlus/core/item/base/dusts/BaseItemDust.java
index be020b7d05..7638da6f0a 100644
--- a/src/Java/gtPlusPlus/core/item/base/dusts/BaseItemDust.java
+++ b/src/Java/gtPlusPlus/core/item/base/dusts/BaseItemDust.java
@@ -9,7 +9,6 @@ import gtPlusPlus.core.material.Material;
import gtPlusPlus.core.util.Utils;
import gtPlusPlus.core.util.item.UtilsItems;
import gtPlusPlus.core.util.math.MathUtils;
-import gtPlusPlus.core.util.recipe.UtilsRecipe;
import java.util.List;
@@ -72,7 +71,6 @@ public class BaseItemDust extends Item{
oredictName = temp;
GT_OreDictUnificator.registerOre(temp, UtilsItems.getSimpleStack(this));
}
- addMixerRecipe();
addFurnaceRecipe();
addMacerationRecipe();
}
@@ -133,79 +131,6 @@ public class BaseItemDust extends Item{
}
-
-
- private void addMixerRecipe(){
-
- ItemStack thisItem;
- ItemStack normalDust = dustInfo.getDust(1);
- ItemStack smallDust = dustInfo.getSmallDust(1);
- ItemStack tinyDust = dustInfo.getTinyDust(1);
-
- ItemStack[] inputStacks = dustInfo.getMaterialComposites();
- ItemStack outputStacks = dustInfo.getDust(10);
-
- if (oredictName.contains("dustTiny")){
- thisItem = tinyDust;
- ItemStack normalStack = dustInfo.getDust(1);
- ItemStack tinyStack = dustInfo.getTinyDust(9);
- Utils.LOG_INFO("Generating a 9 Tiny dust to 1 Dust recipe for "+materialName);
- UtilsRecipe.recipeBuilder(
- thisItem, thisItem, thisItem,
- thisItem, thisItem, thisItem,
- thisItem, thisItem, thisItem,
- normalStack);
-
- Utils.LOG_INFO("Generating a 9 Tiny dust from 1 Dust recipe for "+materialName);
- UtilsRecipe.recipeBuilder(
- normalStack, null, null,
- null, null, null,
- null, null, null,
- tinyStack);
-
- }
- else if (oredictName.contains("dustSmall")){
- thisItem = smallDust;
- ItemStack normalStack = dustInfo.getDust(1);
- ItemStack smallStack = dustInfo.getSmallDust(4);
-
- Utils.LOG_INFO("Generating a 4 Small dust to 1 Dust recipe for "+materialName);
- UtilsRecipe.recipeBuilder(
- thisItem, thisItem, null,
- thisItem, thisItem, null,
- null, null, null,
- normalStack);
-
- Utils.LOG_INFO("Generating a 4 Small dust from 1 Dust recipe for "+materialName);
- UtilsRecipe.recipeBuilder(
- null, normalStack, null,
- null, null, null,
- null, null, null,
- smallStack);
-
- }
- else {
- thisItem = normalDust;
- }
-
- if (thisItem == normalDust){
- Utils.LOG_WARNING("Generating a Dust recipe for "+materialName+" in the mixer.");
-
- if (inputStacks.length != 0){
- GT_Values.RA.addMixerRecipe(
- inputStacks[0], inputStacks[1],
- inputStacks[2], inputStacks[3],
- null, null,
- outputStacks,
- 8*mTier*20, 8*mTier*2);
- }
- else {
- return;
- }
- }
- }
-
-
private void addMacerationRecipe(){
Utils.LOG_WARNING("Adding recipe for "+materialName+" Dusts");
diff --git a/src/Java/gtPlusPlus/core/material/ALLOY.java b/src/Java/gtPlusPlus/core/material/ALLOY.java
index 0aa819ee48..ea5b90259f 100644
--- a/src/Java/gtPlusPlus/core/material/ALLOY.java
+++ b/src/Java/gtPlusPlus/core/material/ALLOY.java
@@ -35,7 +35,8 @@ public final class ALLOY {
true, //Uses Blast furnace?
//Material Stacks with Percentage of required elements.
new MaterialStack[]{
- new MaterialStack(ELEMENT.URANIUM, 90),
+ new MaterialStack(ELEMENT.URANIUM, 45),
+ new MaterialStack(ELEMENT.URANIUM, 45),
new MaterialStack(ELEMENT.TITANIUM, 10)
});
@@ -49,9 +50,9 @@ public final class ALLOY {
true, //Uses Blast furnace?
//Material Stacks with Percentage of required elements.
new MaterialStack[]{
- new MaterialStack(ELEMENT.TUNGSTEN, 7),
- new MaterialStack(ELEMENT.TANTALUM, 90),
- new MaterialStack(ELEMENT.TANTALUM, 2)
+ new MaterialStack(ELEMENT.TUNGSTEN, 8),
+ new MaterialStack(ELEMENT.TANTALUM, 46),
+ new MaterialStack(ELEMENT.TANTALUM, 46)
});
public static final Material TANTALLOY_61 = new Material(
@@ -64,10 +65,10 @@ public final class ALLOY {
true, //Uses Blast furnace?
//Material Stacks with Percentage of required elements.
new MaterialStack[]{
- new MaterialStack(ELEMENT.TUNGSTEN, 10),
- new MaterialStack(ELEMENT.TANTALUM, 70),
- new MaterialStack(ELEMENT.TITANIUM, 10),
- new MaterialStack(ELEMENT.YTTRIUM, 10)
+ new MaterialStack(ELEMENT.TUNGSTEN, 20),
+ new MaterialStack(ELEMENT.TANTALUM, 60),
+ new MaterialStack(ELEMENT.TITANIUM, 12),
+ new MaterialStack(ELEMENT.YTTRIUM, 8)
});
public static final Material QUANTUM = new Material(
@@ -91,7 +92,8 @@ public final class ALLOY {
false, //Uses Blast furnace?
//Material Stacks with Percentage of required elements.
new MaterialStack[]{
- new MaterialStack(ELEMENT.COPPER, 75),
+ new MaterialStack(ELEMENT.COPPER, 35),
+ new MaterialStack(ELEMENT.COPPER, 40),
new MaterialStack(ELEMENT.TIN, 25)
});
@@ -105,7 +107,8 @@ public final class ALLOY {
false, //Uses Blast furnace?
//Material Stacks with Percentage of required elements.
new MaterialStack[]{
- new MaterialStack(ELEMENT.GOLD, 70),
+ new MaterialStack(ELEMENT.GOLD, 30),
+ new MaterialStack(ELEMENT.GOLD, 40),
new MaterialStack(ELEMENT.COPPER, 30)
});
@@ -193,8 +196,10 @@ public final class ALLOY {
true, //Uses Blast furnace?
//Material Stacks with Percentage of required elements.
new MaterialStack[]{
- new MaterialStack(ELEMENT.CARBON, 05),
- new MaterialStack(ELEMENT.IRON, 95)
+ new MaterialStack(ELEMENT.CARBON, 10),
+ new MaterialStack(ELEMENT.IRON, 30),
+ new MaterialStack(ELEMENT.IRON, 30),
+ new MaterialStack(ELEMENT.IRON, 30)
});
public static final Material ZERON_100 = new Material(
@@ -224,9 +229,9 @@ public final class ALLOY {
//Material Stacks with Percentage of required elements.
new MaterialStack[]{
new MaterialStack(ELEMENT.TITANIUM, 5),
- new MaterialStack(ELEMENT.NICKEL, 16),
- new MaterialStack(ELEMENT.COBALT, 9),
- new MaterialStack(ALLOY.STEEL, 70)
+ new MaterialStack(ELEMENT.NICKEL, 25),
+ new MaterialStack(ELEMENT.COBALT, 10),
+ new MaterialStack(ALLOY.STEEL, 60)
});
public static final Material MARAGING300 = new Material(
@@ -240,8 +245,8 @@ public final class ALLOY {
//Material Stacks with Percentage of required elements.
new MaterialStack[]{
new MaterialStack(ELEMENT.TITANIUM, 10),
- new MaterialStack(ELEMENT.NICKEL, 21),
- new MaterialStack(ELEMENT.COBALT, 14),
+ new MaterialStack(ELEMENT.NICKEL, 20),
+ new MaterialStack(ELEMENT.COBALT, 15),
new MaterialStack(ALLOY.STEEL, 55)
});
@@ -256,8 +261,8 @@ public final class ALLOY {
//Material Stacks with Percentage of required elements.
new MaterialStack[]{
new MaterialStack(ELEMENT.TITANIUM, 15),
- new MaterialStack(ELEMENT.NICKEL, 21),
- new MaterialStack(ELEMENT.COBALT, 9),
+ new MaterialStack(ELEMENT.NICKEL, 20),
+ new MaterialStack(ELEMENT.COBALT, 10),
new MaterialStack(ALLOY.STEEL, 55)
});
@@ -305,8 +310,8 @@ public final class ALLOY {
new MaterialStack[]{
new MaterialStack(ELEMENT.IRON, 06),
new MaterialStack(ELEMENT.MOLYBDENUM, 24),
- new MaterialStack(ELEMENT.CHROMIUM, 5),
- new MaterialStack(ELEMENT.NICKEL, 65)
+ new MaterialStack(ELEMENT.CHROMIUM, 8),
+ new MaterialStack(ELEMENT.NICKEL, 62)
});
/*public static final Material HASTELLOY_X = new Material(
@@ -351,10 +356,10 @@ public final class ALLOY {
true, //Uses Blast furnace?
//Material Stacks with Percentage of required elements.
new MaterialStack[]{
- new MaterialStack(ELEMENT.YTTRIUM, 05),
+ new MaterialStack(ELEMENT.YTTRIUM, 10),
new MaterialStack(ELEMENT.MOLYBDENUM, 16),
- new MaterialStack(ELEMENT.CHROMIUM, 7),
- new MaterialStack(ELEMENT.NICKEL, 72)
+ new MaterialStack(ELEMENT.CHROMIUM, 10),
+ new MaterialStack(ELEMENT.NICKEL, 64)
});
public static final Material HASTELLOY_C276 = new Material(
@@ -415,10 +420,10 @@ public final class ALLOY {
true, //Uses Blast furnace?
//Material Stacks with Percentage of required elements.
new MaterialStack[]{
- new MaterialStack(ELEMENT.IRON, 75),
- new MaterialStack(ELEMENT.ALUMINIUM, 4),
+ new MaterialStack(ELEMENT.IRON, 64),
+ new MaterialStack(ELEMENT.ALUMINIUM, 12),
new MaterialStack(ELEMENT.CHROMIUM, 20),
- new MaterialStack(ELEMENT.YTTRIUM, 1)
+ new MaterialStack(ELEMENT.YTTRIUM, 4)
});
public static final Material TUNGSTEN_CARBIDE = new Material(
diff --git a/src/Java/gtPlusPlus/core/material/Material.java b/src/Java/gtPlusPlus/core/material/Material.java
index 44a8c021f9..3190486537 100644
--- a/src/Java/gtPlusPlus/core/material/Material.java
+++ b/src/Java/gtPlusPlus/core/material/Material.java
@@ -6,10 +6,6 @@ import gtPlusPlus.core.util.Utils;
import gtPlusPlus.core.util.item.UtilsItems;
import gtPlusPlus.core.util.materials.MaterialUtils;
import gtPlusPlus.core.util.math.MathUtils;
-
-import java.util.ArrayList;
-import java.util.List;
-
import net.minecraft.item.ItemStack;
public class Material {
@@ -20,7 +16,7 @@ public class Material {
protected Object dataVar;
private MaterialStack[] materialInput = new MaterialStack[4];
- final List<MaterialStack> mMaterialList = new ArrayList<MaterialStack>();
+ public final long[] vSmallestRatio;
final short[] RGBA;
@@ -35,7 +31,7 @@ public class Material {
final long vProtons;
final long vNeutrons;
final long vMass;
- final int smallestStackSizeWhenProcessing; //Add a check for <=0 || > 64
+ public final int smallestStackSizeWhenProcessing; //Add a check for <=0 || > 64
public final int vTier;
public final int vVoltageMultiplier;
public final String vChemicalFormula;
@@ -65,14 +61,14 @@ public class Material {
this.vNeutrons = neutrons;
this.vMass = getMass();
- //List<MaterialStack> inputArray = Arrays.asList(inputs);
+ /*//List<MaterialStack> inputArray = Arrays.asList(inputs);
int tempSmallestSize = getSmallestStackForCrafting(inputs);
if (tempSmallestSize <= 64 && tempSmallestSize >= 1){
this.smallestStackSizeWhenProcessing = tempSmallestSize; //Valid stacksizes
}
else {
this.smallestStackSizeWhenProcessing = 50; //Can divide my math by 1/2 and round it~
- }
+ }*/
//Sets the Rad level
if (radiationLevel != 0){
@@ -134,6 +130,28 @@ public class Material {
}
}
}
+
+ this.vSmallestRatio = getSmallestRatio(materialInput);
+ int tempSmallestSize = 0;
+
+ if (vSmallestRatio != null){
+ for (int v=0;v<this.vSmallestRatio.length;v++){
+ tempSmallestSize=(int) (tempSmallestSize+vSmallestRatio[v]);
+ }
+ this.smallestStackSizeWhenProcessing = tempSmallestSize; //Valid stacksizes
+ }
+ else {
+ this.smallestStackSizeWhenProcessing = 1; //Valid stacksizes
+ }
+
+
+
+ /*if (tempSmallestSize <= 64 && tempSmallestSize >= 1){
+ this.smallestStackSizeWhenProcessing = tempSmallestSize; //Valid stacksizes
+ }
+ else {
+ this.smallestStackSizeWhenProcessing = 50; //Can divide my math by 1/2 and round it~
+ }*/
//Makes a Fancy Chemical Tooltip
this.vChemicalSymbol = chemicalSymbol;
@@ -152,7 +170,7 @@ public class Material {
dataVar = MathUtils.generateSingularRandomHexValue();
Utils.LOG_INFO("Creating a Material instance for "+materialName);
- Utils.LOG_INFO("Formula: "+vChemicalFormula);
+ Utils.LOG_INFO("Formula: "+vChemicalFormula + " Smallest Stack: "+smallestStackSizeWhenProcessing+" Smallest Ratio:"+vSmallestRatio);
Utils.LOG_INFO("Protons: "+vProtons);
Utils.LOG_INFO("Neutrons: "+vNeutrons);
Utils.LOG_INFO("Mass: "+vMass+"/units");
@@ -405,7 +423,7 @@ public class Material {
return null;
}
- public int getSmallestStackForCrafting(MaterialStack[] inputs){
+ private int getSmallestStackForCrafting(MaterialStack[] inputs){
if (inputs != null){
if (inputs.length != 0){
long[] smallestRatio = getSmallestRatio(inputs);
diff --git a/src/Java/gtPlusPlus/core/util/item/UtilsItems.java b/src/Java/gtPlusPlus/core/util/item/UtilsItems.java
index 530ac24f98..41dccda796 100644
--- a/src/Java/gtPlusPlus/core/util/item/UtilsItems.java
+++ b/src/Java/gtPlusPlus/core/util/item/UtilsItems.java
@@ -32,6 +32,7 @@ import gtPlusPlus.core.util.Utils;
import gtPlusPlus.core.util.fluid.FluidUtils;
import gtPlusPlus.core.util.materials.MaterialUtils;
import gtPlusPlus.core.util.wrapper.var;
+import gtPlusPlus.xmod.gregtech.loaders.RecipeGen_DustGeneration;
import gtPlusPlus.xmod.gregtech.loaders.RecipeGen_Extruder;
import gtPlusPlus.xmod.gregtech.loaders.RecipeGen_Plates;
import gtPlusPlus.xmod.gregtech.loaders.RecipeGen_ShapedCrafting;
@@ -386,6 +387,7 @@ public class UtilsItems {
RecipeGen_Plates.generateRecipes(matInfo);
RecipeGen_Extruder.generateRecipes(matInfo);
RecipeGen_ShapedCrafting.generateRecipes(matInfo);
+ RecipeGen_DustGeneration.generateRecipes(matInfo);
FluidUtils.generateFluid(matInfo, 1);