aboutsummaryrefslogtreecommitdiff
path: root/src/Java/gtPlusPlus/xmod/gregtech/loaders
diff options
context:
space:
mode:
Diffstat (limited to 'src/Java/gtPlusPlus/xmod/gregtech/loaders')
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_DustGeneration.java28
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Recycling.java64
2 files changed, 63 insertions, 29 deletions
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_DustGeneration.java b/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_DustGeneration.java
index 46bf36c445..b7af6eadac 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_DustGeneration.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_DustGeneration.java
@@ -114,12 +114,12 @@ public class RecipeGen_DustGeneration implements Runnable{
//Is this a composite?
if ((inputStacks != null) && !disableOptional){
//Is this a composite?
- Utils.LOG_INFO("mixer length: "+inputStacks.length);
+ Utils.LOG_WARNING("mixer length: "+inputStacks.length);
if ((inputStacks.length != 0) && (inputStacks.length <= 4)){
//Log Input items
Utils.LOG_WARNING(ItemUtils.getArrayStackNames(inputStacks));
final long[] inputStackSize = material.vSmallestRatio;
- Utils.LOG_INFO("mixer is stacksizeVar null? "+(inputStackSize != null));
+ Utils.LOG_WARNING("mixer is stacksizeVar null? "+(inputStackSize != null));
//Is smallest ratio invalid?
if (inputStackSize != null){
//set stack sizes on an input ItemStack[]
@@ -168,19 +168,19 @@ public class RecipeGen_DustGeneration implements Runnable{
(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");
+ Utils.LOG_WARNING("Dust Mixer Recipe: "+material.getLocalizedName()+" - Success");
}
else {
- Utils.LOG_INFO("Dust Mixer Recipe: "+material.getLocalizedName()+" - Failed");
+ Utils.LOG_WARNING("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");
+ Utils.LOG_WARNING("Dust Shapeless Recipe: "+material.getLocalizedName()+" - Success");
}
else {
- Utils.LOG_INFO("Dust Shapeless Recipe: "+material.getLocalizedName()+" - Failed");
+ Utils.LOG_WARNING("Dust Shapeless Recipe: "+material.getLocalizedName()+" - Failed");
}
}
}
@@ -200,12 +200,12 @@ public class RecipeGen_DustGeneration implements Runnable{
//Is this a composite?
if ((inputStacks != null)){
//Is this a composite?
- Utils.LOG_INFO("mixer length: "+inputStacks.length);
+ Utils.LOG_WARNING("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));
+ Utils.LOG_WARNING("mixer is stacksizeVar not null? "+(inputStackSize != null));
//Is smallest ratio invalid?
if (inputStackSize != null){
//set stack sizes on an input ItemStack[]
@@ -215,7 +215,7 @@ public class RecipeGen_DustGeneration implements Runnable{
}
}
//Relog input values, with stack sizes
- Utils.LOG_INFO(ItemUtils.getArrayStackNames(inputStacks));
+ Utils.LOG_WARNING(ItemUtils.getArrayStackNames(inputStacks));
//Get us four ItemStacks to input into the mixer
ItemStack input1, input2, input3, input4;
@@ -254,24 +254,24 @@ public class RecipeGen_DustGeneration implements Runnable{
(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");
+ Utils.LOG_WARNING("Dust Mixer Recipe: "+material.getLocalizedName()+" - Success");
return true;
}
else {
- Utils.LOG_INFO("Dust Mixer Recipe: "+material.getLocalizedName()+" - Failed");
+ Utils.LOG_WARNING("Dust Mixer Recipe: "+material.getLocalizedName()+" - Failed");
return false;
}
}
else {
- Utils.LOG_INFO("inputStackSize == NUll - "+material.getLocalizedName());
+ Utils.LOG_WARNING("inputStackSize == NUll - "+material.getLocalizedName());
}
}
else {
- Utils.LOG_INFO("InputStacks is out range 1-4 - "+material.getLocalizedName());
+ Utils.LOG_WARNING("InputStacks is out range 1-4 - "+material.getLocalizedName());
}
}
else {
- Utils.LOG_INFO("InputStacks == NUll - "+material.getLocalizedName());
+ Utils.LOG_WARNING("InputStacks == NUll - "+material.getLocalizedName());
}
return false;
}
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Recycling.java b/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Recycling.java
index d0651f783c..f48d9822f0 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Recycling.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Recycling.java
@@ -9,10 +9,7 @@ import org.apache.commons.lang3.reflect.FieldUtils;
import gregtech.api.enums.GT_Values;
import gregtech.api.enums.OrePrefixes;
-import gregtech.api.util.GT_ModHandler;
-import gregtech.api.util.GT_OreDictUnificator;
-import gregtech.api.util.GT_Utility;
-import gtPlusPlus.core.item.ModItems;
+import gregtech.api.util.*;
import gtPlusPlus.core.material.Material;
import gtPlusPlus.core.material.state.MaterialState;
import gtPlusPlus.core.util.Utils;
@@ -20,7 +17,6 @@ import gtPlusPlus.core.util.array.Pair;
import gtPlusPlus.core.util.item.ItemUtils;
import gtPlusPlus.core.util.reflect.ReflectionUtils;
import net.minecraft.item.ItemStack;
-import net.minecraftforge.fluids.FluidStack;
import net.minecraftforge.oredict.OreDictionary;
public class RecipeGen_Recycling implements Runnable {
@@ -51,21 +47,59 @@ public class RecipeGen_Recycling implements Runnable {
OrePrefixes.plate, OrePrefixes.plateDense, OrePrefixes.plateDouble, OrePrefixes.plateTriple,
OrePrefixes.plateQuadruple, OrePrefixes.plateQuintuple, OrePrefixes.stick, OrePrefixes.stickLong,
OrePrefixes.bolt, OrePrefixes.screw, OrePrefixes.ring, OrePrefixes.rotor, OrePrefixes.gearGt,
- OrePrefixes.gearGtSmall };
+ OrePrefixes.gearGtSmall, OrePrefixes.gear, OrePrefixes.block, OrePrefixes.cableGt01, OrePrefixes.cableGt02,
+ OrePrefixes.cableGt04, OrePrefixes.cableGt08, OrePrefixes.cableGt12, OrePrefixes.wireFine, OrePrefixes.wireGt01,
+ OrePrefixes.wireGt02, OrePrefixes.wireGt04, OrePrefixes.wireGt08, OrePrefixes.wireGt12, OrePrefixes.wireGt16,
+ OrePrefixes.foil, OrePrefixes.frameGt, OrePrefixes.pipeHuge, OrePrefixes.pipeLarge, OrePrefixes.pipeMedium, OrePrefixes.pipeSmall, OrePrefixes.pipeTiny,
+ };
- Utils.LOG_INFO("Found " + mValidPrefixesAsString.length + " valid OreDict prefixes.");
+ int mSlotIndex = 0;
+ Pair<OrePrefixes, ItemStack>[] mValidPairs = new Pair[mValidPrefixesAsString.length];
+
+ for (int r=0;r<mValidPairs.length;r++){
+ ItemStack temp = ItemUtils.getItemStackOfAmountFromOreDictNoBroken(mValidPrefixesAsString[r].name()+Utils.sanitizeString(material.getLocalizedName()), 1);
+ if (temp != null){
+ mValidPairs[mSlotIndex++] = new Pair<OrePrefixes, ItemStack>(mValidPrefixesAsString[r], temp.copy());
+ }
+ else {
+ Utils.LOG_INFO("Invalid Item: "+mValidPrefixesAsString[r].name()+Utils.sanitizeString(material.getLocalizedName()));
+ }
+ }
+
+ if (mValidPairs.length > 0){
+ int validCounter = 0;
+ Pair<OrePrefixes, ItemStack>[] temp = mValidPairs;
+ for (Pair<OrePrefixes, ItemStack> temp2 : mValidPairs){
+ if (temp2 != null){
+ Utils.LOG_INFO("Valid: "+temp2.getValue().getDisplayName());
+ validCounter++;
+ }
+ }
+ Pair<OrePrefixes, ItemStack> temp3[] = new Pair[validCounter];
+ int temp4 = 0;
+ for (Pair<OrePrefixes, ItemStack> r : mValidPairs){
+ if (r != null){
+ temp3[temp4++] = r;
+ }
+ }
+ if (temp3.length > 0){
+ mValidPairs = temp3.clone();
+ }
+ }
+
+ Utils.LOG_INFO("Found " + mValidPairs.length + " valid OreDict prefixes.");
if (mValidPrefixesAsString.length >= 1) {
- for (final OrePrefixes validPrefix : mValidPrefixesAsString) {
+ for (final Pair<OrePrefixes, ItemStack> validPrefix : mValidPairs) {
try {
if (material.getState() != MaterialState.SOLID){
continue;
}
- final ItemStack tempStack = get(validPrefix, material, 1);
- final ItemStack mDust = getDust(material, validPrefix);
- final Pair<OrePrefixes, ItemStack> mData = getDustData(material, validPrefix);
- int mFluidAmount = (int) GT_Utility.translateMaterialToFluidAmount(mData.getKey().mMaterialAmount, true);
+ final ItemStack tempStack = validPrefix.getValue();
+ final ItemStack mDust = getDust(material, validPrefix.getKey());
+ final Pair<OrePrefixes, ItemStack> mData = getDustData(material, validPrefix.getKey());
+ int mFluidAmount = (int) GT_Utility.translateMaterialToFluidAmount(validPrefix.getKey().mMaterialAmount, true);
//Maceration
if (tempStack != null) {
@@ -91,11 +125,11 @@ public class RecipeGen_Recycling implements Runnable {
if (tempStack != null) {
// mValidItems[mSlotIndex++] = tempStack;
if ((mDust != null) && GT_Values.RA.addFluidExtractionRecipe(tempStack, null, material.getFluid(mFluidAmount), 0, 30, 8)) {
- Utils.LOG_INFO("Recycle Recipe: " + material.getLocalizedName() + " - Success - Recycle "
- + tempStack.getDisplayName() + " and obtain " + mDust.getDisplayName());
+ Utils.LOG_INFO("Fluid Recycle Recipe: " + material.getLocalizedName() + " - Success - Recycle "
+ + tempStack.getDisplayName() + " and obtain " + mFluidAmount+"mb of "+material.getFluid(1).getLocalizedName()+".");
}
else {
- Utils.LOG_INFO("Recycle Recipe: " + material.getLocalizedName() + " - Failed");
+ Utils.LOG_INFO("Fluid Recycle Recipe: " + material.getLocalizedName() + " - Failed");
if (mDust == null) {
Utils.LOG_INFO("Invalid Dust output.");
}