diff options
3 files changed, 69 insertions, 71 deletions
diff --git a/src/Java/gtPlusPlus/core/item/base/dusts/BaseItemDust.java b/src/Java/gtPlusPlus/core/item/base/dusts/BaseItemDust.java index 10f5e0165e..01823021d3 100644 --- a/src/Java/gtPlusPlus/core/item/base/dusts/BaseItemDust.java +++ b/src/Java/gtPlusPlus/core/item/base/dusts/BaseItemDust.java @@ -107,7 +107,7 @@ public class BaseItemDust extends Item{ else { return unlocal; } - + /*if (this.getUnlocalizedName().contains("DustTiny")){ this.name = "Tiny Pile of "+this.materialName + " Dust"; } @@ -233,14 +233,16 @@ public class BaseItemDust extends Item{ } temp = temp.replace("itemDust", "ingot"); if ((temp != null) && !temp.equals("")){ - + ItemStack mThisStack = ItemUtils.getSimpleStack(this); if (this.dustInfo.requiresBlastFurnace()){ Logger.WARNING("Adding recipe for Hot "+this.materialName+" Ingots in a Blast furnace."); final String tempIngot = temp.replace("ingot", "ingotHot"); final ItemStack tempOutputStack = ItemUtils.getItemStackOfAmountFromOreDict(tempIngot, 1); if (null != tempOutputStack && tempOutputStack != ItemUtils.getSimpleStack(ModItems.AAA_Broken)){ Logger.WARNING("This will produce "+tempOutputStack.getDisplayName() + " Debug: "+tempIngot); - this.addBlastFurnaceRecipe(ItemUtils.getSimpleStack(this), null, tempOutputStack, null, 350*this.mTier); + if (ItemUtils.checkForInvalidItems(tempOutputStack) && ItemUtils.checkForInvalidItems(mThisStack)) { + this.addBlastFurnaceRecipe(mThisStack, null, tempOutputStack, null, 350*this.mTier); + } } return; } @@ -249,18 +251,22 @@ public class BaseItemDust extends Item{ //Utils.LOG_WARNING("This will produce an ingot of "+tempOutputStack.getDisplayName() + " Debug: "+temp); if (null != tempOutputStack && tempOutputStack != ItemUtils.getSimpleStack(ModItems.AAA_Broken)){ if ((this.mTier < 5) || !this.dustInfo.requiresBlastFurnace()){ - if (CORE.GT_Recipe.addSmeltingAndAlloySmeltingRecipe(ItemUtils.getSimpleStack(this), tempOutputStack)){ - Logger.WARNING("Successfully added a furnace recipe for "+this.materialName); - } - else { - Logger.WARNING("Failed to add a furnace recipe for "+this.materialName); + if (ItemUtils.checkForInvalidItems(tempOutputStack) && ItemUtils.checkForInvalidItems(mThisStack)) { + if (CORE.GT_Recipe.addSmeltingAndAlloySmeltingRecipe(ItemUtils.getSimpleStack(this), tempOutputStack)){ + Logger.WARNING("Successfully added a furnace recipe for "+this.materialName); + } + else { + Logger.WARNING("Failed to add a furnace recipe for "+this.materialName); + } } } else if ((this.mTier >= 5) || this.dustInfo.requiresBlastFurnace()){ Logger.WARNING("Adding recipe for "+this.materialName+" Ingots in a Blast furnace."); Logger.WARNING("This will produce "+tempOutputStack.getDisplayName()); if (null != tempOutputStack && tempOutputStack != ItemUtils.getSimpleStack(ModItems.AAA_Broken)){ - this.addBlastFurnaceRecipe(ItemUtils.getSimpleStack(this), null, tempOutputStack, null, 350*this.mTier); + if (ItemUtils.checkForInvalidItems(tempOutputStack) && ItemUtils.checkForInvalidItems(mThisStack)) { + this.addBlastFurnaceRecipe(ItemUtils.getSimpleStack(this), null, tempOutputStack, null, 350*this.mTier); + } } return; } diff --git a/src/Java/gtPlusPlus/core/util/minecraft/ItemUtils.java b/src/Java/gtPlusPlus/core/util/minecraft/ItemUtils.java index cf98ec81ff..f9eb9de310 100644 --- a/src/Java/gtPlusPlus/core/util/minecraft/ItemUtils.java +++ b/src/Java/gtPlusPlus/core/util/minecraft/ItemUtils.java @@ -764,6 +764,13 @@ public class ItemUtils { return blockName; } } + + + + public static boolean checkForInvalidItems(ItemStack mInput) { + return checkForInvalidItems(new ItemStack[] {mInput}); + } + /** * * @param mInputs diff --git a/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechConduits.java b/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechConduits.java index 58598fe5ba..de716141dd 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechConduits.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechConduits.java @@ -13,7 +13,6 @@ import gregtech.api.util.GT_OreDictUnificator; import gregtech.api.util.GT_Utility; import gtPlusPlus.api.objects.Logger; -import gtPlusPlus.core.item.ModItems; import gtPlusPlus.core.lib.CORE; import gtPlusPlus.core.lib.LoadedMods; import gtPlusPlus.core.material.ALLOY; @@ -67,13 +66,13 @@ public class GregtechConduits { } private static void run1(){ - + if (LoadedMods.Big_Reactors){ wireFactory("Blutonium", 8196, BaseWireID, 8, 32, 2, new short[]{28, 28, 218, 0}); wireFactory("Cyanite", 512, BaseWireID+15, 2, 16, 4, new short[]{27, 130, 178, 0}); wireFactory("Yellorium", 2048, BaseWireID+30, 4, 16, 2, new short[]{150, 195, 54, 0}); } - + if (LoadedMods.EnderIO){ wireFactory("RedstoneAlloy", 32, BaseWireID+45, 0, 2, 1, new short[]{178,34,34, 0}); } @@ -84,7 +83,7 @@ public class GregtechConduits { customWireFactory(ALLOY.HG1223, 32768, BaseWireID + 78, 2, 8, 4); customWireFactory(ALLOY.TRINIUM_TITANIUM, 2048, BaseWireID + 89, 1, 2, 16); } - + //superConductorFactory(GT_Materials.Superconductor, 524288, 30660, 0, 0, 8); if (LoadedMods.Thaumcraft){ @@ -113,10 +112,11 @@ public class GregtechConduits { } generateGTFluidPipes(Materials.Clay, BasePipeID+65, 100, 500, false); generateGTFluidPipes(Materials.Lead, BasePipeID+70, 720, 1200, true); - + } private static void wireFactory(final String Material, final int Voltage, final int ID, final long insulatedLoss, final long uninsulatedLoss, final long Amps, final short[] rgb){ + @SuppressWarnings("deprecation") final Materials T = Materials.valueOf(Material); int V = GT_Utility.getTier(Voltage); if (V == -1){ @@ -244,17 +244,11 @@ public class GregtechConduits { private static void generateNonGTFluidPipes(final GT_Materials material, final Material myMaterial, final int startID, final int transferRatePerSec, final int heatResistance, final boolean isGasProof){ final int transferRatePerTick = transferRatePerSec/10; long mass; - long voltage; if (myMaterial != null){ mass = myMaterial.getMass(); - voltage = myMaterial.vVoltageMultiplier; - if (myMaterial.getLocalizedName().equals(ALLOY.POTIN.getLocalizedName())){ - voltage = 4; - } } else { mass = ELEMENT.getInstance().IRON.getMass(); - voltage = 8; } int tVoltageMultiplier = (material.mBlastFurnaceTemp >= 2800) ? 64 : 16; @@ -296,9 +290,6 @@ public class GregtechConduits { Logger.WARNING("Generated pipeHuge from "+ materialName +"? "+ ((ItemUtils.getItemStackOfAmountFromOreDict("pipe"+"Huge"+output, 1) != null) ? true : false)); int eut = 120; - int time; - - time = (int) Math.max(Mass * 8L, 1); eut = (int) (8 * vMulti); @@ -321,48 +312,52 @@ public class GregtechConduits { pipePlate, "craftingToolWrench", pipePlate, ItemUtils.getItemStackOfAmountFromOreDict("pipe"+"Large"+output, 1)); - GT_Values.RA.addExtruderRecipe( - ItemUtils.getSimpleStack(pipeIngot, 1), - ItemList.Shape_Extruder_Pipe_Tiny.get(0), - ItemUtils.getItemStackOfAmountFromOreDictNoBroken("pipe"+"Tiny"+output, 2), - 5, eut); + if (pipeIngot != null) { + + GT_Values.RA.addExtruderRecipe( + ItemUtils.getSimpleStack(pipeIngot, 1), + ItemList.Shape_Extruder_Pipe_Tiny.get(0), + ItemUtils.getItemStackOfAmountFromOreDictNoBroken("pipe"+"Tiny"+output, 2), + 5, eut); + + GT_Values.RA.addExtruderRecipe( + ItemUtils.getSimpleStack(pipeIngot, 1), + ItemList.Shape_Extruder_Pipe_Small.get(0), + ItemUtils.getItemStackOfAmountFromOreDict("pipe"+"Small"+output, 1), + 10, eut); + + GT_Values.RA.addExtruderRecipe( + ItemUtils.getSimpleStack(pipeIngot, 3), + ItemList.Shape_Extruder_Pipe_Medium.get(0), + ItemUtils.getItemStackOfAmountFromOreDict("pipe"+"Medium"+output, 1), + 1*20, eut); + + GT_Values.RA.addExtruderRecipe( + ItemUtils.getSimpleStack(pipeIngot, 6), + ItemList.Shape_Extruder_Pipe_Large.get(0), + ItemUtils.getItemStackOfAmountFromOreDict("pipe"+"Large"+output, 1), + 2*20, eut); + + GT_Values.RA.addExtruderRecipe( + ItemUtils.getSimpleStack(pipeIngot, 12), + ItemList.Shape_Extruder_Pipe_Huge.get(0), + ItemUtils.getItemStackOfAmountFromOreDict("pipe"+"Huge"+output, 1), + 4*20, eut); - GT_Values.RA.addExtruderRecipe( - ItemUtils.getSimpleStack(pipeIngot, 1), - ItemList.Shape_Extruder_Pipe_Small.get(0), - ItemUtils.getItemStackOfAmountFromOreDict("pipe"+"Small"+output, 1), - 10, eut); - - GT_Values.RA.addExtruderRecipe( - ItemUtils.getSimpleStack(pipeIngot, 3), - ItemList.Shape_Extruder_Pipe_Medium.get(0), - ItemUtils.getItemStackOfAmountFromOreDict("pipe"+"Medium"+output, 1), - 1*20, eut); - - GT_Values.RA.addExtruderRecipe( - ItemUtils.getSimpleStack(pipeIngot, 6), - ItemList.Shape_Extruder_Pipe_Large.get(0), - ItemUtils.getItemStackOfAmountFromOreDict("pipe"+"Large"+output, 1), - 2*20, eut); - - GT_Values.RA.addExtruderRecipe( - ItemUtils.getSimpleStack(pipeIngot, 12), - ItemList.Shape_Extruder_Pipe_Huge.get(0), - ItemUtils.getItemStackOfAmountFromOreDict("pipe"+"Huge"+output, 1), - 4*20, eut); + } if ((eut < 512) && !output.equals("Void")){ try { - final ItemStack pipePlateDouble = ItemUtils.getItemStackOfAmountFromOreDict("plateDouble"+output, 1).copy(); - if (pipePlateDouble != null) { - RecipeUtils.recipeBuilder( - pipePlateDouble, "craftingToolHardHammer", pipePlateDouble, - pipePlateDouble, null, pipePlateDouble, - pipePlateDouble, "craftingToolWrench", pipePlateDouble, - ItemUtils.getItemStackOfAmountFromOreDict("pipe"+"Huge"+output, 1)); - } else { - Logger.INFO("Failed to add a recipe for "+materialName+" Huge pipes. Double plates probably do not exist."); - } + final ItemStack pipePlateDouble = ItemUtils.getItemStackOfAmountFromOreDict("plateDouble"+output, 1).copy(); + if (pipePlateDouble != null) { + RecipeUtils.recipeBuilder( + pipePlateDouble, "craftingToolHardHammer", pipePlateDouble, + pipePlateDouble, null, pipePlateDouble, + pipePlateDouble, "craftingToolWrench", pipePlateDouble, + ItemUtils.getItemStackOfAmountFromOreDict("pipe"+"Huge"+output, 1)); + } else { + Logger.INFO("Failed to add a recipe for "+materialName+" Huge pipes. Double plates probably do not exist."); + } } catch (Throwable t) { t.printStackTrace(); @@ -372,16 +367,6 @@ public class GregtechConduits { } - private static ItemStack getOredictStack(final String oredictName, final int amount){ - final ArrayList<ItemStack> oreDictList = OreDictionary.getOres(oredictName); - if (!oreDictList.isEmpty()){ - final ItemStack returnValue = oreDictList.get(0).copy(); - returnValue.stackSize = amount; - return returnValue; - } - return ItemUtils.getSimpleStack(ModItems.AAA_Broken, amount); - } - public static boolean registerOre(OrePrefixes aPrefix, Material aMaterial, ItemStack aStack) { return registerOre(aPrefix.get(Utils.sanitizeString(aMaterial.getLocalizedName())), aStack); } |