From 3f541625b039f5a7a8c03e41425c995af5d60f96 Mon Sep 17 00:00:00 2001 From: Dream-MasterXXL Date: Mon, 4 Mar 2019 12:25:38 +0100 Subject: New coil rebalance (1200K+) #4126 https://github.com/GTNewHorizons/NewHorizons/issues/4126 --- src/main/java/gregtech/common/blocks/GT_Item_Casings_Abstract.java | 4 ++-- .../machines/multi/GT_MetaTileEntity_ElectricBlastFurnace.java | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'src/main/java/gregtech/common') diff --git a/src/main/java/gregtech/common/blocks/GT_Item_Casings_Abstract.java b/src/main/java/gregtech/common/blocks/GT_Item_Casings_Abstract.java index 68aa777d8c..1ca55d499f 100644 --- a/src/main/java/gregtech/common/blocks/GT_Item_Casings_Abstract.java +++ b/src/main/java/gregtech/common/blocks/GT_Item_Casings_Abstract.java @@ -20,8 +20,8 @@ public abstract class GT_Item_Casings_Abstract protected final String mCoil05Tooltip = GT_LanguageManager.addStringLocalization("gt.coil05tooltip", "Base Heating Capacity = 5400 Kelvin"); protected final String mCoil06Tooltip = GT_LanguageManager.addStringLocalization("gt.coil06tooltip", "Base Heating Capacity = 7200 Kelvin"); protected final String mCoil07Tooltip = GT_LanguageManager.addStringLocalization("gt.coil07tooltip", "Base Heating Capacity = 9001 Kelvin"); - protected final String mCoil08Tooltip = GT_LanguageManager.addStringLocalization("gt.coil08tooltip", "Base Heating Capacity = 12000 Kelvin"); - protected final String mCoil09Tooltip = GT_LanguageManager.addStringLocalization("gt.coil09tooltip", "Base Heating Capacity = 15000 Kelvin"); + protected final String mCoil08Tooltip = GT_LanguageManager.addStringLocalization("gt.coil08tooltip", "Base Heating Capacity = 9900 Kelvin"); + protected final String mCoil09Tooltip = GT_LanguageManager.addStringLocalization("gt.coil09tooltip", "Base Heating Capacity = 10800 Kelvin"); protected final String mCoilOverheated1Tooltip = GT_LanguageManager.addStringLocalization("gt.coil.overheated1.tooltip", "These coils are deprecated"); protected final String mCoilOverheated2Tooltip = GT_LanguageManager.addStringLocalization("gt.coil.overheated2.tooltip", "Place in crafting grid to get regular coils"); protected final String mBlastProofTooltip = GT_LanguageManager.addStringLocalization("gt.blastprooftooltip", "This Block is Blast Proof"); diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ElectricBlastFurnace.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ElectricBlastFurnace.java index f3d5a8ef45..ed1d43e8a5 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ElectricBlastFurnace.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ElectricBlastFurnace.java @@ -242,10 +242,10 @@ public class GT_MetaTileEntity_ElectricBlastFurnace this.mHeatingCapacity = 9001; break; case 7: - this.mHeatingCapacity = 12001; + this.mHeatingCapacity = 9901; break; case 8: - this.mHeatingCapacity = 15001; + this.mHeatingCapacity = 10801; break; default: return false; -- cgit From 75404252d7a3040e0e9d4d00d78bb74d3c2b53e1 Mon Sep 17 00:00:00 2001 From: Richard Hendricks Date: Mon, 11 Mar 2019 22:29:02 -0500 Subject: Cherry pick multiamp dynamo support for multiblock generators. Removed local explosion checks from large turbine and plasma turbine. Large turbs now support buffered 4A dynamos. --- .../GT_MetaTileEntity_MultiBlockBase.java | 71 ++++++++++++++++++++-- .../multi/GT_MetaTileEntity_LargeTurbine.java | 3 + .../GT_MetaTileEntity_LargeTurbine_Plasma.java | 3 + 3 files changed, 71 insertions(+), 6 deletions(-) (limited to 'src/main/java/gregtech/common') diff --git a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_MultiBlockBase.java b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_MultiBlockBase.java index ad5b94266c..2da97a1939 100644 --- a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_MultiBlockBase.java +++ b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_MultiBlockBase.java @@ -515,15 +515,74 @@ public abstract class GT_MetaTileEntity_MultiBlockBase extends MetaTileEntity { } public boolean addEnergyOutput(long aEU) { - if (aEU <= 0) return true; - for (GT_MetaTileEntity_Hatch_Dynamo tHatch : mDynamoHatches) { - if (isValidMetaTileEntity(tHatch)) { - if (tHatch.getBaseMetaTileEntity().increaseStoredEnergyUnits(aEU, false)) { - return true; + if (aEU <= 0) { + return true; + } + if (mDynamoHatches.size() > 0) { + return addEnergyOutputMultipleDynamos(aEU, true); + } + return false; + } + public boolean addEnergyOutputMultipleDynamos(long aEU, boolean aAllowMixedVoltageDynamos) { + int injected = 0; + long totalOutput = 0; + long aFirstVoltageFound = -1; + boolean aFoundMixedDynamos = false; + for (GT_MetaTileEntity_Hatch_Dynamo aDynamo : mDynamoHatches) { + if( aDynamo == null ) { + return false; + } + if (isValidMetaTileEntity(aDynamo)) { + long aVoltage = aDynamo.maxEUOutput(); + long aTotal = aDynamo.maxAmperesOut() * aVoltage; + // Check against voltage to check when hatch mixing + if (aFirstVoltageFound == -1) { + aFirstVoltageFound = aVoltage; } + else { + /** + * Calcualtes overclocked ness using long integers + * @param aEUt - recipe EUt + * @param aDuration - recipe Duration + * @param mAmperage - should be 1 ? + */ + //Long time calculation + if (aFirstVoltageFound != aVoltage) { + aFoundMixedDynamos = true; + } + } + totalOutput += aTotal; } } - return false; + + if (totalOutput < aEU || (aFoundMixedDynamos && !aAllowMixedVoltageDynamos)) { + explodeMultiblock(); + return false; + } + + long leftToInject; + //Long EUt calculation + long aVoltage; + //Isnt too low EUt check? + int aAmpsToInject; + int aRemainder; + + //xEUt *= 4;//this is effect of everclocking + for (GT_MetaTileEntity_Hatch_Dynamo aDynamo : mDynamoHatches) { + if (isValidMetaTileEntity(aDynamo)) { + leftToInject = aEU - injected; + aVoltage = aDynamo.maxEUOutput(); + aAmpsToInject = (int) (leftToInject / aVoltage); + aRemainder = (int) (leftToInject - (aAmpsToInject * aVoltage)); + long powerGain; + for (int i = 0; i < Math.min(aDynamo.maxAmperesOut(), aAmpsToInject > 0 ? aAmpsToInject : 1); i++) { + powerGain = aAmpsToInject > 0 ? aVoltage : aRemainder; + aDynamo.getBaseMetaTileEntity().increaseStoredEnergyUnits(powerGain, false); + injected += powerGain; + } + } + } + return injected > 0; } public long getMaxInputVoltage() { diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeTurbine.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeTurbine.java index 4bc5e5ed9a..3797806460 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeTurbine.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeTurbine.java @@ -175,6 +175,8 @@ public abstract class GT_MetaTileEntity_LargeTurbine extends GT_MetaTileEntity_M } else { this.mMaxProgresstime = 1; this.mEfficiencyIncrease = 10; + // Overvoltage is handled inside the MultiBlockBase when pushing out to dynamos. no need to do it here. + /* if(this.mDynamoHatches.size()>0){ for(GT_MetaTileEntity_Hatch dynamo:mDynamoHatches) if(isValidMetaTileEntity(dynamo) && dynamo.maxEUOutput() < mEUt) { @@ -182,6 +184,7 @@ public abstract class GT_MetaTileEntity_LargeTurbine extends GT_MetaTileEntity_M explodeMultiblock(); } } + */ return true; } } diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeTurbine_Plasma.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeTurbine_Plasma.java index b80f01a85e..fb3f58efd5 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeTurbine_Plasma.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeTurbine_Plasma.java @@ -192,6 +192,8 @@ public class GT_MetaTileEntity_LargeTurbine_Plasma extends GT_MetaTileEntity_Lar } else { this.mMaxProgresstime = 20; this.mEfficiencyIncrease = 200; + // Overvoltage is handled inside the MultiBlockBase when pushing out to dynamos. no need to do it here. + /* if(this.mDynamoHatches.size()>0){ for(GT_MetaTileEntity_Hatch dynamo:mDynamoHatches) if(isValidMetaTileEntity(dynamo) && dynamo.maxEUOutput() < mEUt) { @@ -199,6 +201,7 @@ public class GT_MetaTileEntity_LargeTurbine_Plasma extends GT_MetaTileEntity_Lar explodeMultiblock(); } } + */ return true; } } -- cgit From 7c80bf08e8670b0d4e7bb0442e7fff384846d6fb Mon Sep 17 00:00:00 2001 From: Dream-Master Date: Tue, 19 Mar 2019 18:12:59 +0100 Subject: Mining plascrete blocks #3998 https://github.com/GTNewHorizons/NewHorizons/issues/3998 --- src/main/java/gregtech/common/blocks/GT_Block_Reinforced.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/main/java/gregtech/common') diff --git a/src/main/java/gregtech/common/blocks/GT_Block_Reinforced.java b/src/main/java/gregtech/common/blocks/GT_Block_Reinforced.java index cf4ad9c317..c5393f0be1 100644 --- a/src/main/java/gregtech/common/blocks/GT_Block_Reinforced.java +++ b/src/main/java/gregtech/common/blocks/GT_Block_Reinforced.java @@ -139,7 +139,7 @@ public class GT_Block_Reinforced extends GT_Generic_Block { return 400.0F; } if (tMeta == 2) { - return 400.0F; + return 40.0F; } if (tMeta == 3) { return 250.0F; -- cgit From 767d90b1b6188500fd55942965cd297e472e1215 Mon Sep 17 00:00:00 2001 From: Dream-Master Date: Tue, 19 Mar 2019 18:47:06 +0100 Subject: change name sparkling --- src/main/java/gregtech/common/items/CombType.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/main/java/gregtech/common') diff --git a/src/main/java/gregtech/common/items/CombType.java b/src/main/java/gregtech/common/items/CombType.java index 9ff5eb359c..0fac4b3af8 100644 --- a/src/main/java/gregtech/common/items/CombType.java +++ b/src/main/java/gregtech/common/items/CombType.java @@ -43,7 +43,7 @@ public enum CombType { THAUMINITE("thauminite", true, Materials._NULL, 50), SHADOWMETAL("shadowmetal", true, Materials.Shadow, 50), DIVIDED("divided", true, Materials.Unstable, 40), - SPARKELING("sparkeling", true, Materials.NetherStar, 40), + SPARKELING("sparkling", true, Materials.NetherStar, 40), //Gem Line STONE("stone", true, Materials._NULL, 70), -- cgit From 244d8a1ba17b11a336181b2e86896f03dbb235c6 Mon Sep 17 00:00:00 2001 From: Dream-Master Date: Tue, 19 Mar 2019 19:02:50 +0100 Subject: https://github.com/GTNewHorizons/NewHorizons/issues/4253 Problems with bee comb ore quadrupling recipes #4253 all ev and iv combs have now chemical recipes --- src/main/java/gregtech/common/items/ItemComb.java | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'src/main/java/gregtech/common') diff --git a/src/main/java/gregtech/common/items/ItemComb.java b/src/main/java/gregtech/common/items/ItemComb.java index a9c5a29b0d..ae25eb2430 100644 --- a/src/main/java/gregtech/common/items/ItemComb.java +++ b/src/main/java/gregtech/common/items/ItemComb.java @@ -291,6 +291,7 @@ public class ItemComb extends Item { tComb = getStackForType(CombType.LEAD); addSpecialCentLV(tComb, GT_OreDictUnificator.get(OrePrefixes.dustTiny, Materials.Lead, 1), 45); addProcessLV(tComb, Materials.Lead, 100); + addProcessLV(tComb, Materials.Galena, 75); tComb = getStackForType(CombType.IRON); addSpecialCentLV(tComb, GT_OreDictUnificator.get(OrePrefixes.dustTiny, Materials.Iron, 1), 30); addProcessLV(tComb, Materials.Iron, 100); @@ -482,6 +483,7 @@ public class ItemComb extends Item { tComb = getStackForType(CombType.MYSTERIOUSCRYSTAL); GT_Values.RA.addCentrifugeRecipe(tComb, GT_Values.NI, GT_Values.NF, GT_Values.NF, ItemList.FR_Wax.get(1L), GT_OreDictUnificator.get(OrePrefixes.dustTiny, Materials.MysteriousCrystal, 1L), GT_OreDictUnificator.get(OrePrefixes.dustTiny, Materials.Emerald, 1L), GT_Values.NI, GT_Values.NI, GT_Values.NI, new int[]{5000, 1000, 1500, 0, 0, 0}, 512, 30720); addProcessLUV(tComb,Materials.Emerald,50); + addProcessLUV(tComb,Materials.MysteriousCrystal,40); tComb = getStackForType(CombType.BLACKPLUTONIUM); addProcessLUV(tComb,Materials.BlackPlutonium,25); addProcessLUV(tComb,Materials.Plutonium,50); @@ -590,6 +592,7 @@ public class ItemComb extends Item { } public void addProcessEV(ItemStack tComb, Materials aMaterial, int chance){ if(GT_Mod.gregtechproxy.mNerfedCombs){ + GT_Values.RA.addChemicalRecipe(GT_Utility.copyAmount(9, tComb), GT_OreDictUnificator.get(OrePrefixes.crushed, aMaterial, 1), Materials.Mercury.getFluid(288L), aMaterial.mOreByProducts.isEmpty() ? null : aMaterial.mOreByProducts.get(0).getMolten(144), GT_OreDictUnificator.get(OrePrefixes.crushedPurified, aMaterial, 4), 192, 1536); GT_Values.RA.addAutoclaveRecipe(GT_Utility.copyAmount(9, tComb), Materials.UUMatter.getFluid(Math.max(1, ((aMaterial.getMass()+18)/10))), GT_OreDictUnificator.get(OrePrefixes.crushedPurified, aMaterial, 4), 10000, (int) (aMaterial.getMass() * 128), 3072, true); }else{ GT_Values.RA.addCentrifugeRecipe(tComb, GT_Values.NI, GT_Values.NF, GT_Values.NF, GT_OreDictUnificator.get(OrePrefixes.dustTiny, aMaterial, 1), ItemList.FR_Wax.get(1, new Object[0]), GT_Values.NI, GT_Values.NI, GT_Values.NI, GT_Values.NI, new int[] { chance * 100, 3000 }, 224, 1920); @@ -597,6 +600,7 @@ public class ItemComb extends Item { } public void addProcessIV(ItemStack tComb, Materials aMaterial, int chance){ if(GT_Mod.gregtechproxy.mNerfedCombs){ + GT_Values.RA.addChemicalRecipe(GT_Utility.copyAmount(9, tComb), GT_OreDictUnificator.get(OrePrefixes.crushed, aMaterial, 1), Materials.Mercury.getFluid(576L), aMaterial.mOreByProducts.isEmpty() ? null : aMaterial.mOreByProducts.get(0).getMolten(144), GT_OreDictUnificator.get(OrePrefixes.crushedPurified, aMaterial, 4), 224, 6144); GT_Values.RA.addAutoclaveRecipe(GT_Utility.copyAmount(9, tComb), Materials.UUMatter.getFluid(Math.max(1, ((aMaterial.getMass()+27)/10))), GT_OreDictUnificator.get(OrePrefixes.crushedPurified, aMaterial, 4), 10000, (int) (aMaterial.getMass() * 128), 6144, true); }else{ GT_Values.RA.addCentrifugeRecipe(tComb, GT_Values.NI, GT_Values.NF, GT_Values.NF, GT_OreDictUnificator.get(OrePrefixes.dustTiny, aMaterial, 1), ItemList.FR_Wax.get(1, new Object[0]), GT_Values.NI, GT_Values.NI, GT_Values.NI, GT_Values.NI, new int[] { chance * 100, 3000 }, 256, 7680); @@ -604,7 +608,7 @@ public class ItemComb extends Item { } public void addProcessLUV(ItemStack tComb, Materials aMaterial, int chance){ if(GT_Mod.gregtechproxy.mNerfedCombs){ - GT_Values.RA.addChemicalRecipe(GT_Utility.copyAmount(9, tComb), GT_OreDictUnificator.get(OrePrefixes.crushed, aMaterial, 1), FluidRegistry.getFluidStack("mutagen", 144), aMaterial.mOreByProducts.isEmpty() ? null : aMaterial.mOreByProducts.get(0).getMolten(144), GT_OreDictUnificator.get(OrePrefixes.crushedPurified, aMaterial, 4), GT_Values.NI,256, 12288, true); + GT_Values.RA.addChemicalRecipe(GT_Utility.copyAmount(9, tComb), GT_OreDictUnificator.get(OrePrefixes.crushed, aMaterial, 1), FluidRegistry.getFluidStack("mutagen", 144), aMaterial.mOreByProducts.isEmpty() ? null : aMaterial.mOreByProducts.get(0).getMolten(144), GT_OreDictUnificator.get(OrePrefixes.crushedPurified, aMaterial, 4), GT_Values.NI,256, 24576, true); GT_Values.RA.addAutoclaveRecipe(GT_Utility.copyAmount(9, tComb), Materials.UUMatter.getFluid(Math.max(1, ((aMaterial.getMass()+36)/10))), GT_OreDictUnificator.get(OrePrefixes.crushedPurified, aMaterial, 4), 10000, (int) (aMaterial.getMass() * 128), 24576, true); }else{ GT_Values.RA.addCentrifugeRecipe(tComb, GT_Values.NI, GT_Values.NF, GT_Values.NF, GT_OreDictUnificator.get(OrePrefixes.dustTiny, aMaterial, 1), ItemList.FR_Wax.get(1, new Object[0]), GT_Values.NI, GT_Values.NI, GT_Values.NI, GT_Values.NI, new int[] { chance * 100, 3000 }, 288, 30720); @@ -612,7 +616,7 @@ public class ItemComb extends Item { } public void addProcessZPM(ItemStack tComb, Materials aMaterial, int chance){ if(GT_Mod.gregtechproxy.mNerfedCombs){ - GT_Values.RA.addChemicalRecipe(GT_Utility.copyAmount(9, tComb), GT_OreDictUnificator.get(OrePrefixes.crushed, aMaterial, 1), FluidRegistry.getFluidStack("mutagen", 288), aMaterial.mOreByProducts.isEmpty() ? null : aMaterial.mOreByProducts.get(0).getMolten(144), GT_OreDictUnificator.get(OrePrefixes.crushedPurified, aMaterial, 4), GT_Values.NI,288, 500000, true); + GT_Values.RA.addChemicalRecipe(GT_Utility.copyAmount(9, tComb), GT_OreDictUnificator.get(OrePrefixes.crushed, aMaterial, 1), FluidRegistry.getFluidStack("mutagen", 288), aMaterial.mOreByProducts.isEmpty() ? null : aMaterial.mOreByProducts.get(0).getMolten(144), GT_OreDictUnificator.get(OrePrefixes.crushedPurified, aMaterial, 4), GT_Values.NI,288, 100000, true); GT_Values.RA.addAutoclaveRecipe(GT_Utility.copyAmount(9, tComb), Materials.UUMatter.getFluid(Math.max(1, ((aMaterial.getMass()+45)/10))), GT_OreDictUnificator.get(OrePrefixes.crushedPurified, aMaterial, 4), 10000, (int) (aMaterial.getMass() * 128), 100000, true); }else{ GT_Values.RA.addCentrifugeRecipe(tComb, GT_Values.NI, GT_Values.NF, GT_Values.NF, GT_OreDictUnificator.get(OrePrefixes.dustTiny, aMaterial, 1), ItemList.FR_Wax.get(1, new Object[0]), GT_Values.NI, GT_Values.NI, GT_Values.NI, GT_Values.NI, new int[] { chance * 100, 3000 }, 320, 122880); @@ -620,7 +624,7 @@ public class ItemComb extends Item { } public void addProcessUV(ItemStack tComb, Materials aMaterial, int chance){ if(GT_Mod.gregtechproxy.mNerfedCombs){ - GT_Values.RA.addChemicalRecipe(GT_Utility.copyAmount(9, tComb), GT_OreDictUnificator.get(OrePrefixes.crushed, aMaterial, 1), FluidRegistry.getFluidStack("mutagen", 576), aMaterial.mOreByProducts.isEmpty() ? null : aMaterial.mOreByProducts.get(0).getMolten(144), GT_OreDictUnificator.get(OrePrefixes.crushedPurified, aMaterial, 4), GT_Values.NI,320, 2000000, true); + GT_Values.RA.addChemicalRecipe(GT_Utility.copyAmount(9, tComb), GT_OreDictUnificator.get(OrePrefixes.crushed, aMaterial, 1), FluidRegistry.getFluidStack("mutagen", 576), aMaterial.mOreByProducts.isEmpty() ? null : aMaterial.mOreByProducts.get(0).getMolten(144), GT_OreDictUnificator.get(OrePrefixes.crushedPurified, aMaterial, 4), GT_Values.NI,320, 400000, true); GT_Values.RA.addAutoclaveRecipe(GT_Utility.copyAmount(9, tComb), Materials.UUMatter.getFluid(Math.max(1, ((aMaterial.getMass()+54)/10))), GT_OreDictUnificator.get(OrePrefixes.crushedPurified, aMaterial, 4), 10000, (int) (aMaterial.getMass() * 128), 100000, true); }else{ GT_Values.RA.addCentrifugeRecipe(tComb, GT_Values.NI, GT_Values.NF, GT_Values.NF, GT_OreDictUnificator.get(OrePrefixes.dustTiny, aMaterial, 1), ItemList.FR_Wax.get(1, new Object[0]), GT_Values.NI, GT_Values.NI, GT_Values.NI, GT_Values.NI, new int[] { chance * 100, 3000 }, 352, 500000); -- cgit From ed30fa23cb7fcd46e9e5be9749b13d654e039dfb Mon Sep 17 00:00:00 2001 From: Dream-Master Date: Tue, 19 Mar 2019 20:44:34 +0100 Subject: add more comb recipes --- src/main/java/gregtech/common/items/ItemComb.java | 1 + 1 file changed, 1 insertion(+) (limited to 'src/main/java/gregtech/common') diff --git a/src/main/java/gregtech/common/items/ItemComb.java b/src/main/java/gregtech/common/items/ItemComb.java index ae25eb2430..c3691d96f4 100644 --- a/src/main/java/gregtech/common/items/ItemComb.java +++ b/src/main/java/gregtech/common/items/ItemComb.java @@ -288,6 +288,7 @@ public class ItemComb extends Item { addSpecialCentLV(tComb, GT_OreDictUnificator.get(OrePrefixes.dustTiny, Materials.Tin, 1), 60); addProcessLV(tComb, Materials.Tin, 100); addProcessLV(tComb, Materials.Cassiterite, 85); + addProcessLV(tComb, Materials.CassiteriteSand, 65); tComb = getStackForType(CombType.LEAD); addSpecialCentLV(tComb, GT_OreDictUnificator.get(OrePrefixes.dustTiny, Materials.Lead, 1), 45); addProcessLV(tComb, Materials.Lead, 100); -- cgit From f5f9d29c848705effe4414c2ed39ce118430476c Mon Sep 17 00:00:00 2001 From: Technus Date: Mon, 1 Apr 2019 17:23:00 +0200 Subject: Make use of scanner recipe map since i also inject my own recipes... --- .../machines/basic/GT_MetaTileEntity_Scanner.java | 286 +++++++++++---------- 1 file changed, 147 insertions(+), 139 deletions(-) (limited to 'src/main/java/gregtech/common') diff --git a/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Scanner.java b/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Scanner.java index 8e244ff502..ea7897eaca 100644 --- a/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Scanner.java +++ b/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Scanner.java @@ -29,6 +29,8 @@ import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTTagList; import net.minecraft.nbt.NBTTagString; +import static gregtech.api.util.GT_Recipe.GT_Recipe_Map.sScannerFakeRecipes; + public class GT_MetaTileEntity_Scanner extends GT_MetaTileEntity_BasicMachine { @@ -64,7 +66,7 @@ public class GT_MetaTileEntity_Scanner NBTTagCompound tNBT = new NBTTagCompound(); ((IIndividual) tIndividual).writeToNBT(tNBT); this.mOutputItems[0].setTagCompound(tNBT); - calculateOverclockedNess(2,500); + calculateOverclockedNess(2, 500); //In case recipe is too OP for that machine if (mMaxProgresstime == Integer.MAX_VALUE - 1 && mEUt == Integer.MAX_VALUE - 1) return FOUND_RECIPE_BUT_DID_NOT_MEET_REQUIREMENTS; @@ -89,7 +91,7 @@ public class GT_MetaTileEntity_Scanner } if (tNBT.getByte("scan") < 4) { tNBT.setByte("scan", (byte) 4); - calculateOverclockedNess(8,160); + calculateOverclockedNess(8, 160); //In case recipe is too OP for that machine if (mMaxProgresstime == Integer.MAX_VALUE - 1 && mEUt == Integer.MAX_VALUE - 1) return FOUND_RECIPE_BUT_DID_NOT_MEET_REQUIREMENTS; @@ -104,9 +106,9 @@ public class GT_MetaTileEntity_Scanner } if (ItemList.Tool_DataOrb.isStackEqual(getSpecialSlot(), false, true)) { if (ItemList.Tool_DataOrb.isStackEqual(aStack, false, true)) { - aStack.stackSize -= 1; + aStack.stackSize -= 1; this.mOutputItems[0] = GT_Utility.copyAmount(1L, new Object[]{getSpecialSlot()}); - calculateOverclockedNess(30,512); + calculateOverclockedNess(30, 512); //In case recipe is too OP for that machine if (mMaxProgresstime == Integer.MAX_VALUE - 1 && mEUt == Integer.MAX_VALUE - 1) return FOUND_RECIPE_BUT_DID_NOT_MEET_REQUIREMENTS; @@ -120,7 +122,7 @@ public class GT_MetaTileEntity_Scanner this.mOutputItems[0] = ItemList.Tool_DataOrb.get(1L, new Object[0]); Behaviour_DataOrb.setDataTitle(this.mOutputItems[0], "Elemental-Scan"); Behaviour_DataOrb.setDataName(this.mOutputItems[0], tData.mMaterial.mMaterial.mElement.name()); - calculateOverclockedNess(30,GT_Utility.safeInt(tData.mMaterial.mMaterial.getMass() * 8192L)); + calculateOverclockedNess(30, GT_Utility.safeInt(tData.mMaterial.mMaterial.getMass() * 8192L)); //In case recipe is too OP for that machine if (mMaxProgresstime == Integer.MAX_VALUE - 1 && mEUt == Integer.MAX_VALUE - 1) return FOUND_RECIPE_BUT_DID_NOT_MEET_REQUIREMENTS; @@ -131,7 +133,7 @@ public class GT_MetaTileEntity_Scanner if (ItemList.Tool_DataStick.isStackEqual(aStack, false, true)) { aStack.stackSize -= 1; this.mOutputItems[0] = GT_Utility.copyAmount(1L, new Object[]{getSpecialSlot()}); - calculateOverclockedNess(30,128); + calculateOverclockedNess(30, 128); //In case recipe is too OP for that machine if (mMaxProgresstime == Integer.MAX_VALUE - 1 && mEUt == Integer.MAX_VALUE - 1) return FOUND_RECIPE_BUT_DID_NOT_MEET_REQUIREMENTS; @@ -143,7 +145,7 @@ public class GT_MetaTileEntity_Scanner this.mOutputItems[0] = GT_Utility.copyAmount(1L, new Object[]{getSpecialSlot()}); this.mOutputItems[0].setTagCompound(aStack.getTagCompound()); - calculateOverclockedNess(30,128); + calculateOverclockedNess(30, 128); //In case recipe is too OP for that machine if (mMaxProgresstime == Integer.MAX_VALUE - 1 && mEUt == Integer.MAX_VALUE - 1) return FOUND_RECIPE_BUT_DID_NOT_MEET_REQUIREMENTS; @@ -155,44 +157,40 @@ public class GT_MetaTileEntity_Scanner this.mOutputItems[0] = GT_Utility.copyAmount(1L, new Object[]{getSpecialSlot()}); this.mOutputItems[0].setTagCompound(GT_Utility.getNBTContainingShort(new NBTTagCompound(), "map_id", (short) aStack.getItemDamage())); - calculateOverclockedNess(30,128); + calculateOverclockedNess(30, 128); //In case recipe is too OP for that machine if (mMaxProgresstime == Integer.MAX_VALUE - 1 && mEUt == Integer.MAX_VALUE - 1) return FOUND_RECIPE_BUT_DID_NOT_MEET_REQUIREMENTS; return 2; } - - if ((aStack.getItem().getUnlocalizedName().contains("Schematic")||aStack.getItem().getUnlocalizedName().contains("schematic"))&&!aStack.getItem().getUnlocalizedName().contains("Schematics")){ - String sTier =""; - - if (aStack.getItem().getIdFromItem(aStack.getItem()) == GT_ModHandler.getModItem("GalacticraftCore", "item.schematic", 1L, 0).getItem().getIdFromItem(GT_ModHandler.getModItem("GalacticraftCore", "item.schematic", 1L, 0).getItem())) { - if (aStack.getItemDamage()==0 && aStack.toString().equals(GT_ModHandler.getModItem("GalacticraftCore", "item.schematic", 1L, 0).copy().toString())) - sTier = "100"; - else if (aStack.getItemDamage()==1 && aStack.toString().equals(GT_ModHandler.getModItem("GalacticraftCore", "item.schematic", 1L, 1).copy().toString())) - sTier = "2"; - } - - else if (aStack.getItem().getIdFromItem(aStack.getItem()) == GT_ModHandler.getModItem("GalacticraftMars", "item.schematic", 1L, 0).getItem().getIdFromItem(GT_ModHandler.getModItem("GalacticraftMars", "item.schematic", 1L, 0).getItem())) { - if(aStack.getItemDamage()==0 && aStack.toString().equals(GT_ModHandler.getModItem("GalacticraftMars", "item.schematic", 1L, 0).copy().toString())) - sTier = "3"; - else if(aStack.getItemDamage()==1 && aStack.toString().equals(GT_ModHandler.getModItem("GalacticraftMars", "item.schematic", 1L, 1).copy().toString())) - sTier = "101"; - else if(aStack.getItemDamage()==2 && aStack.toString().equals(GT_ModHandler.getModItem("GalacticraftMars", "item.schematic", 1L, 2).copy().toString())) - sTier = "102"; - } - - else if (aStack.getUnlocalizedName().matches(".*\\d+.*")) - sTier = aStack.getUnlocalizedName().split("(?<=\\D)(?=\\d)")[1].substring(0, 1); - else - sTier = "1"; - - getSpecialSlot().stackSize -= 1; + + if ((aStack.getItem().getUnlocalizedName().contains("Schematic") || aStack.getItem().getUnlocalizedName().contains("schematic")) && !aStack.getItem().getUnlocalizedName().contains("Schematics")) { + String sTier = ""; + + if (aStack.getItem().getIdFromItem(aStack.getItem()) == GT_ModHandler.getModItem("GalacticraftCore", "item.schematic", 1L, 0).getItem().getIdFromItem(GT_ModHandler.getModItem("GalacticraftCore", "item.schematic", 1L, 0).getItem())) { + if (aStack.getItemDamage() == 0 && aStack.toString().equals(GT_ModHandler.getModItem("GalacticraftCore", "item.schematic", 1L, 0).copy().toString())) + sTier = "100"; + else if (aStack.getItemDamage() == 1 && aStack.toString().equals(GT_ModHandler.getModItem("GalacticraftCore", "item.schematic", 1L, 1).copy().toString())) + sTier = "2"; + } else if (aStack.getItem().getIdFromItem(aStack.getItem()) == GT_ModHandler.getModItem("GalacticraftMars", "item.schematic", 1L, 0).getItem().getIdFromItem(GT_ModHandler.getModItem("GalacticraftMars", "item.schematic", 1L, 0).getItem())) { + if (aStack.getItemDamage() == 0 && aStack.toString().equals(GT_ModHandler.getModItem("GalacticraftMars", "item.schematic", 1L, 0).copy().toString())) + sTier = "3"; + else if (aStack.getItemDamage() == 1 && aStack.toString().equals(GT_ModHandler.getModItem("GalacticraftMars", "item.schematic", 1L, 1).copy().toString())) + sTier = "101"; + else if (aStack.getItemDamage() == 2 && aStack.toString().equals(GT_ModHandler.getModItem("GalacticraftMars", "item.schematic", 1L, 2).copy().toString())) + sTier = "102"; + } else if (aStack.getUnlocalizedName().matches(".*\\d+.*")) + sTier = aStack.getUnlocalizedName().split("(?<=\\D)(?=\\d)")[1].substring(0, 1); + else + sTier = "1"; + + getSpecialSlot().stackSize -= 1; aStack.stackSize -= 1; - - this.mOutputItems[0] = GT_Utility.copyAmount(1L, new Object[]{getSpecialSlot()}); - this.mOutputItems[0].setTagCompound(GT_Utility.getNBTContainingShort(new NBTTagCompound(), "rocket_tier", Short.parseShort(sTier) )); - - calculateOverclockedNess(480,36000); + + this.mOutputItems[0] = GT_Utility.copyAmount(1L, new Object[]{getSpecialSlot()}); + this.mOutputItems[0].setTagCompound(GT_Utility.getNBTContainingShort(new NBTTagCompound(), "rocket_tier", Short.parseShort(sTier))); + + calculateOverclockedNess(480, 36000); //In case recipe is too OP for that machine if (mMaxProgresstime == Integer.MAX_VALUE - 1 && mEUt == Integer.MAX_VALUE - 1) return FOUND_RECIPE_BUT_DID_NOT_MEET_REQUIREMENTS; @@ -207,7 +205,7 @@ public class GT_MetaTileEntity_Scanner aStack.stackSize -= 1; this.mOutputItems[0] = GT_Utility.copyAmount(1L, new Object[]{aStack}); - calculateOverclockedNess(30,1000); + calculateOverclockedNess(30, 1000); //In case recipe is too OP for that machine if (mMaxProgresstime == Integer.MAX_VALUE - 1 && mEUt == Integer.MAX_VALUE - 1) return FOUND_RECIPE_BUT_DID_NOT_MEET_REQUIREMENTS; @@ -215,105 +213,115 @@ public class GT_MetaTileEntity_Scanner } } - if(ItemList.Tool_DataStick.isStackEqual(getSpecialSlot(), false, true)&& aStack !=null){ - for(GT_Recipe.GT_Recipe_AssemblyLine tRecipe:GT_Recipe.GT_Recipe_AssemblyLine.sAssemblylineRecipes){ - if(GT_Utility.areStacksEqual(tRecipe.mResearchItem, aStack, true)){ - - String s = tRecipe.mOutput.getDisplayName(); - if (FMLCommonHandler.instance().getEffectiveSide().isServer()) { - s = GT_Assemblyline_Server.lServerNames.get(tRecipe.mOutput.getDisplayName()); - if (s==null) - s=tRecipe.mOutput.getDisplayName(); - } - this.mOutputItems[0] = GT_Utility.copyAmount(1L, new Object[]{getSpecialSlot()}); - //remove possible old NBTTagCompound - this.mOutputItems[0].setTagCompound(new NBTTagCompound()); - GT_Utility.ItemNBT.setBookTitle(this.mOutputItems[0], s+" Construction Data"); - - NBTTagCompound tNBT = this.mOutputItems[0].getTagCompound(); - if (tNBT == null) { - tNBT = new NBTTagCompound(); - } - - tNBT.setTag("output", tRecipe.mOutput.writeToNBT(new NBTTagCompound())); - tNBT.setInteger("time", tRecipe.mDuration); - tNBT.setInteger("eu", tRecipe.mEUt); - for(int i = 0 ; i < tRecipe.mInputs.length ; i++){ - tNBT.setTag(""+i, tRecipe.mInputs[i].writeToNBT(new NBTTagCompound())); - } - for(int i = 0 ; i < tRecipe.mOreDictAlt.length ; i++){ - if (tRecipe.mOreDictAlt[i] != null && tRecipe.mOreDictAlt[i].length > 0) { - tNBT.setInteger("a" + i, tRecipe.mOreDictAlt[i].length); - for (int j = 0; j < tRecipe.mOreDictAlt[i].length; j++) { - tNBT.setTag("a" + i + ":" + j, tRecipe.mOreDictAlt[i][j].writeToNBT(new NBTTagCompound())); - } - } - } - for(int i = 0 ; i < tRecipe.mFluidInputs.length ; i++){ - tNBT.setTag("f"+i, tRecipe.mFluidInputs[i].writeToNBT(new NBTTagCompound())); - } - tNBT.setString("author", "Assembling Line Recipe Generator"); - NBTTagList tNBTList = new NBTTagList(); - s=tRecipe.mOutput.getDisplayName(); - if (FMLCommonHandler.instance().getEffectiveSide().isServer()) { - s = GT_Assemblyline_Server.lServerNames.get(tRecipe.mOutput.getDisplayName()); - if (s==null) - s=tRecipe.mOutput.getDisplayName(); - } - tNBTList.appendTag(new NBTTagString("Construction plan for "+tRecipe.mOutput.stackSize+" "+s+". Needed EU/t: "+tRecipe.mEUt+" Production time: "+(tRecipe.mDuration/20))); - for(int i=0;i 0) tNBTList.appendTag(new NBTTagString(tBuilder.toString())); - } else if(tRecipe.mInputs[i]!=null){ - s=tRecipe.mInputs[i].getDisplayName(); - if (FMLCommonHandler.instance().getEffectiveSide().isServer()) { - s = GT_Assemblyline_Server.lServerNames.get(tRecipe.mInputs[i].getDisplayName()); - if (s==null) - s=tRecipe.mInputs[i].getDisplayName(); - } - tNBTList.appendTag(new NBTTagString("Input Bus "+(i+1)+": "+tRecipe.mInputs[i].stackSize+" "+s)); - } - } - for(int i=0;i 0) { + tNBT.setInteger("a" + i, tRecipe.mOreDictAlt[i].length); + for (int j = 0; j < tRecipe.mOreDictAlt[i].length; j++) { + tNBT.setTag("a" + i + ":" + j, tRecipe.mOreDictAlt[i][j].writeToNBT(new NBTTagCompound())); + } + } + } + for (int i = 0; i < tRecipe.mFluidInputs.length; i++) { + tNBT.setTag("f" + i, tRecipe.mFluidInputs[i].writeToNBT(new NBTTagCompound())); + } + tNBT.setString("author", "Assembling Line Recipe Generator"); + NBTTagList tNBTList = new NBTTagList(); + s = tRecipe.mOutput.getDisplayName(); + if (FMLCommonHandler.instance().getEffectiveSide().isServer()) { + s = GT_Assemblyline_Server.lServerNames.get(tRecipe.mOutput.getDisplayName()); + if (s == null) + s = tRecipe.mOutput.getDisplayName(); + } + tNBTList.appendTag(new NBTTagString("Construction plan for " + tRecipe.mOutput.stackSize + " " + s + ". Needed EU/t: " + tRecipe.mEUt + " Production time: " + (tRecipe.mDuration / 20))); + for (int i = 0; i < tRecipe.mInputs.length; i++) { + if (tRecipe.mOreDictAlt[i] != null) { + int count = 0; + StringBuilder tBuilder = new StringBuilder("Input Bus " + (i + 1) + ": "); + for (ItemStack tStack : tRecipe.mOreDictAlt[i]) { + if (tStack != null) { + s = tStack.getDisplayName(); + if (FMLCommonHandler.instance().getEffectiveSide().isServer()) { + s = GT_Assemblyline_Server.lServerNames.get(tStack.getDisplayName()); + if (s == null) + s = tStack.getDisplayName(); + } + + + tBuilder.append((count == 0 ? "" : "\nOr ") + tStack.stackSize + " " + s); + count++; + } + } + if (count > 0) tNBTList.appendTag(new NBTTagString(tBuilder.toString())); + } else if (tRecipe.mInputs[i] != null) { + s = tRecipe.mInputs[i].getDisplayName(); + if (FMLCommonHandler.instance().getEffectiveSide().isServer()) { + s = GT_Assemblyline_Server.lServerNames.get(tRecipe.mInputs[i].getDisplayName()); + if (s == null) + s = tRecipe.mInputs[i].getDisplayName(); + } + tNBTList.appendTag(new NBTTagString("Input Bus " + (i + 1) + ": " + tRecipe.mInputs[i].stackSize + " " + s)); + } + } + for (int i = 0; i < tRecipe.mFluidInputs.length; i++) { + if (tRecipe.mFluidInputs[i] != null) { + s = tRecipe.mFluidInputs[i].getLocalizedName(); + if (FMLCommonHandler.instance().getEffectiveSide().isServer()) { + s = GT_Assemblyline_Server.lServerNames.get(tRecipe.mFluidInputs[i].getLocalizedName()); + if (s == null) + s = tRecipe.mFluidInputs[i].getLocalizedName(); + } + tNBTList.appendTag(new NBTTagString("Input Hatch " + (i + 1) + ": " + tRecipe.mFluidInputs[i].amount + "L " + s)); + } + } + tNBT.setTag("pages", tNBTList); + + this.mOutputItems[0].setTagCompound(tNBT); + + aStack.stackSize -= 1; + calculateOverclockedNess(30, tRecipe.mResearchTime); + //In case recipe is too OP for that machine + if (mMaxProgresstime == Integer.MAX_VALUE - 1 && mEUt == Integer.MAX_VALUE - 1) + return FOUND_RECIPE_BUT_DID_NOT_MEET_REQUIREMENTS; + getSpecialSlot().stackSize -= 1; + return 2; + } } - tNBT.setTag("pages", tNBTList); - - this.mOutputItems[0].setTagCompound(tNBT); - - aStack.stackSize -= 1; - calculateOverclockedNess(30,tRecipe.mResearchTime); - //In case recipe is too OP for that machine - if (mMaxProgresstime == Integer.MAX_VALUE - 1 && mEUt == Integer.MAX_VALUE - 1) - return FOUND_RECIPE_BUT_DID_NOT_MEET_REQUIREMENTS; - getSpecialSlot().stackSize -= 1; - return 2; - } - } } } @@ -332,7 +340,7 @@ public class GT_MetaTileEntity_Scanner public GT_Recipe.GT_Recipe_Map getRecipeList() { - return GT_Recipe.GT_Recipe_Map.sScannerFakeRecipes; + return sScannerFakeRecipes; } public int getCapacity() { -- cgit