aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDraknyte1 <Draknyte1@hotmail.com>2017-06-07 20:15:01 +1000
committerDraknyte1 <Draknyte1@hotmail.com>2017-06-07 20:15:01 +1000
commit1cb08313232fe112ceaa4036da8b057d7ee9209f (patch)
tree6fac6e504f19fe1c5ee89ea11cae10f61a040c71 /src
parented3d0de32f9cdf7294814346b9cfabb5a725087a (diff)
downloadGT5-Unofficial-1cb08313232fe112ceaa4036da8b057d7ee9209f.tar.gz
GT5-Unofficial-1cb08313232fe112ceaa4036da8b057d7ee9209f.tar.bz2
GT5-Unofficial-1cb08313232fe112ceaa4036da8b057d7ee9209f.zip
$ Fixed Shapeless recipes not working.
% Tweaked Cost of custom pipes in the extruder. Fixes #67.
Diffstat (limited to 'src')
-rw-r--r--src/Java/gtPlusPlus/core/util/recipe/RecipeUtils.java180
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechConduits.java12
2 files changed, 96 insertions, 96 deletions
diff --git a/src/Java/gtPlusPlus/core/util/recipe/RecipeUtils.java b/src/Java/gtPlusPlus/core/util/recipe/RecipeUtils.java
index 6f52da7fb0..fc73c4f325 100644
--- a/src/Java/gtPlusPlus/core/util/recipe/RecipeUtils.java
+++ b/src/Java/gtPlusPlus/core/util/recipe/RecipeUtils.java
@@ -214,35 +214,35 @@ public class RecipeUtils {
array[z].toString();
switch(z)
{
- case 0:
- a = array[z];
- break;
- case 1:
- b = array[z];
- break;
- case 2:
- c = array[z];
- break;
- case 3:
- d = array[z];
- break;
- case 4:
- e = array[z];
- break;
- case 5:
- f = array[z];
- break;
- case 6:
- g = array[z];
- break;
- case 7:
- h = array[z];
- break;
- case 8:
- i = array[z];
- break;
- default:
- break;
+ case 0:
+ a = array[z];
+ break;
+ case 1:
+ b = array[z];
+ break;
+ case 2:
+ c = array[z];
+ break;
+ case 3:
+ d = array[z];
+ break;
+ case 4:
+ e = array[z];
+ break;
+ case 5:
+ f = array[z];
+ break;
+ case 6:
+ g = array[z];
+ break;
+ case 7:
+ h = array[z];
+ break;
+ case 8:
+ i = array[z];
+ break;
+ default:
+ break;
}
recipeBuilder(a, b, c, d, e, f, g, h, i, outPut);
}
@@ -330,78 +330,76 @@ public class RecipeUtils {
final Object InputItem7, final Object InputItem8, final Object InputItem9,
final ItemStack OutputItem){
- Object[] o = {
- InputItem1, InputItem2, InputItem3,
- InputItem4, InputItem5, InputItem6,
- InputItem7, InputItem8, InputItem9
- };
-
- if (addShapedGregtechRecipe(o, OutputItem)){
- return true;
- }
- else {
- return false;
- }
- }
+ Object[] o = {
+ InputItem1, InputItem2, InputItem3,
+ InputItem4, InputItem5, InputItem6,
+ InputItem7, InputItem8, InputItem9
+ };
- public static boolean addShapedGregtechRecipe(final Object[] inputs, ItemStack output){
+ if (addShapedGregtechRecipe(o, OutputItem)){
+ return true;
+ }
+ else {
+ return false;
+ }
+ }
- if (inputs.length != 9){
- Utils.LOG_INFO("Input array for "+output.getDisplayName()+" does not equal 9.");
- return false;
- }
-
- for (int x=0;x<9;x++){
- if (inputs[x] == null){
- inputs[x] = " ";
- }
- if (!(inputs[x] instanceof ItemStack) || !(inputs[x] instanceof String)){
- if (output != null){
- Utils.LOG_INFO("Invalid Item inserted into inputArray. Item:"+output.getDisplayName()+" has a bad recipe. Please report to Alkalus.");
- return false;
- }
- else {
- Utils.LOG_INFO("Output is Null for a recipe. Report to Alkalus.");
- output = ItemUtils.getItemStackOfAmountFromOreDict("sadibasdkjnad", 1);
- }
- }
- }
+ public static boolean addShapedGregtechRecipe(final Object[] inputs, ItemStack output){
- if (GT_ModHandler.addCraftingRecipe(output,
- GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE |
- GT_ModHandler.RecipeBits.REVERSIBLE | GT_ModHandler.RecipeBits.BUFFERED,
- new Object[]{"ABC", "DEF", "GHI",
- 'A', inputs[0],
- 'B', inputs[1],
- 'C', inputs[2],
- 'D', inputs[3],
- 'E', inputs[4],
- 'F', inputs[5],
- 'G', inputs[6],
- 'H', inputs[7],
- 'I', inputs[8]})){
- Utils.LOG_INFO("Success! Added a recipe for "+output.getDisplayName());
- RegistrationHandler.recipesSuccess++;
- return true;
+ if (inputs.length != 9){
+ Utils.LOG_INFO("Input array for "+output.getDisplayName()+" does not equal 9.");
+ return false;
+ }
+
+ for (int x=0;x<9;x++){
+ if (inputs[x] == null){
+ inputs[x] = " ";
+ }
+ if (!(inputs[x] instanceof ItemStack) || !(inputs[x] instanceof String)){
+ if (output != null){
+ Utils.LOG_INFO("Invalid Item inserted into inputArray. Item:"+output.getDisplayName()+" has a bad recipe. Please report to Alkalus.");
+ return false;
}
else {
- Utils.LOG_INFO("Failed to add recipe for "+output.getDisplayName()+". Please report to Alkalus.");
- return false;
+ Utils.LOG_INFO("Output is Null for a recipe. Report to Alkalus.");
+ output = ItemUtils.getItemStackOfAmountFromOreDict("sadibasdkjnad", 1);
}
}
+ }
- public static void addShapelessGregtechRecipe(final ItemStack OutputItem, final Object... inputItems){
-
- for(final Object whatever : inputItems){
- if (!(whatever instanceof ItemStack) && !(whatever instanceof String)){
- Utils.LOG_INFO("One Input item was not an ItemStack of an OreDict String.");
- return;
- }
+ if (GT_ModHandler.addCraftingRecipe(output,
+ GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE |
+ GT_ModHandler.RecipeBits.REVERSIBLE | GT_ModHandler.RecipeBits.BUFFERED,
+ new Object[]{"ABC", "DEF", "GHI",
+ 'A', inputs[0],
+ 'B', inputs[1],
+ 'C', inputs[2],
+ 'D', inputs[3],
+ 'E', inputs[4],
+ 'F', inputs[5],
+ 'G', inputs[6],
+ 'H', inputs[7],
+ 'I', inputs[8]})){
+ Utils.LOG_INFO("Success! Added a recipe for "+output.getDisplayName());
+ RegistrationHandler.recipesSuccess++;
+ return true;
}
+ else {
+ Utils.LOG_INFO("Failed to add recipe for "+output.getDisplayName()+". Please report to Alkalus.");
+ return false;
+ }
+ }
- GT_ModHandler.addShapelessCraftingRecipe(OutputItem,
- GT_ModHandler.RecipeBits.BUFFERED | GT_ModHandler.RecipeBits.NOT_REMOVABLE,
- new Object[]{inputItems});
+ public static boolean addShapelessGregtechRecipe(final Object[] inputItems, final ItemStack OutputItem){
+ //Catch Invalid Recipes
+ if (inputItems.length > 9 || inputItems.length < 2){
+ return false;
+ }
+ //let gregtech handle shapeless recipes.
+ if (GT_ModHandler.addShapelessCraftingRecipe(OutputItem, inputItems)){
+ return true;
+ }
+ return false;
}
public static ItemStack getItemStackFromOreDict(final String oredictName){
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechConduits.java b/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechConduits.java
index 9fd4eedaa7..93fb07d4ba 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechConduits.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechConduits.java
@@ -58,7 +58,8 @@ public class GregtechConduits {
superConductorFactory(GT_Materials.Superconductor, 524288, 30660, 0, 0, 8);
if (LoadedMods.Thaumcraft){
- superConductorFactory(GT_Materials.Void, 512, 30661, 0, 0, 8);}
+ superConductorFactory(GT_Materials.Void, 512, 30661, 0, 0, 8);
+ }
@@ -70,7 +71,8 @@ public class GregtechConduits {
generateNonGTFluidPipes(GT_Materials.Tantalloy60, ALLOY.TANTALLOY_60, BasePipeID+5, 5000, 4250, true);
generateNonGTFluidPipes(GT_Materials.Tantalloy61, ALLOY.TANTALLOY_61, BasePipeID+10, 6000, 5800, true);
if (LoadedMods.Thaumcraft){
- generateNonGTFluidPipes(GT_Materials.Void, null, BasePipeID+15, 250, 25000, true);}
+ generateNonGTFluidPipes(GT_Materials.Void, null, BasePipeID+15, 250, 25000, true);
+ }
generateGTFluidPipes(Materials.Europium, BasePipeID+20, 12000, 7500, true);
generateNonGTFluidPipes(GT_Materials.Potin, ALLOY.POTIN, BasePipeID+25, 375, 2000, true);
generateNonGTFluidPipes(GT_Materials.MaragingSteel300, ALLOY.MARAGING300, BasePipeID+30, 7000, 2500, true);
@@ -205,7 +207,7 @@ public class GregtechConduits {
private static void generateGTFluidPipes(final Materials material, final int startID, final int transferRatePerSec, final int heatResistance, final boolean isGasProof){
final int transferRatePerTick = transferRatePerSec/20;
final long mass = material.getMass();
- final long voltage = material.mMeltingPoint >= 2800 ? 64 : 16;
+ final long voltage = material.mMeltingPoint >= 2800 ? 60 : 15;
GT_OreDictUnificator.registerOre(OrePrefixes.pipeTiny.get(material), new GT_MetaPipeEntity_Fluid(startID, "GT_Pipe_"+material.mDefaultLocalName+"_Tiny", "Tiny "+material.mDefaultLocalName+" Fluid Pipe", 0.25F, material, transferRatePerTick*2, heatResistance, isGasProof).getStackForm(1L));
GT_OreDictUnificator.registerOre(OrePrefixes.pipeSmall.get(material), new GT_MetaPipeEntity_Fluid(startID+1, "GT_Pipe_"+material.mDefaultLocalName+"_Small", "Small "+material.mDefaultLocalName+" Fluid Pipe", 0.375F, material, transferRatePerTick*4, heatResistance, isGasProof).getStackForm(1L));
GT_OreDictUnificator.registerOre(OrePrefixes.pipeMedium.get(material), new GT_MetaPipeEntity_Fluid(startID+2, "GT_Pipe_"+material.mDefaultLocalName+"", ""+material.mDefaultLocalName+" Fluid Pipe", 0.5F, material, transferRatePerTick*6, heatResistance, isGasProof).getStackForm(1L));
@@ -266,7 +268,7 @@ public class GregtechConduits {
Utils.LOG_INFO("Generated pipeLarge from "+ materialName +"? "+ ((ItemUtils.getItemStackOfAmountFromOreDict("pipe"+"Large"+output, 1) != null) ? true : false));
Utils.LOG_INFO("Generated pipeHuge from "+ materialName +"? "+ ((ItemUtils.getItemStackOfAmountFromOreDict("pipe"+"Huge"+output, 1) != null) ? true : false));
- int eut = 128;
+ int eut = 120;
int time = 0;
final int bonusMulti = 5*20;
@@ -348,4 +350,4 @@ public class GregtechConduits {
}
return ItemUtils.getSimpleStack(ModItems.AAA_Broken, amount);
}
-}
+} \ No newline at end of file