From c8e15b35fa6060e4c9fd45a61c1837e0289ee000 Mon Sep 17 00:00:00 2001 From: Alkalus <3060479+draknyte1@users.noreply.github.com> Date: Sun, 28 Nov 2021 00:26:53 +0000 Subject: Fix a heap of conflicting dehydrator recipes. --- .../gtPlusPlus/core/item/chemistry/CoalTar.java | 45 ++++++++++++++-------- .../core/item/chemistry/RocketFuels.java | 4 +- 2 files changed, 31 insertions(+), 18 deletions(-) (limited to 'src/Java/gtPlusPlus/core/item') diff --git a/src/Java/gtPlusPlus/core/item/chemistry/CoalTar.java b/src/Java/gtPlusPlus/core/item/chemistry/CoalTar.java index badd318414..ca9053dacb 100644 --- a/src/Java/gtPlusPlus/core/item/chemistry/CoalTar.java +++ b/src/Java/gtPlusPlus/core/item/chemistry/CoalTar.java @@ -53,27 +53,35 @@ public class CoalTar extends ItemPackage { FluidStack bioEth1 = FluidUtils.getFluidStack("fluid.bioethanol", 2000); FluidStack bioEth2 = FluidUtils.getFluidStack("bioethanol", 2000); - if (bioEth1 != null){ + if (bioEth1 != null){ CORE.RA.addDehydratorRecipe( - ItemUtils.getItemStackOfAmountFromOreDict("cellEmpty", 2), - bioEth1, + new ItemStack[] { + CI.getNumberedBioCircuit(17), + ItemUtils.getItemStackOfAmountFromOreDict("cellEmpty", 1) + }, + bioEth1, + FluidUtils.getWater(1000), new ItemStack[]{ - ItemUtils.getItemStackOfAmountFromOreDict("cellWater", 1), ItemUtils.getItemStackOfAmountFromOreDict("cellEthylene", 1) - }, - 120*20, + }, + new int[] {10000}, + 120 * 20, 80); } if (bioEth2 != null){ CORE.RA.addDehydratorRecipe( - ItemUtils.getItemStackOfAmountFromOreDict("cellEmpty", 2), - bioEth2, + new ItemStack[] { + CI.getNumberedBioCircuit(18), + ItemUtils.getItemStackOfAmountFromOreDict("cellEmpty", 1) + }, + bioEth2, + FluidUtils.getWater(1000), new ItemStack[]{ - ItemUtils.getItemStackOfAmountFromOreDict("cellWater", 1), ItemUtils.getItemStackOfAmountFromOreDict("cellEthylene", 1) - }, - 120*20, + }, + new int[] {10000}, + 120 * 20, 80); } } @@ -241,16 +249,19 @@ public class CoalTar extends ItemPackage { } - private static void recipePhthalicAcidToPhthalicAnhydride() { + private static void recipePhthalicAcidToPhthalicAnhydride() { CORE.RA.addDehydratorRecipe( - ItemUtils.getGregtechCircuit(6), - FluidUtils.getFluidStack("fluid.phthalicacid", 144), + new ItemStack[] { + CI.getNumberedBioCircuit(15) + }, + FluidUtils.getFluidStack("fluid.phthalicacid", 144), + null, new ItemStack[]{ ItemUtils.getItemStackOfAmountFromOreDict("dustPhthalicAnhydride", 1) - }, - 60*20, + }, + new int[] {10000}, + 60 * 20, 120); - } @Override diff --git a/src/Java/gtPlusPlus/core/item/chemistry/RocketFuels.java b/src/Java/gtPlusPlus/core/item/chemistry/RocketFuels.java index 66f20e0079..094cb59cb7 100644 --- a/src/Java/gtPlusPlus/core/item/chemistry/RocketFuels.java +++ b/src/Java/gtPlusPlus/core/item/chemistry/RocketFuels.java @@ -209,7 +209,9 @@ public class RocketFuels extends ItemPackage { new ItemStack[] {CI.getNumberedCircuit(8)}, FluidUtils.getFluidStack(Hydrated_Ammonium_Nitrate_Slurry, 8*144), FluidUtils.getWater(2000), - new ItemStack[] {ItemUtils.getSimpleStack(Ammonium_Nitrate_Dust, 8)}, + new ItemStack[] { + ItemUtils.getSimpleStack(Ammonium_Nitrate_Dust, 8) + }, new int[] {10000}, 90 * 20, 480); -- cgit From d76fe6c897d28af0f99c0fa04c7de7c654497742 Mon Sep 17 00:00:00 2001 From: Alkalus <3060479+draknyte1@users.noreply.github.com> Date: Sun, 28 Nov 2021 16:46:38 +0000 Subject: Added NEI handler for LFTR Sparging. Fixed Material generation for noble gases. Fixed Chemical Formula not being applied to some cells. --- src/Java/gregtech/api/util/GasSpargingRecipe.java | 53 ++++ .../gregtech/api/util/GasSpargingRecipeMap.java | 35 +++ src/Java/gtPlusPlus/core/item/ModItems.java | 2 + .../core/item/base/BaseItemComponent.java | 15 +- src/Java/gtPlusPlus/core/material/ELEMENT.java | 6 +- .../gtPlusPlus/core/material/MISC_MATERIALS.java | 12 +- src/Java/gtPlusPlus/core/material/Material.java | 16 +- .../core/material/MaterialGenerator.java | 4 + .../core/material/state/MaterialState.java | 3 +- .../gtPlusPlus/core/util/minecraft/FluidUtils.java | 18 +- src/Java/gtPlusPlus/nei/NEI_GT_Config.java | 4 + src/Java/gtPlusPlus/nei/NEI_IMC_Sender.java | 1 + src/Java/gtPlusPlus/nei/SpargingRecipeHandler.java | 317 +++++++++++++++++++++ .../production/GregtechMTE_NuclearReactor.java | 2 +- .../gregtech/loaders/RecipeGen_DustGeneration.java | 2 +- .../gregtech/loaders/recipe/RecipeLoader_LFTR.java | 85 +++++- 16 files changed, 546 insertions(+), 29 deletions(-) create mode 100644 src/Java/gregtech/api/util/GasSpargingRecipe.java create mode 100644 src/Java/gregtech/api/util/GasSpargingRecipeMap.java create mode 100644 src/Java/gtPlusPlus/nei/SpargingRecipeHandler.java (limited to 'src/Java/gtPlusPlus/core/item') diff --git a/src/Java/gregtech/api/util/GasSpargingRecipe.java b/src/Java/gregtech/api/util/GasSpargingRecipe.java new file mode 100644 index 0000000000..7bbebf0bcf --- /dev/null +++ b/src/Java/gregtech/api/util/GasSpargingRecipe.java @@ -0,0 +1,53 @@ +package gregtech.api.util; + +import net.minecraft.item.ItemStack; +import net.minecraftforge.fluids.FluidStack; + +public class GasSpargingRecipe { + + public final FluidStack mInputGas; + public final int[] mMaxOutputQuantity; + public final FluidStack[] mFluidInputs; + public final FluidStack[] mFluidOutputs; + public final ItemStack[] mInputs; + public final ItemStack[] mOutputs; + + public GasSpargingRecipe(FluidStack aSpargeGas, FluidStack[] aOutputs, int[] aMaxOutputQuantity) { + mInputGas = aSpargeGas; + mFluidInputs = new FluidStack[] {mInputGas}; + mFluidOutputs = aOutputs; + mMaxOutputQuantity = aMaxOutputQuantity; + mInputs = new ItemStack[] {GT_Utility.getFluidDisplayStack(mFluidInputs[0], true)}; + mOutputs = new ItemStack[mFluidOutputs.length]; + for (int i=0; i= this.mMaxOutputQuantity.length)) { + return 10000; + } + return this.mMaxOutputQuantity[aIndex]; + } + + public boolean isValid() { + if (mInputGas == null || mInputGas.amount <= 0 || + mFluidOutputs == null || mFluidOutputs.length < 1 || + mMaxOutputQuantity == null || mMaxOutputQuantity.length < 1 || + mFluidOutputs.length != mMaxOutputQuantity.length) { + return false; + } + return true; + } + +} diff --git a/src/Java/gregtech/api/util/GasSpargingRecipeMap.java b/src/Java/gregtech/api/util/GasSpargingRecipeMap.java new file mode 100644 index 0000000000..4f4bba9aca --- /dev/null +++ b/src/Java/gregtech/api/util/GasSpargingRecipeMap.java @@ -0,0 +1,35 @@ +package gregtech.api.util; + +import static gregtech.api.enums.GT_Values.RES_PATH_GUI; + +import gtPlusPlus.api.objects.data.AutoMap; +import net.minecraftforge.fluids.FluidStack; + +public class GasSpargingRecipeMap extends AutoMap{ + + public static final AutoMap mRecipes = new AutoMap(); + public static final String mUnlocalizedName = "gtpp.recipe.lftr.sparging"; + public static final String mNEIName = mUnlocalizedName; + public static final String mNEIDisplayName = "LFTR Gas Sparging"; + public static final String mNEIGUIPath = RES_PATH_GUI + "basicmachines/FissionFuel.png"; + + + public static boolean addRecipe(FluidStack aSpargeGas, FluidStack[] aOutputs, int[] aMaxOutputs) { + if (aSpargeGas == null || aSpargeGas.amount <= 0 || + aOutputs == null || aOutputs.length < 1 || + aMaxOutputs == null || aMaxOutputs.length < 1 || + aOutputs.length != aMaxOutputs.length) { + return false; + } + int aMapSize = mRecipes.size(); + GasSpargingRecipe aRecipe = new GasSpargingRecipe( + aSpargeGas, + aOutputs, + aMaxOutputs + ); + mRecipes.put(aRecipe); + return mRecipes.size() > aMapSize; + } +} + + diff --git a/src/Java/gtPlusPlus/core/item/ModItems.java b/src/Java/gtPlusPlus/core/item/ModItems.java index 1e0b779bac..e95b646f8e 100644 --- a/src/Java/gtPlusPlus/core/item/ModItems.java +++ b/src/Java/gtPlusPlus/core/item/ModItems.java @@ -232,6 +232,7 @@ public final class ModItems { public static Item dustFertUN32; public static Fluid fluidFLiBeSalt; + public static Fluid fluidFLiBeSaltBurnt; //Possibly missing base items that GT may be missing. @@ -715,6 +716,7 @@ public final class ModItems { dustLi2BeF4 = ItemUtils.generateSpecialUseDusts("Li2BeF4", "Li2BeF4 Fuel Compound", "Li2BeF4", Utils.rgbtoHexValue(255, 255, 255))[0]; //https://en.wikipedia.org/wiki/FLiBe //fluidFLiBeSalt = ("Li2BeF4", "Li2BeF4", 7430, new short[]{255, 255, 255, 100}, 0); fluidFLiBeSalt = FluidUtils.addGTFluidNoPrefix("Li2BeF4", "Li2BeF4", new short[]{255, 255, 255, 100}, 0, 743, null, CI.emptyCells(1), 1000, true); + fluidFLiBeSaltBurnt = FluidUtils.addGTFluidNoPrefix("Li2BeF2UF4", "Li2BeF2UF4", new short[]{50, 255, 50, 100}, 0, 743, null, CI.emptyCells(1), 1000, true); //LFTR Control Circuit itemCircuitLFTR = new CoreItem("itemCircuitLFTR", ""+EnumChatFormatting.GREEN+"Control Circuit", AddToCreativeTab.tabMisc, 1, 0, new String[] {"Keeps Multiblocks Stable"}, EnumRarity.epic, EnumChatFormatting.DARK_GREEN, false, null); diff --git a/src/Java/gtPlusPlus/core/item/base/BaseItemComponent.java b/src/Java/gtPlusPlus/core/item/base/BaseItemComponent.java index 9b732e38e1..1975e7770d 100644 --- a/src/Java/gtPlusPlus/core/item/base/BaseItemComponent.java +++ b/src/Java/gtPlusPlus/core/item/base/BaseItemComponent.java @@ -46,6 +46,8 @@ public class BaseItemComponent extends Item{ public final int componentColour; public Object extraData; + private static HashMap mChemicalFormula = new HashMap(); + protected IIcon base; protected IIcon overlay; @@ -59,6 +61,7 @@ public class BaseItemComponent extends Item{ this.setMaxStackSize(64); //this.setTextureName(this.getCorrectTextures()); this.componentColour = material.getRgbAsHex(); + mChemicalFormula.put(materialName.toLowerCase(), material.vChemicalFormula); GameRegistry.registerItem(this, this.unlocalName); //if (componentType != ComponentTypes.DUST) @@ -84,8 +87,9 @@ public class BaseItemComponent extends Item{ else { aFormattedNameForFluids = unlocalName; } - - this.componentMaterial = null; + Material aTempMaterial = Material.mMaterialCache.get(localName.toLowerCase()); + Logger.INFO("Attempted to get "+localName+" cell material from cache. Valid? "+(aTempMaterial != null)); + this.componentMaterial = aTempMaterial; this.unlocalName = "itemCell"+aFormattedNameForFluids; this.materialName = localName; this.componentType = ComponentTypes.CELL; @@ -94,6 +98,7 @@ public class BaseItemComponent extends Item{ this.setMaxStackSize(64); this.componentColour = MathUtils.getRgbAsHex(RGBA); this.extraData = RGBA; + this.setTextureName(CORE.MODID + ":" + "item"+ComponentTypes.CELL.COMPONENT_NAME); GameRegistry.registerItem(this, aFormattedNameForFluids); GT_OreDictUnificator.registerOre(ComponentTypes.CELL.getOreDictName()+Utils.sanitizeStringKeepBrackets(localName), ItemUtils.getSimpleStack(this)); @@ -202,6 +207,12 @@ public class BaseItemComponent extends Item{ } } } + else { + String aChemicalFormula = mChemicalFormula.get(materialName.toLowerCase()); + if (aChemicalFormula != null && aChemicalFormula.length() > 0) { + list.add(Utils.sanitizeStringKeepBrackets(aChemicalFormula)); + } + } //Hidden Tooltip if (KeyboardUtils.isCtrlKeyDown()) { diff --git a/src/Java/gtPlusPlus/core/material/ELEMENT.java b/src/Java/gtPlusPlus/core/material/ELEMENT.java index 3af8b560ad..0ad231aac8 100644 --- a/src/Java/gtPlusPlus/core/material/ELEMENT.java +++ b/src/Java/gtPlusPlus/core/material/ELEMENT.java @@ -23,7 +23,7 @@ public final class ELEMENT { public final Material NITROGEN = MaterialUtils.generateMaterialFromGtENUM(Materials.Nitrogen); public final Material OXYGEN = MaterialUtils.generateMaterialFromGtENUM(Materials.Oxygen); public final Material FLUORINE = MaterialUtils.generateMaterialFromGtENUM(Materials.Fluorine); - public final Material NEON = new Material("Neon", MaterialState.GAS, new short[]{255, 255, 255}, -248, -246, 10, 10, false, "Ne", 0);//Not a GT Inherited Material + public final Material NEON = new Material("Neon", MaterialState.PURE_GAS, new short[]{240, 180, 30}, -248, -246, 10, 10, false, "Ne", 0);//Not a GT Inherited Material public final Material SODIUM = MaterialUtils.generateMaterialFromGtENUM(Materials.Sodium); public final Material MAGNESIUM = MaterialUtils.generateMaterialFromGtENUM(Materials.Magnesium); public final Material ALUMINIUM = MaterialUtils.generateMaterialFromGtENUM(Materials.Aluminium); @@ -51,7 +51,7 @@ public final class ELEMENT { public final Material ARSENIC = MaterialUtils.generateMaterialFromGtENUM(Materials.Arsenic); public final Material SELENIUM = new Material("Selenium", MaterialState.SOLID, new short[]{190, 190, 190}, 217, 685, 34, 45, false, "Se", 0);//Not a GT Inherited Material public final Material BROMINE = new Material("Bromine", MaterialState.PURE_LIQUID, new short[]{200, 25, 25}, -7, 58, 35, 45, false, "Br", 0);//Not a GT Inherited Material - public final Material KRYPTON = new Material("Krypton", MaterialState.PURE_LIQUID, new short[]{255, 255, 255}, -157, -153, 36, 48, false, "Kr", 0);//Not a GT Inherited Material + public final Material KRYPTON = new Material("Krypton", MaterialState.PURE_GAS, new short[]{5, 200, 220}, -157, -153, 36, 48, false, "Kr", 0);//Not a GT Inherited Material public final Material RUBIDIUM = MaterialUtils.generateMaterialFromGtENUM(Materials.Rubidium); public final Material STRONTIUM = MaterialUtils.generateMaterialFromGtENUM(Materials.Strontium, new short[] {230, 210, 110}, TextureSet.SET_FLINT); public final Material YTTRIUM = MaterialUtils.generateMaterialFromGtENUM(Materials.Yttrium); @@ -69,7 +69,7 @@ public final class ELEMENT { public final Material ANTIMONY = MaterialUtils.generateMaterialFromGtENUM(Materials.Antimony); public final Material TELLURIUM = new Material("Tellurium", MaterialState.SOLID, new short[]{210, 210, 210}, 449, 989, 52, 76, false, "Te", 0);//Not a GT Inherited Material public final Material IODINE = new Material("Iodine", MaterialState.SOLID, TextureSet.SET_SHINY, new short[]{96, 96, 96}, 114, 184, 53, 74, false, "I", 0);//Not a GT Inherited Material - public final Material XENON = new Material("Xenon", MaterialState.GAS, new short[]{255, 255, 255}, -111, -108, 54, 77, false, "Xe", 0);//Not a GT Inherited Material + public final Material XENON = new Material("Xenon", MaterialState.PURE_GAS, new short[]{5, 105, 210}, -111, -108, 54, 77, false, "Xe", 0);//Not a GT Inherited Material public final Material CAESIUM = MaterialUtils.generateMaterialFromGtENUM(Materials.Caesium); public final Material BARIUM = MaterialUtils.generateMaterialFromGtENUM(Materials.Barium); public final Material LANTHANUM = MaterialUtils.generateMaterialFromGtENUM(Materials.Lanthanum); diff --git a/src/Java/gtPlusPlus/core/material/MISC_MATERIALS.java b/src/Java/gtPlusPlus/core/material/MISC_MATERIALS.java index 8dad69f70a..aaee1cc790 100644 --- a/src/Java/gtPlusPlus/core/material/MISC_MATERIALS.java +++ b/src/Java/gtPlusPlus/core/material/MISC_MATERIALS.java @@ -71,7 +71,7 @@ public final class MISC_MATERIALS { public static final Material HYDROGEN_CYANIDE = new Material( "Hydrogen Cyanide", - MaterialState.PURE_LIQUID, //State + MaterialState.PURE_GAS, //State null, //Material Colour 4, //Melting Point in C 26, //Boiling Point in C @@ -87,7 +87,7 @@ public final class MISC_MATERIALS { public static final Material CARBON_MONOXIDE = new Material( "Carbon Monoxide", - MaterialState.PURE_LIQUID, //State + MaterialState.PURE_GAS, //State null, //Material Colour -1, //Melting Point in C -1, //Boiling Point in C @@ -102,7 +102,7 @@ public final class MISC_MATERIALS { public static final Material CARBON_DIOXIDE = new Material( "Carbon Dioxide", - MaterialState.PURE_LIQUID, //State + MaterialState.PURE_GAS, //State null, //Material Colour -1, //Melting Point in C -1, //Boiling Point in C @@ -245,7 +245,7 @@ public final class MISC_MATERIALS { public static final Material HYDROGEN_CHLORIDE = new Material( "Hydrogen Chloride", - MaterialState.PURE_LIQUID, + MaterialState.PURE_GAS, new MaterialStack[]{ new MaterialStack(ELEMENT.getInstance().HYDROGEN, 1), new MaterialStack(ELEMENT.getInstance().CHLORINE, 1), @@ -254,7 +254,7 @@ public final class MISC_MATERIALS { public static final Material SODIUM_CHLORIDE = new Material( "Sodium Chloride", - MaterialState.PURE_LIQUID, + MaterialState.PURE_GAS, new MaterialStack[]{ new MaterialStack(ELEMENT.getInstance().SODIUM, 1), new MaterialStack(ELEMENT.getInstance().CHLORINE, 1), @@ -263,7 +263,7 @@ public final class MISC_MATERIALS { public static final Material SODIUM_HYDROXIDE = new Material( "Sodium Hydroxide", - MaterialState.PURE_LIQUID, + MaterialState.PURE_GAS, new MaterialStack[]{ new MaterialStack(ELEMENT.getInstance().SODIUM, 1), new MaterialStack(HYDROXIDE, 1), diff --git a/src/Java/gtPlusPlus/core/material/Material.java b/src/Java/gtPlusPlus/core/material/Material.java index dee064353a..c4131d99e7 100644 --- a/src/Java/gtPlusPlus/core/material/Material.java +++ b/src/Java/gtPlusPlus/core/material/Material.java @@ -3,7 +3,11 @@ package gtPlusPlus.core.material; import static gregtech.api.enums.GT_Values.M; import static gtPlusPlus.core.util.math.MathUtils.safeCast_LongToInt; -import java.util.*; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Set; import gregtech.api.enums.Materials; import gregtech.api.enums.OrePrefixes; @@ -33,6 +37,7 @@ import net.minecraftforge.fluids.FluidStack; public class Material { public static final Set mMaterialMap = new HashSet(); + public static HashMap mMaterialCache = new HashMap(); public static final Map> mComponentMap = new HashMap>(); @@ -163,6 +168,8 @@ public class Material { try { this.unlocalizedName = Utils.sanitizeString(materialName); this.localizedName = materialName; + mMaterialCache.put(getLocalizedName().toLowerCase(), this); + Logger.INFO("Stored "+getLocalizedName()+" to cache with key: "+getLocalizedName().toLowerCase()); this.materialState = defaultState; @@ -1185,8 +1192,9 @@ public class Material { 1000, this.vGenerateCells); } - else if (this.materialState == MaterialState.GAS){ - return FluidUtils.addGTFluid( + else if (this.materialState == MaterialState.GAS || this.materialState == MaterialState.PURE_GAS){ + return FluidUtils.generateGas(unlocalizedName, this.getLocalizedName(), getMeltingPointK(), getRGBA(), vGenerateCells); + /*return FluidUtils.addGTFluid( this.getUnlocalizedName(), this.getLocalizedName()+" Gas", this.RGBA, @@ -1195,7 +1203,7 @@ public class Material { aFullCell, ItemUtils.getEmptyCell(), 1000, - this.vGenerateCells); + this.vGenerateCells);*/ } else { //Plasma return this.generatePlasma(); diff --git a/src/Java/gtPlusPlus/core/material/MaterialGenerator.java b/src/Java/gtPlusPlus/core/material/MaterialGenerator.java index 20fdfd3c8c..68026d1cac 100644 --- a/src/Java/gtPlusPlus/core/material/MaterialGenerator.java +++ b/src/Java/gtPlusPlus/core/material/MaterialGenerator.java @@ -188,6 +188,10 @@ public class MaterialGenerator { temp = new BaseItemDust(matInfo); FluidUtils.generateGas(unlocalizedName, materialName, matInfo.getMeltingPointK(), C, true); } + else if (matInfo.getState() == MaterialState.PURE_GAS){ + FluidUtils.generateGas(unlocalizedName, materialName, matInfo.getMeltingPointK(), C, true); + return true; + } else if (matInfo.getState() == MaterialState.PURE_LIQUID){ FluidUtils.generateFluidNoPrefix(unlocalizedName, materialName, matInfo.getMeltingPointK(), C); return true; diff --git a/src/Java/gtPlusPlus/core/material/state/MaterialState.java b/src/Java/gtPlusPlus/core/material/state/MaterialState.java index 284e9582f1..460fe019dc 100644 --- a/src/Java/gtPlusPlus/core/material/state/MaterialState.java +++ b/src/Java/gtPlusPlus/core/material/state/MaterialState.java @@ -6,7 +6,8 @@ public enum MaterialState { GAS(2), PLASMA(3), PURE_LIQUID(4), - ORE(5); + ORE(5), + PURE_GAS(6); private int STATE; private MaterialState (final int State){ this.STATE = State; diff --git a/src/Java/gtPlusPlus/core/util/minecraft/FluidUtils.java b/src/Java/gtPlusPlus/core/util/minecraft/FluidUtils.java index 758ec8bab0..7b945ba507 100644 --- a/src/Java/gtPlusPlus/core/util/minecraft/FluidUtils.java +++ b/src/Java/gtPlusPlus/core/util/minecraft/FluidUtils.java @@ -232,6 +232,7 @@ public class FluidUtils { public static Fluid addGTFluid(String aName, final String aTexture, final String aLocalized, final short[] aRGBa, final int aState, final long aTemperatureK, ItemStack aFullContainer, final ItemStack aEmptyContainer, final int aFluidAmount, final boolean aGenerateFilledCell) { String aNameOriginal = aName; + Logger.INFO("Generating Fluid for "+aName); aName = Utils.sanitizeString(aName.toLowerCase()); @@ -288,8 +289,18 @@ public class FluidUtils { if (aFullContainer == null) { - ItemStack oreStack = ItemUtils.getItemStackOfAmountFromOreDictNoBroken("cell"+aName, 1); - aFullContainer = oreStack; + ItemStack oreStack = ItemUtils.getItemStackOfAmountFromOreDictNoBroken("cell"+aLocalName, 1); + aFullContainer = oreStack; + if (aFullContainer == null) { + oreStack = ItemUtils.getItemStackOfAmountFromOreDictNoBroken("cell"+aNameOriginal, 1); + aFullContainer = oreStack; + if (aFullContainer != null) { + Logger.INFO("Found cell for "+aNameOriginal); + } + } + else { + Logger.INFO("Found cell for "+aLocalName); + } } Item tempCell = null; @@ -304,7 +315,8 @@ public class FluidUtils { aMatName = aMatName.replace("fluid.", ""); aMatName = aMatName.substring(0, 1).toUpperCase() + aMatName.substring(1); } - tempCell = new BaseItemComponent(aMatName, aLocalized, aRGBa); + Logger.INFO("Generating cell for "+aMatName+", "+aLocalName); + tempCell = new BaseItemComponent(aMatName, aLocalName, aRGBa); aFullContainer = ItemUtils.getSimpleStack(tempCell); } diff --git a/src/Java/gtPlusPlus/nei/NEI_GT_Config.java b/src/Java/gtPlusPlus/nei/NEI_GT_Config.java index 1c647210c0..06e02d273b 100644 --- a/src/Java/gtPlusPlus/nei/NEI_GT_Config.java +++ b/src/Java/gtPlusPlus/nei/NEI_GT_Config.java @@ -91,6 +91,10 @@ implements IConfigureNEI { API.registerRecipeHandler(new DecayableRecipeHandler()); API.registerUsageHandler(new DecayableRecipeHandler()); + Logger.INFO("NEI Registration: Registering NEI handler for "+SpargingRecipeHandler.mNEIName); + API.registerRecipeHandler(new SpargingRecipeHandler()); + API.registerUsageHandler(new SpargingRecipeHandler()); + // Hide Flasks if (Utils.isClient()) { codechicken.nei.api.API.addItemListEntry(GregtechItemList.VOLUMETRIC_FLASK_8k.get(1)); diff --git a/src/Java/gtPlusPlus/nei/NEI_IMC_Sender.java b/src/Java/gtPlusPlus/nei/NEI_IMC_Sender.java index 16a8f9b677..e3712f5ab2 100644 --- a/src/Java/gtPlusPlus/nei/NEI_IMC_Sender.java +++ b/src/Java/gtPlusPlus/nei/NEI_IMC_Sender.java @@ -20,6 +20,7 @@ public class NEI_IMC_Sender { setNBTInfoAndSendIt("gtpp.recipe.fissionfuel", "gregtech:gt.blockmachines:835"); setNBTInfoAndSendIt("gtpp.recipe.geothermalfuel", "gregtech:gt.blockmachines:830"); setNBTInfoAndSendIt("gtpp.recipe.lftr", "gregtech:gt.blockmachines:751"); + setNBTInfoAndSendIt("gtpp.recipe.lftr.sparging", "gregtech:gt.blockmachines:751"); setNBTInfoAndSendIt("gtpp.recipe.matterfab2", "gregtech:gt.blockmachines:799"); setNBTInfoAndSendIt("gtpp.recipe.multicentrifuge", "gregtech:gt.blockmachines:790"); setNBTInfoAndSendIt("gtpp.recipe.multielectro", "gregtech:gt.blockmachines:796"); diff --git a/src/Java/gtPlusPlus/nei/SpargingRecipeHandler.java b/src/Java/gtPlusPlus/nei/SpargingRecipeHandler.java new file mode 100644 index 0000000000..2373d55967 --- /dev/null +++ b/src/Java/gtPlusPlus/nei/SpargingRecipeHandler.java @@ -0,0 +1,317 @@ +package gtPlusPlus.nei; + +import java.awt.Rectangle; +import java.util.ArrayList; +import java.util.Collections; +import java.util.Iterator; +import java.util.List; + +import codechicken.nei.PositionedStack; +import codechicken.nei.recipe.GuiRecipe; +import codechicken.nei.recipe.TemplateRecipeHandler; +import gregtech.api.enums.ItemList; +import gregtech.api.util.GT_Utility; +import gregtech.api.util.GasSpargingRecipe; +import gregtech.api.util.GasSpargingRecipeMap; +import gtPlusPlus.api.objects.Logger; +import gtPlusPlus.core.gui.machine.GUI_DecayablesChest; +import gtPlusPlus.core.util.minecraft.ItemUtils; +import net.minecraft.client.gui.inventory.GuiContainer; +import net.minecraft.init.Blocks; +import net.minecraft.item.ItemStack; + +public class SpargingRecipeHandler extends TemplateRecipeHandler { + + public static final String mNEIName = GasSpargingRecipeMap.mNEIDisplayName; + + public String getRecipeName() { + return mNEIName; + } + + public String getGuiTexture() { + return GasSpargingRecipeMap.mNEIGUIPath; + } + + public Class getGuiClass() { + return GUI_DecayablesChest.class; + } + + public String getOverlayIdentifier() { + return "GTPP_Sparging"; + } + + public int recipiesPerPage() { + return 1; + } + + public void loadTransferRects() { + this.transferRects.add(new RecipeTransferRect(new Rectangle(72, 14, 22, 16), getOverlayIdentifier(), new Object[0])); + } + + public void loadCraftingRecipes(ItemStack result) { + if (result == null) { + return; + } + if (result != null) { + //Logger.INFO("Looking up crafting recipes for "+ItemUtils.getItemName(result)); + } + final List recipes = GasSpargingRecipeMap.mRecipes; + for (final GasSpargingRecipe recipe : recipes) { + if (recipe.isValid()) { + final GasSpargingRecipeNEI rec = new GasSpargingRecipeNEI(recipe); + this.arecipes.add(rec); + sort(); + } + } + } + + public void loadCraftingRecipes(String outputId, Object... results) { + if (outputId.equals(getOverlayIdentifier()) && this.getClass() == SpargingRecipeHandler.class) { + final List recipes = GasSpargingRecipeMap.mRecipes; + for (final GasSpargingRecipe recipe : recipes) { + if (recipe.isValid()) { + final GasSpargingRecipeNEI rec = new GasSpargingRecipeNEI(recipe); + this.arecipes.add(rec); + sort(); + } + } + } else { + super.loadCraftingRecipes(outputId, results); + } + } + + public void loadUsageRecipes(ItemStack ingredient) { + final List recipes = GasSpargingRecipeMap.mRecipes; + if (ingredient != null) { + //Logger.INFO("Looking up Usage results for "+ItemUtils.getItemName(ingredient)); + } + for (final GasSpargingRecipe recipe : recipes) { + if (recipe.isValid()) { + final GasSpargingRecipeNEI rec = new GasSpargingRecipeNEI(recipe); + this.arecipes.add(rec); + sort(); + } + } + } + + private final void sort() { + List g = new ArrayList(); + for (CachedRecipe u : arecipes) { + g.add((GasSpargingRecipeNEI) u); + } + if (g != null && !g.isEmpty()) { + Collections.sort(g); + } + } + + public void drawExtras(int recipeIndex) { + GasSpargingRecipeNEI recipe = (GasSpargingRecipeNEI) this.arecipes.get(recipeIndex); + //NeiTextureHandler.RECIPE_BUTTON.renderIcon(72.0D, 14.0D, 22.0D, 16.0D, 0.0D, true); + } + + @Override + public List handleItemTooltip(final GuiRecipe gui, final ItemStack aStack, final List currenttip, final int aRecipeIndex) { + final TemplateRecipeHandler.CachedRecipe tObject = this.arecipes.get(aRecipeIndex); + if ((tObject instanceof GasSpargingRecipeNEI)) { + final GasSpargingRecipeNEI tRecipe = (GasSpargingRecipeNEI) tObject; + ItemStack aInput = tRecipe.mInputs.get(0).item; + for (final PositionedStack tStack : tRecipe.mOutputs) { + if (aStack == tStack.item) { + if (ItemList.Display_Fluid.isStackEqual(tStack.item, true, true) && ((FixedPositionedStack) tStack).mChance <= 10000) { + if (GT_Utility.areStacksEqual(aStack, aInput, true)) { + currenttip.add("The amount returned is the remainder after all other outputs."); + } + currenttip.add("Maximum Output: " + (((FixedPositionedStack) tStack).mChance / 100) + "." + ((((FixedPositionedStack) tStack).mChance % 100) < 10 ? "0" + (((FixedPositionedStack) tStack).mChance % 100) : Integer.valueOf(((FixedPositionedStack) tStack).mChance % 100)) + "L"); + break; + } + break; + } + } + for (final PositionedStack tStack : tRecipe.mInputs) { + if (GT_Utility.areStacksEqual(aStack, tStack.item)) { + if ((gregtech.api.enums.ItemList.Display_Fluid.isStackEqual(tStack.item, true, true)) || + (tStack.item.stackSize != 0)) { + break; + } + if (ItemUtils.isControlCircuit(aStack)) { + currenttip.add("Does not get consumed in the process"); + } + break; + } + } + } + return currenttip; + } + + public class FixedPositionedStack + extends PositionedStack { + public final int mChance; + public boolean permutated = false; + + public FixedPositionedStack(final Object object, final int x, final int y) { + this(object, x, y, 0); + } + + public FixedPositionedStack(final Object object, final int x, final int y, final int aChance) { + super(object, x, y, true); + this.mChance = aChance; + } + + @Override + public void generatePermutations() { + if (this.permutated) { + return; + } + final ArrayList tDisplayStacks = new ArrayList(); + for (final ItemStack tStack : this.items) { + if (GT_Utility.isStackValid(tStack)) { + if (tStack.getItemDamage() == 32767) { + final List permutations = codechicken.nei.ItemList.itemMap.get(tStack.getItem()); + if (!permutations.isEmpty()) { + ItemStack stack; + for (final Iterator i$ = permutations.iterator(); i$.hasNext(); tDisplayStacks.add(GT_Utility.copyAmount(tStack.stackSize, new Object[]{stack}))) { + stack = i$.next(); + } + } else { + final ItemStack base = new ItemStack(tStack.getItem(), tStack.stackSize); + base.stackTagCompound = tStack.stackTagCompound; + tDisplayStacks.add(base); + } + } else { + tDisplayStacks.add(GT_Utility.copy(new Object[]{tStack})); + } + } + } + this.items = (tDisplayStacks.toArray(new ItemStack[0])); + if (this.items.length == 0) { + this.items = new ItemStack[]{new ItemStack(Blocks.fire)}; + } + this.permutated = true; + this.setPermutationToRender(0); + } + } + + public class GasSpargingRecipeNEI extends CachedRecipe implements Comparable { + + public final GasSpargingRecipe mRecipe; + public final List mOutputs = new ArrayList(); + public final List mInputs = new ArrayList(); + + public GasSpargingRecipeNEI(GasSpargingRecipe tRecipe) { + super(); + this.mRecipe = tRecipe; + int tStartIndex = 0; + if (tRecipe.mFluidInputs.length > 0) { + if ((tRecipe.mFluidInputs[0] != null) && (tRecipe.mFluidInputs[0].getFluid() != null)) { + this.mInputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(tRecipe.mFluidInputs[0], true), 12, 5)); + } + if ((tRecipe.mFluidInputs.length > 1) && (tRecipe.mFluidInputs[1] != null) && (tRecipe.mFluidInputs[1].getFluid() != null)) { + this.mInputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(tRecipe.mFluidInputs[1], true), 30, 5)); + } + if ((tRecipe.mFluidInputs.length > 2) && (tRecipe.mFluidInputs[2] != null) && (tRecipe.mFluidInputs[2].getFluid() != null)) { + this.mInputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(tRecipe.mFluidInputs[2], true), 48, 5)); + } + if ((tRecipe.mFluidInputs.length > 3) && (tRecipe.mFluidInputs[3] != null) && (tRecipe.mFluidInputs[3].getFluid() != null)) { + this.mInputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(tRecipe.mFluidInputs[3], true), 12, 23)); + } + if ((tRecipe.mFluidInputs.length > 4) && (tRecipe.mFluidInputs[4] != null) && (tRecipe.mFluidInputs[4].getFluid() != null)) { + this.mInputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(tRecipe.mFluidInputs[4], true), 30, 23)); + } + if ((tRecipe.mFluidInputs.length > 5) && (tRecipe.mFluidInputs[5] != null) && (tRecipe.mFluidInputs[5].getFluid() != null)) { + this.mInputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(tRecipe.mFluidInputs[5], true), 48, 23)); + } + if ((tRecipe.mFluidInputs.length > 6) && (tRecipe.mFluidInputs[6] != null) && (tRecipe.mFluidInputs[6].getFluid() != null)) { + this.mInputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(tRecipe.mFluidInputs[6], true), 12, 41)); + } + if ((tRecipe.mFluidInputs.length > 7) && (tRecipe.mFluidInputs[7] != null) && (tRecipe.mFluidInputs[7].getFluid() != null)) { + this.mInputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(tRecipe.mFluidInputs[7], true), 30, 41)); + } + if ((tRecipe.mFluidInputs.length > 8) && (tRecipe.mFluidInputs[8] != null) && (tRecipe.mFluidInputs[8].getFluid() != null)) { + this.mInputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(tRecipe.mFluidInputs[8], true), 48, 41)); + } + } + + tStartIndex = 0; + if (tRecipe.mFluidOutputs.length > 0) { + if ((tRecipe.mFluidOutputs[0] != null) && (tRecipe.mFluidOutputs[0].getFluid() != null)) { + this.mOutputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(tRecipe.mFluidOutputs[0], false), 102, 5, tRecipe.getMaxOutput(tStartIndex++))); + } + if ((tRecipe.mFluidOutputs.length > 1) && (tRecipe.mFluidOutputs[1] != null) && (tRecipe.mFluidOutputs[1].getFluid() != null)) { + this.mOutputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(tRecipe.mFluidOutputs[1], false), 120, 5, tRecipe.getMaxOutput(tStartIndex++))); + } + if ((tRecipe.mFluidOutputs.length > 2) && (tRecipe.mFluidOutputs[2] != null) && (tRecipe.mFluidOutputs[2].getFluid() != null)) { + this.mOutputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(tRecipe.mFluidOutputs[2], false), 138, 5, tRecipe.getMaxOutput(tStartIndex++))); + } + if ((tRecipe.mFluidOutputs.length > 3) && (tRecipe.mFluidOutputs[3] != null) && (tRecipe.mFluidOutputs[3].getFluid() != null)) { + this.mOutputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(tRecipe.mFluidOutputs[3], false), 102, 23, tRecipe.getMaxOutput(tStartIndex++))); + } + if ((tRecipe.mFluidOutputs.length > 4) && (tRecipe.mFluidOutputs[4] != null) && (tRecipe.mFluidOutputs[4].getFluid() != null)) { + this.mOutputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(tRecipe.mFluidOutputs[4], false), 120, 23, tRecipe.getMaxOutput(tStartIndex++))); + } + if ((tRecipe.mFluidOutputs.length > 5) && (tRecipe.mFluidOutputs[5] != null) && (tRecipe.mFluidOutputs[5].getFluid() != null)) { + this.mOutputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(tRecipe.mFluidOutputs[5], false), 138, 23, tRecipe.getMaxOutput(tStartIndex++))); + } + if ((tRecipe.mFluidOutputs.length > 6) && (tRecipe.mFluidOutputs[6] != null) && (tRecipe.mFluidOutputs[6].getFluid() != null)) { + this.mOutputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(tRecipe.mFluidOutputs[6], false), 102, 41, tRecipe.getMaxOutput(tStartIndex++))); + } + if ((tRecipe.mFluidOutputs.length > 7) && (tRecipe.mFluidOutputs[7] != null) && (tRecipe.mFluidOutputs[7].getFluid() != null)) { + this.mOutputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(tRecipe.mFluidOutputs[7], false), 120, 41, tRecipe.getMaxOutput(tStartIndex++))); + } + if ((tRecipe.mFluidOutputs.length > 8) && (tRecipe.mFluidOutputs[8] != null) && (tRecipe.mFluidOutputs[8].getFluid() != null)) { + this.mOutputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(tRecipe.mFluidOutputs[8], false), 138, 41, tRecipe.getMaxOutput(tStartIndex++))); + } + Logger.INFO("Outputs: "+tRecipe.mFluidOutputs.length); + } + } + + @Override + public int compareTo(CachedRecipe o) { + boolean b = GasSpargingRecipeNEI.class.isInstance(o); + if (b) { + GasSpargingRecipeNEI p = (GasSpargingRecipeNEI) o; + if (p.mOutputs.size() > this.mOutputs.size()) { + return 1; + } else if (p.mOutputs.size() == this.mOutputs.size()) { + return 0; + } else { + return -1; + } + } + return 0; + } + + @Override + public boolean equals(Object obj) { + if (obj != null) { + if (GasSpargingRecipeNEI.class.isInstance(obj)) { + GasSpargingRecipeNEI p = (GasSpargingRecipeNEI) obj; + if (p != null) { + if (GT_Utility.areStacksEqual(p.mInputs.get(0).item, this.mInputs.get(0).item, true)) { + if (p.mOutputs.size() == this.mOutputs.size()) { + return true; + } + } + } + } + } + return false; + } + + @Override + public List getIngredients() { + return this.getCycledIngredients(SpargingRecipeHandler.this.cycleticks / 10, this.mInputs); + } + + @Override + public PositionedStack getResult() { + return null; + } + + @Override + public List getOtherStacks() { + return this.mOutputs; + } + + + } +} \ No newline at end of file diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMTE_NuclearReactor.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMTE_NuclearReactor.java index 95d0419edf..a52b55234d 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMTE_NuclearReactor.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMTE_NuclearReactor.java @@ -658,7 +658,7 @@ public class GregtechMTE_NuclearReactor extends GregtechMeta_MultiBlockBase { } else { // Try output some Uranium-233 - if (MathUtils.randInt(300, 600) == 1){ + if (MathUtils.randInt(1, 300) == 1){ this.addOutput(ELEMENT.getInstance().URANIUM233.getFluid(MathUtils.randInt(1, 10))); } // Set a random tick counter, count it up. diff --git a/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_DustGeneration.java b/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_DustGeneration.java index d5ca3211e9..173d11c97b 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_DustGeneration.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_DustGeneration.java @@ -298,7 +298,7 @@ public class RecipeGen_DustGeneration extends RecipeGen_Base { if (x.getStackMaterial() != null){ if (x.getStackMaterial().getDust(1) == null){ MaterialState f = x.getStackMaterial().getState(); - if (f == MaterialState.GAS || f == MaterialState.LIQUID || f == MaterialState.PURE_LIQUID){ + if (f == MaterialState.GAS || f == MaterialState.LIQUID || f == MaterialState.PURE_LIQUID || f == MaterialState.PURE_GAS){ oxygen = x.getStackMaterial().getFluid((int) (material.vSmallestRatio[compSlot] * 1000)); } } diff --git a/src/Java/gtPlusPlus/xmod/gregtech/loaders/recipe/RecipeLoader_LFTR.java b/src/Java/gtPlusPlus/xmod/gregtech/loaders/recipe/RecipeLoader_LFTR.java index af692c8bbf..43097413be 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/loaders/recipe/RecipeLoader_LFTR.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/loaders/recipe/RecipeLoader_LFTR.java @@ -1,17 +1,55 @@ package gtPlusPlus.xmod.gregtech.loaders.recipe; +import gregtech.api.enums.Materials; import gregtech.api.util.GTPP_Recipe; import gregtech.api.util.GT_Recipe; +import gregtech.api.util.GasSpargingRecipe; +import gregtech.api.util.GasSpargingRecipeMap; +import gtPlusPlus.api.objects.data.AutoMap; +import gtPlusPlus.api.objects.data.Pair; import gtPlusPlus.core.item.ModItems; import gtPlusPlus.core.item.chemistry.NuclearChem; +import gtPlusPlus.core.material.ELEMENT; +import gtPlusPlus.core.material.nuclear.FLUORIDES; import gtPlusPlus.core.material.nuclear.NUCLIDE; import gtPlusPlus.core.util.minecraft.FluidUtils; import gtPlusPlus.xmod.gregtech.api.enums.GregtechOrePrefixes.GT_Materials; import net.minecraft.item.ItemStack; +import net.minecraftforge.fluids.Fluid; import net.minecraftforge.fluids.FluidStack; public class RecipeLoader_LFTR { + private static AutoMap mNobleGases; + private static AutoMap mFluorideGases; + private static AutoMap mSpargeGases; + + private static void configureSparging() { + if (mSpargeGases == null) { + mSpargeGases = new AutoMap(); + mSpargeGases.add(Materials.Helium.getGas(1).getFluid()); + mSpargeGases.add(Materials.Fluorine.getGas(1).getFluid()); + } + if (mNobleGases == null) { + mNobleGases = new AutoMap(); + mNobleGases.add(mSpargeGases.get(0)); + mNobleGases.add(ELEMENT.getInstance().XENON.getFluid(1).getFluid()); + mNobleGases.add(ELEMENT.getInstance().NEON.getFluid(1).getFluid()); + mNobleGases.add(ELEMENT.getInstance().ARGON.getFluid(1).getFluid()); + mNobleGases.add(ELEMENT.getInstance().KRYPTON.getFluid(1).getFluid()); + mNobleGases.add(ELEMENT.getInstance().RADON.getFluid(1).getFluid()); + } + if (mFluorideGases == null) { + mFluorideGases = new AutoMap(); + mFluorideGases.add(mSpargeGases.get(1)); + mFluorideGases.add(FLUORIDES.LITHIUM_FLUORIDE.getFluid(1).getFluid()); + mFluorideGases.add(FLUORIDES.NEPTUNIUM_HEXAFLUORIDE.getFluid(1).getFluid()); + mFluorideGases.add(FLUORIDES.TECHNETIUM_HEXAFLUORIDE.getFluid(1).getFluid()); + mFluorideGases.add(FLUORIDES.SELENIUM_HEXAFLUORIDE.getFluid(1).getFluid()); + mFluorideGases.add(FLUORIDES.THORIUM_TETRAFLUORIDE.getFluid(1).getFluid()); + } + } + public static void generate() { // Fli2BeF4 + Thorium TetraFluoride = Uranium233 //72k Ticks/hr @@ -19,21 +57,24 @@ public class RecipeLoader_LFTR { //1l/40t = 1000l/10hr (Probably better) LiFBeF2ThF4UF4 //1l/20t= 1000l/2.5hr LiFBeF2ZrF4UF4 //1l/10t= 1000l/2.5hr LiFBeF2ZrF4U235 - + + configureSparging(); FluidStack Li2BeF4 = new FluidStack(ModItems.fluidFLiBeSalt, 34); + FluidStack aBurntLi2BeF4 = new FluidStack(ModItems.fluidFLiBeSaltBurnt, 34); //LiFBeF2ThF4UF4 GT_Recipe LFTR1 = new GTPP_Recipe( true, new ItemStack[] {}, new ItemStack[] {}, - null, new int[] {10000, 5000, 2500}, + null, new int[] {10000, 10000, 5000, 2500}, new FluidStack[] { NUCLIDE.LiFBeF2ThF4UF4.getFluid(17), Li2BeF4 }, new FluidStack[] { new FluidStack(NuclearChem.Burnt_LiFBeF2ThF4UF4, 17), + aBurntLi2BeF4, FluidUtils.getFluidStack("molten.uraniumhexafluoride", 10), FluidUtils.getFluidStack("molten.uraniumhexafluoride", 5) }, @@ -47,13 +88,14 @@ public class RecipeLoader_LFTR { true, new ItemStack[] {}, new ItemStack[] {}, - null, new int[] {10000, 2500, 1250}, + null, new int[] {10000, 10000, 2500, 1250}, new FluidStack[] { NUCLIDE.LiFBeF2ZrF4UF4.getFluid(17), Li2BeF4 }, new FluidStack[] { new FluidStack(NuclearChem.Burnt_LiFBeF2ZrF4UF4, 17), + aBurntLi2BeF4, FluidUtils.getFluidStack("molten.uraniumhexafluoride", 4), FluidUtils.getFluidStack("molten.uraniumhexafluoride", 2) }, @@ -67,13 +109,14 @@ public class RecipeLoader_LFTR { true, new ItemStack[] {}, new ItemStack[] {}, - null, new int[] {10000, 1000, 500}, + null, new int[] {10000, 10000, 1000, 500}, new FluidStack[] { NUCLIDE.LiFBeF2ZrF4U235.getFluid(17), Li2BeF4 }, new FluidStack[] { new FluidStack(NuclearChem.Burnt_LiFBeF2ZrF4U235, 17), + aBurntLi2BeF4, FluidUtils.getFluidStack("molten.uraniumhexafluoride", 2), FluidUtils.getFluidStack("molten.uraniumhexafluoride", 1) }, @@ -82,13 +125,39 @@ public class RecipeLoader_LFTR { 8192//fuel value ); - /*mRecipesLFTR.add(LFTR1); - mRecipesLFTR.add(LFTR2); - mRecipesLFTR.add(LFTR3);*/ + // Sparging NEI Recipes + GasSpargingRecipeMap.addRecipe( + new FluidStack(mSpargeGases.get(0), 50), + new FluidStack[] { + new FluidStack(mNobleGases.get(0), 50), + new FluidStack(mNobleGases.get(1), 10), + new FluidStack(mNobleGases.get(2), 10), + new FluidStack(mNobleGases.get(3), 10), + new FluidStack(mNobleGases.get(4), 10), + new FluidStack(mNobleGases.get(5), 10) + }, + new int[] { + 5000, 1000, 1000, 1000, 1000, 1000 + }); + + GasSpargingRecipeMap.addRecipe( + new FluidStack(mSpargeGases.get(1), 100), + new FluidStack[] { + new FluidStack(mFluorideGases.get(0), 100), + new FluidStack(mFluorideGases.get(1), 20), + new FluidStack(mFluorideGases.get(2), 20), + new FluidStack(mFluorideGases.get(3), 20), + new FluidStack(mFluorideGases.get(4), 20), + new FluidStack(mFluorideGases.get(5), 20) + }, + new int[] { + 10000, 2000, 2000, 2000, 2000, 2000 + }); + GTPP_Recipe.GTPP_Recipe_Map.sLiquidFluorineThoriumReactorRecipes.add(LFTR1); GTPP_Recipe.GTPP_Recipe_Map.sLiquidFluorineThoriumReactorRecipes.add(LFTR2); GTPP_Recipe.GTPP_Recipe_Map.sLiquidFluorineThoriumReactorRecipes.add(LFTR3); - + } } -- cgit From 92ba4e62b6628a146dd24df13ae9ec40b0a69a22 Mon Sep 17 00:00:00 2001 From: Alkalus <3060479+draknyte1@users.noreply.github.com> Date: Mon, 29 Nov 2021 16:38:31 +0000 Subject: Added new generic Nuclear Chem item. Added ability to set Fluid for a Material. Moved Nuclear recipe generation to a different phase during init. --- .../commands/CommandEnableDebugWhileRunning.java | 16 ++ .../gtPlusPlus/core/handler/COMPAT_HANDLER.java | 4 +- src/Java/gtPlusPlus/core/item/ModItems.java | 5 +- .../core/item/chemistry/NuclearChem.java | 59 ++++-- .../chemistry/general/ItemNuclearChemBase.java | 152 +++++++++++++++ src/Java/gtPlusPlus/core/lib/CORE.java | 14 +- src/Java/gtPlusPlus/core/material/Material.java | 8 + src/Java/gtPlusPlus/xmod/gregtech/HANDLER_GT.java | 3 - .../gregtech/loaders/recipe/RecipeLoader_FFPP.java | 205 +++++++-------------- src/resources/assets/miscutils/lang/en_US.lang | 17 +- .../textures/items/science/nuclear/MetaItem1/0.png | Bin 0 -> 243 bytes .../textures/items/science/nuclear/MetaItem1/1.png | Bin 0 -> 243 bytes .../textures/items/science/nuclear/MetaItem1/2.png | Bin 0 -> 243 bytes .../textures/items/science/nuclear/MetaItem1/3.png | Bin 0 -> 243 bytes .../textures/items/science/nuclear/MetaItem1/4.png | Bin 0 -> 328 bytes .../textures/items/science/nuclear/MetaItem1/5.png | Bin 0 -> 328 bytes .../textures/items/science/nuclear/MetaItem1/6.png | Bin 0 -> 328 bytes 17 files changed, 321 insertions(+), 162 deletions(-) create mode 100644 src/Java/gtPlusPlus/core/item/chemistry/general/ItemNuclearChemBase.java create mode 100644 src/resources/assets/miscutils/textures/items/science/nuclear/MetaItem1/0.png create mode 100644 src/resources/assets/miscutils/textures/items/science/nuclear/MetaItem1/1.png create mode 100644 src/resources/assets/miscutils/textures/items/science/nuclear/MetaItem1/2.png create mode 100644 src/resources/assets/miscutils/textures/items/science/nuclear/MetaItem1/3.png create mode 100644 src/resources/assets/miscutils/textures/items/science/nuclear/MetaItem1/4.png create mode 100644 src/resources/assets/miscutils/textures/items/science/nuclear/MetaItem1/5.png create mode 100644 src/resources/assets/miscutils/textures/items/science/nuclear/MetaItem1/6.png (limited to 'src/Java/gtPlusPlus/core/item') diff --git a/src/Java/gtPlusPlus/core/commands/CommandEnableDebugWhileRunning.java b/src/Java/gtPlusPlus/core/commands/CommandEnableDebugWhileRunning.java index 334f647b44..493b7d415d 100644 --- a/src/Java/gtPlusPlus/core/commands/CommandEnableDebugWhileRunning.java +++ b/src/Java/gtPlusPlus/core/commands/CommandEnableDebugWhileRunning.java @@ -4,8 +4,10 @@ import java.util.ArrayList; import java.util.List; import java.util.Map; +import cpw.mods.fml.common.registry.GameRegistry; import gtPlusPlus.api.objects.Logger; import gtPlusPlus.api.objects.data.AutoMap; +import gtPlusPlus.core.lib.CORE; import gtPlusPlus.core.util.Utils; import gtPlusPlus.core.util.minecraft.FluidUtils; import gtPlusPlus.core.util.minecraft.ItemUtils; @@ -105,6 +107,20 @@ public class CommandEnableDebugWhileRunning implements ICommand PlayerUtils.messagePlayer(P, ItemUtils.getItemName(mSemiFluidgen)); } }*/ + + else if (argString[0].toLowerCase().equals("inv")) { + final EntityPlayer P = CommandUtils.getPlayer(S); + if (P != null && !P.worldObj.isRemote) { + ItemStack[] aInv = P.inventory.mainInventory; + for (ItemStack aItem : aInv) { + if (aItem != null) { + String aModID = GameRegistry.findUniqueIdentifierFor(aItem.getItem()).modId; + String aRegistryName = GameRegistry.findUniqueIdentifierFor(aItem.getItem()).name; + Logger.INFO(aModID+":"+aRegistryName); + } + } + } + } else if (argString[0].toLowerCase().equals("hand")) { final EntityPlayer P = CommandUtils.getPlayer(S); if (P != null) { diff --git a/src/Java/gtPlusPlus/core/handler/COMPAT_HANDLER.java b/src/Java/gtPlusPlus/core/handler/COMPAT_HANDLER.java index 4fda17ee8a..c345863a61 100644 --- a/src/Java/gtPlusPlus/core/handler/COMPAT_HANDLER.java +++ b/src/Java/gtPlusPlus/core/handler/COMPAT_HANDLER.java @@ -43,6 +43,7 @@ import gtPlusPlus.xmod.gregtech.api.enums.GregtechItemList; import gtPlusPlus.xmod.gregtech.common.tileentities.machines.basic.GregtechMetaGarbageCollector; import gtPlusPlus.xmod.gregtech.loaders.RecipeGen_FluidCanning; import gtPlusPlus.xmod.gregtech.loaders.RecipeGen_Recycling; +import gtPlusPlus.xmod.gregtech.loaders.recipe.RecipeLoader_Nuclear; import gtPlusPlus.xmod.gregtech.registration.gregtech.*; import net.minecraft.item.ItemStack; @@ -228,7 +229,8 @@ public class COMPAT_HANDLER { public static void startLoadingGregAPIBasedRecipes(){ //Add hand-made recipes - RECIPES_GREGTECH.run(); + RECIPES_GREGTECH.run(); + RecipeLoader_Nuclear.generate(); //Add autogenerated Recipes from Item Components for (Set> m : MaterialGenerator.mRecipeMapsToGenerate) { for (RunnableWithInfo r : m) { diff --git a/src/Java/gtPlusPlus/core/item/ModItems.java b/src/Java/gtPlusPlus/core/item/ModItems.java index e95b646f8e..85ec564978 100644 --- a/src/Java/gtPlusPlus/core/item/ModItems.java +++ b/src/Java/gtPlusPlus/core/item/ModItems.java @@ -717,7 +717,7 @@ public final class ModItems { //fluidFLiBeSalt = ("Li2BeF4", "Li2BeF4", 7430, new short[]{255, 255, 255, 100}, 0); fluidFLiBeSalt = FluidUtils.addGTFluidNoPrefix("Li2BeF4", "Li2BeF4", new short[]{255, 255, 255, 100}, 0, 743, null, CI.emptyCells(1), 1000, true); fluidFLiBeSaltBurnt = FluidUtils.addGTFluidNoPrefix("Li2BeF2UF4", "Li2BeF2UF4", new short[]{50, 255, 50, 100}, 0, 743, null, CI.emptyCells(1), 1000, true); - + //LFTR Control Circuit itemCircuitLFTR = new CoreItem("itemCircuitLFTR", ""+EnumChatFormatting.GREEN+"Control Circuit", AddToCreativeTab.tabMisc, 1, 0, new String[] {"Keeps Multiblocks Stable"}, EnumRarity.epic, EnumChatFormatting.DARK_GREEN, false, null); @@ -739,7 +739,8 @@ public final class ModItems { //GT_OreDictUnificator.registerOre("cellZrF4", ItemUtils.getItemStackOfAmountFromOreDict("cellZirconiumTetrafluoride", 1)); //GT_OreDictUnificator.registerOre("dustZrF4", ItemUtils.getItemStackOfAmountFromOreDict("dustZirconiumTetrafluoride", 1)); fluidZrF4 = FluidUtils.generateFluidNoPrefix("ZirconiumTetrafluoride", "Zirconium Tetrafluoride", 500, new short[]{170, 170, 140, 100}); //https://en.wikipedia.org/wiki/Zirconium_tetrafluoride - + FLUORIDES.ZIRCONIUM_TETRAFLUORIDE.setFluid(fluidZrF4); + //Coolant Salt //NaBF4 - NaF - 621C //dustNaBF4NaF = ItemUtils.generateSpecialUseDusts("NaBF4NaF", "NaBF4NaF", Utils.rgbtoHexValue(45, 45, 90))[0]; //https://en.wikipedia.org/wiki/Zirconium_tetrafluoride diff --git a/src/Java/gtPlusPlus/core/item/chemistry/NuclearChem.java b/src/Java/gtPlusPlus/core/item/chemistry/NuclearChem.java index 25beb6d9b5..db41da43b2 100644 --- a/src/Java/gtPlusPlus/core/item/chemistry/NuclearChem.java +++ b/src/Java/gtPlusPlus/core/item/chemistry/NuclearChem.java @@ -1,14 +1,15 @@ package gtPlusPlus.core.item.chemistry; -import net.minecraft.init.Items; - -import gregtech.api.enums.GT_Values; import gtPlusPlus.api.objects.minecraft.ItemPackage; import gtPlusPlus.core.item.ModItems; +import gtPlusPlus.core.item.chemistry.general.ItemGenericChemBase; +import gtPlusPlus.core.item.chemistry.general.ItemNuclearChemBase; import gtPlusPlus.core.lib.CORE; import gtPlusPlus.core.recipe.common.CI; import gtPlusPlus.core.util.minecraft.FluidUtils; import gtPlusPlus.core.util.minecraft.ItemUtils; +import net.minecraft.init.Items; +import net.minecraft.item.ItemStack; import net.minecraftforge.fluids.Fluid; public class NuclearChem extends ItemPackage { @@ -19,23 +20,39 @@ public class NuclearChem extends ItemPackage { public static Fluid GeneticMutagen; private static boolean generateMutagenRecipe = false; + + public static ItemNuclearChemBase mNuclearChemItem1; + + public static ItemStack mResidueUranium; + public static ItemStack mResiduePlutonium; + public static ItemStack mResidueFluorides; + public static ItemStack mResidueNobles; @Override - public String errorMessage() { - return "bad Nuclear Chemistry Recipes."; + public void items() { + + mNuclearChemItem1 = new ItemNuclearChemBase(); + registerItemStacks(); + registerOreDict(); } - @Override - public boolean generateRecipes() { - if (generateMutagenRecipe) { - chemReator_CreateMutagen(); - } - chemReactor_MutagenWithEggs(); - return true; + + public void registerItemStacks() { + + mResidueUranium = ItemUtils.simpleMetaStack(mNuclearChemItem1, 0, 1); + mResidueUranium = ItemUtils.simpleMetaStack(mNuclearChemItem1, 1, 1); + mResidueUranium = ItemUtils.simpleMetaStack(mNuclearChemItem1, 2, 1); + mResidueUranium = ItemUtils.simpleMetaStack(mNuclearChemItem1, 3, 1); + } - @Override - public void items() { + public void registerOreDict() { + + ItemUtils.addItemToOreDictionary(mResidueUranium, "dustResidueUranium"); + ItemUtils.addItemToOreDictionary(mResiduePlutonium, "dustResiduePlutonium"); + ItemUtils.addItemToOreDictionary(mResidueFluorides, "dustResidueFluoride"); + ItemUtils.addItemToOreDictionary(mResidueNobles, "dustResidueNoble"); + } @Override @@ -57,6 +74,20 @@ public class NuclearChem extends ItemPackage { GeneticMutagen = FluidUtils.getFluidStack("fluid.Mutagen", 1).getFluid(); } } + + @Override + public String errorMessage() { + return "Bad Nuclear Chemistry Recipes."; + } + + @Override + public boolean generateRecipes() { + if (generateMutagenRecipe) { + chemReator_CreateMutagen(); + } + chemReactor_MutagenWithEggs(); + return true; + } private static void chemReator_CreateMutagen() { CORE.RA.addChemicalRecipe( diff --git a/src/Java/gtPlusPlus/core/item/chemistry/general/ItemNuclearChemBase.java b/src/Java/gtPlusPlus/core/item/chemistry/general/ItemNuclearChemBase.java new file mode 100644 index 0000000000..cfd3fd6259 --- /dev/null +++ b/src/Java/gtPlusPlus/core/item/chemistry/general/ItemNuclearChemBase.java @@ -0,0 +1,152 @@ +package gtPlusPlus.core.item.chemistry.general; + +import java.util.List; + +import cpw.mods.fml.common.registry.GameRegistry; +import gtPlusPlus.core.lib.CORE; +import gtPlusPlus.core.util.minecraft.ItemUtils; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.Entity; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.EnumRarity; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.util.IIcon; +import net.minecraft.world.World; + +public class ItemNuclearChemBase extends Item { + + final protected IIcon base[]; + + final private int aMetaSize = 4; + + /* + * 0 - Uranium Residue + * 1 - Plutonium Residue + * 2 - Fluoride Reside + * 3 - Noble Gas Residue + */ + + public ItemNuclearChemBase() { + this.setHasSubtypes(true); + this.setNoRepair(); + this.setMaxStackSize(64); + this.setMaxDamage(0); + base = new IIcon[aMetaSize]; + this.setUnlocalizedName("BasicNuclearChemItem"); + GameRegistry.registerItem(this, this.getUnlocalizedName()); + } + + @Override + public int getItemStackLimit(ItemStack stack) { + return super.getItemStackLimit(stack); + } + + @Override + public boolean isDamageable() { + return false; + } + + @Override + public boolean shouldRotateAroundWhenRendering() { + return super.shouldRotateAroundWhenRendering(); + } + + @Override + public void onUpdate(ItemStack p_77663_1_, World p_77663_2_, Entity p_77663_3_, int p_77663_4_, boolean p_77663_5_) { + super.onUpdate(p_77663_1_, p_77663_2_, p_77663_3_, p_77663_4_, p_77663_5_); + } + + @Override + public String getItemStackDisplayName(ItemStack aStack) { + return super.getItemStackDisplayName(aStack); + } + + @Override + public EnumRarity getRarity(ItemStack p_77613_1_) { + return EnumRarity.common; + } + + @Override + public boolean requiresMultipleRenderPasses() { + return false; + } + + @Override + public void getSubItems(Item aItem, CreativeTabs p_150895_2_, List aList) { + for (int i=0;i mNobleGases; - private static AutoMap mFluorideGases; - private static AutoMap mSpargeGases; - - private static void configureSparging() { - if (mSpargeGases == null) { - mSpargeGases = new AutoMap(); - mSpargeGases.add(Materials.Helium.getGas(1).getFluid()); - mSpargeGases.add(Materials.Fluorine.getGas(1).getFluid()); - } - if (mNobleGases == null) { - mNobleGases = new AutoMap(); - mNobleGases.add(mSpargeGases.get(0)); - mNobleGases.add(ELEMENT.getInstance().XENON.getFluid(1).getFluid()); - mNobleGases.add(ELEMENT.getInstance().NEON.getFluid(1).getFluid()); - mNobleGases.add(ELEMENT.getInstance().ARGON.getFluid(1).getFluid()); - mNobleGases.add(ELEMENT.getInstance().KRYPTON.getFluid(1).getFluid()); - mNobleGases.add(ELEMENT.getInstance().RADON.getFluid(1).getFluid()); - } - if (mFluorideGases == null) { - mFluorideGases = new AutoMap(); - mFluorideGases.add(mSpargeGases.get(1)); - mFluorideGases.add(FLUORIDES.LITHIUM_FLUORIDE.getFluid(1).getFluid()); - mFluorideGases.add(FLUORIDES.NEPTUNIUM_HEXAFLUORIDE.getFluid(1).getFluid()); - mFluorideGases.add(FLUORIDES.TECHNETIUM_HEXAFLUORIDE.getFluid(1).getFluid()); - mFluorideGases.add(FLUORIDES.SELENIUM_HEXAFLUORIDE.getFluid(1).getFluid()); - mFluorideGases.add(FLUORIDES.THORIUM_TETRAFLUORIDE.getFluid(1).getFluid()); - } - } - public static void generate() { - // Fli2BeF4 + Thorium TetraFluoride = Uranium233 - //72k Ticks/hr - //1l/4t = 1000l/hr - //1l/40t = 1000l/10hr (Probably better) LiFBeF2ThF4UF4 - //1l/20t= 1000l/2.5hr LiFBeF2ZrF4UF4 - //1l/10t= 1000l/2.5hr LiFBeF2ZrF4U235 - configureSparging(); - FluidStack Li2BeF4 = new FluidStack(ModItems.fluidFLiBeSalt, 34); - FluidStack aBurntLi2BeF4 = new FluidStack(ModItems.fluidFLiBeSaltBurnt, 34); + // Create Fuels + + final FluidStack aLithiumFluoride = FLUORIDES.LITHIUM_FLUORIDE.getFluid(100); + final FluidStack aBerylliumFluoride = FLUORIDES.BERYLLIUM_FLUORIDE.getFluid(100); + final FluidStack aThoriumFluoride = FLUORIDES.THORIUM_TETRAFLUORIDE.getFluid(100); + final FluidStack aZirconiumFluoride = FLUORIDES.ZIRCONIUM_TETRAFLUORIDE.getFluid(100); + final FluidStack aUraniumTetraFluoride = FLUORIDES.URANIUM_TETRAFLUORIDE.getFluid(100); + final FluidStack aUranium235 = ELEMENT.getInstance().URANIUM235.getFluid(1000); + final FluidStack aLiFBeF2ZrF4U235 = NUCLIDE.LiFBeF2ZrF4U235.getFluid(100); + final FluidStack aLiFBeF2ZrF4UF4 = NUCLIDE.LiFBeF2ZrF4UF4.getFluid(100); + final FluidStack aLiFBeF2ThF4UF4 = NUCLIDE.LiFBeF2ThF4UF4.getFluid(100); - //LiFBeF2ThF4UF4 - GT_Recipe LFTR1 = new GTPP_Recipe( - true, - new ItemStack[] {}, - new ItemStack[] {}, - null, new int[] {10000, 10000, 5000, 2500}, - new FluidStack[] { - NUCLIDE.LiFBeF2ThF4UF4.getFluid(17), - Li2BeF4 - }, - new FluidStack[] { - new FluidStack(NuclearChem.Burnt_LiFBeF2ThF4UF4, 17), - aBurntLi2BeF4, - FluidUtils.getFluidStack("molten.uraniumhexafluoride", 10), - FluidUtils.getFluidStack("molten.uraniumhexafluoride", 5) - }, - 12000,//time - 0,//cost - 8192//fuel value + // 7LiF - BeF2 - ZrF4 - U235 - 590C + CORE.RA.addFissionFuel( + FluidUtils.getFluidStack(aLithiumFluoride, 550), + FluidUtils.getFluidStack(aBerylliumFluoride, 150), + FluidUtils.getFluidStack(aZirconiumFluoride, 60), + FluidUtils.getFluidStack(aUranium235, 240), + null, null, null, null, null, // Extra 5 inputs + FluidUtils.getFluidStack(aLiFBeF2ZrF4U235, 1000), + null, + 90 * 60 * 20, // Duration + MaterialUtils.getVoltageForTier(5) ); - - //LiFBeF2ZrF4UF4 - GT_Recipe LFTR2 = new GTPP_Recipe( - true, - new ItemStack[] {}, - new ItemStack[] {}, - null, new int[] {10000, 10000, 2500, 1250}, - new FluidStack[] { - NUCLIDE.LiFBeF2ZrF4UF4.getFluid(17), - Li2BeF4 - }, - new FluidStack[] { - new FluidStack(NuclearChem.Burnt_LiFBeF2ZrF4UF4, 17), - aBurntLi2BeF4, - FluidUtils.getFluidStack("molten.uraniumhexafluoride", 4), - FluidUtils.getFluidStack("molten.uraniumhexafluoride", 2) - }, - 6000,//time - 0,//cost - 8192//fuel value + + // 7LiF - BeF2 - ZrF4 - UF4 - 650C + CORE.RA.addFissionFuel( + FluidUtils.getFluidStack(aLithiumFluoride, 650), + FluidUtils.getFluidStack(aBerylliumFluoride, 250), + FluidUtils.getFluidStack(aZirconiumFluoride, 80), + FluidUtils.getFluidStack(aUraniumTetraFluoride, 70), + null, null, null, null, null, // Extra 5 inputs + FluidUtils.getFluidStack(aLiFBeF2ZrF4UF4, 1000), + null, + 120 * 60 * 20, + MaterialUtils.getVoltageForTier(5) ); - //LiFBeF2ZrF4U235 - GT_Recipe LFTR3 = new GTPP_Recipe( - true, - new ItemStack[] {}, - new ItemStack[] {}, - null, new int[] {10000, 10000, 1000, 500}, - new FluidStack[] { - NUCLIDE.LiFBeF2ZrF4U235.getFluid(17), - Li2BeF4 - }, - new FluidStack[] { - new FluidStack(NuclearChem.Burnt_LiFBeF2ZrF4U235, 17), - aBurntLi2BeF4, - FluidUtils.getFluidStack("molten.uraniumhexafluoride", 2), - FluidUtils.getFluidStack("molten.uraniumhexafluoride", 1) - }, - 3000,//time - 0,//cost - 8192//fuel value + // 7liF - BeF2 - ThF4 - UF4 - 566C + CORE.RA.addFissionFuel( + FluidUtils.getFluidStack(aLithiumFluoride, 620), + FluidUtils.getFluidStack(aBerylliumFluoride, 280), + FluidUtils.getFluidStack(aThoriumFluoride, 70), + FluidUtils.getFluidStack(aUraniumTetraFluoride, 70), + null, null, null, null, null, // Extra 5 inputs + FluidUtils.getFluidStack(aLiFBeF2ThF4UF4, 1000), + null, + 150 * 60 * 20, // Duration + MaterialUtils.getVoltageForTier(5) ); + + + // Reprocess Fuels - // Sparging NEI Recipes - GasSpargingRecipeMap.addRecipe( - new FluidStack(mSpargeGases.get(0), 50), - new FluidStack[] { - new FluidStack(mNobleGases.get(0), 50), - new FluidStack(mNobleGases.get(1), 10), - new FluidStack(mNobleGases.get(2), 10), - new FluidStack(mNobleGases.get(3), 10), - new FluidStack(mNobleGases.get(4), 10), - new FluidStack(mNobleGases.get(5), 10) - }, - new int[] { - 5000, 1000, 1000, 1000, 1000, 1000 - }); - - GasSpargingRecipeMap.addRecipe( - new FluidStack(mSpargeGases.get(1), 100), - new FluidStack[] { - new FluidStack(mFluorideGases.get(0), 100), - new FluidStack(mFluorideGases.get(1), 20), - new FluidStack(mFluorideGases.get(2), 20), - new FluidStack(mFluorideGases.get(3), 20), - new FluidStack(mFluorideGases.get(4), 20), - new FluidStack(mFluorideGases.get(5), 20) - }, - new int[] { - 10000, 2000, 2000, 2000, 2000, 2000 - }); - - GTPP_Recipe.GTPP_Recipe_Map.sLiquidFluorineThoriumReactorRecipes.add(LFTR1); - GTPP_Recipe.GTPP_Recipe_Map.sLiquidFluorineThoriumReactorRecipes.add(LFTR2); - GTPP_Recipe.GTPP_Recipe_Map.sLiquidFluorineThoriumReactorRecipes.add(LFTR3); + final FluidStack aBurntLiFBeF2ZrF4U235 = new FluidStack(NuclearChem.Burnt_LiFBeF2ZrF4U235, 17); + final FluidStack aBurntLiFBeF2ZrF4UF4 = new FluidStack(NuclearChem.Burnt_LiFBeF2ZrF4UF4, 17); + final FluidStack aBurntLiFBeF2ThF4UF4 = new FluidStack(NuclearChem.Burnt_LiFBeF2ThF4UF4, 17); + final FluidStack aBurntLi2BeF4 = new FluidStack(ModItems.fluidFLiBeSaltBurnt, 34); + final FluidStack aHelium = Materials.Helium.getGas(1000); + final FluidStack aFluorine = Materials.Fluorine.getGas(1000); + CORE.RA.addFissionFuel( + FluidUtils.getFluidStack(aBurntLiFBeF2ZrF4U235, 500), + FluidUtils.getFluidStack(aBerylliumFluoride, 280), + FluidUtils.getFluidStack(aThoriumFluoride, 70), + FluidUtils.getFluidStack(aUraniumTetraFluoride, 70), + null, null, null, null, null, // Extra 5 inputs + FluidUtils.getFluidStack(aLiFBeF2ThF4UF4, 1000), + null, + 150 * 60 * 20, // Duration + MaterialUtils.getVoltageForTier(5) + ); } } diff --git a/src/resources/assets/miscutils/lang/en_US.lang b/src/resources/assets/miscutils/lang/en_US.lang index d581791031..ab9580d291 100644 --- a/src/resources/assets/miscutils/lang/en_US.lang +++ b/src/resources/assets/miscutils/lang/en_US.lang @@ -3240,4 +3240,19 @@ interaction.voidexcess.enabled=Void Excess Enabled interaction.voidexcess.disabled=Void Excess Disabled interaction.separateBusses.enabled=Input busses are separated -interaction.separateBusses.disabled=Input busses are not separated \ No newline at end of file +interaction.separateBusses.disabled=Input busses are not separated + +//Added 29/11/21 + +item.BasicNuclearChemItem.0.name=Uranium Residue Mix +item.BasicNuclearChemItem.1.name=Plutonium Residue Mix +item.BasicNuclearChemItem.2.name=Fluoride Residue Mix +item.BasicNuclearChemItem.3.name=Noble Residue Mix +item.BasicNuclearChemItem.4.name=Red Algae Biomass +item.BasicNuclearChemItem.5.name=Cellulose Fiber +item.BasicNuclearChemItem.6.name=Golden-Brown Cellulose Fiber +item.BasicNuclearChemItem.7.name=Red Cellulose Fiber + +item.itemCellLiFBeF2ZrF4U235.name=LFTR Fuel I Cell +item.itemCellLiFBeF2ZrF4UF4.name=LFTR Fuel II Cell +item.itemCellLiFBeF2ThF4UF4.name=LFTR Fuel III Cell \ No newline at end of file diff --git a/src/resources/assets/miscutils/textures/items/science/nuclear/MetaItem1/0.png b/src/resources/assets/miscutils/textures/items/science/nuclear/MetaItem1/0.png new file mode 100644 index 0000000000..7adcc6adcf Binary files /dev/null and b/src/resources/assets/miscutils/textures/items/science/nuclear/MetaItem1/0.png differ diff --git a/src/resources/assets/miscutils/textures/items/science/nuclear/MetaItem1/1.png b/src/resources/assets/miscutils/textures/items/science/nuclear/MetaItem1/1.png new file mode 100644 index 0000000000..2064052fa5 Binary files /dev/null and b/src/resources/assets/miscutils/textures/items/science/nuclear/MetaItem1/1.png differ diff --git a/src/resources/assets/miscutils/textures/items/science/nuclear/MetaItem1/2.png b/src/resources/assets/miscutils/textures/items/science/nuclear/MetaItem1/2.png new file mode 100644 index 0000000000..a974943866 Binary files /dev/null and b/src/resources/assets/miscutils/textures/items/science/nuclear/MetaItem1/2.png differ diff --git a/src/resources/assets/miscutils/textures/items/science/nuclear/MetaItem1/3.png b/src/resources/assets/miscutils/textures/items/science/nuclear/MetaItem1/3.png new file mode 100644 index 0000000000..97a796c871 Binary files /dev/null and b/src/resources/assets/miscutils/textures/items/science/nuclear/MetaItem1/3.png differ diff --git a/src/resources/assets/miscutils/textures/items/science/nuclear/MetaItem1/4.png b/src/resources/assets/miscutils/textures/items/science/nuclear/MetaItem1/4.png new file mode 100644 index 0000000000..b50c781c6d Binary files /dev/null and b/src/resources/assets/miscutils/textures/items/science/nuclear/MetaItem1/4.png differ diff --git a/src/resources/assets/miscutils/textures/items/science/nuclear/MetaItem1/5.png b/src/resources/assets/miscutils/textures/items/science/nuclear/MetaItem1/5.png new file mode 100644 index 0000000000..b50c781c6d Binary files /dev/null and b/src/resources/assets/miscutils/textures/items/science/nuclear/MetaItem1/5.png differ diff --git a/src/resources/assets/miscutils/textures/items/science/nuclear/MetaItem1/6.png b/src/resources/assets/miscutils/textures/items/science/nuclear/MetaItem1/6.png new file mode 100644 index 0000000000..b50c781c6d Binary files /dev/null and b/src/resources/assets/miscutils/textures/items/science/nuclear/MetaItem1/6.png differ -- cgit From 87240928dbabeab240523ff0d3d59c09176f4955 Mon Sep 17 00:00:00 2001 From: Alkalus <3060479+draknyte1@users.noreply.github.com> Date: Sun, 5 Dec 2021 18:49:08 +0000 Subject: Add workaround for BW Hydrogen Peroxide unification. Made generic GT++ Recipes maps use default GT NEI handler. Boosted fuel value of Rocket Fuels. --- .../core/item/chemistry/RocketFuels.java | 31 +++++++++++++++++++--- .../gtPlusPlus/core/util/minecraft/FluidUtils.java | 10 +++---- src/Java/gtPlusPlus/nei/NEI_GT_Config.java | 3 ++- src/resources/assets/miscutils/lang/en_US.lang | 3 ++- 4 files changed, 36 insertions(+), 11 deletions(-) (limited to 'src/Java/gtPlusPlus/core/item') diff --git a/src/Java/gtPlusPlus/core/item/chemistry/RocketFuels.java b/src/Java/gtPlusPlus/core/item/chemistry/RocketFuels.java index 094cb59cb7..c03566c1a8 100644 --- a/src/Java/gtPlusPlus/core/item/chemistry/RocketFuels.java +++ b/src/Java/gtPlusPlus/core/item/chemistry/RocketFuels.java @@ -144,6 +144,29 @@ public class RocketFuels extends ItemPackage { MaterialUtils.getVoltageForTier(2), 1); + FluidStack aBartWorksHydrogenPeroxide = FluidUtils.getWildcardFluidStack("Hydrogen Peroxide", 2000); + if (aBartWorksHydrogenPeroxide != null) { + Logger.INFO("Found BW Hydrogen Peroxide, adding compat recipe."); + CORE.RA.addChemicalPlantRecipe( + new ItemStack[] { + CI.getNumberedCircuit(22) + }, + new FluidStack[] { + aBartWorksHydrogenPeroxide, + FluidUtils.getFluidStack("ammonia", 2000), + }, + new ItemStack[] { + + }, + new FluidStack[] { + FluidUtils.getFluidStack(Hydrazine, 4000), + + }, + 20 * 30, + MaterialUtils.getVoltageForTier(2), + 1); + } + } @@ -294,7 +317,7 @@ public class RocketFuels extends ItemPackage { new FluidStack[] {}, 0, 0, - 256)); //Fuel Value + 512)); //Fuel Value mRocketFuels.put(1, new GTPP_Recipe( true, @@ -306,7 +329,7 @@ public class RocketFuels extends ItemPackage { new FluidStack[] {}, 0, 0, - 512)); //Fuel Value + 1024)); //Fuel Value mRocketFuels.put(2, new GTPP_Recipe( true, @@ -318,7 +341,7 @@ public class RocketFuels extends ItemPackage { new FluidStack[] {}, 0, 0, - 768)); //Fuel Value + 2048)); //Fuel Value mRocketFuels.put(3, new GTPP_Recipe( true, @@ -330,7 +353,7 @@ public class RocketFuels extends ItemPackage { new FluidStack[] {}, 0, 0, - 1024)); //Fuel Value + 4196)); //Fuel Value //Add in default Diesel for the Buggy diff --git a/src/Java/gtPlusPlus/core/util/minecraft/FluidUtils.java b/src/Java/gtPlusPlus/core/util/minecraft/FluidUtils.java index 7b945ba507..6b07667b28 100644 --- a/src/Java/gtPlusPlus/core/util/minecraft/FluidUtils.java +++ b/src/Java/gtPlusPlus/core/util/minecraft/FluidUtils.java @@ -575,11 +575,11 @@ public class FluidUtils { return aFStack1 != null || aFStack2 != null || aFStack3 != null || aFStack4 != null || aFStack5 != null || aFStack6 != null; } - public static FluidStack getWildcardFluidStack(String aFluidName, int amount) { - FluidStack aFStack1 = (FluidUtils.getFluidStack("molten"+"."+aFluidName.toLowerCase(), amount)); - FluidStack aFStack2 = (FluidUtils.getFluidStack("fluid"+"."+aFluidName.toLowerCase(), amount)); - FluidStack aFStack3 = (FluidUtils.getFluidStack(aFluidName.toLowerCase(), amount)); - FluidStack aFStack4 = (FluidUtils.getFluidStack(aFluidName, amount)); + public static FluidStack getWildcardFluidStack(String aFluidName, int amount) { + FluidStack aFStack1 = (FluidUtils.getFluidStack(aFluidName, amount)); + FluidStack aFStack2 = (FluidUtils.getFluidStack(aFluidName.toLowerCase(), amount)); + FluidStack aFStack3 = (FluidUtils.getFluidStack("molten"+"."+aFluidName.toLowerCase(), amount)); + FluidStack aFStack4 = (FluidUtils.getFluidStack("fluid"+"."+aFluidName.toLowerCase(), amount)); FluidStack aFStack5 = (FluidUtils.getFluidStack("liquid_"+aFluidName.toLowerCase(), amount)); FluidStack aFStack6 = (FluidUtils.getFluidStack("liquid"+"."+aFluidName.toLowerCase(), amount)); if (aFStack1 != null) { diff --git a/src/Java/gtPlusPlus/nei/NEI_GT_Config.java b/src/Java/gtPlusPlus/nei/NEI_GT_Config.java index 57da808f1d..be05961785 100644 --- a/src/Java/gtPlusPlus/nei/NEI_GT_Config.java +++ b/src/Java/gtPlusPlus/nei/NEI_GT_Config.java @@ -5,6 +5,7 @@ import codechicken.nei.api.IConfigureNEI; import gregtech.api.util.GTPP_Recipe; import gregtech.api.util.GTPP_Recipe.GTPP_Recipe_Map; import gregtech.api.util.GT_Recipe.GT_Recipe_Map; +import gregtech.nei.GT_NEI_DefaultHandler; import gtPlusPlus.api.objects.Logger; import gtPlusPlus.api.objects.data.AutoMap; import gtPlusPlus.core.util.Utils; @@ -55,7 +56,7 @@ implements IConfigureNEI { if (tMap.mNEIAllowed) { if (!mUniqueRecipeMapHandling.contains(tMap.mUnlocalizedName)) { Logger.INFO("NEI Registration: Registering NEI handler for "+tMap.mNEIName); - new GTPP_NEI_DefaultHandler(tMap); + new GT_NEI_DefaultHandler(tMap); } else { Logger.INFO("NEI Registration: Not allowed to register NEI handler for "+tMap.mNEIName); diff --git a/src/resources/assets/miscutils/lang/en_US.lang b/src/resources/assets/miscutils/lang/en_US.lang index ab9580d291..d98a114309 100644 --- a/src/resources/assets/miscutils/lang/en_US.lang +++ b/src/resources/assets/miscutils/lang/en_US.lang @@ -3255,4 +3255,5 @@ item.BasicNuclearChemItem.7.name=Red Cellulose Fiber item.itemCellLiFBeF2ZrF4U235.name=LFTR Fuel I Cell item.itemCellLiFBeF2ZrF4UF4.name=LFTR Fuel II Cell -item.itemCellLiFBeF2ThF4UF4.name=LFTR Fuel III Cell \ No newline at end of file +item.itemCellLiFBeF2ThF4UF4.name=LFTR Fuel III Cell +item.Li2BeF2UF4.name=Burnt Li2BeF2UF4 Cell \ No newline at end of file -- cgit From 7f35f5cf2684d056e5cce278e555d685e20a5821 Mon Sep 17 00:00:00 2001 From: Alkalus <3060479+draknyte1@users.noreply.github.com> Date: Mon, 6 Dec 2021 10:56:09 +0000 Subject: Added more Nuclear fluids/dusts. Added two new machines. --- src/Java/gregtech/api/util/GTPP_Recipe.java | 8 +- src/Java/gtPlusPlus/core/item/ModItems.java | 22 ++++- .../core/item/base/BaseItemTickable.java | 1 + .../core/material/nuclear/FLUORIDES.java | 16 +++- .../xmod/gregtech/api/enums/GregtechItemList.java | 10 ++- .../interfaces/internal/IGregtech_RecipeAdder.java | 4 + .../common/blocks/textures/TexturesGtBlock.java | 15 ++++ .../GregtechMetaTileEntity_ReactorColdTrap.java | 67 +++++++++++++++ ...egtechMetaTileEntity_ReactorProcessingUnit.java | 67 +++++++++++++++ .../gregtech/loaders/recipe/RecipeLoader_FFPP.java | 92 --------------------- .../loaders/recipe/RecipeLoader_Nuclear.java | 2 +- .../recipe/RecipeLoader_NuclearFuelProcessing.java | 92 +++++++++++++++++++++ .../xmod/gregtech/recipes/GregtechRecipeAdder.java | 41 +++++++++ .../registration/gregtech/GregtechLFTR.java | 12 ++- .../TileEntities/ReactorColdTrap/OVERLAY_FRONT.png | Bin 0 -> 344 bytes .../ReactorColdTrap/OVERLAY_FRONT_ACTIVE.png | Bin 0 -> 387 bytes .../TileEntities/ReactorColdTrap/OVERLAY_SIDE.png | Bin 0 -> 345 bytes .../ReactorColdTrap/OVERLAY_SIDE_ACTIVE.png | Bin 0 -> 668 bytes .../ReactorColdTrap/OVERLAY_SIDE_ACTIVE.png.mcmeta | 6 ++ .../TileEntities/ReactorColdTrap/OVERLAY_TOP.png | Bin 0 -> 228 bytes .../ReactorColdTrap/OVERLAY_TOP_ACTIVE.png | Bin 0 -> 224 bytes .../ReactorProcessingUnit/OVERLAY_FRONT.png | Bin 0 -> 439 bytes .../ReactorProcessingUnit/OVERLAY_FRONT_ACTIVE.png | Bin 0 -> 704 bytes .../OVERLAY_FRONT_ACTIVE.png.mcmeta | 6 ++ .../ReactorProcessingUnit/OVERLAY_SIDE.png | Bin 0 -> 439 bytes .../ReactorProcessingUnit/OVERLAY_SIDE_ACTIVE.png | Bin 0 -> 1049 bytes .../OVERLAY_SIDE_ACTIVE.png.mcmeta | 6 ++ .../ReactorProcessingUnit/OVERLAY_TOP.png | Bin 0 -> 367 bytes .../ReactorProcessingUnit/OVERLAY_TOP_ACTIVE.png | Bin 0 -> 366 bytes 29 files changed, 365 insertions(+), 102 deletions(-) create mode 100644 src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaTileEntity_ReactorColdTrap.java create mode 100644 src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaTileEntity_ReactorProcessingUnit.java delete mode 100644 src/Java/gtPlusPlus/xmod/gregtech/loaders/recipe/RecipeLoader_FFPP.java create mode 100644 src/Java/gtPlusPlus/xmod/gregtech/loaders/recipe/RecipeLoader_NuclearFuelProcessing.java create mode 100644 src/resources/assets/miscutils/textures/blocks/TileEntities/ReactorColdTrap/OVERLAY_FRONT.png create mode 100644 src/resources/assets/miscutils/textures/blocks/TileEntities/ReactorColdTrap/OVERLAY_FRONT_ACTIVE.png create mode 100644 src/resources/assets/miscutils/textures/blocks/TileEntities/ReactorColdTrap/OVERLAY_SIDE.png create mode 100644 src/resources/assets/miscutils/textures/blocks/TileEntities/ReactorColdTrap/OVERLAY_SIDE_ACTIVE.png create mode 100644 src/resources/assets/miscutils/textures/blocks/TileEntities/ReactorColdTrap/OVERLAY_SIDE_ACTIVE.png.mcmeta create mode 100644 src/resources/assets/miscutils/textures/blocks/TileEntities/ReactorColdTrap/OVERLAY_TOP.png create mode 100644 src/resources/assets/miscutils/textures/blocks/TileEntities/ReactorColdTrap/OVERLAY_TOP_ACTIVE.png create mode 100644 src/resources/assets/miscutils/textures/blocks/TileEntities/ReactorProcessingUnit/OVERLAY_FRONT.png create mode 100644 src/resources/assets/miscutils/textures/blocks/TileEntities/ReactorProcessingUnit/OVERLAY_FRONT_ACTIVE.png create mode 100644 src/resources/assets/miscutils/textures/blocks/TileEntities/ReactorProcessingUnit/OVERLAY_FRONT_ACTIVE.png.mcmeta create mode 100644 src/resources/assets/miscutils/textures/blocks/TileEntities/ReactorProcessingUnit/OVERLAY_SIDE.png create mode 100644 src/resources/assets/miscutils/textures/blocks/TileEntities/ReactorProcessingUnit/OVERLAY_SIDE_ACTIVE.png create mode 100644 src/resources/assets/miscutils/textures/blocks/TileEntities/ReactorProcessingUnit/OVERLAY_SIDE_ACTIVE.png.mcmeta create mode 100644 src/resources/assets/miscutils/textures/blocks/TileEntities/ReactorProcessingUnit/OVERLAY_TOP.png create mode 100644 src/resources/assets/miscutils/textures/blocks/TileEntities/ReactorProcessingUnit/OVERLAY_TOP_ACTIVE.png (limited to 'src/Java/gtPlusPlus/core/item') diff --git a/src/Java/gregtech/api/util/GTPP_Recipe.java b/src/Java/gregtech/api/util/GTPP_Recipe.java index 5bd8580995..f98c35363f 100644 --- a/src/Java/gregtech/api/util/GTPP_Recipe.java +++ b/src/Java/gregtech/api/util/GTPP_Recipe.java @@ -348,7 +348,13 @@ public class GTPP_Recipe extends GT_Recipe implements IComparableRecipe { //Fission Fuel Plant Recipes public static final GTPP_Recipe_Map_Internal sFissionFuelProcessing = new GTPP_Recipe_Map_Internal(new HashSet(50), "gtpp.recipe.fissionfuel", "Nuclear Fuel Processing", null, RES_PATH_GUI + "basicmachines/FissionFuel", 0, 0, 0, 0, 1, E, 1, E, true, false); - + + //Cold Trap + public static final GTPP_Recipe_Map_Internal sColdTrapRecipes = new GTPP_Recipe_Map_Internal(new HashSet(3), "gtpp.recipe.coldtrap", "Cold Trap", null, RES_PATH_GUI + "basicmachines/ChemicalReactor", 1, 1, 0, 0, 1, E, 1, E, true, true); + + //Reactor Processing Unit + public static final GTPP_Recipe_Map_Internal sReactorProcessingUnitRecipes = new GTPP_Recipe_Map_Internal(new HashSet(3), "gtpp.recipe.reactorprocessingunit", "Reactor Processing Unit", null, RES_PATH_GUI + "basicmachines/ChemicalReactor", 1, 1, 0, 0, 1, E, 1, E, true, true); + //Basic Washer Map public static final GTPP_Recipe_Map_Internal sSimpleWasherRecipes = new GTPP_Recipe_Map_Internal(new HashSet(3), "gtpp.recipe.simplewasher", "Simple Dust Washer", null, RES_PATH_GUI + "basicmachines/PotionBrewer", 1, 1, 0, 0, 1, E, 1, E, true, true); diff --git a/src/Java/gtPlusPlus/core/item/ModItems.java b/src/Java/gtPlusPlus/core/item/ModItems.java index 85ec564978..4957a2b571 100644 --- a/src/Java/gtPlusPlus/core/item/ModItems.java +++ b/src/Java/gtPlusPlus/core/item/ModItems.java @@ -234,6 +234,14 @@ public final class ModItems { public static Fluid fluidFLiBeSalt; public static Fluid fluidFLiBeSaltBurnt; + public static Fluid fluidLftrCore1; + public static Fluid fluidLftrCore2; + public static Fluid fluidLftrCore3; + public static Fluid fluidLftrCore4; + public static Fluid fluidLftrBlanket1; + public static Fluid fluidLftrBlanket2; + public static Fluid fluidLftrBlanket3; + //Possibly missing base items that GT may be missing. @@ -284,6 +292,7 @@ public final class ModItems { public static Item dustNeptunium238; public static Item dustDecayedRadium226; public static Item dustRadium226; + public static Item dustProtactinium233; public static ItemGiantEgg itemBigEgg; @@ -718,6 +727,17 @@ public final class ModItems { fluidFLiBeSalt = FluidUtils.addGTFluidNoPrefix("Li2BeF4", "Li2BeF4", new short[]{255, 255, 255, 100}, 0, 743, null, CI.emptyCells(1), 1000, true); fluidFLiBeSaltBurnt = FluidUtils.addGTFluidNoPrefix("Li2BeF2UF4", "Li2BeF2UF4", new short[]{50, 255, 50, 100}, 0, 743, null, CI.emptyCells(1), 1000, true); + // LFTR Core Fluid Processing + fluidLftrCore1 = FluidUtils.addGTFluidNoPrefix("LiBeF2UF4FP", "LiBeF2UF4FP", new short[]{110, 255, 110, 100}, 0, 800, null, CI.emptyCells(1), 1000, true); + fluidLftrCore2 = FluidUtils.addGTFluidNoPrefix("UF6F2FP", "UF6F2FP", new short[]{150, 255, 150, 100}, 0, 800, null, CI.emptyCells(1), 1000, true); + fluidLftrCore3 = FluidUtils.addGTFluidNoPrefix("LiFBeF2", "LiFBeF2", new short[]{100, 255, 50, 100}, 0, 800, null, CI.emptyCells(1), 1000, true); + fluidLftrCore4 = FluidUtils.addGTFluidNoPrefix("LiFBeF2UF4", "LiFBeF2UF4", new short[]{50, 255, 100, 100}, 0, 800, null, CI.emptyCells(1), 1000, true); + // LFTR Blanket Fluid Processing + fluidLftrBlanket1 = FluidUtils.addGTFluidNoPrefix("LiFThF4", "LiFThF4", new short[]{50, 150, 255, 50}, 0, 500, null, CI.emptyCells(1), 1000, true); + fluidLftrBlanket2 = FluidUtils.addGTFluidNoPrefix("LiFBeF2ThF4", "LiFBeF2ThF4", new short[]{100, 150, 100, 100}, 0, 500, null, CI.emptyCells(1), 1000, true); + fluidLftrBlanket3 = FluidUtils.addGTFluidNoPrefix("UF6F2", "UF6F2", new short[]{10, 150, 10, 100}, 0, 500, null, CI.emptyCells(1), 1000, true); + + //LFTR Control Circuit itemCircuitLFTR = new CoreItem("itemCircuitLFTR", ""+EnumChatFormatting.GREEN+"Control Circuit", AddToCreativeTab.tabMisc, 1, 0, new String[] {"Keeps Multiblocks Stable"}, EnumRarity.epic, EnumChatFormatting.DARK_GREEN, false, null); @@ -941,7 +961,7 @@ public final class ModItems { dustNeptunium238 = new DustDecayable("dustNeptunium238", Utils.rgbtoHexValue(175, 240, 75), 50640, new String[] {""+StringUtils.superscript("238Np"), "Result: Plutonium 238 ("+StringUtils.superscript("238Pu")+")"}, ELEMENT.getInstance().PLUTONIUM238.getDust(1).getItem(), 5); dustDecayedRadium226 = ItemUtils.generateSpecialUseDusts("DecayedRadium226", "Decayed Radium-226", "Contains Radon ("+StringUtils.superscript("222Rn")+")", ELEMENT.getInstance().RADIUM.getRgbAsHex())[0]; dustRadium226 = new DustDecayable("dustRadium226", ELEMENT.getInstance().RADIUM.getRgbAsHex(), 90000, new String[] {""+StringUtils.superscript("226Ra"), "Result: Radon ("+StringUtils.superscript("222Rn")+")"}, ItemUtils.getSimpleStack(dustDecayedRadium226).getItem(), 5); - + dustProtactinium233 = new DustDecayable("dustProtactinium233", ELEMENT.getInstance().PROTACTINIUM.getRgbAsHex(), 32000, new String[] {""+StringUtils.superscript("233Pa"), "Result: Uranium 233("+StringUtils.superscript("233U")+")"}, ELEMENT.getInstance().URANIUM233.getDust(1).getItem(), 6); dustTechnetium99 = new DustDecayable("dustTechnetium99", ELEMENT.getInstance().TECHNETIUM.getRgbAsHex(), 164500, new String[] {""+StringUtils.superscript("99Mo"), "Result: Ruthenium 99("+StringUtils.superscript("99Ru")+")"}, ELEMENT.getInstance().RUTHENIUM.getDust(1).getItem(), 4); dustTechnetium99M = new DustDecayable("dustTechnetium99M", ELEMENT.getInstance().TECHNETIUM.getRgbAsHex(), 8570, new String[] {""+StringUtils.superscript("99ᵐTc"), "Result: Technicium 99 ("+StringUtils.superscript("99Tc")+")"}, dustTechnetium99, 4); dustMolybdenum99 = new DustDecayable("dustMolybdenum99", ELEMENT.getInstance().MOLYBDENUM.getRgbAsHex(), 16450, new String[] {""+StringUtils.superscript("99Mo"), "Result: Technicium 99ᵐ ("+StringUtils.superscript("99ᵐTc")+")"}, dustTechnetium99M, 4); diff --git a/src/Java/gtPlusPlus/core/item/base/BaseItemTickable.java b/src/Java/gtPlusPlus/core/item/base/BaseItemTickable.java index 79a49f92b7..eb066024e0 100644 --- a/src/Java/gtPlusPlus/core/item/base/BaseItemTickable.java +++ b/src/Java/gtPlusPlus/core/item/base/BaseItemTickable.java @@ -45,6 +45,7 @@ public class BaseItemTickable extends CoreItem { this.maxTicks = maxTicks; this.twoRenderPasses = twoPass; this.ticksInContainers = containerTick; + this.maxStackSize = 1; //setGregtechItemList(); } diff --git a/src/Java/gtPlusPlus/core/material/nuclear/FLUORIDES.java b/src/Java/gtPlusPlus/core/material/nuclear/FLUORIDES.java index bfa08d3c29..5872587872 100644 --- a/src/Java/gtPlusPlus/core/material/nuclear/FLUORIDES.java +++ b/src/Java/gtPlusPlus/core/material/nuclear/FLUORIDES.java @@ -1,7 +1,6 @@ package gtPlusPlus.core.material.nuclear; import gregtech.api.enums.Materials; -import gregtech.api.enums.TextureSet; import gtPlusPlus.core.material.ELEMENT; import gtPlusPlus.core.material.MISC_MATERIALS; import gtPlusPlus.core.material.Material; @@ -263,6 +262,21 @@ public class FLUORIDES { new MaterialStack(ELEMENT.getInstance().SELENIUM, 1), new MaterialStack(ELEMENT.getInstance().FLUORINE, 6) }); + + public static final Material SODIUM_FLUORIDE = new Material( + "Sodium Fluoride", //Material Name + MaterialState.PURE_LIQUID, //State + null, //Material Colour + -1, //Melting Point in C + -1, //Boiling Point in C + -1, //Protons + -1, //Neutrons + false, //Uses Blast furnace? + //Material Stacks with Percentage of required elements. + new MaterialStack[]{ + new MaterialStack(ELEMENT.getInstance().SODIUM, 1), + new MaterialStack(ELEMENT.getInstance().FLUORINE, 1) + }); private static final FLUORIDES INSTANCE = new FLUORIDES(); public static FLUORIDES getInstance(){return INSTANCE;} diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/enums/GregtechItemList.java b/src/Java/gtPlusPlus/xmod/gregtech/api/enums/GregtechItemList.java index 7ff40ccc12..30ab7fc19f 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/api/enums/GregtechItemList.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/api/enums/GregtechItemList.java @@ -586,9 +586,13 @@ public enum GregtechItemList implements GregtechItemContainer { Machine_ZPM_Component_Maker, Machine_UV_Component_Maker, - // Fluid Reactor - FluidReactor_LV, FluidReactor_HV, - FluidReactor_IV, FluidReactor_ZPM, + // Reactor Processing Unit + ReactorProcessingUnit_IV, + ReactorProcessingUnit_ZPM, + + // Cold Trap + ColdTrap_IV, + ColdTrap_ZPM, //Breakers BreakerBox_ULV, BreakerBox_LV, BreakerBox_MV, diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/interfaces/internal/IGregtech_RecipeAdder.java b/src/Java/gtPlusPlus/xmod/gregtech/api/interfaces/internal/IGregtech_RecipeAdder.java index 945ff7bf0e..34d1290de9 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/api/interfaces/internal/IGregtech_RecipeAdder.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/api/interfaces/internal/IGregtech_RecipeAdder.java @@ -304,5 +304,9 @@ public interface IGregtech_RecipeAdder { public boolean addFuelForRTG(ItemStack aFuelPellet, int aFuelDays, int aVoltage); + public boolean addColdTrapRecipe(int aCircuit, ItemStack aInput, FluidStack aFluidInput, ItemStack[] aOutputs, FluidStack aFluidOutput, int aTime, int aEU); + + public boolean addReactorProcessingUnitRecipe(ItemStack aInput1, ItemStack aInput2, FluidStack aFluidInput, ItemStack[] aOutputs, int[] aChances, FluidStack aFluidOutput, int aTime, int aEU); + } diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/textures/TexturesGtBlock.java b/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/textures/TexturesGtBlock.java index d4221f064a..6a4a74e4e3 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/textures/TexturesGtBlock.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/textures/TexturesGtBlock.java @@ -477,6 +477,21 @@ public class TexturesGtBlock { public static final CustomIcon TEXTURE_TECH_PANEL_RADIOACTIVE = new CustomIcon("TileEntities/DecayablesChest_bottom"); public static final CustomIcon TEXTURE_TECH_PANEL_RADIOACTIVE_ALT = new CustomIcon("TileEntities/DecayablesChest_top"); + + // LFTR Single blocks + public static final CustomIcon OVERLAY_REACTOR_COLDTRAP_FRONT = new CustomIcon("TileEntities/ReactorColdTrap/OVERLAY_FRONT"); + public static final CustomIcon OVERLAY_REACTOR_COLDTRAP_FRONT_ACTIVE = new CustomIcon("TileEntities/ReactorColdTrap/OVERLAY_FRONT_ACTIVE"); + public static final CustomIcon OVERLAY_REACTOR_COLDTRAP_SIDE = new CustomIcon("TileEntities/ReactorColdTrap/OVERLAY_SIDE"); + public static final CustomIcon OVERLAY_REACTOR_COLDTRAP_SIDE_ACTIVE = new CustomIcon("TileEntities/ReactorColdTrap/OVERLAY_SIDE_ACTIVE"); + public static final CustomIcon OVERLAY_REACTOR_COLDTRAP_TOP = new CustomIcon("TileEntities/ReactorColdTrap/OVERLAY_TOP"); + public static final CustomIcon OVERLAY_REACTOR_COLDTRAP_TOP_ACTIVE = new CustomIcon("TileEntities/ReactorColdTrap/OVERLAY_TOP_ACTIVE"); + + public static final CustomIcon OVERLAY_REACTOR_PROCESSINGUNIT_FRONT = new CustomIcon("TileEntities/ReactorProcessingUnit/OVERLAY_FRONT"); + public static final CustomIcon OVERLAY_REACTOR_PROCESSINGUNIT_FRONT_ACTIVE = new CustomIcon("TileEntities/ReactorProcessingUnit/OVERLAY_FRONT_ACTIVE"); + public static final CustomIcon OVERLAY_REACTOR_PROCESSINGUNIT_SIDE = new CustomIcon("TileEntities/ReactorProcessingUnit/OVERLAY_SIDE"); + public static final CustomIcon OVERLAY_REACTOR_PROCESSINGUNIT_SIDE_ACTIVE = new CustomIcon("TileEntities/ReactorProcessingUnit/OVERLAY_SIDE_ACTIVE"); + public static final CustomIcon OVERLAY_REACTOR_PROCESSINGUNIT_TOP = new CustomIcon("TileEntities/ReactorProcessingUnit/OVERLAY_TOP"); + public static final CustomIcon OVERLAY_REACTOR_PROCESSINGUNIT_TOP_ACTIVE = new CustomIcon("TileEntities/ReactorProcessingUnit/OVERLAY_TOP_ACTIVE"); //Overlay Arrays diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaTileEntity_ReactorColdTrap.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaTileEntity_ReactorColdTrap.java new file mode 100644 index 0000000000..58bdba18a5 --- /dev/null +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaTileEntity_ReactorColdTrap.java @@ -0,0 +1,67 @@ +package gtPlusPlus.xmod.gregtech.common.tileentities.machines.basic; + +import gregtech.api.interfaces.ITexture; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.metatileentity.MetaTileEntity; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicMachine; +import gregtech.api.objects.GT_RenderedTexture; +import gregtech.api.util.GTPP_Recipe; +import gregtech.api.util.GT_Recipe; +import gtPlusPlus.core.lib.CORE; +import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock; +import net.minecraft.item.ItemStack; +import net.minecraftforge.fluids.FluidStack; + +public class GregtechMetaTileEntity_ReactorColdTrap extends GT_MetaTileEntity_BasicMachine { + + public GregtechMetaTileEntity_ReactorColdTrap(int aID, String aName, String aNameRegional, int aTier) { + super(aID, aName, aNameRegional, aTier, 1, + "Just like the Arctic", 1, 1, "ChemicalReactor.png", "", + new ITexture[]{ + new GT_RenderedTexture(TexturesGtBlock.OVERLAY_REACTOR_COLDTRAP_SIDE_ACTIVE), + new GT_RenderedTexture(TexturesGtBlock.OVERLAY_REACTOR_COLDTRAP_SIDE), + new GT_RenderedTexture(TexturesGtBlock.OVERLAY_REACTOR_COLDTRAP_FRONT_ACTIVE), + new GT_RenderedTexture(TexturesGtBlock.OVERLAY_REACTOR_COLDTRAP_FRONT), + new GT_RenderedTexture(TexturesGtBlock.OVERLAY_REACTOR_COLDTRAP_TOP_ACTIVE), + new GT_RenderedTexture(TexturesGtBlock.OVERLAY_REACTOR_COLDTRAP_TOP), + new GT_RenderedTexture(TexturesGtBlock.OVERLAY_REACTOR_COLDTRAP_TOP_ACTIVE), + new GT_RenderedTexture(TexturesGtBlock.OVERLAY_REACTOR_COLDTRAP_TOP) + } + ); + } + + public GregtechMetaTileEntity_ReactorColdTrap(String aName, int aTier, String aDescription, ITexture[][][] aTextures, String aGUIName, String aNEIName) { + super(aName, aTier, 1, aDescription, aTextures, 1, 1, aGUIName, aNEIName); + } + + @Override + public String[] getDescription() { + return new String[]{this.mDescription, "Does not require ice cubes", CORE.GT_Tooltip}; + } + + @Override + public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { + return new GregtechMetaTileEntity_ReactorColdTrap(this.mName, this.mTier, this.mDescription, this.mTextures, this.mGUIName, this.mNEIName); + } + + @Override + public GT_Recipe.GT_Recipe_Map getRecipeList() { + return GTPP_Recipe.GTPP_Recipe_Map.sColdTrapRecipes; + } + + @Override + public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) { + return (super.allowPutStack(aBaseMetaTileEntity, aIndex, aSide, aStack)) && (getRecipeList().containsInput(aStack)); + } + + @Override + public boolean isFluidInputAllowed(FluidStack aFluid) { + return super.isFluidInputAllowed(aFluid); + } + + @Override + public int getCapacity() { + return 16000 * Math.max(1, this.mTier); + } + +} diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaTileEntity_ReactorProcessingUnit.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaTileEntity_ReactorProcessingUnit.java new file mode 100644 index 0000000000..75259a0b88 --- /dev/null +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaTileEntity_ReactorProcessingUnit.java @@ -0,0 +1,67 @@ +package gtPlusPlus.xmod.gregtech.common.tileentities.machines.basic; + +import gregtech.api.interfaces.ITexture; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.metatileentity.MetaTileEntity; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicMachine; +import gregtech.api.objects.GT_RenderedTexture; +import gregtech.api.util.GTPP_Recipe; +import gregtech.api.util.GT_Recipe; +import gtPlusPlus.core.lib.CORE; +import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock; +import net.minecraft.item.ItemStack; +import net.minecraftforge.fluids.FluidStack; + +public class GregtechMetaTileEntity_ReactorProcessingUnit extends GT_MetaTileEntity_BasicMachine { + + public GregtechMetaTileEntity_ReactorProcessingUnit(int aID, String aName, String aNameRegional, int aTier) { + super(aID, aName, aNameRegional, aTier, 1, + "Processes Nuclear things", 1, 1, "ChemicalReactor.png", "", + new ITexture[]{ + new GT_RenderedTexture(TexturesGtBlock.OVERLAY_REACTOR_PROCESSINGUNIT_SIDE_ACTIVE), + new GT_RenderedTexture(TexturesGtBlock.OVERLAY_REACTOR_PROCESSINGUNIT_SIDE), + new GT_RenderedTexture(TexturesGtBlock.OVERLAY_REACTOR_PROCESSINGUNIT_FRONT_ACTIVE), + new GT_RenderedTexture(TexturesGtBlock.OVERLAY_REACTOR_PROCESSINGUNIT_FRONT), + new GT_RenderedTexture(TexturesGtBlock.OVERLAY_REACTOR_PROCESSINGUNIT_TOP_ACTIVE), + new GT_RenderedTexture(TexturesGtBlock.OVERLAY_REACTOR_PROCESSINGUNIT_TOP), + new GT_RenderedTexture(TexturesGtBlock.OVERLAY_REACTOR_PROCESSINGUNIT_TOP_ACTIVE), + new GT_RenderedTexture(TexturesGtBlock.OVERLAY_REACTOR_PROCESSINGUNIT_TOP) + } + ); + } + + public GregtechMetaTileEntity_ReactorProcessingUnit(String aName, int aTier, String aDescription, ITexture[][][] aTextures, String aGUIName, String aNEIName) { + super(aName, aTier, 1, aDescription, aTextures, 1, 1, aGUIName, aNEIName); + } + + @Override + public String[] getDescription() { + return new String[]{this.mDescription, CORE.GT_Tooltip}; + } + + @Override + public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { + return new GregtechMetaTileEntity_ReactorProcessingUnit(this.mName, this.mTier, this.mDescription, this.mTextures, this.mGUIName, this.mNEIName); + } + + @Override + public GT_Recipe.GT_Recipe_Map getRecipeList() { + return GTPP_Recipe.GTPP_Recipe_Map.sReactorProcessingUnitRecipes; + } + + @Override + public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) { + return (super.allowPutStack(aBaseMetaTileEntity, aIndex, aSide, aStack)) && (getRecipeList().containsInput(aStack)); + } + + @Override + public boolean isFluidInputAllowed(FluidStack aFluid) { + return super.isFluidInputAllowed(aFluid); + } + + @Override + public int getCapacity() { + return 8000 * Math.max(1, this.mTier); + } + +} diff --git a/src/Java/gtPlusPlus/xmod/gregtech/loaders/recipe/RecipeLoader_FFPP.java b/src/Java/gtPlusPlus/xmod/gregtech/loaders/recipe/RecipeLoader_FFPP.java deleted file mode 100644 index d1d800cebc..0000000000 --- a/src/Java/gtPlusPlus/xmod/gregtech/loaders/recipe/RecipeLoader_FFPP.java +++ /dev/null @@ -1,92 +0,0 @@ -package gtPlusPlus.xmod.gregtech.loaders.recipe; - -import gregtech.api.enums.Materials; -import gtPlusPlus.core.item.ModItems; -import gtPlusPlus.core.item.chemistry.NuclearChem; -import gtPlusPlus.core.lib.CORE; -import gtPlusPlus.core.material.ELEMENT; -import gtPlusPlus.core.material.nuclear.FLUORIDES; -import gtPlusPlus.core.material.nuclear.NUCLIDE; -import gtPlusPlus.core.util.minecraft.FluidUtils; -import gtPlusPlus.core.util.minecraft.MaterialUtils; -import net.minecraftforge.fluids.FluidStack; - -public class RecipeLoader_FFPP { - - public static void generate() { - - // Create Fuels - - final FluidStack aLithiumFluoride = FLUORIDES.LITHIUM_FLUORIDE.getFluid(100); - final FluidStack aBerylliumFluoride = FLUORIDES.BERYLLIUM_FLUORIDE.getFluid(100); - final FluidStack aThoriumFluoride = FLUORIDES.THORIUM_TETRAFLUORIDE.getFluid(100); - final FluidStack aZirconiumFluoride = FLUORIDES.ZIRCONIUM_TETRAFLUORIDE.getFluid(100); - final FluidStack aUraniumTetraFluoride = FLUORIDES.URANIUM_TETRAFLUORIDE.getFluid(100); - final FluidStack aUranium235 = ELEMENT.getInstance().URANIUM235.getFluid(1000); - final FluidStack aLiFBeF2ZrF4U235 = NUCLIDE.LiFBeF2ZrF4U235.getFluid(100); - final FluidStack aLiFBeF2ZrF4UF4 = NUCLIDE.LiFBeF2ZrF4UF4.getFluid(100); - final FluidStack aLiFBeF2ThF4UF4 = NUCLIDE.LiFBeF2ThF4UF4.getFluid(100); - - // 7LiF - BeF2 - ZrF4 - U235 - 590C - CORE.RA.addFissionFuel( - FluidUtils.getFluidStack(aLithiumFluoride, 550), - FluidUtils.getFluidStack(aBerylliumFluoride, 150), - FluidUtils.getFluidStack(aZirconiumFluoride, 60), - FluidUtils.getFluidStack(aUranium235, 240), - null, null, null, null, null, // Extra 5 inputs - FluidUtils.getFluidStack(aLiFBeF2ZrF4U235, 1000), - null, - 90 * 60 * 20, // Duration - MaterialUtils.getVoltageForTier(5) - ); - - // 7LiF - BeF2 - ZrF4 - UF4 - 650C - CORE.RA.addFissionFuel( - FluidUtils.getFluidStack(aLithiumFluoride, 650), - FluidUtils.getFluidStack(aBerylliumFluoride, 250), - FluidUtils.getFluidStack(aZirconiumFluoride, 80), - FluidUtils.getFluidStack(aUraniumTetraFluoride, 70), - null, null, null, null, null, // Extra 5 inputs - FluidUtils.getFluidStack(aLiFBeF2ZrF4UF4, 1000), - null, - 120 * 60 * 20, - MaterialUtils.getVoltageForTier(5) - ); - - // 7liF - BeF2 - ThF4 - UF4 - 566C - CORE.RA.addFissionFuel( - FluidUtils.getFluidStack(aLithiumFluoride, 620), - FluidUtils.getFluidStack(aBerylliumFluoride, 280), - FluidUtils.getFluidStack(aThoriumFluoride, 70), - FluidUtils.getFluidStack(aUraniumTetraFluoride, 70), - null, null, null, null, null, // Extra 5 inputs - FluidUtils.getFluidStack(aLiFBeF2ThF4UF4, 1000), - null, - 150 * 60 * 20, // Duration - MaterialUtils.getVoltageForTier(5) - ); - - - // Reprocess Fuels - - final FluidStack aBurntLiFBeF2ZrF4U235 = new FluidStack(NuclearChem.Burnt_LiFBeF2ZrF4U235, 17); - final FluidStack aBurntLiFBeF2ZrF4UF4 = new FluidStack(NuclearChem.Burnt_LiFBeF2ZrF4UF4, 17); - final FluidStack aBurntLiFBeF2ThF4UF4 = new FluidStack(NuclearChem.Burnt_LiFBeF2ThF4UF4, 17); - final FluidStack aBurntLi2BeF4 = new FluidStack(ModItems.fluidFLiBeSaltBurnt, 34); - final FluidStack aHelium = Materials.Helium.getGas(1000); - final FluidStack aFluorine = Materials.Fluorine.getGas(1000); - - CORE.RA.addFissionFuel( - FluidUtils.getFluidStack(aBurntLiFBeF2ZrF4U235, 500), - FluidUtils.getFluidStack(aBerylliumFluoride, 280), - FluidUtils.getFluidStack(aThoriumFluoride, 70), - FluidUtils.getFluidStack(aUraniumTetraFluoride, 70), - null, null, null, null, null, // Extra 5 inputs - FluidUtils.getFluidStack(aLiFBeF2ThF4UF4, 1000), - null, - 150 * 60 * 20, // Duration - MaterialUtils.getVoltageForTier(5) - ); - - } -} diff --git a/src/Java/gtPlusPlus/xmod/gregtech/loaders/recipe/RecipeLoader_Nuclear.java b/src/Java/gtPlusPlus/xmod/gregtech/loaders/recipe/RecipeLoader_Nuclear.java index 4128c228b3..1397ddc1eb 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/loaders/recipe/RecipeLoader_Nuclear.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/loaders/recipe/RecipeLoader_Nuclear.java @@ -28,7 +28,7 @@ public class RecipeLoader_Nuclear { public static void generate() { createRecipes(); RecipeLoader_LFTR.generate(); - RecipeLoader_FFPP.generate(); + RecipeLoader_NuclearFuelProcessing.generate(); } private static void createRecipes() { diff --git a/src/Java/gtPlusPlus/xmod/gregtech/loaders/recipe/RecipeLoader_NuclearFuelProcessing.java b/src/Java/gtPlusPlus/xmod/gregtech/loaders/recipe/RecipeLoader_NuclearFuelProcessing.java new file mode 100644 index 0000000000..764d7cffdd --- /dev/null +++ b/src/Java/gtPlusPlus/xmod/gregtech/loaders/recipe/RecipeLoader_NuclearFuelProcessing.java @@ -0,0 +1,92 @@ +package gtPlusPlus.xmod.gregtech.loaders.recipe; + +import gregtech.api.enums.Materials; +import gtPlusPlus.core.item.ModItems; +import gtPlusPlus.core.item.chemistry.NuclearChem; +import gtPlusPlus.core.lib.CORE; +import gtPlusPlus.core.material.ELEMENT; +import gtPlusPlus.core.material.nuclear.FLUORIDES; +import gtPlusPlus.core.material.nuclear.NUCLIDE; +import gtPlusPlus.core.util.minecraft.FluidUtils; +import gtPlusPlus.core.util.minecraft.MaterialUtils; +import net.minecraftforge.fluids.FluidStack; + +public class RecipeLoader_NuclearFuelProcessing { + + public static void generate() { + + // Create Fuels + + final FluidStack aLithiumFluoride = FLUORIDES.LITHIUM_FLUORIDE.getFluid(100); + final FluidStack aBerylliumFluoride = FLUORIDES.BERYLLIUM_FLUORIDE.getFluid(100); + final FluidStack aThoriumFluoride = FLUORIDES.THORIUM_TETRAFLUORIDE.getFluid(100); + final FluidStack aZirconiumFluoride = FLUORIDES.ZIRCONIUM_TETRAFLUORIDE.getFluid(100); + final FluidStack aUraniumTetraFluoride = FLUORIDES.URANIUM_TETRAFLUORIDE.getFluid(100); + final FluidStack aUranium235 = ELEMENT.getInstance().URANIUM235.getFluid(1000); + final FluidStack aLiFBeF2ZrF4U235 = NUCLIDE.LiFBeF2ZrF4U235.getFluid(100); + final FluidStack aLiFBeF2ZrF4UF4 = NUCLIDE.LiFBeF2ZrF4UF4.getFluid(100); + final FluidStack aLiFBeF2ThF4UF4 = NUCLIDE.LiFBeF2ThF4UF4.getFluid(100); + + // 7LiF - BeF2 - ZrF4 - U235 - 590C + CORE.RA.addFissionFuel( + FluidUtils.getFluidStack(aLithiumFluoride, 550), + FluidUtils.getFluidStack(aBerylliumFluoride, 150), + FluidUtils.getFluidStack(aZirconiumFluoride, 60), + FluidUtils.getFluidStack(aUranium235, 240), + null, null, null, null, null, // Extra 5 inputs + FluidUtils.getFluidStack(aLiFBeF2ZrF4U235, 1000), + null, + 90 * 60 * 20, // Duration + MaterialUtils.getVoltageForTier(5) + ); + + // 7LiF - BeF2 - ZrF4 - UF4 - 650C + CORE.RA.addFissionFuel( + FluidUtils.getFluidStack(aLithiumFluoride, 650), + FluidUtils.getFluidStack(aBerylliumFluoride, 250), + FluidUtils.getFluidStack(aZirconiumFluoride, 80), + FluidUtils.getFluidStack(aUraniumTetraFluoride, 70), + null, null, null, null, null, // Extra 5 inputs + FluidUtils.getFluidStack(aLiFBeF2ZrF4UF4, 1000), + null, + 120 * 60 * 20, + MaterialUtils.getVoltageForTier(5) + ); + + // 7liF - BeF2 - ThF4 - UF4 - 566C + CORE.RA.addFissionFuel( + FluidUtils.getFluidStack(aLithiumFluoride, 620), + FluidUtils.getFluidStack(aBerylliumFluoride, 280), + FluidUtils.getFluidStack(aThoriumFluoride, 70), + FluidUtils.getFluidStack(aUraniumTetraFluoride, 70), + null, null, null, null, null, // Extra 5 inputs + FluidUtils.getFluidStack(aLiFBeF2ThF4UF4, 1000), + null, + 150 * 60 * 20, // Duration + MaterialUtils.getVoltageForTier(5) + ); + + + // Reprocess Fuels + + final FluidStack aBurntLiFBeF2ZrF4U235 = new FluidStack(NuclearChem.Burnt_LiFBeF2ZrF4U235, 17); + final FluidStack aBurntLiFBeF2ZrF4UF4 = new FluidStack(NuclearChem.Burnt_LiFBeF2ZrF4UF4, 17); + final FluidStack aBurntLiFBeF2ThF4UF4 = new FluidStack(NuclearChem.Burnt_LiFBeF2ThF4UF4, 17); + final FluidStack aBurntLi2BeF4 = new FluidStack(ModItems.fluidFLiBeSaltBurnt, 34); + final FluidStack aHelium = Materials.Helium.getGas(1000); + final FluidStack aFluorine = Materials.Fluorine.getGas(1000); + + CORE.RA.addFissionFuel( + FluidUtils.getFluidStack(aBurntLiFBeF2ZrF4U235, 500), + FluidUtils.getFluidStack(aBerylliumFluoride, 280), + FluidUtils.getFluidStack(aThoriumFluoride, 70), + FluidUtils.getFluidStack(aUraniumTetraFluoride, 70), + null, null, null, null, null, // Extra 5 inputs + FluidUtils.getFluidStack(aLiFBeF2ThF4UF4, 1000), + null, + 150 * 60 * 20, // Duration + MaterialUtils.getVoltageForTier(5) + ); + + } +} diff --git a/src/Java/gtPlusPlus/xmod/gregtech/recipes/GregtechRecipeAdder.java b/src/Java/gtPlusPlus/xmod/gregtech/recipes/GregtechRecipeAdder.java index afb0303470..2b5b2b3097 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/recipes/GregtechRecipeAdder.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/recipes/GregtechRecipeAdder.java @@ -12,6 +12,7 @@ import gregtech.api.enums.GT_Values; import gregtech.api.enums.Materials; import gregtech.api.interfaces.internal.IGT_RecipeAdder; import gregtech.api.util.*; +import gregtech.api.util.GTPP_Recipe.GTPP_Recipe_Map; import gregtech.api.util.GT_Recipe.GT_Recipe_Map; import gtPlusPlus.api.objects.Logger; import gtPlusPlus.api.objects.data.AutoMap; @@ -1755,6 +1756,46 @@ public class GregtechRecipeAdder implements IGregtech_RecipeAdder { } + @Override + public boolean addColdTrapRecipe(int aCircuit, ItemStack aInput, FluidStack aFluidInput, ItemStack[] aOutputs, FluidStack aFluidOutput, int aTime, int aEU) { + GTPP_Recipe aRecipe = new GTPP_Recipe( + false, + new ItemStack[] {CI.getNumberedAdvancedCircuit(aCircuit), aInput}, + aOutputs, + null, + new int[] {}, + new FluidStack[] {aFluidInput}, + new FluidStack[] {aFluidOutput}, + aTime, + aEU, + 0); + + int aSize = GTPP_Recipe_Map.sColdTrapRecipes.mRecipeList.size(); + GTPP_Recipe_Map.sColdTrapRecipes.add(aRecipe); + return GTPP_Recipe_Map.sColdTrapRecipes.mRecipeList.size() > aSize; + } + + + @Override + public boolean addReactorProcessingUnitRecipe(ItemStack aInput1, ItemStack aInput2, FluidStack aFluidInput, ItemStack[] aOutputs, int[] aChances, FluidStack aFluidOutput, int aTime, int aEU) { + GTPP_Recipe aRecipe = new GTPP_Recipe( + false, + new ItemStack[] {aInput1, aInput2}, + aOutputs, + null, + aChances, + new FluidStack[] {aFluidInput}, + new FluidStack[] {aFluidOutput}, + aTime, + aEU, + 0); + + int aSize = GTPP_Recipe_Map.sReactorProcessingUnitRecipes.mRecipeList.size(); + GTPP_Recipe_Map.sReactorProcessingUnitRecipes.add(aRecipe); + return GTPP_Recipe_Map.sReactorProcessingUnitRecipes.mRecipeList.size() > aSize; + } + + diff --git a/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechLFTR.java b/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechLFTR.java index a9eee53a7c..c2d4422326 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechLFTR.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechLFTR.java @@ -3,6 +3,8 @@ package gtPlusPlus.xmod.gregtech.registration.gregtech; import gtPlusPlus.api.objects.Logger; import gtPlusPlus.core.lib.CORE; import gtPlusPlus.xmod.gregtech.api.enums.GregtechItemList; +import gtPlusPlus.xmod.gregtech.common.tileentities.machines.basic.GregtechMetaTileEntity_ReactorColdTrap; +import gtPlusPlus.xmod.gregtech.common.tileentities.machines.basic.GregtechMetaTileEntity_ReactorProcessingUnit; import gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.production.GregtechMTE_NuclearReactor; public class GregtechLFTR { @@ -19,9 +21,13 @@ public class GregtechLFTR { private static void run1() { // LFTR - GregtechItemList.ThoriumReactor - .set(new GregtechMTE_NuclearReactor(751, "lftr.controller.single", "Thorium Reactor [LFTR]") - .getStackForm(1L)); + GregtechItemList.ThoriumReactor.set(new GregtechMTE_NuclearReactor(751, "lftr.controller.single", "Thorium Reactor [LFTR]").getStackForm(1L)); + // Reactor Processing Units + GregtechItemList.ReactorProcessingUnit_IV.set(new GregtechMetaTileEntity_ReactorProcessingUnit(31031, "rpu.tier.01", "Reactor Processing Unit I", 5).getStackForm(1L)); + GregtechItemList.ReactorProcessingUnit_ZPM.set(new GregtechMetaTileEntity_ReactorProcessingUnit(31032, "rpu.tier.02", "Reactor Processing Unit II", 7).getStackForm(1L)); + // Cold Traps + GregtechItemList.ColdTrap_IV.set(new GregtechMetaTileEntity_ReactorColdTrap(31033, "coldtrap.tier.01", "Cold Trap I", 5).getStackForm(1L)); + GregtechItemList.ColdTrap_ZPM.set(new GregtechMetaTileEntity_ReactorColdTrap(31034, "coldtrap.tier.02", "Cold Trap II", 7).getStackForm(1L)); } } diff --git a/src/resources/assets/miscutils/textures/blocks/TileEntities/ReactorColdTrap/OVERLAY_FRONT.png b/src/resources/assets/miscutils/textures/blocks/TileEntities/ReactorColdTrap/OVERLAY_FRONT.png new file mode 100644 index 0000000000..012c63a088 Binary files /dev/null and b/src/resources/assets/miscutils/textures/blocks/TileEntities/ReactorColdTrap/OVERLAY_FRONT.png differ diff --git a/src/resources/assets/miscutils/textures/blocks/TileEntities/ReactorColdTrap/OVERLAY_FRONT_ACTIVE.png b/src/resources/assets/miscutils/textures/blocks/TileEntities/ReactorColdTrap/OVERLAY_FRONT_ACTIVE.png new file mode 100644 index 0000000000..30856a6284 Binary files /dev/null and b/src/resources/assets/miscutils/textures/blocks/TileEntities/ReactorColdTrap/OVERLAY_FRONT_ACTIVE.png differ diff --git a/src/resources/assets/miscutils/textures/blocks/TileEntities/ReactorColdTrap/OVERLAY_SIDE.png b/src/resources/assets/miscutils/textures/blocks/TileEntities/ReactorColdTrap/OVERLAY_SIDE.png new file mode 100644 index 0000000000..d577f0cbb3 Binary files /dev/null and b/src/resources/assets/miscutils/textures/blocks/TileEntities/ReactorColdTrap/OVERLAY_SIDE.png differ diff --git a/src/resources/assets/miscutils/textures/blocks/TileEntities/ReactorColdTrap/OVERLAY_SIDE_ACTIVE.png b/src/resources/assets/miscutils/textures/blocks/TileEntities/ReactorColdTrap/OVERLAY_SIDE_ACTIVE.png new file mode 100644 index 0000000000..e41790f90f Binary files /dev/null and b/src/resources/assets/miscutils/textures/blocks/TileEntities/ReactorColdTrap/OVERLAY_SIDE_ACTIVE.png differ diff --git a/src/resources/assets/miscutils/textures/blocks/TileEntities/ReactorColdTrap/OVERLAY_SIDE_ACTIVE.png.mcmeta b/src/resources/assets/miscutils/textures/blocks/TileEntities/ReactorColdTrap/OVERLAY_SIDE_ACTIVE.png.mcmeta new file mode 100644 index 0000000000..f4cce85820 --- /dev/null +++ b/src/resources/assets/miscutils/textures/blocks/TileEntities/ReactorColdTrap/OVERLAY_SIDE_ACTIVE.png.mcmeta @@ -0,0 +1,6 @@ +{ + "animation":{ + "frametime":5, + "frames": [0, 1, 2, 3, 2, 1] + } +} \ No newline at end of file diff --git a/src/resources/assets/miscutils/textures/blocks/TileEntities/ReactorColdTrap/OVERLAY_TOP.png b/src/resources/assets/miscutils/textures/blocks/TileEntities/ReactorColdTrap/OVERLAY_TOP.png new file mode 100644 index 0000000000..e9b20bd486 Binary files /dev/null and b/src/resources/assets/miscutils/textures/blocks/TileEntities/ReactorColdTrap/OVERLAY_TOP.png differ diff --git a/src/resources/assets/miscutils/textures/blocks/TileEntities/ReactorColdTrap/OVERLAY_TOP_ACTIVE.png b/src/resources/assets/miscutils/textures/blocks/TileEntities/ReactorColdTrap/OVERLAY_TOP_ACTIVE.png new file mode 100644 index 0000000000..4469a809e9 Binary files /dev/null and b/src/resources/assets/miscutils/textures/blocks/TileEntities/ReactorColdTrap/OVERLAY_TOP_ACTIVE.png differ diff --git a/src/resources/assets/miscutils/textures/blocks/TileEntities/ReactorProcessingUnit/OVERLAY_FRONT.png b/src/resources/assets/miscutils/textures/blocks/TileEntities/ReactorProcessingUnit/OVERLAY_FRONT.png new file mode 100644 index 0000000000..b7a77be826 Binary files /dev/null and b/src/resources/assets/miscutils/textures/blocks/TileEntities/ReactorProcessingUnit/OVERLAY_FRONT.png differ diff --git a/src/resources/assets/miscutils/textures/blocks/TileEntities/ReactorProcessingUnit/OVERLAY_FRONT_ACTIVE.png b/src/resources/assets/miscutils/textures/blocks/TileEntities/ReactorProcessingUnit/OVERLAY_FRONT_ACTIVE.png new file mode 100644 index 0000000000..8a47157d2b Binary files /dev/null and b/src/resources/assets/miscutils/textures/blocks/TileEntities/ReactorProcessingUnit/OVERLAY_FRONT_ACTIVE.png differ diff --git a/src/resources/assets/miscutils/textures/blocks/TileEntities/ReactorProcessingUnit/OVERLAY_FRONT_ACTIVE.png.mcmeta b/src/resources/assets/miscutils/textures/blocks/TileEntities/ReactorProcessingUnit/OVERLAY_FRONT_ACTIVE.png.mcmeta new file mode 100644 index 0000000000..1367b80758 --- /dev/null +++ b/src/resources/assets/miscutils/textures/blocks/TileEntities/ReactorProcessingUnit/OVERLAY_FRONT_ACTIVE.png.mcmeta @@ -0,0 +1,6 @@ +{ + "animation":{ + "frametime":2, + "frames": [0, 0, 1, 1, 2, 2, 3, 3, 3, 2, 2, 1, 1, 0] + } +} \ No newline at end of file diff --git a/src/resources/assets/miscutils/textures/blocks/TileEntities/ReactorProcessingUnit/OVERLAY_SIDE.png b/src/resources/assets/miscutils/textures/blocks/TileEntities/ReactorProcessingUnit/OVERLAY_SIDE.png new file mode 100644 index 0000000000..671bbd7d97 Binary files /dev/null and b/src/resources/assets/miscutils/textures/blocks/TileEntities/ReactorProcessingUnit/OVERLAY_SIDE.png differ diff --git a/src/resources/assets/miscutils/textures/blocks/TileEntities/ReactorProcessingUnit/OVERLAY_SIDE_ACTIVE.png b/src/resources/assets/miscutils/textures/blocks/TileEntities/ReactorProcessingUnit/OVERLAY_SIDE_ACTIVE.png new file mode 100644 index 0000000000..ae63da7746 Binary files /dev/null and b/src/resources/assets/miscutils/textures/blocks/TileEntities/ReactorProcessingUnit/OVERLAY_SIDE_ACTIVE.png differ diff --git a/src/resources/assets/miscutils/textures/blocks/TileEntities/ReactorProcessingUnit/OVERLAY_SIDE_ACTIVE.png.mcmeta b/src/resources/assets/miscutils/textures/blocks/TileEntities/ReactorProcessingUnit/OVERLAY_SIDE_ACTIVE.png.mcmeta new file mode 100644 index 0000000000..8447c98f9a --- /dev/null +++ b/src/resources/assets/miscutils/textures/blocks/TileEntities/ReactorProcessingUnit/OVERLAY_SIDE_ACTIVE.png.mcmeta @@ -0,0 +1,6 @@ +{ + "animation":{ + "frametime":2, + "frames": [0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 7, 7, 6, 6, 5, 5, 4, 4, 3, 3, 2, 2, 1, 1, 0, 0] + } +} \ No newline at end of file diff --git a/src/resources/assets/miscutils/textures/blocks/TileEntities/ReactorProcessingUnit/OVERLAY_TOP.png b/src/resources/assets/miscutils/textures/blocks/TileEntities/ReactorProcessingUnit/OVERLAY_TOP.png new file mode 100644 index 0000000000..a9ab34e963 Binary files /dev/null and b/src/resources/assets/miscutils/textures/blocks/TileEntities/ReactorProcessingUnit/OVERLAY_TOP.png differ diff --git a/src/resources/assets/miscutils/textures/blocks/TileEntities/ReactorProcessingUnit/OVERLAY_TOP_ACTIVE.png b/src/resources/assets/miscutils/textures/blocks/TileEntities/ReactorProcessingUnit/OVERLAY_TOP_ACTIVE.png new file mode 100644 index 0000000000..8a5c131623 Binary files /dev/null and b/src/resources/assets/miscutils/textures/blocks/TileEntities/ReactorProcessingUnit/OVERLAY_TOP_ACTIVE.png differ -- cgit From 0941607a38160b0bced1652b91f38cd55480261d Mon Sep 17 00:00:00 2001 From: Alkalus <3060479+draknyte1@users.noreply.github.com> Date: Mon, 6 Dec 2021 17:24:25 +0000 Subject: Greatly improved NEI handling. Fixed broken Manure Slurry recipes. --- src/Java/gregtech/api/util/GTPP_Recipe.java | 8 +- src/Java/gtPlusPlus/api/objects/Logger.java | 2 +- src/Java/gtPlusPlus/core/item/ModItems.java | 16 +- .../core/item/chemistry/AgriculturalChem.java | 4 +- src/Java/gtPlusPlus/core/material/Material.java | 14 +- .../gtPlusPlus/core/material/nuclear/NUCLIDE.java | 129 +++++ .../core/slots/SlotChemicalPlantInput.java | 4 +- src/Java/gtPlusPlus/core/util/math/MathUtils.java | 16 + .../gtPlusPlus/core/util/minecraft/ItemUtils.java | 7 +- .../gtPlusPlus/nei/GTPP_NEI_DefaultHandler.java | 548 +++++++++++---------- src/Java/gtPlusPlus/nei/GT_NEI_FlotationCell.java | 452 ++--------------- src/Java/gtPlusPlus/nei/GT_NEI_FluidReactor.java | 422 +++------------- src/Java/gtPlusPlus/nei/GT_NEI_LFTR.java | 461 +++-------------- src/Java/gtPlusPlus/nei/GT_NEI_MillingMachine.java | 422 ++-------------- src/Java/gtPlusPlus/nei/GT_NEI_RFPP.java | 523 +++----------------- src/Java/gtPlusPlus/nei/GT_NEI_VacFurnace.java | 471 ++---------------- .../nei/GT_NEI_multiCentriElectroFreezer.java | 456 +---------------- src/Java/gtPlusPlus/nei/NEI_GT_Config.java | 3 +- .../preloader/asm/Preloader_FMLLoadingPlugin.java | 8 + .../interfaces/internal/IGregtech_RecipeAdder.java | 2 +- .../GregtechMetaTileEntity_ReactorColdTrap.java | 2 +- ...egtechMetaTileEntity_ReactorProcessingUnit.java | 2 +- .../chemplant/GregtechMTE_ChemicalPlant.java | 25 +- .../loaders/recipe/RecipeLoader_Nuclear.java | 4 +- .../recipe/RecipeLoader_NuclearFuelProcessing.java | 67 +++ .../xmod/gregtech/recipes/GregtechRecipeAdder.java | 4 +- 26 files changed, 921 insertions(+), 3151 deletions(-) (limited to 'src/Java/gtPlusPlus/core/item') diff --git a/src/Java/gregtech/api/util/GTPP_Recipe.java b/src/Java/gregtech/api/util/GTPP_Recipe.java index f98c35363f..51212c21bc 100644 --- a/src/Java/gregtech/api/util/GTPP_Recipe.java +++ b/src/Java/gregtech/api/util/GTPP_Recipe.java @@ -350,18 +350,18 @@ public class GTPP_Recipe extends GT_Recipe implements IComparableRecipe { public static final GTPP_Recipe_Map_Internal sFissionFuelProcessing = new GTPP_Recipe_Map_Internal(new HashSet(50), "gtpp.recipe.fissionfuel", "Nuclear Fuel Processing", null, RES_PATH_GUI + "basicmachines/FissionFuel", 0, 0, 0, 0, 1, E, 1, E, true, false); //Cold Trap - public static final GTPP_Recipe_Map_Internal sColdTrapRecipes = new GTPP_Recipe_Map_Internal(new HashSet(3), "gtpp.recipe.coldtrap", "Cold Trap", null, RES_PATH_GUI + "basicmachines/ChemicalReactor", 1, 1, 0, 0, 1, E, 1, E, true, true); + public static final GTPP_Recipe_Map_Internal sColdTrapRecipes = new GTPP_Recipe_Map_Internal(new HashSet(10000), "gtpp.recipe.coldtrap", "Cold Trap", null, RES_PATH_GUI + "basicmachines/Dehydrator", 2, 9, 0, 0, 1, E, 1, E, true, true); //Reactor Processing Unit - public static final GTPP_Recipe_Map_Internal sReactorProcessingUnitRecipes = new GTPP_Recipe_Map_Internal(new HashSet(3), "gtpp.recipe.reactorprocessingunit", "Reactor Processing Unit", null, RES_PATH_GUI + "basicmachines/ChemicalReactor", 1, 1, 0, 0, 1, E, 1, E, true, true); + public static final GTPP_Recipe_Map_Internal sReactorProcessingUnitRecipes = new GTPP_Recipe_Map_Internal(new HashSet(10000), "gtpp.recipe.reactorprocessingunit", "Reactor Processing Unit", null, RES_PATH_GUI + "basicmachines/Dehydrator", 2, 9, 0, 0, 1, E, 1, E, true, true); //Basic Washer Map public static final GTPP_Recipe_Map_Internal sSimpleWasherRecipes = new GTPP_Recipe_Map_Internal(new HashSet(3), "gtpp.recipe.simplewasher", "Simple Dust Washer", null, RES_PATH_GUI + "basicmachines/PotionBrewer", 1, 1, 0, 0, 1, E, 1, E, true, true); //public static final GT_Recipe_Map sSimpleWasherRecipes_FakeFuckBW = new GT_Recipe_Map(new HashSet(3), "gtpp.recipe.simplewasher", "Fuck you Bart", null, RES_PATH_GUI + "basicmachines/PotionBrewer", 1, 1, 0, 0, 1, E, 1, E, true, false); - public static final GTPP_Recipe_Map sChemicalPlantRecipes = new GTPP_Recipe_Map( - new HashSet(100), + public static final GTPP_Recipe_Map_Internal sChemicalPlantRecipes = new GTPP_Recipe_Map_Internal( + new HashSet(100), "gtpp.recipe.fluidchemicaleactor", "Chemical Plant", null, diff --git a/src/Java/gtPlusPlus/api/objects/Logger.java b/src/Java/gtPlusPlus/api/objects/Logger.java index ecc28d4a59..1a1da6868b 100644 --- a/src/Java/gtPlusPlus/api/objects/Logger.java +++ b/src/Java/gtPlusPlus/api/objects/Logger.java @@ -121,7 +121,7 @@ public class Logger { */ public static void MATERIALS(final String s) { if (enabled) { - if (/* CORE_Preloader.DEV_ENVIRONMENT || */CORE_Preloader.DEBUG_MODE) { + if (CORE_Preloader.DEV_ENVIRONMENT || CORE_Preloader.DEBUG_MODE) { modLogger.info("[Materials] "+s); } } diff --git a/src/Java/gtPlusPlus/core/item/ModItems.java b/src/Java/gtPlusPlus/core/item/ModItems.java index 4957a2b571..e66206a6bc 100644 --- a/src/Java/gtPlusPlus/core/item/ModItems.java +++ b/src/Java/gtPlusPlus/core/item/ModItems.java @@ -241,6 +241,7 @@ public final class ModItems { public static Fluid fluidLftrBlanket1; public static Fluid fluidLftrBlanket2; public static Fluid fluidLftrBlanket3; + public static Fluid fluidNuclearWaste; //Possibly missing base items that GT may be missing. @@ -728,14 +729,15 @@ public final class ModItems { fluidFLiBeSaltBurnt = FluidUtils.addGTFluidNoPrefix("Li2BeF2UF4", "Li2BeF2UF4", new short[]{50, 255, 50, 100}, 0, 743, null, CI.emptyCells(1), 1000, true); // LFTR Core Fluid Processing - fluidLftrCore1 = FluidUtils.addGTFluidNoPrefix("LiBeF2UF4FP", "LiBeF2UF4FP", new short[]{110, 255, 110, 100}, 0, 800, null, CI.emptyCells(1), 1000, true); - fluidLftrCore2 = FluidUtils.addGTFluidNoPrefix("UF6F2FP", "UF6F2FP", new short[]{150, 255, 150, 100}, 0, 800, null, CI.emptyCells(1), 1000, true); - fluidLftrCore3 = FluidUtils.addGTFluidNoPrefix("LiFBeF2", "LiFBeF2", new short[]{100, 255, 50, 100}, 0, 800, null, CI.emptyCells(1), 1000, true); - fluidLftrCore4 = FluidUtils.addGTFluidNoPrefix("LiFBeF2UF4", "LiFBeF2UF4", new short[]{50, 255, 100, 100}, 0, 800, null, CI.emptyCells(1), 1000, true); + //fluidLftrCore1 = FluidUtils.addGTFluidNoPrefix("LiBeF2UF4FP", "LiBeF2UF4FP", new short[]{110, 255, 110, 100}, 0, 800, null, CI.emptyCells(1), 1000, true); + //fluidLftrCore2 = FluidUtils.addGTFluidNoPrefix("UF6F2FP", "UF6F2FP", new short[]{150, 255, 150, 100}, 0, 800, null, CI.emptyCells(1), 1000, true); + //fluidLftrCore3 = FluidUtils.addGTFluidNoPrefix("LiFBeF2", "LiFBeF2", new short[]{100, 255, 50, 100}, 0, 800, null, CI.emptyCells(1), 1000, true); + //fluidLftrCore4 = FluidUtils.addGTFluidNoPrefix("LiFBeF2UF4", "LiFBeF2UF4", new short[]{50, 255, 100, 100}, 0, 800, null, CI.emptyCells(1), 1000, true); // LFTR Blanket Fluid Processing - fluidLftrBlanket1 = FluidUtils.addGTFluidNoPrefix("LiFThF4", "LiFThF4", new short[]{50, 150, 255, 50}, 0, 500, null, CI.emptyCells(1), 1000, true); - fluidLftrBlanket2 = FluidUtils.addGTFluidNoPrefix("LiFBeF2ThF4", "LiFBeF2ThF4", new short[]{100, 150, 100, 100}, 0, 500, null, CI.emptyCells(1), 1000, true); - fluidLftrBlanket3 = FluidUtils.addGTFluidNoPrefix("UF6F2", "UF6F2", new short[]{10, 150, 10, 100}, 0, 500, null, CI.emptyCells(1), 1000, true); + //fluidLftrBlanket1 = FluidUtils.addGTFluidNoPrefix("LiFThF4", "LiFThF4", new short[]{50, 150, 255, 50}, 0, 500, null, CI.emptyCells(1), 1000, true); + //fluidLftrBlanket2 = FluidUtils.addGTFluidNoPrefix("LiFBeF2ThF4", "LiFBeF2ThF4", new short[]{100, 150, 100, 100}, 0, 500, null, CI.emptyCells(1), 1000, true); + //fluidLftrBlanket3 = FluidUtils.addGTFluidNoPrefix("UF6F2", "UF6F2", new short[]{10, 150, 10, 100}, 0, 500, null, CI.emptyCells(1), 1000, true); + fluidNuclearWaste = FluidUtils.addGTFluidNoPrefix("nuclear.waste", "Nuclear Waste", new short[]{10, 250, 10, 100}, 0, 1000, null, CI.emptyCells(1), 1000, true); //LFTR Control Circuit diff --git a/src/Java/gtPlusPlus/core/item/chemistry/AgriculturalChem.java b/src/Java/gtPlusPlus/core/item/chemistry/AgriculturalChem.java index e11b163753..8e7a760195 100644 --- a/src/Java/gtPlusPlus/core/item/chemistry/AgriculturalChem.java +++ b/src/Java/gtPlusPlus/core/item/chemistry/AgriculturalChem.java @@ -296,7 +296,7 @@ public class AgriculturalChem extends ItemPackage { } if (aTiCon) { - aBlood = FluidUtils.getFluidStack("hell_blood", 100); + aBlood = FluidUtils.getFluidStack("blood", 100); if (aBlood != null) { Logger.INFO("Found Tinker's Construct, enabled Blood support."); CustomBlood = aBlood.getFluid(); @@ -435,7 +435,7 @@ public class AgriculturalChem extends ItemPackage { ItemStack aBone; ItemStack aMeat; ItemStack aEmptyCells = CI.emptyCells(2); - ItemStack aInputCells = ItemUtils.getItemStackOfAmountFromOreDict("cellRawWaste", 2); + ItemStack aInputCells = ItemUtils.getItemStackOfAmountFromOreDict("cellRawAnimalWaste", 2); FluidStack aOutput = FluidUtils.getFluidStack(FertileManureSlurry, 1000); for (FluidStack aBloodStack : mBloodFluids) { diff --git a/src/Java/gtPlusPlus/core/material/Material.java b/src/Java/gtPlusPlus/core/material/Material.java index 81c16efa2c..b8e006b021 100644 --- a/src/Java/gtPlusPlus/core/material/Material.java +++ b/src/Java/gtPlusPlus/core/material/Material.java @@ -744,12 +744,24 @@ public class Material { Materials Erf = MaterialUtils.getMaterial(this.unlocalizedName); if (Erf != null && Erf != Materials._NULL) { ItemStack Erg = ItemUtils.getOrePrefixStack(aPrefix, Erf, stacksize); - if (Erg != null) { + if (Erg != null && ItemUtils.checkForInvalidItems(Erg)) { Logger.MATERIALS("Found \"" + aKey + this.unlocalizedName + "\" using backup GT Materials option."); g.put(aKey, Erg); mComponentMap.put(unlocalizedName, g); return Erg; } + else { + // Try get a molten cell + if (aPrefix == OrePrefixes.cell) { + Erg = ItemUtils.getOrePrefixStack(OrePrefixes.cellMolten, Erf, stacksize); + if (Erg != null && ItemUtils.checkForInvalidItems(Erg)) { + Logger.MATERIALS("Found \"" + OrePrefixes.cellMolten.name() + this.unlocalizedName + "\" using backup GT Materials option."); + g.put(aKey, Erg); + mComponentMap.put(unlocalizedName, g); + return Erg; + } + } + } } else { ItemStack u = ItemUtils.getItemStackOfAmountFromOreDictNoBroken(aKey + this.unlocalizedName, stacksize); if (u != null) { diff --git a/src/Java/gtPlusPlus/core/material/nuclear/NUCLIDE.java b/src/Java/gtPlusPlus/core/material/nuclear/NUCLIDE.java index 73751ac49d..9e59758f73 100644 --- a/src/Java/gtPlusPlus/core/material/nuclear/NUCLIDE.java +++ b/src/Java/gtPlusPlus/core/material/nuclear/NUCLIDE.java @@ -69,6 +69,135 @@ public final class NUCLIDE { new MaterialStack(FLUORIDES.ZIRCONIUM_TETRAFLUORIDE, 6), new MaterialStack(ELEMENT.getInstance().URANIUM235, 14) }); + + + // LFTR Core Fluids + public static final Material LiBeF2UF4FP = new Material( + "LiBeF2UF4FP", //Material Name + MaterialState.PURE_LIQUID, //State + null, //Material Colour + -1, //Melting Point in C + -1, //Boiling Point in C + -1, //Protons + -1, //Neutrons + false, //Uses Blast furnace? + //Material Stacks with Percentage of required elements. + new MaterialStack[]{ + new MaterialStack(ELEMENT.getInstance().LITHIUM, 1), + new MaterialStack(FLUORIDES.BERYLLIUM_FLUORIDE, 1), + new MaterialStack(FLUORIDES.URANIUM_TETRAFLUORIDE, 1), + new MaterialStack(ELEMENT.getInstance().PROTACTINIUM, 1) + }); + + public static final Material UF6F2FP = new Material( + "UF6F2FP", //Material Name + MaterialState.PURE_LIQUID, //State + null, //Material Colour + -1, //Melting Point in C + -1, //Boiling Point in C + -1, //Protons + -1, //Neutrons + false, //Uses Blast furnace? + //Material Stacks with Percentage of required elements. + new MaterialStack[]{ + new MaterialStack(FLUORIDES.URANIUM_HEXAFLUORIDE, 1), + new MaterialStack(ELEMENT.getInstance().FLUORINE, 3), + new MaterialStack(ELEMENT.getInstance().PROTACTINIUM, 1) + }); + + public static final Material LiFBeF2 = new Material( + "LiFBeF2", //Material Name + MaterialState.PURE_LIQUID, //State + null, //Material Colour + -1, //Melting Point in C + -1, //Boiling Point in C + -1, //Protons + -1, //Neutrons + false, //Uses Blast furnace? + //Material Stacks with Percentage of required elements. + new MaterialStack[]{ + new MaterialStack(FLUORIDES.LITHIUM_FLUORIDE, 1), + new MaterialStack(FLUORIDES.BERYLLIUM_FLUORIDE, 1) + }); + + public static final Material LiFBeF2UF4 = new Material( + "LiFBeF2UF4", //Material Name + MaterialState.PURE_LIQUID, //State + null, //Material Colour + -1, //Melting Point in C + -1, //Boiling Point in C + -1, //Protons + -1, //Neutrons + false, //Uses Blast furnace? + //Material Stacks with Percentage of required elements. + new MaterialStack[]{ + new MaterialStack(LiFBeF2, 1), + new MaterialStack(FLUORIDES.URANIUM_TETRAFLUORIDE, 1) + }); + + + + + + + // LFTR Blanket Fluids + + public static final Material LiFThF4 = new Material( + "LiFThF4", //Material Name + MaterialState.PURE_LIQUID, //State + null, //Material Colour + -1, //Melting Point in C + -1, //Boiling Point in C + -1, //Protons + -1, //Neutrons + false, //Uses Blast furnace? + //Material Stacks with Percentage of required elements. + new MaterialStack[]{ + new MaterialStack(FLUORIDES.LITHIUM_FLUORIDE, 1), + new MaterialStack(FLUORIDES.THORIUM_TETRAFLUORIDE, 1) + }); + + public static final Material LiFBeF2ThF4 = new Material( + "LiFBeF2ThF4", //Material Name + MaterialState.PURE_LIQUID, //State + null, //Material Colour + -1, //Melting Point in C + -1, //Boiling Point in C + -1, //Protons + -1, //Neutrons + false, //Uses Blast furnace? + //Material Stacks with Percentage of required elements. + new MaterialStack[]{ + new MaterialStack(FLUORIDES.LITHIUM_FLUORIDE, 1), + new MaterialStack(FLUORIDES.BERYLLIUM_FLUORIDE, 1), + new MaterialStack(FLUORIDES.THORIUM_TETRAFLUORIDE, 1) + }); + + public static final Material UF6F2 = new Material( + "UF6F2", //Material Name + MaterialState.PURE_LIQUID, //State + null, //Material Colour + -1, //Melting Point in C + -1, //Boiling Point in C + -1, //Protons + -1, //Neutrons + false, //Uses Blast furnace? + //Material Stacks with Percentage of required elements. + new MaterialStack[]{ + new MaterialStack(FLUORIDES.URANIUM_HEXAFLUORIDE, 1), + new MaterialStack(ELEMENT.getInstance().FLUORINE, 2) + }); + + + + + + + + + + + // Secondary material is molten metal public static final Material NAQ_FUEL_T1 = new Material( diff --git a/src/Java/gtPlusPlus/core/slots/SlotChemicalPlantInput.java b/src/Java/gtPlusPlus/core/slots/SlotChemicalPlantInput.java index 4b9cda0b9b..1029d37a78 100644 --- a/src/Java/gtPlusPlus/core/slots/SlotChemicalPlantInput.java +++ b/src/Java/gtPlusPlus/core/slots/SlotChemicalPlantInput.java @@ -1,7 +1,7 @@ package gtPlusPlus.core.slots; -import gregtech.api.util.GTPP_Recipe; import gregtech.api.util.GTPP_Recipe.GTPP_Recipe_Map; +import gregtech.api.util.GT_Recipe; import net.minecraft.inventory.IInventory; import net.minecraft.inventory.Slot; import net.minecraft.item.ItemStack; @@ -22,7 +22,7 @@ public class SlotChemicalPlantInput extends Slot { public static boolean isItemValidForChemicalPlantSlot(ItemStack aStack) { boolean validItem = GTPP_Recipe_Map.sChemicalPlantRecipes.containsInput(aStack); if (!validItem) { - for (GTPP_Recipe f : GTPP_Recipe_Map.sChemicalPlantRecipes.mRecipeList) { + for (GT_Recipe f : GTPP_Recipe_Map.sChemicalPlantRecipes.mRecipeList) { if (f.mFluidInputs.length > 0) { for (FluidStack g : f.mFluidInputs) { if (g != null) { diff --git a/src/Java/gtPlusPlus/core/util/math/MathUtils.java b/src/Java/gtPlusPlus/core/util/math/MathUtils.java index 2f4db2efcc..7573e0d51c 100644 --- a/src/Java/gtPlusPlus/core/util/math/MathUtils.java +++ b/src/Java/gtPlusPlus/core/util/math/MathUtils.java @@ -1,5 +1,6 @@ package gtPlusPlus.core.util.math; +import java.text.NumberFormat; import java.util.Map; import java.util.Random; @@ -15,6 +16,13 @@ public class MathUtils { final static Random rand = CORE.RANDOM; + /** Formats a number with group separator and at most 2 fraction digits. */ + private static final NumberFormat sNumberFormat = NumberFormat.getInstance(); + + static { + sNumberFormat.setMaximumFractionDigits(2); + } + /** * Returns a psuedo-random number between min and max, inclusive. * The difference between min and max can be at most @@ -766,6 +774,14 @@ public class MathUtils { public static Number max(Number a, Number b) { return (a.longValue() >= b.longValue()) ? a : b; } + + public static String formatNumbers(long aNumber) { + return sNumberFormat.format(aNumber); + } + + public static String formatNumbers(double aNumber) { + return sNumberFormat.format(aNumber); + } } diff --git a/src/Java/gtPlusPlus/core/util/minecraft/ItemUtils.java b/src/Java/gtPlusPlus/core/util/minecraft/ItemUtils.java index 1e282fb849..6330efd694 100644 --- a/src/Java/gtPlusPlus/core/util/minecraft/ItemUtils.java +++ b/src/Java/gtPlusPlus/core/util/minecraft/ItemUtils.java @@ -913,10 +913,11 @@ public class ItemUtils { } public static ItemStack getErrorStack(int mAmount, String aName) { - ItemStack g = getSimpleStack(ModItems.AAA_Broken, 1); - NBTUtils.setString(g, "Lore", EnumChatFormatting.RED+aName); + ItemStack g = getSimpleStack(ModItems.AAA_Broken, 1); if (aName != null) { - NBTUtils.setBookTitle(g, EnumChatFormatting.YELLOW+"Maybe Alkalus should know about this"); + //NBTUtils.setString(g, "Lore", EnumChatFormatting.RED+aName); + NBTUtils.setBookTitle(g, EnumChatFormatting.RED+aName); + //NBTUtils.setBookTitle(g, EnumChatFormatting.YELLOW+"Maybe Alkalus should know about this"); } return g; } diff --git a/src/Java/gtPlusPlus/nei/GTPP_NEI_DefaultHandler.java b/src/Java/gtPlusPlus/nei/GTPP_NEI_DefaultHandler.java index 6dc256d7b4..dd27a19528 100644 --- a/src/Java/gtPlusPlus/nei/GTPP_NEI_DefaultHandler.java +++ b/src/Java/gtPlusPlus/nei/GTPP_NEI_DefaultHandler.java @@ -2,36 +2,47 @@ package gtPlusPlus.nei; import java.awt.Point; import java.awt.Rectangle; -import java.util.*; +import java.lang.ref.SoftReference; +import java.util.ArrayList; +import java.util.Collections; +import java.util.Iterator; +import java.util.List; +import java.util.stream.Collectors; import org.lwjgl.opengl.GL11; +import codechicken.lib.gui.GuiDraw; +import codechicken.nei.PositionedStack; +import codechicken.nei.guihook.GuiContainerManager; +import codechicken.nei.guihook.IContainerInputHandler; +import codechicken.nei.guihook.IContainerTooltipHandler; +import codechicken.nei.recipe.GuiCraftingRecipe; +import codechicken.nei.recipe.GuiRecipe; +import codechicken.nei.recipe.GuiUsageRecipe; +import codechicken.nei.recipe.TemplateRecipeHandler; import cpw.mods.fml.common.event.FMLInterModComms; - -import net.minecraft.client.Minecraft; -import net.minecraft.client.gui.inventory.GuiContainer; -import net.minecraft.init.Blocks; -import net.minecraft.item.ItemStack; - import gregtech.api.enums.GT_Values; import gregtech.api.enums.OrePrefixes; import gregtech.api.gui.GT_GUIContainer_BasicMachine; import gregtech.api.objects.ItemData; -import gregtech.api.util.*; +import gregtech.api.util.GT_LanguageManager; +import gregtech.api.util.GT_OreDictUnificator; +import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Recipe.GT_Recipe_Map; -import codechicken.lib.gui.GuiDraw; -import codechicken.nei.PositionedStack; -import codechicken.nei.guihook.GuiContainerManager; -import codechicken.nei.guihook.IContainerInputHandler; -import codechicken.nei.guihook.IContainerTooltipHandler; -import codechicken.nei.recipe.*; -import net.minecraftforge.fluids.FluidContainerRegistry; +import gregtech.api.util.GT_Utility; +import gtPlusPlus.core.util.math.MathUtils; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.inventory.GuiContainer; +import net.minecraft.init.Blocks; +import net.minecraft.item.ItemStack; import net.minecraftforge.fluids.FluidStack; public class GTPP_NEI_DefaultHandler extends TemplateRecipeHandler { + public static final int sOffsetX = 5; public static final int sOffsetY = 11; + private SoftReference> mCachedRecipes = null; static { GuiContainerManager.addInputHandler(new GT_RectHandler()); @@ -66,13 +77,28 @@ extends TemplateRecipeHandler { return result; } + public List getCache() { + List cache; + if (mCachedRecipes == null || (cache = mCachedRecipes.get()) == null) { + cache = mRecipeMap.mRecipeList.stream() // do not use parallel stream. This is already parallelized by NEI + .filter(r -> !r.mHidden) + .sorted() + .map(temp -> {return createCachedRecipe(temp);}) + .collect(Collectors.toList()); + // while the NEI parallelize handlers, for each individual handler it still uses sequential execution model + // so we do not need any synchronization here + mCachedRecipes = new SoftReference<>(cache); + } + return cache; + } + + public CachedDefaultRecipe createCachedRecipe(GT_Recipe aRecipe) { + return new CachedDefaultRecipe(aRecipe); + } + public void loadCraftingRecipes(String outputId, Object... results) { if (outputId.equals(getOverlayIdentifier())) { - for (GT_Recipe tRecipe : getSortedRecipes()) { - if (!tRecipe.mHidden) { - this.arecipes.add(new CachedDefaultRecipe(tRecipe)); - } - } + arecipes.addAll(getCache()); } else { super.loadCraftingRecipes(outputId, results); } @@ -81,7 +107,7 @@ extends TemplateRecipeHandler { public void loadCraftingRecipes(ItemStack aResult) { ItemData tPrefixMaterial = GT_OreDictUnificator.getAssociation(aResult); - ArrayList tResults = new ArrayList(); + ArrayList tResults = new ArrayList<>(); tResults.add(aResult); tResults.add(GT_OreDictUnificator.get(true, aResult)); if ((tPrefixMaterial != null) && (!tPrefixMaterial.mBlackListed) && (!tPrefixMaterial.mPrefix.mFamiliarPrefixes.isEmpty())) { @@ -90,30 +116,25 @@ extends TemplateRecipeHandler { } } FluidStack tFluid = GT_Utility.getFluidForFilledItem(aResult, true); + FluidStack tFluidStack; if (tFluid != null) { + tFluidStack = tFluid; tResults.add(GT_Utility.getFluidDisplayStack(tFluid, false)); - for (FluidContainerRegistry.FluidContainerData tData : FluidContainerRegistry.getRegisteredFluidContainerData()) { - if (tData.fluid.isFluidEqual(tFluid)) { - tResults.add(GT_Utility.copy(new Object[]{tData.filledContainer})); - } - } } - for (GT_Recipe tRecipe : getSortedRecipes()) { - if (!tRecipe.mHidden) { - CachedDefaultRecipe tNEIRecipe = new CachedDefaultRecipe(tRecipe); - for (ItemStack tStack : tResults) { - if (tNEIRecipe.contains(tNEIRecipe.mOutputs, tStack)) { - this.arecipes.add(tNEIRecipe); - break; - } - } - } + else tFluidStack = GT_Utility.getFluidFromDisplayStack(aResult); + if (tFluidStack != null) { + tResults.addAll(GT_Utility.getContainersFromFluid(tFluidStack)); + } + for (CachedDefaultRecipe recipe : getCache()) { + if (tResults.stream().anyMatch(stack -> recipe.contains(recipe.mOutputs, stack))) + arecipes.add(recipe); } } public void loadUsageRecipes(ItemStack aInput) { ItemData tPrefixMaterial = GT_OreDictUnificator.getAssociation(aInput); - ArrayList tInputs = new ArrayList(); + + ArrayList tInputs = new ArrayList<>(); tInputs.add(aInput); tInputs.add(GT_OreDictUnificator.get(false, aInput)); if ((tPrefixMaterial != null) && (!tPrefixMaterial.mPrefix.mFamiliarPrefixes.isEmpty())) { @@ -122,24 +143,18 @@ extends TemplateRecipeHandler { } } FluidStack tFluid = GT_Utility.getFluidForFilledItem(aInput, true); + FluidStack tFluidStack; if (tFluid != null) { + tFluidStack = tFluid; tInputs.add(GT_Utility.getFluidDisplayStack(tFluid, false)); - for (FluidContainerRegistry.FluidContainerData tData : FluidContainerRegistry.getRegisteredFluidContainerData()) { - if (tData.fluid.isFluidEqual(tFluid)) { - tInputs.add(GT_Utility.copy(new Object[]{tData.filledContainer})); - } - } } - for (GT_Recipe tRecipe : getSortedRecipes()) { - if (!tRecipe.mHidden) { - CachedDefaultRecipe tNEIRecipe = new CachedDefaultRecipe(tRecipe); - for (ItemStack tStack : tInputs) { - if (tNEIRecipe.contains(tNEIRecipe.mInputs, tStack)) { - this.arecipes.add(tNEIRecipe); - break; - } - } - } + else tFluidStack = GT_Utility.getFluidFromDisplayStack(aInput); + if (tFluidStack != null) { + tInputs.addAll(GT_Utility.getContainersFromFluid(tFluidStack)); + } + for (CachedDefaultRecipe recipe : getCache()) { + if (tInputs.stream().anyMatch(stack -> recipe.contains(recipe.mInputs, stack))) + arecipes.add(recipe); } } @@ -167,7 +182,6 @@ extends TemplateRecipeHandler { @Override public String getGuiTexture() { - // return "gregtech:textures/gui/" + this.mRecipeMap.mUnlocalizedName + ".png"; return this.mRecipeMap.mNEIGUIPath; } @@ -204,10 +218,10 @@ extends TemplateRecipeHandler { final long tEUt = ((CachedDefaultRecipe) this.arecipes.get(aRecipeIndex)).mRecipe.mEUt; final long tDuration = ((CachedDefaultRecipe) this.arecipes.get(aRecipeIndex)).mRecipe.mDuration; if (tEUt != 0) { - drawText(10, 73, "Total: " + (tDuration * tEUt) + " EU", -16777216); - drawText(10, 83, "Usage: " + tEUt + " EU/t", -16777216); + drawText(10, 73, "Total: " + MathUtils.formatNumbers((long) (tDuration * tEUt)) + " EU", -16777216); + drawText(10, 83, "Usage: " + MathUtils.formatNumbers(tEUt) + " EU/t", -16777216); if (this.mRecipeMap.mShowVoltageAmperageInNEI) { - drawText(10, 93, "Voltage: " + (tEUt / this.mRecipeMap.mAmperage) + " EU", -16777216); + drawText(10, 93, "Voltage: " + MathUtils.formatNumbers(tEUt / this.mRecipeMap.mAmperage) + " EU", -16777216); drawText(10, 103, "Amperage: " + this.mRecipeMap.mAmperage, -16777216); } else { drawText(10, 93, "Voltage: unspecified", -16777216); @@ -215,7 +229,7 @@ extends TemplateRecipeHandler { } } if (tDuration > 0) { - drawText(10, 113, "Time: " + (tDuration < 20 ? "< 1" : Long.valueOf(tDuration / 20)) + " secs", -16777216); + drawText(10, 113, "Time: " + (tDuration < 20 ? "< 1" : MathUtils.formatNumbers(Long.valueOf(tDuration / 20))) + " secs", -16777216); } if ((GT_Utility.isStringValid(this.mRecipeMap.mNEISpecialValuePre)) || (GT_Utility.isStringValid(this.mRecipeMap.mNEISpecialValuePost))) { drawText(10, 123, this.mRecipeMap.mNEISpecialValuePre + (((CachedDefaultRecipe) this.arecipes.get(aRecipeIndex)).mRecipe.mSpecialValue * this.mRecipeMap.mNEISpecialValueMultiplier) + this.mRecipeMap.mNEISpecialValuePost, -16777216); @@ -243,7 +257,7 @@ extends TemplateRecipeHandler { } public boolean canHandle(final GuiContainer gui) { - return (((gui instanceof GT_GUIContainer_BasicMachine)) && (GT_Utility.isStringValid(((GT_GUIContainer_BasicMachine) gui).mNEI)) /*|| ((gui instanceof GT_GUIContainer_FusionReactor)) && (GT_Utility.isStringValid(((GT_GUIContainer_FusionReactor) gui).mNEI))*/); + return (((gui instanceof GT_GUIContainer_BasicMachine)) && (GT_Utility.isStringValid(((GT_GUIContainer_BasicMachine) gui).mNEI))); } @Override @@ -251,10 +265,7 @@ extends TemplateRecipeHandler { if ((this.canHandle(gui)) && (currenttip.isEmpty())) { if ((gui instanceof GT_GUIContainer_BasicMachine) && new Rectangle(65, 13, 36, 18).contains(new Point(GuiDraw.getMousePosition().x - ((GT_GUIContainer_BasicMachine) gui).getLeft() - codechicken.nei.recipe.RecipeInfo.getGuiOffset(gui)[0], GuiDraw.getMousePosition().y - ((GT_GUIContainer_BasicMachine) gui).getTop() - codechicken.nei.recipe.RecipeInfo.getGuiOffset(gui)[1]))) { currenttip.add("Recipes"); - } /*else if (gui instanceof GT_GUIContainer_FusionReactor && new Rectangle(145, 0, 24, 24).contains(new Point(GuiDraw.getMousePosition().x - ((GT_GUIContainer_FusionReactor) gui).getLeft() - codechicken.nei.recipe.RecipeInfo.getGuiOffset(gui)[0], GuiDraw.getMousePosition().y - ((GT_GUIContainer_FusionReactor) gui).getTop() - codechicken.nei.recipe.RecipeInfo.getGuiOffset(gui)[1]))) { - currenttip.add("Recipes"); - }*/ - + } } return currenttip; } @@ -262,9 +273,7 @@ extends TemplateRecipeHandler { private boolean transferRect(final GuiContainer gui, final boolean usage) { if (gui instanceof GT_GUIContainer_BasicMachine) { return (this.canHandle(gui)) && (new Rectangle(65, 13, 36, 18).contains(new Point(GuiDraw.getMousePosition().x - ((GT_GUIContainer_BasicMachine) gui).getLeft() - codechicken.nei.recipe.RecipeInfo.getGuiOffset(gui)[0], GuiDraw.getMousePosition().y - ((GT_GUIContainer_BasicMachine) gui).getTop() - codechicken.nei.recipe.RecipeInfo.getGuiOffset(gui)[1]))) && (usage ? GuiUsageRecipe.openRecipeGui(((GT_GUIContainer_BasicMachine) gui).mNEI, new Object[0]) : GuiCraftingRecipe.openRecipeGui(((GT_GUIContainer_BasicMachine) gui).mNEI, new Object[0])); - } /*else if (gui instanceof GT_GUIContainer_FusionReactor) { - return (canHandle(gui)) && (new Rectangle(145, 0, 24, 24).contains(new Point(GuiDraw.getMousePosition().x - ((GT_GUIContainer_FusionReactor) gui).getLeft() - codechicken.nei.recipe.RecipeInfo.getGuiOffset(gui)[0], GuiDraw.getMousePosition().y - ((GT_GUIContainer_FusionReactor) gui).getTop() - codechicken.nei.recipe.RecipeInfo.getGuiOffset(gui)[1]))) && (usage ? GuiUsageRecipe.openRecipeGui(((GT_GUIContainer_FusionReactor) gui).mNEI, new Object[0]) : GuiCraftingRecipe.openRecipeGui(((GT_GUIContainer_FusionReactor) gui).mNEI, new Object[0])); - }*/ + } return false; } @@ -357,8 +366,7 @@ extends TemplateRecipeHandler { } } - public class CachedDefaultRecipe - extends TemplateRecipeHandler.CachedRecipe { + public class CachedDefaultRecipe extends TemplateRecipeHandler.CachedRecipe { public final GT_Recipe mRecipe; public final List mOutputs = new ArrayList(); public final List mInputs = new ArrayList(); @@ -366,442 +374,444 @@ extends TemplateRecipeHandler { public CachedDefaultRecipe(final GT_Recipe aRecipe) { super(); this.mRecipe = aRecipe; - + handleSlots(); + } + + public void handleSlots() { int tStartIndex = 0; switch (GTPP_NEI_DefaultHandler.this.mRecipeMap.mUsualInputCount) { case 0: break; case 1: - if (aRecipe.getRepresentativeInput(tStartIndex) != null) { - this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 48, 14)); + if (mRecipe.getRepresentativeInput(tStartIndex) != null) { + this.mInputs.add(new FixedPositionedStack(mRecipe.getRepresentativeInput(tStartIndex), 48, 14)); } tStartIndex++; break; case 2: - if (aRecipe.getRepresentativeInput(tStartIndex) != null) { - this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 30, 14)); + if (mRecipe.getRepresentativeInput(tStartIndex) != null) { + this.mInputs.add(new FixedPositionedStack(mRecipe.getRepresentativeInput(tStartIndex), 30, 14)); } tStartIndex++; - if (aRecipe.getRepresentativeInput(tStartIndex) != null) { - this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 48, 14)); + if (mRecipe.getRepresentativeInput(tStartIndex) != null) { + this.mInputs.add(new FixedPositionedStack(mRecipe.getRepresentativeInput(tStartIndex), 48, 14)); } tStartIndex++; break; case 3: - if (aRecipe.getRepresentativeInput(tStartIndex) != null) { - this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 12, 14)); + if (mRecipe.getRepresentativeInput(tStartIndex) != null) { + this.mInputs.add(new FixedPositionedStack(mRecipe.getRepresentativeInput(tStartIndex), 12, 14)); } tStartIndex++; - if (aRecipe.getRepresentativeInput(tStartIndex) != null) { - this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 30, 14)); + if (mRecipe.getRepresentativeInput(tStartIndex) != null) { + this.mInputs.add(new FixedPositionedStack(mRecipe.getRepresentativeInput(tStartIndex), 30, 14)); } tStartIndex++; - if (aRecipe.getRepresentativeInput(tStartIndex) != null) { - this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 48, 14)); + if (mRecipe.getRepresentativeInput(tStartIndex) != null) { + this.mInputs.add(new FixedPositionedStack(mRecipe.getRepresentativeInput(tStartIndex), 48, 14)); } tStartIndex++; break; case 4: - if (aRecipe.getRepresentativeInput(tStartIndex) != null) { - this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 30, 5)); + if (mRecipe.getRepresentativeInput(tStartIndex) != null) { + this.mInputs.add(new FixedPositionedStack(mRecipe.getRepresentativeInput(tStartIndex), 30, 5)); } tStartIndex++; - if (aRecipe.getRepresentativeInput(tStartIndex) != null) { - this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 48, 5)); + if (mRecipe.getRepresentativeInput(tStartIndex) != null) { + this.mInputs.add(new FixedPositionedStack(mRecipe.getRepresentativeInput(tStartIndex), 48, 5)); } tStartIndex++; - if (aRecipe.getRepresentativeInput(tStartIndex) != null) { - this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 30, 23)); + if (mRecipe.getRepresentativeInput(tStartIndex) != null) { + this.mInputs.add(new FixedPositionedStack(mRecipe.getRepresentativeInput(tStartIndex), 30, 23)); } tStartIndex++; - if (aRecipe.getRepresentativeInput(tStartIndex) != null) { - this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 48, 23)); + if (mRecipe.getRepresentativeInput(tStartIndex) != null) { + this.mInputs.add(new FixedPositionedStack(mRecipe.getRepresentativeInput(tStartIndex), 48, 23)); } tStartIndex++; break; case 5: - if (aRecipe.getRepresentativeInput(tStartIndex) != null) { - this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 12, 5)); + if (mRecipe.getRepresentativeInput(tStartIndex) != null) { + this.mInputs.add(new FixedPositionedStack(mRecipe.getRepresentativeInput(tStartIndex), 12, 5)); } tStartIndex++; - if (aRecipe.getRepresentativeInput(tStartIndex) != null) { - this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 30, 5)); + if (mRecipe.getRepresentativeInput(tStartIndex) != null) { + this.mInputs.add(new FixedPositionedStack(mRecipe.getRepresentativeInput(tStartIndex), 30, 5)); } tStartIndex++; - if (aRecipe.getRepresentativeInput(tStartIndex) != null) { - this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 48, 5)); + if (mRecipe.getRepresentativeInput(tStartIndex) != null) { + this.mInputs.add(new FixedPositionedStack(mRecipe.getRepresentativeInput(tStartIndex), 48, 5)); } tStartIndex++; - if (aRecipe.getRepresentativeInput(tStartIndex) != null) { - this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 30, 23)); + if (mRecipe.getRepresentativeInput(tStartIndex) != null) { + this.mInputs.add(new FixedPositionedStack(mRecipe.getRepresentativeInput(tStartIndex), 30, 23)); } tStartIndex++; - if (aRecipe.getRepresentativeInput(tStartIndex) != null) { - this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 48, 23)); + if (mRecipe.getRepresentativeInput(tStartIndex) != null) { + this.mInputs.add(new FixedPositionedStack(mRecipe.getRepresentativeInput(tStartIndex), 48, 23)); } tStartIndex++; break; case 6: - if (aRecipe.getRepresentativeInput(tStartIndex) != null) { - this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 12, 5)); + if (mRecipe.getRepresentativeInput(tStartIndex) != null) { + this.mInputs.add(new FixedPositionedStack(mRecipe.getRepresentativeInput(tStartIndex), 12, 5)); } tStartIndex++; - if (aRecipe.getRepresentativeInput(tStartIndex) != null) { - this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 30, 5)); + if (mRecipe.getRepresentativeInput(tStartIndex) != null) { + this.mInputs.add(new FixedPositionedStack(mRecipe.getRepresentativeInput(tStartIndex), 30, 5)); } tStartIndex++; - if (aRecipe.getRepresentativeInput(tStartIndex) != null) { - this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 48, 5)); + if (mRecipe.getRepresentativeInput(tStartIndex) != null) { + this.mInputs.add(new FixedPositionedStack(mRecipe.getRepresentativeInput(tStartIndex), 48, 5)); } tStartIndex++; - if (aRecipe.getRepresentativeInput(tStartIndex) != null) { - this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 12, 23)); + if (mRecipe.getRepresentativeInput(tStartIndex) != null) { + this.mInputs.add(new FixedPositionedStack(mRecipe.getRepresentativeInput(tStartIndex), 12, 23)); } tStartIndex++; - if (aRecipe.getRepresentativeInput(tStartIndex) != null) { - this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 30, 23)); + if (mRecipe.getRepresentativeInput(tStartIndex) != null) { + this.mInputs.add(new FixedPositionedStack(mRecipe.getRepresentativeInput(tStartIndex), 30, 23)); } tStartIndex++; - if (aRecipe.getRepresentativeInput(tStartIndex) != null) { - this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 48, 23)); + if (mRecipe.getRepresentativeInput(tStartIndex) != null) { + this.mInputs.add(new FixedPositionedStack(mRecipe.getRepresentativeInput(tStartIndex), 48, 23)); } tStartIndex++; break; case 7: - if (aRecipe.getRepresentativeInput(tStartIndex) != null) { - this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 12, -4)); + if (mRecipe.getRepresentativeInput(tStartIndex) != null) { + this.mInputs.add(new FixedPositionedStack(mRecipe.getRepresentativeInput(tStartIndex), 12, -4)); } tStartIndex++; - if (aRecipe.getRepresentativeInput(tStartIndex) != null) { - this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 30, -4)); + if (mRecipe.getRepresentativeInput(tStartIndex) != null) { + this.mInputs.add(new FixedPositionedStack(mRecipe.getRepresentativeInput(tStartIndex), 30, -4)); } tStartIndex++; - if (aRecipe.getRepresentativeInput(tStartIndex) != null) { - this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 48, -4)); + if (mRecipe.getRepresentativeInput(tStartIndex) != null) { + this.mInputs.add(new FixedPositionedStack(mRecipe.getRepresentativeInput(tStartIndex), 48, -4)); } tStartIndex++; - if (aRecipe.getRepresentativeInput(tStartIndex) != null) { - this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 12, 14)); + if (mRecipe.getRepresentativeInput(tStartIndex) != null) { + this.mInputs.add(new FixedPositionedStack(mRecipe.getRepresentativeInput(tStartIndex), 12, 14)); } tStartIndex++; - if (aRecipe.getRepresentativeInput(tStartIndex) != null) { - this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 30, 14)); + if (mRecipe.getRepresentativeInput(tStartIndex) != null) { + this.mInputs.add(new FixedPositionedStack(mRecipe.getRepresentativeInput(tStartIndex), 30, 14)); } tStartIndex++; - if (aRecipe.getRepresentativeInput(tStartIndex) != null) { - this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 48, 14)); + if (mRecipe.getRepresentativeInput(tStartIndex) != null) { + this.mInputs.add(new FixedPositionedStack(mRecipe.getRepresentativeInput(tStartIndex), 48, 14)); } tStartIndex++; - if (aRecipe.getRepresentativeInput(tStartIndex) != null) { - this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 12, 32)); + if (mRecipe.getRepresentativeInput(tStartIndex) != null) { + this.mInputs.add(new FixedPositionedStack(mRecipe.getRepresentativeInput(tStartIndex), 12, 32)); } tStartIndex++; break; case 8: - if (aRecipe.getRepresentativeInput(tStartIndex) != null) { - this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 12, -4)); + if (mRecipe.getRepresentativeInput(tStartIndex) != null) { + this.mInputs.add(new FixedPositionedStack(mRecipe.getRepresentativeInput(tStartIndex), 12, -4)); } tStartIndex++; - if (aRecipe.getRepresentativeInput(tStartIndex) != null) { - this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 30, -4)); + if (mRecipe.getRepresentativeInput(tStartIndex) != null) { + this.mInputs.add(new FixedPositionedStack(mRecipe.getRepresentativeInput(tStartIndex), 30, -4)); } tStartIndex++; - if (aRecipe.getRepresentativeInput(tStartIndex) != null) { - this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 48, -4)); + if (mRecipe.getRepresentativeInput(tStartIndex) != null) { + this.mInputs.add(new FixedPositionedStack(mRecipe.getRepresentativeInput(tStartIndex), 48, -4)); } tStartIndex++; - if (aRecipe.getRepresentativeInput(tStartIndex) != null) { - this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 12, 14)); + if (mRecipe.getRepresentativeInput(tStartIndex) != null) { + this.mInputs.add(new FixedPositionedStack(mRecipe.getRepresentativeInput(tStartIndex), 12, 14)); } tStartIndex++; - if (aRecipe.getRepresentativeInput(tStartIndex) != null) { - this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 30, 14)); + if (mRecipe.getRepresentativeInput(tStartIndex) != null) { + this.mInputs.add(new FixedPositionedStack(mRecipe.getRepresentativeInput(tStartIndex), 30, 14)); } tStartIndex++; - if (aRecipe.getRepresentativeInput(tStartIndex) != null) { - this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 48, 14)); + if (mRecipe.getRepresentativeInput(tStartIndex) != null) { + this.mInputs.add(new FixedPositionedStack(mRecipe.getRepresentativeInput(tStartIndex), 48, 14)); } tStartIndex++; - if (aRecipe.getRepresentativeInput(tStartIndex) != null) { - this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 12, 32)); + if (mRecipe.getRepresentativeInput(tStartIndex) != null) { + this.mInputs.add(new FixedPositionedStack(mRecipe.getRepresentativeInput(tStartIndex), 12, 32)); } tStartIndex++; - if (aRecipe.getRepresentativeInput(tStartIndex) != null) { - this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 30, 32)); + if (mRecipe.getRepresentativeInput(tStartIndex) != null) { + this.mInputs.add(new FixedPositionedStack(mRecipe.getRepresentativeInput(tStartIndex), 30, 32)); } tStartIndex++; break; default: - if (aRecipe.getRepresentativeInput(tStartIndex) != null) { - this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 12, -4)); + if (mRecipe.getRepresentativeInput(tStartIndex) != null) { + this.mInputs.add(new FixedPositionedStack(mRecipe.getRepresentativeInput(tStartIndex), 12, -4)); } tStartIndex++; - if (aRecipe.getRepresentativeInput(tStartIndex) != null) { - this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 30, -4)); + if (mRecipe.getRepresentativeInput(tStartIndex) != null) { + this.mInputs.add(new FixedPositionedStack(mRecipe.getRepresentativeInput(tStartIndex), 30, -4)); } tStartIndex++; - if (aRecipe.getRepresentativeInput(tStartIndex) != null) { - this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 48, -4)); + if (mRecipe.getRepresentativeInput(tStartIndex) != null) { + this.mInputs.add(new FixedPositionedStack(mRecipe.getRepresentativeInput(tStartIndex), 48, -4)); } tStartIndex++; - if (aRecipe.getRepresentativeInput(tStartIndex) != null) { - this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 12, 14)); + if (mRecipe.getRepresentativeInput(tStartIndex) != null) { + this.mInputs.add(new FixedPositionedStack(mRecipe.getRepresentativeInput(tStartIndex), 12, 14)); } tStartIndex++; - if (aRecipe.getRepresentativeInput(tStartIndex) != null) { - this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 30, 14)); + if (mRecipe.getRepresentativeInput(tStartIndex) != null) { + this.mInputs.add(new FixedPositionedStack(mRecipe.getRepresentativeInput(tStartIndex), 30, 14)); } tStartIndex++; - if (aRecipe.getRepresentativeInput(tStartIndex) != null) { - this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 48, 14)); + if (mRecipe.getRepresentativeInput(tStartIndex) != null) { + this.mInputs.add(new FixedPositionedStack(mRecipe.getRepresentativeInput(tStartIndex), 48, 14)); } tStartIndex++; - if (aRecipe.getRepresentativeInput(tStartIndex) != null) { - this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 12, 32)); + if (mRecipe.getRepresentativeInput(tStartIndex) != null) { + this.mInputs.add(new FixedPositionedStack(mRecipe.getRepresentativeInput(tStartIndex), 12, 32)); } tStartIndex++; - if (aRecipe.getRepresentativeInput(tStartIndex) != null) { - this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 30, 32)); + if (mRecipe.getRepresentativeInput(tStartIndex) != null) { + this.mInputs.add(new FixedPositionedStack(mRecipe.getRepresentativeInput(tStartIndex), 30, 32)); } tStartIndex++; - if (aRecipe.getRepresentativeInput(tStartIndex) != null) { - this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 48, 32)); + if (mRecipe.getRepresentativeInput(tStartIndex) != null) { + this.mInputs.add(new FixedPositionedStack(mRecipe.getRepresentativeInput(tStartIndex), 48, 32)); } tStartIndex++; } - if (aRecipe.mSpecialItems != null) { - this.mInputs.add(new FixedPositionedStack(aRecipe.mSpecialItems, 120, 52)); + if (mRecipe.mSpecialItems != null) { + this.mInputs.add(new FixedPositionedStack(mRecipe.mSpecialItems, 120, 52)); } tStartIndex = 0; switch (GTPP_NEI_DefaultHandler.this.mRecipeMap.mUsualOutputCount) { case 0: break; case 1: - if (aRecipe.getOutput(tStartIndex) != null) { - this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 102, 14, aRecipe.getOutputChance(tStartIndex))); + if (mRecipe.getOutput(tStartIndex) != null) { + this.mOutputs.add(new FixedPositionedStack(mRecipe.getOutput(tStartIndex), 102, 14, mRecipe.getOutputChance(tStartIndex))); } tStartIndex++; break; case 2: - if (aRecipe.getOutput(tStartIndex) != null) { - this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 102, 14, aRecipe.getOutputChance(tStartIndex))); + if (mRecipe.getOutput(tStartIndex) != null) { + this.mOutputs.add(new FixedPositionedStack(mRecipe.getOutput(tStartIndex), 102, 14, mRecipe.getOutputChance(tStartIndex))); } tStartIndex++; - if (aRecipe.getOutput(tStartIndex) != null) { - this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 120, 14, aRecipe.getOutputChance(tStartIndex))); + if (mRecipe.getOutput(tStartIndex) != null) { + this.mOutputs.add(new FixedPositionedStack(mRecipe.getOutput(tStartIndex), 120, 14, mRecipe.getOutputChance(tStartIndex))); } tStartIndex++; break; case 3: - if (aRecipe.getOutput(tStartIndex) != null) { - this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 102, 14, aRecipe.getOutputChance(tStartIndex))); + if (mRecipe.getOutput(tStartIndex) != null) { + this.mOutputs.add(new FixedPositionedStack(mRecipe.getOutput(tStartIndex), 102, 14, mRecipe.getOutputChance(tStartIndex))); } tStartIndex++; - if (aRecipe.getOutput(tStartIndex) != null) { - this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 120, 14, aRecipe.getOutputChance(tStartIndex))); + if (mRecipe.getOutput(tStartIndex) != null) { + this.mOutputs.add(new FixedPositionedStack(mRecipe.getOutput(tStartIndex), 120, 14, mRecipe.getOutputChance(tStartIndex))); } tStartIndex++; - if (aRecipe.getOutput(tStartIndex) != null) { - this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 138, 14, aRecipe.getOutputChance(tStartIndex))); + if (mRecipe.getOutput(tStartIndex) != null) { + this.mOutputs.add(new FixedPositionedStack(mRecipe.getOutput(tStartIndex), 138, 14, mRecipe.getOutputChance(tStartIndex))); } tStartIndex++; break; case 4: - if (aRecipe.getOutput(tStartIndex) != null) { - this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 102, 5, aRecipe.getOutputChance(tStartIndex))); + if (mRecipe.getOutput(tStartIndex) != null) { + this.mOutputs.add(new FixedPositionedStack(mRecipe.getOutput(tStartIndex), 102, 5, mRecipe.getOutputChance(tStartIndex))); } tStartIndex++; - if (aRecipe.getOutput(tStartIndex) != null) { - this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 120, 5, aRecipe.getOutputChance(tStartIndex))); + if (mRecipe.getOutput(tStartIndex) != null) { + this.mOutputs.add(new FixedPositionedStack(mRecipe.getOutput(tStartIndex), 120, 5, mRecipe.getOutputChance(tStartIndex))); } tStartIndex++; - if (aRecipe.getOutput(tStartIndex) != null) { - this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 102, 23, aRecipe.getOutputChance(tStartIndex))); + if (mRecipe.getOutput(tStartIndex) != null) { + this.mOutputs.add(new FixedPositionedStack(mRecipe.getOutput(tStartIndex), 102, 23, mRecipe.getOutputChance(tStartIndex))); } tStartIndex++; - if (aRecipe.getOutput(tStartIndex) != null) { - this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 120, 23, aRecipe.getOutputChance(tStartIndex))); + if (mRecipe.getOutput(tStartIndex) != null) { + this.mOutputs.add(new FixedPositionedStack(mRecipe.getOutput(tStartIndex), 120, 23, mRecipe.getOutputChance(tStartIndex))); } tStartIndex++; break; case 5: - if (aRecipe.getOutput(tStartIndex) != null) { - this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 102, 5, aRecipe.getOutputChance(tStartIndex))); + if (mRecipe.getOutput(tStartIndex) != null) { + this.mOutputs.add(new FixedPositionedStack(mRecipe.getOutput(tStartIndex), 102, 5, mRecipe.getOutputChance(tStartIndex))); } tStartIndex++; - if (aRecipe.getOutput(tStartIndex) != null) { - this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 120, 5, aRecipe.getOutputChance(tStartIndex))); + if (mRecipe.getOutput(tStartIndex) != null) { + this.mOutputs.add(new FixedPositionedStack(mRecipe.getOutput(tStartIndex), 120, 5, mRecipe.getOutputChance(tStartIndex))); } tStartIndex++; - if (aRecipe.getOutput(tStartIndex) != null) { - this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 138, 5, aRecipe.getOutputChance(tStartIndex))); + if (mRecipe.getOutput(tStartIndex) != null) { + this.mOutputs.add(new FixedPositionedStack(mRecipe.getOutput(tStartIndex), 138, 5, mRecipe.getOutputChance(tStartIndex))); } tStartIndex++; - if (aRecipe.getOutput(tStartIndex) != null) { - this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 102, 23, aRecipe.getOutputChance(tStartIndex))); + if (mRecipe.getOutput(tStartIndex) != null) { + this.mOutputs.add(new FixedPositionedStack(mRecipe.getOutput(tStartIndex), 102, 23, mRecipe.getOutputChance(tStartIndex))); } tStartIndex++; - if (aRecipe.getOutput(tStartIndex) != null) { - this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 120, 23, aRecipe.getOutputChance(tStartIndex))); + if (mRecipe.getOutput(tStartIndex) != null) { + this.mOutputs.add(new FixedPositionedStack(mRecipe.getOutput(tStartIndex), 120, 23, mRecipe.getOutputChance(tStartIndex))); } tStartIndex++; break; case 6: - if (aRecipe.getOutput(tStartIndex) != null) { - this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 102, 5, aRecipe.getOutputChance(tStartIndex))); + if (mRecipe.getOutput(tStartIndex) != null) { + this.mOutputs.add(new FixedPositionedStack(mRecipe.getOutput(tStartIndex), 102, 5, mRecipe.getOutputChance(tStartIndex))); } tStartIndex++; - if (aRecipe.getOutput(tStartIndex) != null) { - this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 120, 5, aRecipe.getOutputChance(tStartIndex))); + if (mRecipe.getOutput(tStartIndex) != null) { + this.mOutputs.add(new FixedPositionedStack(mRecipe.getOutput(tStartIndex), 120, 5, mRecipe.getOutputChance(tStartIndex))); } tStartIndex++; - if (aRecipe.getOutput(tStartIndex) != null) { - this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 138, 5, aRecipe.getOutputChance(tStartIndex))); + if (mRecipe.getOutput(tStartIndex) != null) { + this.mOutputs.add(new FixedPositionedStack(mRecipe.getOutput(tStartIndex), 138, 5, mRecipe.getOutputChance(tStartIndex))); } tStartIndex++; - if (aRecipe.getOutput(tStartIndex) != null) { - this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 102, 23, aRecipe.getOutputChance(tStartIndex))); + if (mRecipe.getOutput(tStartIndex) != null) { + this.mOutputs.add(new FixedPositionedStack(mRecipe.getOutput(tStartIndex), 102, 23, mRecipe.getOutputChance(tStartIndex))); } tStartIndex++; - if (aRecipe.getOutput(tStartIndex) != null) { - this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 120, 23, aRecipe.getOutputChance(tStartIndex))); + if (mRecipe.getOutput(tStartIndex) != null) { + this.mOutputs.add(new FixedPositionedStack(mRecipe.getOutput(tStartIndex), 120, 23, mRecipe.getOutputChance(tStartIndex))); } tStartIndex++; - if (aRecipe.getOutput(tStartIndex) != null) { - this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 138, 23, aRecipe.getOutputChance(tStartIndex))); + if (mRecipe.getOutput(tStartIndex) != null) { + this.mOutputs.add(new FixedPositionedStack(mRecipe.getOutput(tStartIndex), 138, 23, mRecipe.getOutputChance(tStartIndex))); } tStartIndex++; break; case 7: - if (aRecipe.getOutput(tStartIndex) != null) { - this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 102, -4, aRecipe.getOutputChance(tStartIndex))); + if (mRecipe.getOutput(tStartIndex) != null) { + this.mOutputs.add(new FixedPositionedStack(mRecipe.getOutput(tStartIndex), 102, -4, mRecipe.getOutputChance(tStartIndex))); } tStartIndex++; - if (aRecipe.getOutput(tStartIndex) != null) { - this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 120, -4, aRecipe.getOutputChance(tStartIndex))); + if (mRecipe.getOutput(tStartIndex) != null) { + this.mOutputs.add(new FixedPositionedStack(mRecipe.getOutput(tStartIndex), 120, -4, mRecipe.getOutputChance(tStartIndex))); } tStartIndex++; - if (aRecipe.getOutput(tStartIndex) != null) { - this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 138, -4, aRecipe.getOutputChance(tStartIndex))); + if (mRecipe.getOutput(tStartIndex) != null) { + this.mOutputs.add(new FixedPositionedStack(mRecipe.getOutput(tStartIndex), 138, -4, mRecipe.getOutputChance(tStartIndex))); } tStartIndex++; - if (aRecipe.getOutput(tStartIndex) != null) { - this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 102, 14, aRecipe.getOutputChance(tStartIndex))); + if (mRecipe.getOutput(tStartIndex) != null) { + this.mOutputs.add(new FixedPositionedStack(mRecipe.getOutput(tStartIndex), 102, 14, mRecipe.getOutputChance(tStartIndex))); } tStartIndex++; - if (aRecipe.getOutput(tStartIndex) != null) { - this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 120, 14, aRecipe.getOutputChance(tStartIndex))); + if (mRecipe.getOutput(tStartIndex) != null) { + this.mOutputs.add(new FixedPositionedStack(mRecipe.getOutput(tStartIndex), 120, 14, mRecipe.getOutputChance(tStartIndex))); } tStartIndex++; - if (aRecipe.getOutput(tStartIndex) != null) { - this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 138, 14, aRecipe.getOutputChance(tStartIndex))); + if (mRecipe.getOutput(tStartIndex) != null) { + this.mOutputs.add(new FixedPositionedStack(mRecipe.getOutput(tStartIndex), 138, 14, mRecipe.getOutputChance(tStartIndex))); } tStartIndex++; - if (aRecipe.getOutput(tStartIndex) != null) { - this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 102, 32, aRecipe.getOutputChance(tStartIndex))); + if (mRecipe.getOutput(tStartIndex) != null) { + this.mOutputs.add(new FixedPositionedStack(mRecipe.getOutput(tStartIndex), 102, 32, mRecipe.getOutputChance(tStartIndex))); } tStartIndex++; break; case 8: - if (aRecipe.getOutput(tStartIndex) != null) { - this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 102, -4, aRecipe.getOutputChance(tStartIndex))); + if (mRecipe.getOutput(tStartIndex) != null) { + this.mOutputs.add(new FixedPositionedStack(mRecipe.getOutput(tStartIndex), 102, -4, mRecipe.getOutputChance(tStartIndex))); } tStartIndex++; - if (aRecipe.getOutput(tStartIndex) != null) { - this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 120, -4, aRecipe.getOutputChance(tStartIndex))); + if (mRecipe.getOutput(tStartIndex) != null) { + this.mOutputs.add(new FixedPositionedStack(mRecipe.getOutput(tStartIndex), 120, -4, mRecipe.getOutputChance(tStartIndex))); } tStartIndex++; - if (aRecipe.getOutput(tStartIndex) != null) { - this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 138, -4, aRecipe.getOutputChance(tStartIndex))); + if (mRecipe.getOutput(tStartIndex) != null) { + this.mOutputs.add(new FixedPositionedStack(mRecipe.getOutput(tStartIndex), 138, -4, mRecipe.getOutputChance(tStartIndex))); } tStartIndex++; - if (aRecipe.getOutput(tStartIndex) != null) { - this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 102, 14, aRecipe.getOutputChance(tStartIndex))); + if (mRecipe.getOutput(tStartIndex) != null) { + this.mOutputs.add(new FixedPositionedStack(mRecipe.getOutput(tStartIndex), 102, 14, mRecipe.getOutputChance(tStartIndex))); } tStartIndex++; - if (aRecipe.getOutput(tStartIndex) != null) { - this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 120, 14, aRecipe.getOutputChance(tStartIndex))); + if (mRecipe.getOutput(tStartIndex) != null) { + this.mOutputs.add(new FixedPositionedStack(mRecipe.getOutput(tStartIndex), 120, 14, mRecipe.getOutputChance(tStartIndex))); } tStartIndex++; - if (aRecipe.getOutput(tStartIndex) != null) { - this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 138, 14, aRecipe.getOutputChance(tStartIndex))); + if (mRecipe.getOutput(tStartIndex) != null) { + this.mOutputs.add(new FixedPositionedStack(mRecipe.getOutput(tStartIndex), 138, 14, mRecipe.getOutputChance(tStartIndex))); } tStartIndex++; - if (aRecipe.getOutput(tStartIndex) != null) { - this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 102, 32, aRecipe.getOutputChance(tStartIndex))); + if (mRecipe.getOutput(tStartIndex) != null) { + this.mOutputs.add(new FixedPositionedStack(mRecipe.getOutput(tStartIndex), 102, 32, mRecipe.getOutputChance(tStartIndex))); } tStartIndex++; - if (aRecipe.getOutput(tStartIndex) != null) { - this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 120, 32, aRecipe.getOutputChance(tStartIndex))); + if (mRecipe.getOutput(tStartIndex) != null) { + this.mOutputs.add(new FixedPositionedStack(mRecipe.getOutput(tStartIndex), 120, 32, mRecipe.getOutputChance(tStartIndex))); } tStartIndex++; break; default: - if (aRecipe.getOutput(tStartIndex) != null) { - this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 102, -4, aRecipe.getOutputChance(tStartIndex))); + if (mRecipe.getOutput(tStartIndex) != null) { + this.mOutputs.add(new FixedPositionedStack(mRecipe.getOutput(tStartIndex), 102, -4, mRecipe.getOutputChance(tStartIndex))); } tStartIndex++; - if (aRecipe.getOutput(tStartIndex) != null) { - this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 120, -4, aRecipe.getOutputChance(tStartIndex))); + if (mRecipe.getOutput(tStartIndex) != null) { + this.mOutputs.add(new FixedPositionedStack(mRecipe.getOutput(tStartIndex), 120, -4, mRecipe.getOutputChance(tStartIndex))); } tStartIndex++; - if (aRecipe.getOutput(tStartIndex) != null) { - this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 138, -4, aRecipe.getOutputChance(tStartIndex))); + if (mRecipe.getOutput(tStartIndex) != null) { + this.mOutputs.add(new FixedPositionedStack(mRecipe.getOutput(tStartIndex), 138, -4, mRecipe.getOutputChance(tStartIndex))); } tStartIndex++; - if (aRecipe.getOutput(tStartIndex) != null) { - this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 102, 14, aRecipe.getOutputChance(tStartIndex))); + if (mRecipe.getOutput(tStartIndex) != null) { + this.mOutputs.add(new FixedPositionedStack(mRecipe.getOutput(tStartIndex), 102, 14, mRecipe.getOutputChance(tStartIndex))); } tStartIndex++; - if (aRecipe.getOutput(tStartIndex) != null) { - this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 120, 14, aRecipe.getOutputChance(tStartIndex))); + if (mRecipe.getOutput(tStartIndex) != null) { + this.mOutputs.add(new FixedPositionedStack(mRecipe.getOutput(tStartIndex), 120, 14, mRecipe.getOutputChance(tStartIndex))); } tStartIndex++; - if (aRecipe.getOutput(tStartIndex) != null) { - this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 138, 14, aRecipe.getOutputChance(tStartIndex))); + if (mRecipe.getOutput(tStartIndex) != null) { + this.mOutputs.add(new FixedPositionedStack(mRecipe.getOutput(tStartIndex), 138, 14, mRecipe.getOutputChance(tStartIndex))); } tStartIndex++; - if (aRecipe.getOutput(tStartIndex) != null) { - this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 102, 32, aRecipe.getOutputChance(tStartIndex))); + if (mRecipe.getOutput(tStartIndex) != null) { + this.mOutputs.add(new FixedPositionedStack(mRecipe.getOutput(tStartIndex), 102, 32, mRecipe.getOutputChance(tStartIndex))); } tStartIndex++; - if (aRecipe.getOutput(tStartIndex) != null) { - this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 120, 32, aRecipe.getOutputChance(tStartIndex))); + if (mRecipe.getOutput(tStartIndex) != null) { + this.mOutputs.add(new FixedPositionedStack(mRecipe.getOutput(tStartIndex), 120, 32, mRecipe.getOutputChance(tStartIndex))); } tStartIndex++; - if (aRecipe.getOutput(tStartIndex) != null) { - this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 138, 32, aRecipe.getOutputChance(tStartIndex))); + if (mRecipe.getOutput(tStartIndex) != null) { + this.mOutputs.add(new FixedPositionedStack(mRecipe.getOutput(tStartIndex), 138, 32, mRecipe.getOutputChance(tStartIndex))); } tStartIndex++; } - if ((aRecipe.mFluidInputs.length > 0) && (aRecipe.mFluidInputs[0] != null) && (aRecipe.mFluidInputs[0].getFluid() != null)) { - this.mInputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(aRecipe.mFluidInputs[0], true), 48, 52)); - if ((aRecipe.mFluidInputs.length > 1) && (aRecipe.mFluidInputs[1] != null) && (aRecipe.mFluidInputs[1].getFluid() != null)) { - this.mInputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(aRecipe.mFluidInputs[1], true), 30, 52)); + if ((mRecipe.mFluidInputs.length > 0) && (mRecipe.mFluidInputs[0] != null) && (mRecipe.mFluidInputs[0].getFluid() != null)) { + this.mInputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(mRecipe.mFluidInputs[0], true), 48, 52)); + if ((mRecipe.mFluidInputs.length > 1) && (mRecipe.mFluidInputs[1] != null) && (mRecipe.mFluidInputs[1].getFluid() != null)) { + this.mInputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(mRecipe.mFluidInputs[1], true), 30, 52)); } } - if (aRecipe.mFluidOutputs.length > 1) { - if (aRecipe.mFluidOutputs[0] != null && (aRecipe.mFluidOutputs[0].getFluid() != null)) { - this.mOutputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(aRecipe.mFluidOutputs[0], true), 120, 5)); + if (mRecipe.mFluidOutputs.length > 1) { + if (mRecipe.mFluidOutputs[0] != null && (mRecipe.mFluidOutputs[0].getFluid() != null)) { + this.mOutputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(mRecipe.mFluidOutputs[0], true), 120, 5)); } - if (aRecipe.mFluidOutputs[1] != null && (aRecipe.mFluidOutputs[1].getFluid() != null)) { - this.mOutputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(aRecipe.mFluidOutputs[1], true), 138, 5)); + if (mRecipe.mFluidOutputs[1] != null && (mRecipe.mFluidOutputs[1].getFluid() != null)) { + this.mOutputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(mRecipe.mFluidOutputs[1], true), 138, 5)); } - if (aRecipe.mFluidOutputs.length > 2 && aRecipe.mFluidOutputs[2] != null && (aRecipe.mFluidOutputs[2].getFluid() != null)) { - this.mOutputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(aRecipe.mFluidOutputs[2], true), 102, 23)); + if (mRecipe.mFluidOutputs.length > 2 && mRecipe.mFluidOutputs[2] != null && (mRecipe.mFluidOutputs[2].getFluid() != null)) { + this.mOutputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(mRecipe.mFluidOutputs[2], true), 102, 23)); } - if (aRecipe.mFluidOutputs.length > 3 && aRecipe.mFluidOutputs[3] != null && (aRecipe.mFluidOutputs[3].getFluid() != null)) { - this.mOutputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(aRecipe.mFluidOutputs[3], true), 120, 23)); + if (mRecipe.mFluidOutputs.length > 3 && mRecipe.mFluidOutputs[3] != null && (mRecipe.mFluidOutputs[3].getFluid() != null)) { + this.mOutputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(mRecipe.mFluidOutputs[3], true), 120, 23)); } - if (aRecipe.mFluidOutputs.length > 4 && aRecipe.mFluidOutputs[4] != null && (aRecipe.mFluidOutputs[4].getFluid() != null)) { - this.mOutputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(aRecipe.mFluidOutputs[4], true), 138, 23)); + if (mRecipe.mFluidOutputs.length > 4 && mRecipe.mFluidOutputs[4] != null && (mRecipe.mFluidOutputs[4].getFluid() != null)) { + this.mOutputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(mRecipe.mFluidOutputs[4], true), 138, 23)); } - } else if ((aRecipe.mFluidOutputs.length > 0) && (aRecipe.mFluidOutputs[0] != null) && (aRecipe.mFluidOutputs[0].getFluid() != null)) { - this.mOutputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(aRecipe.mFluidOutputs[0], true), 102, 52)); - } - + } else if ((mRecipe.mFluidOutputs.length > 0) && (mRecipe.mFluidOutputs[0] != null) && (mRecipe.mFluidOutputs[0].getFluid() != null)) { + this.mOutputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(mRecipe.mFluidOutputs[0], true), 102, 52)); + } } @Override diff --git a/src/Java/gtPlusPlus/nei/GT_NEI_FlotationCell.java b/src/Java/gtPlusPlus/nei/GT_NEI_FlotationCell.java index c4eff20a27..ca12e1c740 100644 --- a/src/Java/gtPlusPlus/nei/GT_NEI_FlotationCell.java +++ b/src/Java/gtPlusPlus/nei/GT_NEI_FlotationCell.java @@ -1,63 +1,14 @@ package gtPlusPlus.nei; -import java.awt.Point; -import java.awt.Rectangle; -import java.util.*; - -import org.lwjgl.opengl.GL11; - -import codechicken.lib.gui.GuiDraw; -import codechicken.nei.PositionedStack; -import codechicken.nei.guihook.GuiContainerManager; -import codechicken.nei.guihook.IContainerInputHandler; -import codechicken.nei.guihook.IContainerTooltipHandler; -import codechicken.nei.recipe.*; -import cpw.mods.fml.common.event.FMLInterModComms; -import gregtech.api.enums.GT_Values; -import gregtech.api.enums.OrePrefixes; -import gregtech.api.gui.GT_GUIContainer_BasicMachine; -import gregtech.api.objects.ItemData; -import gregtech.api.util.*; -import gregtech.api.util.GT_Recipe.GT_Recipe_Map; +import codechicken.nei.recipe.TemplateRecipeHandler; import gregtech.api.util.GTPP_Recipe.GTPP_Recipe_Map; -import gtPlusPlus.core.util.minecraft.ItemUtils; -import net.minecraft.client.Minecraft; -import net.minecraft.client.gui.inventory.GuiContainer; -import net.minecraft.init.Blocks; -import net.minecraft.item.ItemStack; -import net.minecraftforge.fluids.FluidContainerRegistry; -import net.minecraftforge.fluids.FluidStack; - -public class GT_NEI_FlotationCell -extends TemplateRecipeHandler { - public static final int sOffsetX = 5; - public static final int sOffsetY = 11; - - static { - GuiContainerManager.addInputHandler(new GT_RectHandler()); - GuiContainerManager.addTooltipHandler(new GT_RectHandler()); - } +import gregtech.api.util.GT_Recipe; +import gregtech.api.util.GT_Utility; - protected GT_Recipe_Map mRecipeMap; +public class GT_NEI_FlotationCell extends GTPP_NEI_DefaultHandler { public GT_NEI_FlotationCell() { - this.mRecipeMap = GTPP_Recipe_Map.sFlotationCellRecipes; - this.transferRects.add(new TemplateRecipeHandler.RecipeTransferRect(new Rectangle(65, 13, 36, 18), this.getRecipeMapName(), new Object[0])); - if (!NEI_GT_Config.sIsAdded) { - FMLInterModComms.sendRuntimeMessage(GT_Values.GT, "NEIPlugins", "register-crafting-handler", "gregtechplusplus@" + this.getRecipeName() + "@" + this.getRecipeMapName()); - GuiCraftingRecipe.craftinghandlers.add(this); - GuiUsageRecipe.usagehandlers.add(this); - } - } - - public List getSortedRecipes() { - List result = new ArrayList(this.mRecipeMap.mRecipeList); - Collections.sort(result); - return result; - } - - public static void drawText(final int aX, final int aY, final String aString, final int aColor) { - Minecraft.getMinecraft().fontRenderer.drawString(aString, aX, aY, aColor); + super(GTPP_Recipe_Map.sFlotationCellRecipes); } @Override @@ -66,397 +17,84 @@ extends TemplateRecipeHandler { } @Override - public void loadCraftingRecipes(final String outputId, final Object... results) { - if (outputId.equals(getRecipeMapName())) { - for (GTPP_Recipe tRecipe : getSortedRecipes()) { - if (!tRecipe.mHidden) { - this.arecipes.add(new CachedDefaultRecipe(tRecipe)); - } - } - } else { - super.loadCraftingRecipes(outputId, results); - } - } - - @Override - public void loadCraftingRecipes(final ItemStack aResult) { - ItemData tPrefixMaterial = GT_OreDictUnificator.getAssociation(aResult); - - ArrayList tResults = new ArrayList(); - tResults.add(aResult); - tResults.add(GT_OreDictUnificator.get(true, aResult)); - if ((tPrefixMaterial != null) && (!tPrefixMaterial.mBlackListed) && (!tPrefixMaterial.mPrefix.mFamiliarPrefixes.isEmpty())) { - for (OrePrefixes tPrefix : tPrefixMaterial.mPrefix.mFamiliarPrefixes) { - tResults.add(GT_OreDictUnificator.get(tPrefix, tPrefixMaterial.mMaterial.mMaterial, 1L)); - } - } - FluidStack tFluid = GT_Utility.getFluidForFilledItem(aResult, true); - if (tFluid != null) { - tResults.add(GT_Utility.getFluidDisplayStack(tFluid, false)); - for (FluidContainerRegistry.FluidContainerData tData : FluidContainerRegistry.getRegisteredFluidContainerData()) { - if (tData.fluid.isFluidEqual(tFluid)) { - tResults.add(GT_Utility.copy(new Object[]{tData.filledContainer})); - } - } - } - for (GTPP_Recipe tRecipe : getSortedRecipes()) { - if (!tRecipe.mHidden) { - CachedDefaultRecipe tNEIRecipe = new CachedDefaultRecipe(tRecipe); - for (ItemStack tStack : tResults) { - if (tNEIRecipe.contains(tNEIRecipe.mOutputs, tStack)) { - this.arecipes.add(tNEIRecipe); - break; - } - } - } - } - //CachedDefaultRecipe tNEIRecipe; - } - - public void loadUsageRecipes(ItemStack aInput) { - ItemData tPrefixMaterial = GT_OreDictUnificator.getAssociation(aInput); - - ArrayList tInputs = new ArrayList(); - tInputs.add(aInput); - tInputs.add(GT_OreDictUnificator.get(false, aInput)); - if ((tPrefixMaterial != null) && (!tPrefixMaterial.mPrefix.mFamiliarPrefixes.isEmpty())) { - for (OrePrefixes tPrefix : tPrefixMaterial.mPrefix.mFamiliarPrefixes) { - tInputs.add(GT_OreDictUnificator.get(tPrefix, tPrefixMaterial.mMaterial.mMaterial, 1L)); - } - } - FluidStack tFluid = GT_Utility.getFluidForFilledItem(aInput, true); - if (tFluid != null) { - tInputs.add(GT_Utility.getFluidDisplayStack(tFluid, false)); - for (FluidContainerRegistry.FluidContainerData tData : FluidContainerRegistry.getRegisteredFluidContainerData()) { - if (tData.fluid.isFluidEqual(tFluid)) { - tInputs.add(GT_Utility.copy(new Object[]{tData.filledContainer})); - } - } - } - for (GTPP_Recipe tRecipe : getSortedRecipes()) { - if (!tRecipe.mHidden) { - CachedDefaultRecipe tNEIRecipe = new CachedDefaultRecipe(tRecipe); - for (ItemStack tStack : tInputs) { - if (tNEIRecipe.contains(tNEIRecipe.mInputs, tStack)) { - this.arecipes.add(tNEIRecipe); - break; - } - } - } - } - //CachedDefaultRecipe tNEIRecipe; - } - - public String getRecipeMapName() { - return this.mRecipeMap.mNEIName; - } - - @Override - public String getOverlayIdentifier() { - return this.mRecipeMap.mNEIName; - } - - @Override - public void drawBackground(final int recipe) { - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - GuiDraw.changeTexture(this.getGuiTexture()); - GuiDraw.drawTexturedModalRect(-4, -8, 1, 3, 174, 78); - } - - @Override - public int recipiesPerPage() { - return 1; - } - - @Override - public String getRecipeName() { - return GT_LanguageManager.getTranslation(this.mRecipeMap.mUnlocalizedName); - } - - @Override - public String getGuiTexture() { - return this.mRecipeMap.mNEIGUIPath; - } - - @Override - public List handleItemTooltip(final GuiRecipe gui, final ItemStack aStack, final List currenttip, final int aRecipeIndex) { - final TemplateRecipeHandler.CachedRecipe tObject = this.arecipes.get(aRecipeIndex); - if ((tObject instanceof CachedDefaultRecipe)) { - final CachedDefaultRecipe tRecipe = (CachedDefaultRecipe) tObject; - for (final PositionedStack tStack : tRecipe.mOutputs) { - if (aStack == tStack.item) { - if ((!(tStack instanceof FixedPositionedStack)) || (((FixedPositionedStack) tStack).mChance <= 0) || (((FixedPositionedStack) tStack).mChance == 10000)) { - break; - } - currenttip.add("Chance: " + (((FixedPositionedStack) tStack).mChance / 100) + "." + ((((FixedPositionedStack) tStack).mChance % 100) < 10 ? "0" + (((FixedPositionedStack) tStack).mChance % 100) : Integer.valueOf(((FixedPositionedStack) tStack).mChance % 100)) + "%"); - break; - } - } - for (final PositionedStack tStack : tRecipe.mInputs) { - if (GT_Utility.areStacksEqual(aStack, tStack.item)) { - if ((gregtech.api.enums.ItemList.Display_Fluid.isStackEqual(tStack.item, true, true)) || - (tStack.item.stackSize != 0)) { - break; - } - if (ItemUtils.isControlCircuit(aStack)) { - currenttip.add("Does not get consumed in the process"); - } - break; - } - } - } - return currenttip; - } - - @Override - public void drawExtras(final int aRecipeIndex) { - final long tEUt = ((CachedDefaultRecipe) this.arecipes.get(aRecipeIndex)).mRecipe.mEUt; - final int tDuration = ((CachedDefaultRecipe) this.arecipes.get(aRecipeIndex)).mRecipe.mDuration; - if (tEUt != 0) { - drawText(10, 73, "Total: " + (long) (tDuration * tEUt) + " EU", -16777216); - //drawText(10, 83, "Usage: " + tEUt + " EU/t", -16777216); - if (this.mRecipeMap.mShowVoltageAmperageInNEI) { - drawText(10, 83, "Voltage: " + (tEUt / this.mRecipeMap.mAmperage) + " EU/t", -16777216); - drawText(10, 93, "Amperage: " + this.mRecipeMap.mAmperage, -16777216); - } else { - drawText(10, 93, "Voltage: unspecified", -16777216); - drawText(10, 103, "Amperage: unspecified", -16777216); - } - } - if (tDuration > 0) { - drawText(10, 103, "Time: " + (tDuration < 20 ? "< 1" : Integer.valueOf(tDuration / 20)) + " secs", -16777216); - } - //if ((GT_Utility.isStringValid(this.mRecipeMap.mNEISpecialValuePre)) || (GT_Utility.isStringValid(this.mRecipeMap.mNEISpecialValuePost))) { - //drawText(10, 113, this.mRecipeMap.mNEISpecialValuePre + (((CachedDefaultRecipe) this.arecipes.get(aRecipeIndex)).mRecipe.mSpecialValue * this.mRecipeMap.mNEISpecialValueMultiplier) + this.mRecipeMap.mNEISpecialValuePost, -16777216); - //} - } + public CachedDefaultRecipe createCachedRecipe(GT_Recipe aRecipe) { + return new FlotationCellDefaultRecipe(aRecipe); + } - public static class GT_RectHandler - implements IContainerInputHandler, IContainerTooltipHandler { - @Override - public boolean mouseClicked(final GuiContainer gui, final int mousex, final int mousey, final int button) { - if (this.canHandle(gui)) { - if (button == 0) { - return this.transferRect(gui, false); - } - if (button == 1) { - return this.transferRect(gui, true); - } - } - return false; - } + public class FlotationCellDefaultRecipe extends CachedDefaultRecipe { - @Override - public boolean lastKeyTyped(final GuiContainer gui, final char keyChar, final int keyCode) { - return false; - } - - public boolean canHandle(final GuiContainer gui) { - return (((gui instanceof GT_GUIContainer_BasicMachine)) && (GT_Utility.isStringValid(((GT_GUIContainer_BasicMachine) gui).mNEI)) /*|| ((gui instanceof GT_GUIContainer_FusionReactor)) && (GT_Utility.isStringValid(((GT_GUIContainer_FusionReactor) gui).mNEI))*/); + public FlotationCellDefaultRecipe(final GT_Recipe aRecipe) { + super(aRecipe); } @Override - public List handleTooltip(final GuiContainer gui, final int mousex, final int mousey, final List currenttip) { - if ((this.canHandle(gui)) && (currenttip.isEmpty())) { - if ((gui instanceof GT_GUIContainer_BasicMachine) && new Rectangle(65, 13, 36, 18).contains(new Point(GuiDraw.getMousePosition().x - ((GT_GUIContainer_BasicMachine) gui).getLeft() - codechicken.nei.recipe.RecipeInfo.getGuiOffset(gui)[0], GuiDraw.getMousePosition().y - ((GT_GUIContainer_BasicMachine) gui).getTop() - codechicken.nei.recipe.RecipeInfo.getGuiOffset(gui)[1]))) { - currenttip.add("Recipes"); - } /*else if (gui instanceof GT_GUIContainer_FusionReactor && new Rectangle(145, 0, 24, 24).contains(new Point(GuiDraw.getMousePosition().x - ((GT_GUIContainer_FusionReactor) gui).getLeft() - codechicken.nei.recipe.RecipeInfo.getGuiOffset(gui)[0], GuiDraw.getMousePosition().y - ((GT_GUIContainer_FusionReactor) gui).getTop() - codechicken.nei.recipe.RecipeInfo.getGuiOffset(gui)[1]))) { - currenttip.add("Recipes"); - }*/ + public void handleSlots() { + int tStartIndex = 0; - } - return currenttip; - } - - private boolean transferRect(final GuiContainer gui, final boolean usage) { - if (gui instanceof GT_GUIContainer_BasicMachine) { - return (this.canHandle(gui)) && (new Rectangle(65, 13, 36, 18).contains(new Point(GuiDraw.getMousePosition().x - ((GT_GUIContainer_BasicMachine) gui).getLeft() - codechicken.nei.recipe.RecipeInfo.getGuiOffset(gui)[0], GuiDraw.getMousePosition().y - ((GT_GUIContainer_BasicMachine) gui).getTop() - codechicken.nei.recipe.RecipeInfo.getGuiOffset(gui)[1]))) && (usage ? GuiUsageRecipe.openRecipeGui(((GT_GUIContainer_BasicMachine) gui).mNEI, new Object[0]) : GuiCraftingRecipe.openRecipeGui(((GT_GUIContainer_BasicMachine) gui).mNEI, new Object[0])); - } /*else if (gui instanceof GT_GUIContainer_FusionReactor) { - return (canHandle(gui)) && (new Rectangle(145, 0, 24, 24).contains(new Point(GuiDraw.getMousePosition().x - ((GT_GUIContainer_FusionReactor) gui).getLeft() - codechicken.nei.recipe.RecipeInfo.getGuiOffset(gui)[0], GuiDraw.getMousePosition().y - ((GT_GUIContainer_FusionReactor) gui).getTop() - codechicken.nei.recipe.RecipeInfo.getGuiOffset(gui)[1]))) && (usage ? GuiUsageRecipe.openRecipeGui(((GT_GUIContainer_FusionReactor) gui).mNEI, new Object[0]) : GuiCraftingRecipe.openRecipeGui(((GT_GUIContainer_FusionReactor) gui).mNEI, new Object[0])); - }*/ - return false; - } - - @Override - public List handleItemDisplayName(final GuiContainer gui, final ItemStack itemstack, final List currenttip) { - return currenttip; - } - - @Override - public List handleItemTooltip(final GuiContainer gui, final ItemStack itemstack, final int mousex, final int mousey, final List currenttip) { - return currenttip; - } - - @Override - public boolean keyTyped(final GuiContainer gui, final char keyChar, final int keyCode) { - return false; - } - - @Override - public void onKeyTyped(final GuiContainer gui, final char keyChar, final int keyID) { - } - - @Override - public void onMouseClicked(final GuiContainer gui, final int mousex, final int mousey, final int button) { - } - - @Override - public void onMouseUp(final GuiContainer gui, final int mousex, final int mousey, final int button) { - } - - @Override - public boolean mouseScrolled(final GuiContainer gui, final int mousex, final int mousey, final int scrolled) { - return false; - } - - @Override - public void onMouseScrolled(final GuiContainer gui, final int mousex, final int mousey, final int scrolled) { - } - - @Override - public void onMouseDragged(final GuiContainer gui, final int mousex, final int mousey, final int button, final long heldTime) { - } - } - - public class FixedPositionedStack - extends PositionedStack { - public final int mChance; - public boolean permutated = false; - - public FixedPositionedStack(final Object object, final int x, final int y) { - this(object, x, y, 0); - } - - public FixedPositionedStack(final Object object, final int x, final int y, final int aChance) { - super(object, x, y, true); - this.mChance = aChance; - } - - @Override - public void generatePermutations() { - if (this.permutated) { - return; - } - final ArrayList tDisplayStacks = new ArrayList(); - for (final ItemStack tStack : this.items) { - if (GT_Utility.isStackValid(tStack)) { - if (tStack.getItemDamage() == 32767) { - final List permutations = codechicken.nei.ItemList.itemMap.get(tStack.getItem()); - if (!permutations.isEmpty()) { - ItemStack stack; - for (final Iterator i$ = permutations.iterator(); i$.hasNext(); tDisplayStacks.add(GT_Utility.copyAmount(tStack.stackSize, new Object[]{stack}))) { - stack = i$.next(); - } - } else { - final ItemStack base = new ItemStack(tStack.getItem(), tStack.stackSize); - base.stackTagCompound = tStack.stackTagCompound; - tDisplayStacks.add(base); - } - } else { - tDisplayStacks.add(GT_Utility.copy(new Object[]{tStack})); - } - } - } - this.items = (tDisplayStacks.toArray(new ItemStack[0])); - if (this.items.length == 0) { - this.items = new ItemStack[]{new ItemStack(Blocks.fire)}; - } - this.permutated = true; - this.setPermutationToRender(0); - } - } - - public class CachedDefaultRecipe - extends TemplateRecipeHandler.CachedRecipe { - public final GT_Recipe mRecipe; - public final List mOutputs = new ArrayList(); - public final List mInputs = new ArrayList(); - - public CachedDefaultRecipe(final GT_Recipe aRecipe) { - super(); - this.mRecipe = aRecipe; - - int tStartIndex = 0; - - - if (aRecipe.getRepresentativeInput(tStartIndex) != null) { - this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 12, 5)); + if (mRecipe.getRepresentativeInput(tStartIndex) != null) { + this.mInputs.add(new FixedPositionedStack(mRecipe.getRepresentativeInput(tStartIndex), 12, 5)); } tStartIndex++; - if (aRecipe.getRepresentativeInput(tStartIndex) != null) { - this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 30, 5)); + if (mRecipe.getRepresentativeInput(tStartIndex) != null) { + this.mInputs.add(new FixedPositionedStack(mRecipe.getRepresentativeInput(tStartIndex), 30, 5)); } tStartIndex++; - if (aRecipe.getRepresentativeInput(tStartIndex) != null) { - this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 48, 5)); + if (mRecipe.getRepresentativeInput(tStartIndex) != null) { + this.mInputs.add(new FixedPositionedStack(mRecipe.getRepresentativeInput(tStartIndex), 48, 5)); } tStartIndex++; - if (aRecipe.getRepresentativeInput(tStartIndex) != null) { - this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 12, 23)); + if (mRecipe.getRepresentativeInput(tStartIndex) != null) { + this.mInputs.add(new FixedPositionedStack(mRecipe.getRepresentativeInput(tStartIndex), 12, 23)); } tStartIndex++; - if (aRecipe.getRepresentativeInput(tStartIndex) != null) { - this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 30, 23)); + if (mRecipe.getRepresentativeInput(tStartIndex) != null) { + this.mInputs.add(new FixedPositionedStack(mRecipe.getRepresentativeInput(tStartIndex), 30, 23)); } tStartIndex++; - if (aRecipe.getRepresentativeInput(tStartIndex) != null) { - this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 48, 23)); + if (mRecipe.getRepresentativeInput(tStartIndex) != null) { + this.mInputs.add(new FixedPositionedStack(mRecipe.getRepresentativeInput(tStartIndex), 48, 23)); } tStartIndex++; - if (aRecipe.mSpecialItems != null) { - this.mInputs.add(new FixedPositionedStack(aRecipe.mSpecialItems, 120, 52)); + if (mRecipe.mSpecialItems != null) { + this.mInputs.add(new FixedPositionedStack(mRecipe.mSpecialItems, 120, 52)); } tStartIndex = 0; //Four Output Slots - if (aRecipe.getOutput(tStartIndex) != null) { - this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 102, 5, aRecipe.getOutputChance(tStartIndex))); + if (mRecipe.getOutput(tStartIndex) != null) { + this.mOutputs.add(new FixedPositionedStack(mRecipe.getOutput(tStartIndex), 102, 5, mRecipe.getOutputChance(tStartIndex))); } tStartIndex++; - if (aRecipe.getOutput(tStartIndex) != null) { - this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 120, 5, aRecipe.getOutputChance(tStartIndex))); + if (mRecipe.getOutput(tStartIndex) != null) { + this.mOutputs.add(new FixedPositionedStack(mRecipe.getOutput(tStartIndex), 120, 5, mRecipe.getOutputChance(tStartIndex))); } tStartIndex++; - if (aRecipe.getOutput(tStartIndex) != null) { - this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 102, 23, aRecipe.getOutputChance(tStartIndex))); + if (mRecipe.getOutput(tStartIndex) != null) { + this.mOutputs.add(new FixedPositionedStack(mRecipe.getOutput(tStartIndex), 102, 23, mRecipe.getOutputChance(tStartIndex))); } tStartIndex++; - if (aRecipe.getOutput(tStartIndex) != null) { - this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 120, 23, aRecipe.getOutputChance(tStartIndex))); + if (mRecipe.getOutput(tStartIndex) != null) { + this.mOutputs.add(new FixedPositionedStack(mRecipe.getOutput(tStartIndex), 120, 23, mRecipe.getOutputChance(tStartIndex))); } tStartIndex++; - if ((aRecipe.mFluidInputs.length > 0) && (aRecipe.mFluidInputs[0] != null) && (aRecipe.mFluidInputs[0].getFluid() != null)) { - this.mInputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(aRecipe.mFluidInputs[0], true), 30, 52)); - if ((aRecipe.mFluidInputs.length > 1) && (aRecipe.mFluidInputs[1] != null) && (aRecipe.mFluidInputs[1].getFluid() != null)) { - this.mInputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(aRecipe.mFluidInputs[1], true), 48, 52)); + if ((mRecipe.mFluidInputs.length > 0) && (mRecipe.mFluidInputs[0] != null) && (mRecipe.mFluidInputs[0].getFluid() != null)) { + this.mInputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(mRecipe.mFluidInputs[0], true), 30, 52)); + if ((mRecipe.mFluidInputs.length > 1) && (mRecipe.mFluidInputs[1] != null) && (mRecipe.mFluidInputs[1].getFluid() != null)) { + this.mInputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(mRecipe.mFluidInputs[1], true), 48, 52)); } } - if (aRecipe.mFluidOutputs.length > 0) { - if ((aRecipe.mFluidOutputs[0] != null) && (aRecipe.mFluidOutputs[0].getFluid() != null)) { - this.mOutputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(aRecipe.mFluidOutputs[0], true), 102, 52)); + if (mRecipe.mFluidOutputs.length > 0) { + if ((mRecipe.mFluidOutputs[0] != null) && (mRecipe.mFluidOutputs[0].getFluid() != null)) { + this.mOutputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(mRecipe.mFluidOutputs[0], true), 102, 52)); } - if ((aRecipe.mFluidOutputs.length > 1) && (aRecipe.mFluidOutputs[1] != null) && (aRecipe.mFluidOutputs[1].getFluid() != null)) { - this.mOutputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(aRecipe.mFluidOutputs[1], true), 120, 52)); + if ((mRecipe.mFluidOutputs.length > 1) && (mRecipe.mFluidOutputs[1] != null) && (mRecipe.mFluidOutputs[1].getFluid() != null)) { + this.mOutputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(mRecipe.mFluidOutputs[1], true), 120, 52)); } } } - - @Override - public List getIngredients() { - return this.getCycledIngredients(GT_NEI_FlotationCell.this.cycleticks / 10, this.mInputs); - } - - @Override - public PositionedStack getResult() { - return null; - } - - @Override - public List getOtherStacks() { - return this.mOutputs; - } + } } diff --git a/src/Java/gtPlusPlus/nei/GT_NEI_FluidReactor.java b/src/Java/gtPlusPlus/nei/GT_NEI_FluidReactor.java index 213d022478..7ef76f68b2 100644 --- a/src/Java/gtPlusPlus/nei/GT_NEI_FluidReactor.java +++ b/src/Java/gtPlusPlus/nei/GT_NEI_FluidReactor.java @@ -1,72 +1,21 @@ package gtPlusPlus.nei; -import java.awt.Point; -import java.awt.Rectangle; -import java.util.ArrayList; -import java.util.Collections; -import java.util.Iterator; import java.util.List; -import org.lwjgl.opengl.GL11; - -import codechicken.lib.gui.GuiDraw; import codechicken.nei.PositionedStack; -import codechicken.nei.guihook.GuiContainerManager; -import codechicken.nei.guihook.IContainerInputHandler; -import codechicken.nei.guihook.IContainerTooltipHandler; -import codechicken.nei.recipe.GuiCraftingRecipe; import codechicken.nei.recipe.GuiRecipe; -import codechicken.nei.recipe.GuiUsageRecipe; import codechicken.nei.recipe.TemplateRecipeHandler; -import cpw.mods.fml.common.event.FMLInterModComms; -import gregtech.api.enums.GT_Values; -import gregtech.api.enums.OrePrefixes; -import gregtech.api.gui.GT_GUIContainer_BasicMachine; -import gregtech.api.objects.ItemData; -import gregtech.api.util.GT_OreDictUnificator; +import gregtech.api.util.GTPP_Recipe.GTPP_Recipe_Map; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; -import gregtech.api.util.GTPP_Recipe; -import gregtech.api.util.GTPP_Recipe.GTPP_Recipe_Map; -import gtPlusPlus.core.lib.CORE; +import gtPlusPlus.core.util.math.MathUtils; import gtPlusPlus.core.util.minecraft.ItemUtils; -import net.minecraft.client.Minecraft; -import net.minecraft.client.gui.inventory.GuiContainer; -import net.minecraft.init.Blocks; import net.minecraft.item.ItemStack; -import net.minecraftforge.fluids.FluidContainerRegistry; -import net.minecraftforge.fluids.FluidStack; - -public class GT_NEI_FluidReactor -extends TemplateRecipeHandler { - public static final int sOffsetX = 5; - public static final int sOffsetY = 11; - static { - GuiContainerManager.addInputHandler(new GT_RectHandler()); - GuiContainerManager.addTooltipHandler(new GT_RectHandler()); - } - - protected GTPP_Recipe_Map mRecipeMap; +public class GT_NEI_FluidReactor extends GTPP_NEI_DefaultHandler { public GT_NEI_FluidReactor() { - this.mRecipeMap = GTPP_Recipe_Map.sChemicalPlantRecipes; - this.transferRects.add(new TemplateRecipeHandler.RecipeTransferRect(new Rectangle(65, 13, 36, 18), this.getRecipeMapName(), new Object[0])); - if (!NEI_GT_Config.sIsAdded) { - FMLInterModComms.sendRuntimeMessage(GT_Values.GT, "NEIPlugins", "register-crafting-handler", "gregtechplusplus@" + this.getRecipeName() + "@" + this.getRecipeMapName()); - GuiCraftingRecipe.craftinghandlers.add(this); - GuiUsageRecipe.usagehandlers.add(this); - } - } - - public List getSortedRecipes() { - List result = new ArrayList(this.mRecipeMap.mRecipeList); - Collections.sort(result); - return result; - } - - public static void drawText(final int aX, final int aY, final String aString, final int aColor) { - Minecraft.getMinecraft().fontRenderer.drawString(aString, aX, aY, aColor); + super(GTPP_Recipe_Map.sChemicalPlantRecipes); } @Override @@ -75,125 +24,15 @@ extends TemplateRecipeHandler { } @Override - public void loadCraftingRecipes(final String outputId, final Object... results) { - if (outputId.equals(getRecipeMapName())) { - for (GTPP_Recipe tRecipe : getSortedRecipes()) { - if (!tRecipe.mHidden) { - this.arecipes.add(new CachedDefaultRecipe(tRecipe)); - } - } - } else { - super.loadCraftingRecipes(outputId, results); - } - } - - @Override - public void loadCraftingRecipes(final ItemStack aResult) { - ItemData tPrefixMaterial = GT_OreDictUnificator.getAssociation(aResult); - - ArrayList tResults = new ArrayList(); - tResults.add(aResult); - tResults.add(GT_OreDictUnificator.get(true, aResult)); - if ((tPrefixMaterial != null) && (!tPrefixMaterial.mBlackListed) && (!tPrefixMaterial.mPrefix.mFamiliarPrefixes.isEmpty())) { - for (OrePrefixes tPrefix : tPrefixMaterial.mPrefix.mFamiliarPrefixes) { - tResults.add(GT_OreDictUnificator.get(tPrefix, tPrefixMaterial.mMaterial.mMaterial, 1L)); - } - } - FluidStack tFluid = GT_Utility.getFluidForFilledItem(aResult, true); - if (tFluid != null) { - tResults.add(GT_Utility.getFluidDisplayStack(tFluid, false)); - for (FluidContainerRegistry.FluidContainerData tData : FluidContainerRegistry.getRegisteredFluidContainerData()) { - if (tData.fluid.isFluidEqual(tFluid)) { - tResults.add(GT_Utility.copy(new Object[]{tData.filledContainer})); - } - } - } - for (GTPP_Recipe tRecipe : getSortedRecipes()) { - if (!tRecipe.mHidden) { - CachedDefaultRecipe tNEIRecipe = new CachedDefaultRecipe(tRecipe); - for (ItemStack tStack : tResults) { - if (tNEIRecipe.contains(tNEIRecipe.mOutputs, tStack)) { - this.arecipes.add(tNEIRecipe); - break; - } - } - } - } - //CachedDefaultRecipe tNEIRecipe; - } - - public void loadUsageRecipes(ItemStack aInput) { - ItemData tPrefixMaterial = GT_OreDictUnificator.getAssociation(aInput); - - ArrayList tInputs = new ArrayList(); - tInputs.add(aInput); - tInputs.add(GT_OreDictUnificator.get(false, aInput)); - if ((tPrefixMaterial != null) && (!tPrefixMaterial.mPrefix.mFamiliarPrefixes.isEmpty())) { - for (OrePrefixes tPrefix : tPrefixMaterial.mPrefix.mFamiliarPrefixes) { - tInputs.add(GT_OreDictUnificator.get(tPrefix, tPrefixMaterial.mMaterial.mMaterial, 1L)); - } - } - FluidStack tFluid = GT_Utility.getFluidForFilledItem(aInput, true); - if (tFluid != null) { - tInputs.add(GT_Utility.getFluidDisplayStack(tFluid, false)); - for (FluidContainerRegistry.FluidContainerData tData : FluidContainerRegistry.getRegisteredFluidContainerData()) { - if (tData.fluid.isFluidEqual(tFluid)) { - tInputs.add(GT_Utility.copy(new Object[]{tData.filledContainer})); - } - } - } - for (GTPP_Recipe tRecipe : getSortedRecipes()) { - if (!tRecipe.mHidden) { - CachedDefaultRecipe tNEIRecipe = new CachedDefaultRecipe(tRecipe); - for (ItemStack tStack : tInputs) { - if (tNEIRecipe.contains(tNEIRecipe.mInputs, tStack)) { - this.arecipes.add(tNEIRecipe); - break; - } - } - } - } - //CachedDefaultRecipe tNEIRecipe; - } - - public String getRecipeMapName() { - return this.mRecipeMap.mNEIName; - } - - @Override - public String getOverlayIdentifier() { - //return this.mRecipeMap.mNEIName; - return ""; - } - - @Override - public void drawBackground(final int recipe) { - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - GuiDraw.changeTexture(this.getGuiTexture()); - GuiDraw.drawTexturedModalRect(-4, -8, 1, 3, 174, 78); - } - - @Override - public int recipiesPerPage() { - return 1; - } - - @Override - public String getRecipeName() { - //return GT_LanguageManager.getTranslation(this.mRecipeMap.mUnlocalizedName); - return " Chem Plant"; - } - - @Override - public String getGuiTexture() { - return CORE.MODID+":textures/gui/FluidReactor.png"; - } + public CachedDefaultRecipe createCachedRecipe(GT_Recipe aRecipe) { + return new ChemPlantDefaultRecipe(aRecipe); + } @Override public List handleItemTooltip(final GuiRecipe gui, final ItemStack aStack, final List currenttip, final int aRecipeIndex) { final TemplateRecipeHandler.CachedRecipe tObject = this.arecipes.get(aRecipeIndex); - if ((tObject instanceof CachedDefaultRecipe)) { - final CachedDefaultRecipe tRecipe = (CachedDefaultRecipe) tObject; + if ((tObject instanceof ChemPlantDefaultRecipe)) { + final ChemPlantDefaultRecipe tRecipe = (ChemPlantDefaultRecipe) tObject; for (final PositionedStack tStack : tRecipe.mOutputs) { if (aStack == tStack.item) { if ((!(tStack instanceof FixedPositionedStack)) || (((FixedPositionedStack) tStack).mChance <= 0) || (((FixedPositionedStack) tStack).mChance == 10000)) { @@ -225,13 +64,13 @@ extends TemplateRecipeHandler { @Override public void drawExtras(final int aRecipeIndex) { - final long tEUt = ((CachedDefaultRecipe) this.arecipes.get(aRecipeIndex)).mRecipe.mEUt; - final int tDuration = ((CachedDefaultRecipe) this.arecipes.get(aRecipeIndex)).mRecipe.mDuration; + final long tEUt = ((ChemPlantDefaultRecipe) this.arecipes.get(aRecipeIndex)).mRecipe.mEUt; + final int tDuration = ((ChemPlantDefaultRecipe) this.arecipes.get(aRecipeIndex)).mRecipe.mDuration; if (tEUt != 0) { - drawText(10, 73, "Total: " + (long) (tDuration * tEUt) + " EU", -16777216); + drawText(10, 73, "Total: " + MathUtils.formatNumbers((long) (tDuration * tEUt)) + " EU", -16777216); //drawText(10, 83, "Usage: " + tEUt + " EU/t", -16777216); if (this.mRecipeMap.mShowVoltageAmperageInNEI) { - drawText(10, 83, "Voltage: " + (tEUt / this.mRecipeMap.mAmperage) + " EU/t", -16777216); + drawText(10, 83, "Voltage: " + MathUtils.formatNumbers((tEUt / this.mRecipeMap.mAmperage)) + " EU/t", -16777216); drawText(10, 93, "Amperage: " + this.mRecipeMap.mAmperage, -16777216); } else { drawText(10, 93, "Voltage: unspecified", -16777216); @@ -239,10 +78,10 @@ extends TemplateRecipeHandler { } } if (tDuration > 0) { - drawText(10, 103, "Time: " + (tDuration < 20 ? "< 1" : Integer.valueOf(tDuration / 20)) + " secs", -16777216); + drawText(10, 103, "Time: " + (tDuration < 20 ? "< 1" : MathUtils.formatNumbers(Integer.valueOf(tDuration / 20))) + " secs", -16777216); } if ((GT_Utility.isStringValid(this.mRecipeMap.mNEISpecialValuePre)) || (GT_Utility.isStringValid(this.mRecipeMap.mNEISpecialValuePost))) { - int aTier = (((CachedDefaultRecipe) this.arecipes.get(aRecipeIndex)).mRecipe.mSpecialValue); + int aTier = (((ChemPlantDefaultRecipe) this.arecipes.get(aRecipeIndex)).mRecipe.mSpecialValue); String aTierMaterial = " - "; if (aTier <= 0) { aTierMaterial += "Bronze"; @@ -269,239 +108,88 @@ extends TemplateRecipeHandler { aTierMaterial += "Botmium"; } - drawText(10, 113, this.mRecipeMap.mNEISpecialValuePre + (((CachedDefaultRecipe) this.arecipes.get(aRecipeIndex)).mRecipe.mSpecialValue * this.mRecipeMap.mNEISpecialValueMultiplier) + aTierMaterial, -16777216); + drawText(10, 113, this.mRecipeMap.mNEISpecialValuePre + (((ChemPlantDefaultRecipe) this.arecipes.get(aRecipeIndex)).mRecipe.mSpecialValue * this.mRecipeMap.mNEISpecialValueMultiplier) + aTierMaterial, -16777216); } } - public static class GT_RectHandler - implements IContainerInputHandler, IContainerTooltipHandler { - @Override - public boolean mouseClicked(final GuiContainer gui, final int mousex, final int mousey, final int button) { - if (this.canHandle(gui)) { - if (button == 0) { - return this.transferRect(gui, false); - } - if (button == 1) { - return this.transferRect(gui, true); - } - } - return false; - } + public class ChemPlantDefaultRecipe extends CachedDefaultRecipe { - @Override - public boolean lastKeyTyped(final GuiContainer gui, final char keyChar, final int keyCode) { - return false; + public ChemPlantDefaultRecipe(final GT_Recipe aRecipe) { + super(aRecipe); } - - public boolean canHandle(final GuiContainer gui) { - return (((gui instanceof GT_GUIContainer_BasicMachine)) && (GT_Utility.isStringValid(((GT_GUIContainer_BasicMachine) gui).mNEI)) /*|| ((gui instanceof GT_GUIContainer_FusionReactor)) && (GT_Utility.isStringValid(((GT_GUIContainer_FusionReactor) gui).mNEI))*/); - } - - @Override - public List handleTooltip(final GuiContainer gui, final int mousex, final int mousey, final List currenttip) { - if ((this.canHandle(gui)) && (currenttip.isEmpty())) { - if ((gui instanceof GT_GUIContainer_BasicMachine) && new Rectangle(65, 13, 36, 18).contains(new Point(GuiDraw.getMousePosition().x - ((GT_GUIContainer_BasicMachine) gui).getLeft() - codechicken.nei.recipe.RecipeInfo.getGuiOffset(gui)[0], GuiDraw.getMousePosition().y - ((GT_GUIContainer_BasicMachine) gui).getTop() - codechicken.nei.recipe.RecipeInfo.getGuiOffset(gui)[1]))) { - currenttip.add("Recipes"); - } /*else if (gui instanceof GT_GUIContainer_FusionReactor && new Rectangle(145, 0, 24, 24).contains(new Point(GuiDraw.getMousePosition().x - ((GT_GUIContainer_FusionReactor) gui).getLeft() - codechicken.nei.recipe.RecipeInfo.getGuiOffset(gui)[0], GuiDraw.getMousePosition().y - ((GT_GUIContainer_FusionReactor) gui).getTop() - codechicken.nei.recipe.RecipeInfo.getGuiOffset(gui)[1]))) { - currenttip.add("Recipes"); - }*/ - - } - return currenttip; - } - - private boolean transferRect(final GuiContainer gui, final boolean usage) { - if (gui instanceof GT_GUIContainer_BasicMachine) { - return (this.canHandle(gui)) && (new Rectangle(65, 13, 36, 18).contains(new Point(GuiDraw.getMousePosition().x - ((GT_GUIContainer_BasicMachine) gui).getLeft() - codechicken.nei.recipe.RecipeInfo.getGuiOffset(gui)[0], GuiDraw.getMousePosition().y - ((GT_GUIContainer_BasicMachine) gui).getTop() - codechicken.nei.recipe.RecipeInfo.getGuiOffset(gui)[1]))) && (usage ? GuiUsageRecipe.openRecipeGui(((GT_GUIContainer_BasicMachine) gui).mNEI, new Object[0]) : GuiCraftingRecipe.openRecipeGui(((GT_GUIContainer_BasicMachine) gui).mNEI, new Object[0])); - } /*else if (gui instanceof GT_GUIContainer_FusionReactor) { - return (canHandle(gui)) && (new Rectangle(145, 0, 24, 24).contains(new Point(GuiDraw.getMousePosition().x - ((GT_GUIContainer_FusionReactor) gui).getLeft() - codechicken.nei.recipe.RecipeInfo.getGuiOffset(gui)[0], GuiDraw.getMousePosition().y - ((GT_GUIContainer_FusionReactor) gui).getTop() - codechicken.nei.recipe.RecipeInfo.getGuiOffset(gui)[1]))) && (usage ? GuiUsageRecipe.openRecipeGui(((GT_GUIContainer_FusionReactor) gui).mNEI, new Object[0]) : GuiCraftingRecipe.openRecipeGui(((GT_GUIContainer_FusionReactor) gui).mNEI, new Object[0])); - }*/ - return false; - } - - @Override - public List handleItemDisplayName(final GuiContainer gui, final ItemStack itemstack, final List currenttip) { - return currenttip; - } - - @Override - public List handleItemTooltip(final GuiContainer gui, final ItemStack itemstack, final int mousex, final int mousey, final List currenttip) { - return currenttip; - } - + @Override - public boolean keyTyped(final GuiContainer gui, final char keyChar, final int keyCode) { - return false; - } - - @Override - public void onKeyTyped(final GuiContainer gui, final char keyChar, final int keyID) { - } - - @Override - public void onMouseClicked(final GuiContainer gui, final int mousex, final int mousey, final int button) { - } - - @Override - public void onMouseUp(final GuiContainer gui, final int mousex, final int mousey, final int button) { - } - - @Override - public boolean mouseScrolled(final GuiContainer gui, final int mousex, final int mousey, final int scrolled) { - return false; - } - - @Override - public void onMouseScrolled(final GuiContainer gui, final int mousex, final int mousey, final int scrolled) { - } - - @Override - public void onMouseDragged(final GuiContainer gui, final int mousex, final int mousey, final int button, final long heldTime) { - } - } - - public class FixedPositionedStack - extends PositionedStack { - public final int mChance; - public boolean permutated = false; - - public FixedPositionedStack(final Object object, final int x, final int y) { - this(object, x, y, 0); - } - - public FixedPositionedStack(final Object object, final int x, final int y, final int aChance) { - super(object, x, y, true); - this.mChance = aChance; - } - - @Override - public void generatePermutations() { - if (this.permutated) { - return; - } - final ArrayList tDisplayStacks = new ArrayList(); - for (final ItemStack tStack : this.items) { - if (GT_Utility.isStackValid(tStack)) { - if (tStack.getItemDamage() == 32767) { - final List permutations = codechicken.nei.ItemList.itemMap.get(tStack.getItem()); - if (!permutations.isEmpty()) { - ItemStack stack; - for (final Iterator i$ = permutations.iterator(); i$.hasNext(); tDisplayStacks.add(GT_Utility.copyAmount(tStack.stackSize, new Object[]{stack}))) { - stack = i$.next(); - } - } else { - final ItemStack base = new ItemStack(tStack.getItem(), tStack.stackSize); - base.stackTagCompound = tStack.stackTagCompound; - tDisplayStacks.add(base); - } - } else { - tDisplayStacks.add(GT_Utility.copy(new Object[]{tStack})); - } - } - } - this.items = (tDisplayStacks.toArray(new ItemStack[0])); - if (this.items.length == 0) { - this.items = new ItemStack[]{new ItemStack(Blocks.fire)}; - } - this.permutated = true; - this.setPermutationToRender(0); - } - } - - public class CachedDefaultRecipe - extends TemplateRecipeHandler.CachedRecipe { - public final GT_Recipe mRecipe; - public final List mOutputs = new ArrayList(); - public final List mInputs = new ArrayList(); - - public CachedDefaultRecipe(final GT_Recipe aRecipe) { - super(); - this.mRecipe = aRecipe; - - int tStartIndex = 0; + public void handleSlots() { + int tStartIndex = 0; // Four Input Slots - if (aRecipe.getRepresentativeInput(tStartIndex) != null) { - this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 3, -4)); + if (mRecipe.getRepresentativeInput(tStartIndex) != null) { + this.mInputs.add(new FixedPositionedStack(mRecipe.getRepresentativeInput(tStartIndex), 3, -4)); } tStartIndex++; - if (aRecipe.getRepresentativeInput(tStartIndex) != null) { - this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 21, -4)); + if (mRecipe.getRepresentativeInput(tStartIndex) != null) { + this.mInputs.add(new FixedPositionedStack(mRecipe.getRepresentativeInput(tStartIndex), 21, -4)); } tStartIndex++; - if (aRecipe.getRepresentativeInput(tStartIndex) != null) { - this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 39, -4)); + if (mRecipe.getRepresentativeInput(tStartIndex) != null) { + this.mInputs.add(new FixedPositionedStack(mRecipe.getRepresentativeInput(tStartIndex), 39, -4)); } tStartIndex++; - if (aRecipe.getRepresentativeInput(tStartIndex) != null) { - this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 57, -4)); + if (mRecipe.getRepresentativeInput(tStartIndex) != null) { + this.mInputs.add(new FixedPositionedStack(mRecipe.getRepresentativeInput(tStartIndex), 57, -4)); } tStartIndex++; - if (aRecipe.mSpecialItems != null) { - this.mInputs.add(new FixedPositionedStack(aRecipe.mSpecialItems, 120, 52)); + if (mRecipe.mSpecialItems != null) { + this.mInputs.add(new FixedPositionedStack(mRecipe.mSpecialItems, 120, 52)); } tStartIndex = 0; //Four Output Slots - if (aRecipe.getOutput(tStartIndex) != null) { - this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 102, 5, aRecipe.getOutputChance(tStartIndex))); + if (mRecipe.getOutput(tStartIndex) != null) { + this.mOutputs.add(new FixedPositionedStack(mRecipe.getOutput(tStartIndex), 102, 5, mRecipe.getOutputChance(tStartIndex))); } tStartIndex++; - if (aRecipe.getOutput(tStartIndex) != null) { - this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 120, 5, aRecipe.getOutputChance(tStartIndex))); + if (mRecipe.getOutput(tStartIndex) != null) { + this.mOutputs.add(new FixedPositionedStack(mRecipe.getOutput(tStartIndex), 120, 5, mRecipe.getOutputChance(tStartIndex))); } tStartIndex++; - if (aRecipe.getOutput(tStartIndex) != null) { - this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 102, 23, aRecipe.getOutputChance(tStartIndex))); + if (mRecipe.getOutput(tStartIndex) != null) { + this.mOutputs.add(new FixedPositionedStack(mRecipe.getOutput(tStartIndex), 102, 23, mRecipe.getOutputChance(tStartIndex))); } tStartIndex++; - if (aRecipe.getOutput(tStartIndex) != null) { - this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 120, 23, aRecipe.getOutputChance(tStartIndex))); + if (mRecipe.getOutput(tStartIndex) != null) { + this.mOutputs.add(new FixedPositionedStack(mRecipe.getOutput(tStartIndex), 120, 23, mRecipe.getOutputChance(tStartIndex))); } tStartIndex++; //New fluid display behaviour when 3 fluid inputs are detected. (Basically a mix of the code below for outputs an the code above for 9 input slots.) - if (aRecipe.mFluidInputs.length >= 1) { - if ((aRecipe.mFluidInputs[0] != null) && (aRecipe.mFluidInputs[0].getFluid() != null)) { - this.mInputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(aRecipe.mFluidInputs[0], true), 3, 31)); + if (mRecipe.mFluidInputs.length >= 1) { + if ((mRecipe.mFluidInputs[0] != null) && (mRecipe.mFluidInputs[0].getFluid() != null)) { + this.mInputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(mRecipe.mFluidInputs[0], true), 3, 31)); } - if ((aRecipe.mFluidInputs.length > 1) && (aRecipe.mFluidInputs[1] != null) && (aRecipe.mFluidInputs[1].getFluid() != null)) { - this.mInputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(aRecipe.mFluidInputs[1], true), 21, 31)); + if ((mRecipe.mFluidInputs.length > 1) && (mRecipe.mFluidInputs[1] != null) && (mRecipe.mFluidInputs[1].getFluid() != null)) { + this.mInputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(mRecipe.mFluidInputs[1], true), 21, 31)); } - if ((aRecipe.mFluidInputs.length > 2) && (aRecipe.mFluidInputs[2] != null) && (aRecipe.mFluidInputs[2].getFluid() != null)) { - this.mInputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(aRecipe.mFluidInputs[2], true), 39, 31)); + if ((mRecipe.mFluidInputs.length > 2) && (mRecipe.mFluidInputs[2] != null) && (mRecipe.mFluidInputs[2].getFluid() != null)) { + this.mInputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(mRecipe.mFluidInputs[2], true), 39, 31)); } - if ((aRecipe.mFluidInputs.length > 3) && (aRecipe.mFluidInputs[3] != null) && (aRecipe.mFluidInputs[3].getFluid() != null)) { - this.mInputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(aRecipe.mFluidInputs[3], true), 57, 31)); + if ((mRecipe.mFluidInputs.length > 3) && (mRecipe.mFluidInputs[3] != null) && (mRecipe.mFluidInputs[3].getFluid() != null)) { + this.mInputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(mRecipe.mFluidInputs[3], true), 57, 31)); } } - if (aRecipe.mFluidOutputs.length > 0) { - if ((aRecipe.mFluidOutputs[0] != null) && (aRecipe.mFluidOutputs[0].getFluid() != null)) { - this.mOutputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(aRecipe.mFluidOutputs[0], true), 138, 5)); + if (mRecipe.mFluidOutputs.length > 0) { + if ((mRecipe.mFluidOutputs[0] != null) && (mRecipe.mFluidOutputs[0].getFluid() != null)) { + this.mOutputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(mRecipe.mFluidOutputs[0], true), 138, 5)); } - if ((aRecipe.mFluidOutputs.length > 1) && (aRecipe.mFluidOutputs[1] != null) && (aRecipe.mFluidOutputs[1].getFluid() != null)) { - this.mOutputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(aRecipe.mFluidOutputs[1], true), 138, 23)); + if ((mRecipe.mFluidOutputs.length > 1) && (mRecipe.mFluidOutputs[1] != null) && (mRecipe.mFluidOutputs[1].getFluid() != null)) { + this.mOutputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(mRecipe.mFluidOutputs[1], true), 138, 23)); } } - } - - @Override - public List getIngredients() { - return this.getCycledIngredients(GT_NEI_FluidReactor.this.cycleticks / 10, this.mInputs); - } - - @Override - public PositionedStack getResult() { - return null; - } - - @Override - public List getOtherStacks() { - return this.mOutputs; + } } } diff --git a/src/Java/gtPlusPlus/nei/GT_NEI_LFTR.java b/src/Java/gtPlusPlus/nei/GT_NEI_LFTR.java index 0638630201..a88df530ab 100644 --- a/src/Java/gtPlusPlus/nei/GT_NEI_LFTR.java +++ b/src/Java/gtPlusPlus/nei/GT_NEI_LFTR.java @@ -1,457 +1,110 @@ package gtPlusPlus.nei; -import java.awt.Point; -import java.awt.Rectangle; -import java.util.ArrayList; -import java.util.Collections; -import java.util.Iterator; -import java.util.List; - -import org.lwjgl.opengl.GL11; - -import codechicken.lib.gui.GuiDraw; -import codechicken.nei.PositionedStack; -import codechicken.nei.guihook.GuiContainerManager; -import codechicken.nei.guihook.IContainerInputHandler; -import codechicken.nei.guihook.IContainerTooltipHandler; -import codechicken.nei.recipe.GuiCraftingRecipe; -import codechicken.nei.recipe.GuiRecipe; -import codechicken.nei.recipe.GuiUsageRecipe; import codechicken.nei.recipe.TemplateRecipeHandler; -import cpw.mods.fml.common.event.FMLInterModComms; -import gregtech.api.enums.GT_Values; -import gregtech.api.enums.ItemList; -import gregtech.api.enums.OrePrefixes; -import gregtech.api.gui.GT_GUIContainer_BasicMachine; -import gregtech.api.objects.ItemData; -import gregtech.api.util.GTPP_Recipe; -import gregtech.api.util.GTPP_Recipe.GTPP_Recipe_Map_Internal; -import gregtech.api.util.GT_LanguageManager; -import gregtech.api.util.GT_OreDictUnificator; +import gregtech.api.util.GTPP_Recipe.GTPP_Recipe_Map; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; import gtPlusPlus.api.objects.Logger; -import gtPlusPlus.core.util.minecraft.ItemUtils; -import net.minecraft.client.Minecraft; -import net.minecraft.client.gui.inventory.GuiContainer; -import net.minecraft.init.Blocks; -import net.minecraft.item.ItemStack; -import net.minecraftforge.fluids.FluidContainerRegistry; -import net.minecraftforge.fluids.FluidStack; - -public class GT_NEI_LFTR -extends TemplateRecipeHandler { - public static final int sOffsetX = 5; - public static final int sOffsetY = 11; - - static { - GuiContainerManager.addInputHandler(new GT_RectHandler()); - GuiContainerManager.addTooltipHandler(new GT_RectHandler()); - } +import gtPlusPlus.core.util.math.MathUtils; - protected GTPP_Recipe_Map_Internal mRecipeMap; +public class GT_NEI_LFTR extends GTPP_NEI_DefaultHandler { public GT_NEI_LFTR() { - this.mRecipeMap = GTPP_Recipe.GTPP_Recipe_Map.sLiquidFluorineThoriumReactorRecipes; - this.transferRects.add(new TemplateRecipeHandler.RecipeTransferRect(new Rectangle(65, 13, 36, 18), this.getRecipeMapName(), new Object[0])); - if (!NEI_GT_Config.sIsAdded) { - FMLInterModComms.sendRuntimeMessage(GT_Values.GT, "NEIPlugins", "register-crafting-handler", "gregtechplusplus@" + this.getRecipeName() + "@" + this.getRecipeMapName()); - GuiCraftingRecipe.craftinghandlers.add(this); - GuiUsageRecipe.usagehandlers.add(this); - } - } - - public List getSortedRecipes() { - List result = new ArrayList(this.mRecipeMap.mRecipeList); - Collections.sort(result); - return result; + super(GTPP_Recipe_Map.sLiquidFluorineThoriumReactorRecipes); } - - public static void drawText(final int aX, final int aY, final String aString, final int aColor) { - Minecraft.getMinecraft().fontRenderer.drawString(aString, aX, aY, aColor); - } - + @Override public TemplateRecipeHandler newInstance() { return new GT_NEI_LFTR(); } @Override - public void loadCraftingRecipes(final String outputId, final Object... results) { - if (outputId.equals(getRecipeMapName())) { - for (GTPP_Recipe tRecipe : getSortedRecipes()) { - if (!tRecipe.mHidden) { - this.arecipes.add(new CachedDefaultRecipe(tRecipe)); - } - } - } else { - super.loadCraftingRecipes(outputId, results); - } - } - - @Override - public void loadCraftingRecipes(final ItemStack aResult) { - ItemData tPrefixMaterial = GT_OreDictUnificator.getAssociation(aResult); - - ArrayList tResults = new ArrayList(); - tResults.add(aResult); - tResults.add(GT_OreDictUnificator.get(true, aResult)); - if ((tPrefixMaterial != null) && (!tPrefixMaterial.mBlackListed) && (!tPrefixMaterial.mPrefix.mFamiliarPrefixes.isEmpty())) { - for (OrePrefixes tPrefix : tPrefixMaterial.mPrefix.mFamiliarPrefixes) { - tResults.add(GT_OreDictUnificator.get(tPrefix, tPrefixMaterial.mMaterial.mMaterial, 1L)); - } - } - FluidStack tFluid = GT_Utility.getFluidForFilledItem(aResult, true); - if (tFluid != null) { - tResults.add(GT_Utility.getFluidDisplayStack(tFluid, false)); - for (FluidContainerRegistry.FluidContainerData tData : FluidContainerRegistry.getRegisteredFluidContainerData()) { - if (tData.fluid.isFluidEqual(tFluid)) { - tResults.add(GT_Utility.copy(new Object[]{tData.filledContainer})); - } - } - } - for (GTPP_Recipe tRecipe : getSortedRecipes()) { - if (!tRecipe.mHidden) { - CachedDefaultRecipe tNEIRecipe = new CachedDefaultRecipe(tRecipe); - for (ItemStack tStack : tResults) { - if (tNEIRecipe.contains(tNEIRecipe.mOutputs, tStack)) { - this.arecipes.add(tNEIRecipe); - break; - } - } - } - } - //CachedDefaultRecipe tNEIRecipe; - } - - public void loadUsageRecipes(ItemStack aInput) { - ItemData tPrefixMaterial = GT_OreDictUnificator.getAssociation(aInput); - - ArrayList tInputs = new ArrayList(); - tInputs.add(aInput); - tInputs.add(GT_OreDictUnificator.get(false, aInput)); - if ((tPrefixMaterial != null) && (!tPrefixMaterial.mPrefix.mFamiliarPrefixes.isEmpty())) { - for (OrePrefixes tPrefix : tPrefixMaterial.mPrefix.mFamiliarPrefixes) { - tInputs.add(GT_OreDictUnificator.get(tPrefix, tPrefixMaterial.mMaterial.mMaterial, 1L)); - } - } - FluidStack tFluid = GT_Utility.getFluidForFilledItem(aInput, true); - if (tFluid != null) { - tInputs.add(GT_Utility.getFluidDisplayStack(tFluid, false)); - for (FluidContainerRegistry.FluidContainerData tData : FluidContainerRegistry.getRegisteredFluidContainerData()) { - if (tData.fluid.isFluidEqual(tFluid)) { - tInputs.add(GT_Utility.copy(new Object[]{tData.filledContainer})); - } - } - } - for (GTPP_Recipe tRecipe : getSortedRecipes()) { - if (!tRecipe.mHidden) { - CachedDefaultRecipe tNEIRecipe = new CachedDefaultRecipe(tRecipe); - for (ItemStack tStack : tInputs) { - if (tNEIRecipe.contains(tNEIRecipe.mInputs, tStack)) { - this.arecipes.add(tNEIRecipe); - break; - } - } - } - } - //CachedDefaultRecipe tNEIRecipe; - } - - public String getRecipeMapName() { - return this.mRecipeMap.mNEIName; - } - - @Override - public String getOverlayIdentifier() { - return this.mRecipeMap.mNEIName; - } - - @Override - public void drawBackground(final int recipe) { - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - GuiDraw.changeTexture(this.getGuiTexture()); - GuiDraw.drawTexturedModalRect(-4, -8, 1, 3, 174, 78); - } - - @Override - public int recipiesPerPage() { - return 1; - } - - @Override - public String getRecipeName() { - return GT_LanguageManager.getTranslation(this.mRecipeMap.mUnlocalizedName); - } - - @Override - public String getGuiTexture() { - return this.mRecipeMap.mNEIGUIPath; - } - - @Override - public List handleItemTooltip(final GuiRecipe gui, final ItemStack aStack, final List currenttip, final int aRecipeIndex) { - final TemplateRecipeHandler.CachedRecipe tObject = this.arecipes.get(aRecipeIndex); - if ((tObject instanceof CachedDefaultRecipe)) { - final CachedDefaultRecipe tRecipe = (CachedDefaultRecipe) tObject; - for (final PositionedStack tStack : tRecipe.mOutputs) { - if (aStack == tStack.item) { - if (ItemList.Display_Fluid.isStackEqual(tStack.item, true, true) && ((FixedPositionedStack) tStack).mChance < 10000) { - currenttip.add("Chance: " + (((FixedPositionedStack) tStack).mChance / 100) + "." + ((((FixedPositionedStack) tStack).mChance % 100) < 10 ? "0" + (((FixedPositionedStack) tStack).mChance % 100) : Integer.valueOf(((FixedPositionedStack) tStack).mChance % 100)) + "%"); - break; - } - //currenttip.add("Chance: " + (((FixedPositionedStack) tStack).mChance / 100) + "." + ((((FixedPositionedStack) tStack).mChance % 100) < 10 ? "0" + (((FixedPositionedStack) tStack).mChance % 100) : Integer.valueOf(((FixedPositionedStack) tStack).mChance % 100)) + "%"); - break; - } - } - for (final PositionedStack tStack : tRecipe.mInputs) { - if (GT_Utility.areStacksEqual(aStack, tStack.item)) { - if ((gregtech.api.enums.ItemList.Display_Fluid.isStackEqual(tStack.item, true, true)) || - (tStack.item.stackSize != 0)) { - break; - } - if (ItemUtils.isControlCircuit(aStack)) { - currenttip.add("Does not get consumed in the process"); - } - break; - } - } - } - return currenttip; - } + public CachedDefaultRecipe createCachedRecipe(GT_Recipe aRecipe) { + return new LFTRDefaultRecipe(aRecipe); + } @Override public void drawExtras(final int aRecipeIndex) { final long tEUt = ((CachedDefaultRecipe) this.arecipes.get(aRecipeIndex)).mRecipe.mSpecialValue; final int tDuration = ((CachedDefaultRecipe) this.arecipes.get(aRecipeIndex)).mRecipe.mDuration; - drawText(10, 83, "Time: " + (tDuration < 20 ? "< 1" : Integer.valueOf(tDuration / 20)) + " secs", -16777216); - drawText(10, 93, this.mRecipeMap.mNEISpecialValuePre + (((CachedDefaultRecipe) this.arecipes.get(aRecipeIndex)).mRecipe.mSpecialValue * this.mRecipeMap.mNEISpecialValueMultiplier) + this.mRecipeMap.mNEISpecialValuePost, -16777216); - drawText(10, 103, "Dynamo: " + (long) (tDuration * tEUt) + " EU", -16777216); - drawText(10, 113, "Total: " + (long) (tDuration * tEUt * 4) + " EU", -16777216); + drawText(10, 83, "Time: " + (tDuration < 20 ? "< 1" : MathUtils.formatNumbers(Integer.valueOf(tDuration / 20))) + " secs", -16777216); + drawText(10, 93, this.mRecipeMap.mNEISpecialValuePre + MathUtils.formatNumbers((((CachedDefaultRecipe) this.arecipes.get(aRecipeIndex)).mRecipe.mSpecialValue * this.mRecipeMap.mNEISpecialValueMultiplier)) + this.mRecipeMap.mNEISpecialValuePost, -16777216); + drawText(10, 103, "Dynamo: " + MathUtils.formatNumbers((long) (tDuration * tEUt)) + " EU", -16777216); + drawText(10, 113, "Total: " + MathUtils.formatNumbers((long) (tDuration * tEUt * 4)) + " EU", -16777216); } - public static class GT_RectHandler - implements IContainerInputHandler, IContainerTooltipHandler { - @Override - public boolean mouseClicked(final GuiContainer gui, final int mousex, final int mousey, final int button) { - if (this.canHandle(gui)) { - if (button == 0) { - return this.transferRect(gui, false); - } - if (button == 1) { - return this.transferRect(gui, true); - } - } - return false; - } - - @Override - public boolean lastKeyTyped(final GuiContainer gui, final char keyChar, final int keyCode) { - return false; - } - - public boolean canHandle(final GuiContainer gui) { - return (((gui instanceof GT_GUIContainer_BasicMachine)) && (GT_Utility.isStringValid(((GT_GUIContainer_BasicMachine) gui).mNEI)) /*|| ((gui instanceof GT_GUIContainer_FusionReactor)) && (GT_Utility.isStringValid(((GT_GUIContainer_FusionReactor) gui).mNEI))*/); - } - - @Override - public List handleTooltip(final GuiContainer gui, final int mousex, final int mousey, final List currenttip) { - if ((this.canHandle(gui)) && (currenttip.isEmpty())) { - if ((gui instanceof GT_GUIContainer_BasicMachine) && new Rectangle(65, 13, 36, 18).contains(new Point(GuiDraw.getMousePosition().x - ((GT_GUIContainer_BasicMachine) gui).getLeft() - codechicken.nei.recipe.RecipeInfo.getGuiOffset(gui)[0], GuiDraw.getMousePosition().y - ((GT_GUIContainer_BasicMachine) gui).getTop() - codechicken.nei.recipe.RecipeInfo.getGuiOffset(gui)[1]))) { - currenttip.add("Recipes"); - } /*else if (gui instanceof GT_GUIContainer_FusionReactor && new Rectangle(145, 0, 24, 24).contains(new Point(GuiDraw.getMousePosition().x - ((GT_GUIContainer_FusionReactor) gui).getLeft() - codechicken.nei.recipe.RecipeInfo.getGuiOffset(gui)[0], GuiDraw.getMousePosition().y - ((GT_GUIContainer_FusionReactor) gui).getTop() - codechicken.nei.recipe.RecipeInfo.getGuiOffset(gui)[1]))) { - currenttip.add("Recipes"); - }*/ - - } - return currenttip; - } - - private boolean transferRect(final GuiContainer gui, final boolean usage) { - if (gui instanceof GT_GUIContainer_BasicMachine) { - return (this.canHandle(gui)) && (new Rectangle(65, 13, 36, 18).contains(new Point(GuiDraw.getMousePosition().x - ((GT_GUIContainer_BasicMachine) gui).getLeft() - codechicken.nei.recipe.RecipeInfo.getGuiOffset(gui)[0], GuiDraw.getMousePosition().y - ((GT_GUIContainer_BasicMachine) gui).getTop() - codechicken.nei.recipe.RecipeInfo.getGuiOffset(gui)[1]))) && (usage ? GuiUsageRecipe.openRecipeGui(((GT_GUIContainer_BasicMachine) gui).mNEI, new Object[0]) : GuiCraftingRecipe.openRecipeGui(((GT_GUIContainer_BasicMachine) gui).mNEI, new Object[0])); - } /*else if (gui instanceof GT_GUIContainer_FusionReactor) { - return (canHandle(gui)) && (new Rectangle(145, 0, 24, 24).contains(new Point(GuiDraw.getMousePosition().x - ((GT_GUIContainer_FusionReactor) gui).getLeft() - codechicken.nei.recipe.RecipeInfo.getGuiOffset(gui)[0], GuiDraw.getMousePosition().y - ((GT_GUIContainer_FusionReactor) gui).getTop() - codechicken.nei.recipe.RecipeInfo.getGuiOffset(gui)[1]))) && (usage ? GuiUsageRecipe.openRecipeGui(((GT_GUIContainer_FusionReactor) gui).mNEI, new Object[0]) : GuiCraftingRecipe.openRecipeGui(((GT_GUIContainer_FusionReactor) gui).mNEI, new Object[0])); - }*/ - return false; - } - - @Override - public List handleItemDisplayName(final GuiContainer gui, final ItemStack itemstack, final List currenttip) { - return currenttip; - } - - @Override - public List handleItemTooltip(final GuiContainer gui, final ItemStack itemstack, final int mousex, final int mousey, final List currenttip) { - return currenttip; - } - - @Override - public boolean keyTyped(final GuiContainer gui, final char keyChar, final int keyCode) { - return false; - } - - @Override - public void onKeyTyped(final GuiContainer gui, final char keyChar, final int keyID) { - } - - @Override - public void onMouseClicked(final GuiContainer gui, final int mousex, final int mousey, final int button) { - } - - @Override - public void onMouseUp(final GuiContainer gui, final int mousex, final int mousey, final int button) { - } - - @Override - public boolean mouseScrolled(final GuiContainer gui, final int mousex, final int mousey, final int scrolled) { - return false; - } - - @Override - public void onMouseScrolled(final GuiContainer gui, final int mousex, final int mousey, final int scrolled) { - } - - @Override - public void onMouseDragged(final GuiContainer gui, final int mousex, final int mousey, final int button, final long heldTime) { - } - } - - public class FixedPositionedStack - extends PositionedStack { - public final int mChance; - public boolean permutated = false; + public class LFTRDefaultRecipe extends CachedDefaultRecipe { - public FixedPositionedStack(final Object object, final int x, final int y) { - this(object, x, y, 0); - } - - public FixedPositionedStack(final Object object, final int x, final int y, final int aChance) { - super(object, x, y, true); - this.mChance = aChance; + public LFTRDefaultRecipe(final GT_Recipe aRecipe) { + super(aRecipe); } @Override - public void generatePermutations() { - if (this.permutated) { - return; - } - final ArrayList tDisplayStacks = new ArrayList(); - for (final ItemStack tStack : this.items) { - if (GT_Utility.isStackValid(tStack)) { - if (tStack.getItemDamage() == 32767) { - final List permutations = codechicken.nei.ItemList.itemMap.get(tStack.getItem()); - if (!permutations.isEmpty()) { - ItemStack stack; - for (final Iterator i$ = permutations.iterator(); i$.hasNext(); tDisplayStacks.add(GT_Utility.copyAmount(tStack.stackSize, new Object[]{stack}))) { - stack = i$.next(); - } - } else { - final ItemStack base = new ItemStack(tStack.getItem(), tStack.stackSize); - base.stackTagCompound = tStack.stackTagCompound; - tDisplayStacks.add(base); - } - } else { - tDisplayStacks.add(GT_Utility.copy(new Object[]{tStack})); - } - } - } - this.items = (tDisplayStacks.toArray(new ItemStack[0])); - if (this.items.length == 0) { - this.items = new ItemStack[]{new ItemStack(Blocks.fire)}; - } - this.permutated = true; - this.setPermutationToRender(0); - } - } - - public class CachedDefaultRecipe - extends TemplateRecipeHandler.CachedRecipe { - public final GT_Recipe mRecipe; - public final List mOutputs = new ArrayList(); - public final List mInputs = new ArrayList(); - - public CachedDefaultRecipe(final GT_Recipe aRecipe) { - super(); - this.mRecipe = aRecipe; - + public void handleSlots() { int tStartIndex = 0; - if (aRecipe.mFluidInputs.length > 0) { - if ((aRecipe.mFluidInputs[0] != null) && (aRecipe.mFluidInputs[0].getFluid() != null)) { - this.mInputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(aRecipe.mFluidInputs[0], true), 12, 5)); + if (mRecipe.mFluidInputs.length > 0) { + if ((mRecipe.mFluidInputs[0] != null) && (mRecipe.mFluidInputs[0].getFluid() != null)) { + this.mInputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(mRecipe.mFluidInputs[0], true), 12, 5)); } - if ((aRecipe.mFluidInputs.length > 1) && (aRecipe.mFluidInputs[1] != null) && (aRecipe.mFluidInputs[1].getFluid() != null)) { - this.mInputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(aRecipe.mFluidInputs[1], true), 30, 5)); + if ((mRecipe.mFluidInputs.length > 1) && (mRecipe.mFluidInputs[1] != null) && (mRecipe.mFluidInputs[1].getFluid() != null)) { + this.mInputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(mRecipe.mFluidInputs[1], true), 30, 5)); } - if ((aRecipe.mFluidInputs.length > 2) && (aRecipe.mFluidInputs[2] != null) && (aRecipe.mFluidInputs[2].getFluid() != null)) { - this.mInputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(aRecipe.mFluidInputs[2], true), 48, 5)); + if ((mRecipe.mFluidInputs.length > 2) && (mRecipe.mFluidInputs[2] != null) && (mRecipe.mFluidInputs[2].getFluid() != null)) { + this.mInputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(mRecipe.mFluidInputs[2], true), 48, 5)); } - if ((aRecipe.mFluidInputs.length > 3) && (aRecipe.mFluidInputs[3] != null) && (aRecipe.mFluidInputs[3].getFluid() != null)) { - this.mInputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(aRecipe.mFluidInputs[3], true), 12, 23)); + if ((mRecipe.mFluidInputs.length > 3) && (mRecipe.mFluidInputs[3] != null) && (mRecipe.mFluidInputs[3].getFluid() != null)) { + this.mInputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(mRecipe.mFluidInputs[3], true), 12, 23)); } - if ((aRecipe.mFluidInputs.length > 4) && (aRecipe.mFluidInputs[4] != null) && (aRecipe.mFluidInputs[4].getFluid() != null)) { - this.mInputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(aRecipe.mFluidInputs[4], true), 30, 23)); + if ((mRecipe.mFluidInputs.length > 4) && (mRecipe.mFluidInputs[4] != null) && (mRecipe.mFluidInputs[4].getFluid() != null)) { + this.mInputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(mRecipe.mFluidInputs[4], true), 30, 23)); } - if ((aRecipe.mFluidInputs.length > 5) && (aRecipe.mFluidInputs[5] != null) && (aRecipe.mFluidInputs[5].getFluid() != null)) { - this.mInputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(aRecipe.mFluidInputs[5], true), 48, 23)); + if ((mRecipe.mFluidInputs.length > 5) && (mRecipe.mFluidInputs[5] != null) && (mRecipe.mFluidInputs[5].getFluid() != null)) { + this.mInputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(mRecipe.mFluidInputs[5], true), 48, 23)); } - if ((aRecipe.mFluidInputs.length > 6) && (aRecipe.mFluidInputs[6] != null) && (aRecipe.mFluidInputs[6].getFluid() != null)) { - this.mInputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(aRecipe.mFluidInputs[6], true), 12, 41)); + if ((mRecipe.mFluidInputs.length > 6) && (mRecipe.mFluidInputs[6] != null) && (mRecipe.mFluidInputs[6].getFluid() != null)) { + this.mInputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(mRecipe.mFluidInputs[6], true), 12, 41)); } - if ((aRecipe.mFluidInputs.length > 7) && (aRecipe.mFluidInputs[7] != null) && (aRecipe.mFluidInputs[7].getFluid() != null)) { - this.mInputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(aRecipe.mFluidInputs[7], true), 30, 41)); + if ((mRecipe.mFluidInputs.length > 7) && (mRecipe.mFluidInputs[7] != null) && (mRecipe.mFluidInputs[7].getFluid() != null)) { + this.mInputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(mRecipe.mFluidInputs[7], true), 30, 41)); } - if ((aRecipe.mFluidInputs.length > 8) && (aRecipe.mFluidInputs[8] != null) && (aRecipe.mFluidInputs[8].getFluid() != null)) { - this.mInputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(aRecipe.mFluidInputs[8], true), 48, 41)); + if ((mRecipe.mFluidInputs.length > 8) && (mRecipe.mFluidInputs[8] != null) && (mRecipe.mFluidInputs[8].getFluid() != null)) { + this.mInputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(mRecipe.mFluidInputs[8], true), 48, 41)); } } tStartIndex = 0; - if (aRecipe.mFluidOutputs.length > 0) { - if ((aRecipe.mFluidOutputs[0] != null) && (aRecipe.mFluidOutputs[0].getFluid() != null)) { - this.mOutputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(aRecipe.mFluidOutputs[0], true), 102, 5, aRecipe.getOutputChance(tStartIndex++))); + if (mRecipe.mFluidOutputs.length > 0) { + if ((mRecipe.mFluidOutputs[0] != null) && (mRecipe.mFluidOutputs[0].getFluid() != null)) { + this.mOutputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(mRecipe.mFluidOutputs[0], true), 102, 5, mRecipe.getOutputChance(tStartIndex++))); } - if ((aRecipe.mFluidOutputs.length > 1) && (aRecipe.mFluidOutputs[1] != null) && (aRecipe.mFluidOutputs[1].getFluid() != null)) { - this.mOutputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(aRecipe.mFluidOutputs[1], true), 120, 5, aRecipe.getOutputChance(tStartIndex++))); + if ((mRecipe.mFluidOutputs.length > 1) && (mRecipe.mFluidOutputs[1] != null) && (mRecipe.mFluidOutputs[1].getFluid() != null)) { + this.mOutputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(mRecipe.mFluidOutputs[1], true), 120, 5, mRecipe.getOutputChance(tStartIndex++))); } - if ((aRecipe.mFluidOutputs.length > 2) && (aRecipe.mFluidOutputs[2] != null) && (aRecipe.mFluidOutputs[2].getFluid() != null)) { - this.mOutputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(aRecipe.mFluidOutputs[2], true), 138, 5, aRecipe.getOutputChance(tStartIndex++))); + if ((mRecipe.mFluidOutputs.length > 2) && (mRecipe.mFluidOutputs[2] != null) && (mRecipe.mFluidOutputs[2].getFluid() != null)) { + this.mOutputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(mRecipe.mFluidOutputs[2], true), 138, 5, mRecipe.getOutputChance(tStartIndex++))); } - if ((aRecipe.mFluidOutputs.length > 3) && (aRecipe.mFluidOutputs[3] != null) && (aRecipe.mFluidOutputs[3].getFluid() != null)) { - this.mOutputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(aRecipe.mFluidOutputs[3], true), 102, 23, aRecipe.getOutputChance(tStartIndex++))); + if ((mRecipe.mFluidOutputs.length > 3) && (mRecipe.mFluidOutputs[3] != null) && (mRecipe.mFluidOutputs[3].getFluid() != null)) { + this.mOutputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(mRecipe.mFluidOutputs[3], true), 102, 23, mRecipe.getOutputChance(tStartIndex++))); } - if ((aRecipe.mFluidOutputs.length > 4) && (aRecipe.mFluidOutputs[4] != null) && (aRecipe.mFluidOutputs[4].getFluid() != null)) { - this.mOutputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(aRecipe.mFluidOutputs[4], true), 120, 23, aRecipe.getOutputChance(tStartIndex++))); + if ((mRecipe.mFluidOutputs.length > 4) && (mRecipe.mFluidOutputs[4] != null) && (mRecipe.mFluidOutputs[4].getFluid() != null)) { + this.mOutputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(mRecipe.mFluidOutputs[4], true), 120, 23, mRecipe.getOutputChance(tStartIndex++))); } - if ((aRecipe.mFluidOutputs.length > 5) && (aRecipe.mFluidOutputs[5] != null) && (aRecipe.mFluidOutputs[5].getFluid() != null)) { - this.mOutputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(aRecipe.mFluidOutputs[5], true), 138, 23, aRecipe.getOutputChance(tStartIndex++))); + if ((mRecipe.mFluidOutputs.length > 5) && (mRecipe.mFluidOutputs[5] != null) && (mRecipe.mFluidOutputs[5].getFluid() != null)) { + this.mOutputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(mRecipe.mFluidOutputs[5], true), 138, 23, mRecipe.getOutputChance(tStartIndex++))); } - if ((aRecipe.mFluidOutputs.length > 6) && (aRecipe.mFluidOutputs[6] != null) && (aRecipe.mFluidOutputs[6].getFluid() != null)) { - this.mOutputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(aRecipe.mFluidOutputs[6], true), 102, 41, aRecipe.getOutputChance(tStartIndex++))); + if ((mRecipe.mFluidOutputs.length > 6) && (mRecipe.mFluidOutputs[6] != null) && (mRecipe.mFluidOutputs[6].getFluid() != null)) { + this.mOutputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(mRecipe.mFluidOutputs[6], true), 102, 41, mRecipe.getOutputChance(tStartIndex++))); } - if ((aRecipe.mFluidOutputs.length > 7) && (aRecipe.mFluidOutputs[7] != null) && (aRecipe.mFluidOutputs[7].getFluid() != null)) { - this.mOutputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(aRecipe.mFluidOutputs[7], true), 120, 41, aRecipe.getOutputChance(tStartIndex++))); + if ((mRecipe.mFluidOutputs.length > 7) && (mRecipe.mFluidOutputs[7] != null) && (mRecipe.mFluidOutputs[7].getFluid() != null)) { + this.mOutputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(mRecipe.mFluidOutputs[7], true), 120, 41, mRecipe.getOutputChance(tStartIndex++))); } - if ((aRecipe.mFluidOutputs.length > 8) && (aRecipe.mFluidOutputs[8] != null) && (aRecipe.mFluidOutputs[8].getFluid() != null)) { - this.mOutputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(aRecipe.mFluidOutputs[8], true), 138, 41, aRecipe.getOutputChance(tStartIndex++))); + if ((mRecipe.mFluidOutputs.length > 8) && (mRecipe.mFluidOutputs[8] != null) && (mRecipe.mFluidOutputs[8].getFluid() != null)) { + this.mOutputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(mRecipe.mFluidOutputs[8], true), 138, 41, mRecipe.getOutputChance(tStartIndex++))); } - Logger.INFO("Outputs: "+aRecipe.mFluidOutputs.length); + Logger.INFO("Outputs: "+mRecipe.mFluidOutputs.length); } + } - - @Override - public List getIngredients() { - return this.getCycledIngredients(GT_NEI_LFTR.this.cycleticks / 10, this.mInputs); - } - - @Override - public PositionedStack getResult() { - return null; - } - - @Override - public List getOtherStacks() { - return this.mOutputs; - } + } } diff --git a/src/Java/gtPlusPlus/nei/GT_NEI_MillingMachine.java b/src/Java/gtPlusPlus/nei/GT_NEI_MillingMachine.java index 8aea87b6d4..5d09b9003f 100644 --- a/src/Java/gtPlusPlus/nei/GT_NEI_MillingMachine.java +++ b/src/Java/gtPlusPlus/nei/GT_NEI_MillingMachine.java @@ -1,73 +1,20 @@ package gtPlusPlus.nei; -import java.awt.Point; -import java.awt.Rectangle; -import java.util.ArrayList; -import java.util.Collections; -import java.util.Iterator; import java.util.List; -import org.lwjgl.opengl.GL11; - -import codechicken.lib.gui.GuiDraw; import codechicken.nei.PositionedStack; -import codechicken.nei.guihook.GuiContainerManager; -import codechicken.nei.guihook.IContainerInputHandler; -import codechicken.nei.guihook.IContainerTooltipHandler; -import codechicken.nei.recipe.GuiCraftingRecipe; import codechicken.nei.recipe.GuiRecipe; -import codechicken.nei.recipe.GuiUsageRecipe; import codechicken.nei.recipe.TemplateRecipeHandler; -import cpw.mods.fml.common.event.FMLInterModComms; -import gregtech.api.enums.GT_Values; -import gregtech.api.enums.OrePrefixes; -import gregtech.api.gui.GT_GUIContainer_BasicMachine; -import gregtech.api.objects.ItemData; -import gregtech.api.util.GT_LanguageManager; -import gregtech.api.util.GT_OreDictUnificator; +import gregtech.api.util.GTPP_Recipe.GTPP_Recipe_Map; import gregtech.api.util.GT_Recipe; -import gregtech.api.util.GT_Recipe.GT_Recipe_Map; import gregtech.api.util.GT_Utility; -import gregtech.api.util.GTPP_Recipe; -import gregtech.api.util.GTPP_Recipe.GTPP_Recipe_Map; import gtPlusPlus.core.util.minecraft.ItemUtils; -import net.minecraft.client.Minecraft; -import net.minecraft.client.gui.inventory.GuiContainer; -import net.minecraft.init.Blocks; import net.minecraft.item.ItemStack; -import net.minecraftforge.fluids.FluidContainerRegistry; -import net.minecraftforge.fluids.FluidStack; -public class GT_NEI_MillingMachine -extends TemplateRecipeHandler { - public static final int sOffsetX = 5; - public static final int sOffsetY = 11; - - static { - GuiContainerManager.addInputHandler(new GT_RectHandler()); - GuiContainerManager.addTooltipHandler(new GT_RectHandler()); - } - - protected GT_Recipe_Map mRecipeMap; +public class GT_NEI_MillingMachine extends GTPP_NEI_DefaultHandler { public GT_NEI_MillingMachine() { - this.mRecipeMap = GTPP_Recipe_Map.sOreMillRecipes; - this.transferRects.add(new TemplateRecipeHandler.RecipeTransferRect(new Rectangle(65, 13, 36, 18), this.getRecipeMapName(), new Object[0])); - if (!NEI_GT_Config.sIsAdded) { - FMLInterModComms.sendRuntimeMessage(GT_Values.GT, "NEIPlugins", "register-crafting-handler", "gregtechplusplus@" + this.getRecipeName() + "@" + this.getRecipeMapName()); - GuiCraftingRecipe.craftinghandlers.add(this); - GuiUsageRecipe.usagehandlers.add(this); - } - } - - public List getSortedRecipes() { - List result = new ArrayList(this.mRecipeMap.mRecipeList); - Collections.sort(result); - return result; - } - - public static void drawText(final int aX, final int aY, final String aString, final int aColor) { - Minecraft.getMinecraft().fontRenderer.drawString(aString, aX, aY, aColor); + super(GTPP_Recipe_Map.sOreMillRecipes); } @Override @@ -76,118 +23,10 @@ extends TemplateRecipeHandler { } @Override - public void loadCraftingRecipes(final String outputId, final Object... results) { - if (outputId.equals(getRecipeMapName())) { - for (GTPP_Recipe tRecipe : getSortedRecipes()) { - if (!tRecipe.mHidden) { - this.arecipes.add(new CachedDefaultRecipe(tRecipe)); - } - } - } else { - super.loadCraftingRecipes(outputId, results); - } - } - - @Override - public void loadCraftingRecipes(final ItemStack aResult) { - ItemData tPrefixMaterial = GT_OreDictUnificator.getAssociation(aResult); - - ArrayList tResults = new ArrayList(); - tResults.add(aResult); - tResults.add(GT_OreDictUnificator.get(true, aResult)); - if ((tPrefixMaterial != null) && (!tPrefixMaterial.mBlackListed) && (!tPrefixMaterial.mPrefix.mFamiliarPrefixes.isEmpty())) { - for (OrePrefixes tPrefix : tPrefixMaterial.mPrefix.mFamiliarPrefixes) { - tResults.add(GT_OreDictUnificator.get(tPrefix, tPrefixMaterial.mMaterial.mMaterial, 1L)); - } - } - FluidStack tFluid = GT_Utility.getFluidForFilledItem(aResult, true); - if (tFluid != null) { - tResults.add(GT_Utility.getFluidDisplayStack(tFluid, false)); - for (FluidContainerRegistry.FluidContainerData tData : FluidContainerRegistry.getRegisteredFluidContainerData()) { - if (tData.fluid.isFluidEqual(tFluid)) { - tResults.add(GT_Utility.copy(new Object[]{tData.filledContainer})); - } - } - } - for (GTPP_Recipe tRecipe : getSortedRecipes()) { - if (!tRecipe.mHidden) { - CachedDefaultRecipe tNEIRecipe = new CachedDefaultRecipe(tRecipe); - for (ItemStack tStack : tResults) { - if (tNEIRecipe.contains(tNEIRecipe.mOutputs, tStack)) { - this.arecipes.add(tNEIRecipe); - break; - } - } - } - } - //CachedDefaultRecipe tNEIRecipe; - } - - public void loadUsageRecipes(ItemStack aInput) { - ItemData tPrefixMaterial = GT_OreDictUnificator.getAssociation(aInput); - - ArrayList tInputs = new ArrayList(); - tInputs.add(aInput); - tInputs.add(GT_OreDictUnificator.get(false, aInput)); - if ((tPrefixMaterial != null) && (!tPrefixMaterial.mPrefix.mFamiliarPrefixes.isEmpty())) { - for (OrePrefixes tPrefix : tPrefixMaterial.mPrefix.mFamiliarPrefixes) { - tInputs.add(GT_OreDictUnificator.get(tPrefix, tPrefixMaterial.mMaterial.mMaterial, 1L)); - } - } - FluidStack tFluid = GT_Utility.getFluidForFilledItem(aInput, true); - if (tFluid != null) { - tInputs.add(GT_Utility.getFluidDisplayStack(tFluid, false)); - for (FluidContainerRegistry.FluidContainerData tData : FluidContainerRegistry.getRegisteredFluidContainerData()) { - if (tData.fluid.isFluidEqual(tFluid)) { - tInputs.add(GT_Utility.copy(new Object[]{tData.filledContainer})); - } - } - } - for (GTPP_Recipe tRecipe : getSortedRecipes()) { - if (!tRecipe.mHidden) { - CachedDefaultRecipe tNEIRecipe = new CachedDefaultRecipe(tRecipe); - for (ItemStack tStack : tInputs) { - if (tNEIRecipe.contains(tNEIRecipe.mInputs, tStack)) { - this.arecipes.add(tNEIRecipe); - break; - } - } - } - } - //CachedDefaultRecipe tNEIRecipe; - } - - public String getRecipeMapName() { - return this.mRecipeMap.mNEIName; - } - - @Override - public String getOverlayIdentifier() { - return this.mRecipeMap.mNEIName; - } - - @Override - public void drawBackground(final int recipe) { - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - GuiDraw.changeTexture(this.getGuiTexture()); - GuiDraw.drawTexturedModalRect(-4, -8, 1, 3, 174, 78); - } - - @Override - public int recipiesPerPage() { - return 1; - } - - @Override - public String getRecipeName() { - return GT_LanguageManager.getTranslation(this.mRecipeMap.mUnlocalizedName); - } - - @Override - public String getGuiTexture() { - return this.mRecipeMap.mNEIGUIPath; - } - + public CachedDefaultRecipe createCachedRecipe(GT_Recipe aRecipe) { + return new MillingDefaultRecipe(aRecipe); + } + @Override public List handleItemTooltip(final GuiRecipe gui, final ItemStack aStack, final List currenttip, final int aRecipeIndex) { final TemplateRecipeHandler.CachedRecipe tObject = this.arecipes.get(aRecipeIndex); @@ -221,252 +60,77 @@ extends TemplateRecipeHandler { return currenttip; } - @Override - public void drawExtras(final int aRecipeIndex) { - final long tEUt = ((CachedDefaultRecipe) this.arecipes.get(aRecipeIndex)).mRecipe.mEUt; - final int tDuration = ((CachedDefaultRecipe) this.arecipes.get(aRecipeIndex)).mRecipe.mDuration; - if (tEUt != 0) { - drawText(10, 73, "Total: " + (long) (tDuration * tEUt) + " EU", -16777216); - //drawText(10, 83, "Usage: " + tEUt + " EU/t", -16777216); - if (this.mRecipeMap.mShowVoltageAmperageInNEI) { - drawText(10, 83, "Voltage: " + (tEUt / this.mRecipeMap.mAmperage) + " EU/t", -16777216); - drawText(10, 93, "Amperage: " + this.mRecipeMap.mAmperage, -16777216); - } else { - drawText(10, 93, "Voltage: unspecified", -16777216); - drawText(10, 103, "Amperage: unspecified", -16777216); - } - } - if (tDuration > 0) { - drawText(10, 103, "Time: " + (tDuration < 20 ? "< 1" : Integer.valueOf(tDuration / 20)) + " secs", -16777216); - } - if ((GT_Utility.isStringValid(this.mRecipeMap.mNEISpecialValuePre)) || (GT_Utility.isStringValid(this.mRecipeMap.mNEISpecialValuePost))) { - drawText(10, 113, this.mRecipeMap.mNEISpecialValuePre + (((CachedDefaultRecipe) this.arecipes.get(aRecipeIndex)).mRecipe.mSpecialValue * this.mRecipeMap.mNEISpecialValueMultiplier) + this.mRecipeMap.mNEISpecialValuePost, -16777216); - } - } - - public static class GT_RectHandler - implements IContainerInputHandler, IContainerTooltipHandler { - @Override - public boolean mouseClicked(final GuiContainer gui, final int mousex, final int mousey, final int button) { - if (this.canHandle(gui)) { - if (button == 0) { - return this.transferRect(gui, false); - } - if (button == 1) { - return this.transferRect(gui, true); - } - } - return false; - } - - @Override - public boolean lastKeyTyped(final GuiContainer gui, final char keyChar, final int keyCode) { - return false; - } - - public boolean canHandle(final GuiContainer gui) { - return (((gui instanceof GT_GUIContainer_BasicMachine)) && (GT_Utility.isStringValid(((GT_GUIContainer_BasicMachine) gui).mNEI)) /*|| ((gui instanceof GT_GUIContainer_FusionReactor)) && (GT_Utility.isStringValid(((GT_GUIContainer_FusionReactor) gui).mNEI))*/); - } - - @Override - public List handleTooltip(final GuiContainer gui, final int mousex, final int mousey, final List currenttip) { - if ((this.canHandle(gui)) && (currenttip.isEmpty())) { - if ((gui instanceof GT_GUIContainer_BasicMachine) && new Rectangle(65, 13, 36, 18).contains(new Point(GuiDraw.getMousePosition().x - ((GT_GUIContainer_BasicMachine) gui).getLeft() - codechicken.nei.recipe.RecipeInfo.getGuiOffset(gui)[0], GuiDraw.getMousePosition().y - ((GT_GUIContainer_BasicMachine) gui).getTop() - codechicken.nei.recipe.RecipeInfo.getGuiOffset(gui)[1]))) { - currenttip.add("Recipes"); - } /*else if (gui instanceof GT_GUIContainer_FusionReactor && new Rectangle(145, 0, 24, 24).contains(new Point(GuiDraw.getMousePosition().x - ((GT_GUIContainer_FusionReactor) gui).getLeft() - codechicken.nei.recipe.RecipeInfo.getGuiOffset(gui)[0], GuiDraw.getMousePosition().y - ((GT_GUIContainer_FusionReactor) gui).getTop() - codechicken.nei.recipe.RecipeInfo.getGuiOffset(gui)[1]))) { - currenttip.add("Recipes"); - }*/ - - } - return currenttip; - } - - private boolean transferRect(final GuiContainer gui, final boolean usage) { - if (gui instanceof GT_GUIContainer_BasicMachine) { - return (this.canHandle(gui)) && (new Rectangle(65, 13, 36, 18).contains(new Point(GuiDraw.getMousePosition().x - ((GT_GUIContainer_BasicMachine) gui).getLeft() - codechicken.nei.recipe.RecipeInfo.getGuiOffset(gui)[0], GuiDraw.getMousePosition().y - ((GT_GUIContainer_BasicMachine) gui).getTop() - codechicken.nei.recipe.RecipeInfo.getGuiOffset(gui)[1]))) && (usage ? GuiUsageRecipe.openRecipeGui(((GT_GUIContainer_BasicMachine) gui).mNEI, new Object[0]) : GuiCraftingRecipe.openRecipeGui(((GT_GUIContainer_BasicMachine) gui).mNEI, new Object[0])); - } /*else if (gui instanceof GT_GUIContainer_FusionReactor) { - return (canHandle(gui)) && (new Rectangle(145, 0, 24, 24).contains(new Point(GuiDraw.getMousePosition().x - ((GT_GUIContainer_FusionReactor) gui).getLeft() - codechicken.nei.recipe.RecipeInfo.getGuiOffset(gui)[0], GuiDraw.getMousePosition().y - ((GT_GUIContainer_FusionReactor) gui).getTop() - codechicken.nei.recipe.RecipeInfo.getGuiOffset(gui)[1]))) && (usage ? GuiUsageRecipe.openRecipeGui(((GT_GUIContainer_FusionReactor) gui).mNEI, new Object[0]) : GuiCraftingRecipe.openRecipeGui(((GT_GUIContainer_FusionReactor) gui).mNEI, new Object[0])); - }*/ - return false; - } - - @Override - public List handleItemDisplayName(final GuiContainer gui, final ItemStack itemstack, final List currenttip) { - return currenttip; - } - - @Override - public List handleItemTooltip(final GuiContainer gui, final ItemStack itemstack, final int mousex, final int mousey, final List currenttip) { - return currenttip; - } - - @Override - public boolean keyTyped(final GuiContainer gui, final char keyChar, final int keyCode) { - return false; - } - - @Override - public void onKeyTyped(final GuiContainer gui, final char keyChar, final int keyID) { - } - - @Override - public void onMouseClicked(final GuiContainer gui, final int mousex, final int mousey, final int button) { - } - - @Override - public void onMouseUp(final GuiContainer gui, final int mousex, final int mousey, final int button) { - } + public class MillingDefaultRecipe extends CachedDefaultRecipe { - @Override - public boolean mouseScrolled(final GuiContainer gui, final int mousex, final int mousey, final int scrolled) { - return false; + public MillingDefaultRecipe(final GT_Recipe aRecipe) { + super(aRecipe); } - + @Override - public void onMouseScrolled(final GuiContainer gui, final int mousex, final int mousey, final int scrolled) { - } - - @Override - public void onMouseDragged(final GuiContainer gui, final int mousex, final int mousey, final int button, final long heldTime) { - } - } - - public class FixedPositionedStack - extends PositionedStack { - public final int mChance; - public boolean permutated = false; - - public FixedPositionedStack(final Object object, final int x, final int y) { - this(object, x, y, 0); - } - - public FixedPositionedStack(final Object object, final int x, final int y, final int aChance) { - super(object, x, y, true); - this.mChance = aChance; - } - - @Override - public void generatePermutations() { - if (this.permutated) { - return; - } - final ArrayList tDisplayStacks = new ArrayList(); - for (final ItemStack tStack : this.items) { - if (GT_Utility.isStackValid(tStack)) { - if (tStack.getItemDamage() == 32767) { - final List permutations = codechicken.nei.ItemList.itemMap.get(tStack.getItem()); - if (!permutations.isEmpty()) { - ItemStack stack; - for (final Iterator i$ = permutations.iterator(); i$.hasNext(); tDisplayStacks.add(GT_Utility.copyAmount(tStack.stackSize, new Object[]{stack}))) { - stack = i$.next(); - } - } else { - final ItemStack base = new ItemStack(tStack.getItem(), tStack.stackSize); - base.stackTagCompound = tStack.stackTagCompound; - tDisplayStacks.add(base); - } - } else { - tDisplayStacks.add(GT_Utility.copy(new Object[]{tStack})); - } - } - } - this.items = (tDisplayStacks.toArray(new ItemStack[0])); - if (this.items.length == 0) { - this.items = new ItemStack[]{new ItemStack(Blocks.fire)}; - } - this.permutated = true; - this.setPermutationToRender(0); - } - } + public void handleSlots() { + int tStartIndex = 0; - public class CachedDefaultRecipe - extends TemplateRecipeHandler.CachedRecipe { - public final GT_Recipe mRecipe; - public final List mOutputs = new ArrayList(); - public final List mInputs = new ArrayList(); - - public CachedDefaultRecipe(final GT_Recipe aRecipe) { - super(); - this.mRecipe = aRecipe; - - int tStartIndex = 0; - - if (aRecipe.getRepresentativeInput(tStartIndex) != null) { - this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 12, 14)); + if (mRecipe.getRepresentativeInput(tStartIndex) != null) { + this.mInputs.add(new FixedPositionedStack(mRecipe.getRepresentativeInput(tStartIndex), 12, 14)); } tStartIndex++; - if (aRecipe.getRepresentativeInput(tStartIndex) != null) { - this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 30, 14)); + if (mRecipe.getRepresentativeInput(tStartIndex) != null) { + this.mInputs.add(new FixedPositionedStack(mRecipe.getRepresentativeInput(tStartIndex), 30, 14)); } tStartIndex++; - if (aRecipe.getRepresentativeInput(tStartIndex) != null) { - this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 48, 14)); + if (mRecipe.getRepresentativeInput(tStartIndex) != null) { + this.mInputs.add(new FixedPositionedStack(mRecipe.getRepresentativeInput(tStartIndex), 48, 14)); } tStartIndex++; - if (aRecipe.mSpecialItems != null) { - this.mInputs.add(new FixedPositionedStack(aRecipe.mSpecialItems, 120, 52)); + if (mRecipe.mSpecialItems != null) { + this.mInputs.add(new FixedPositionedStack(mRecipe.mSpecialItems, 120, 52)); } tStartIndex = 0; //Four Output Slots - if (aRecipe.getOutput(tStartIndex) != null) { - this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 102, 5, aRecipe.getOutputChance(tStartIndex))); + if (mRecipe.getOutput(tStartIndex) != null) { + this.mOutputs.add(new FixedPositionedStack(mRecipe.getOutput(tStartIndex), 102, 5, mRecipe.getOutputChance(tStartIndex))); } tStartIndex++; - if (aRecipe.getOutput(tStartIndex) != null) { - this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 120, 5, aRecipe.getOutputChance(tStartIndex))); + if (mRecipe.getOutput(tStartIndex) != null) { + this.mOutputs.add(new FixedPositionedStack(mRecipe.getOutput(tStartIndex), 120, 5, mRecipe.getOutputChance(tStartIndex))); } tStartIndex++; - if (aRecipe.getOutput(tStartIndex) != null) { - this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 102, 23, aRecipe.getOutputChance(tStartIndex))); + if (mRecipe.getOutput(tStartIndex) != null) { + this.mOutputs.add(new FixedPositionedStack(mRecipe.getOutput(tStartIndex), 102, 23, mRecipe.getOutputChance(tStartIndex))); } tStartIndex++; - if (aRecipe.getOutput(tStartIndex) != null) { - this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 120, 23, aRecipe.getOutputChance(tStartIndex))); + if (mRecipe.getOutput(tStartIndex) != null) { + this.mOutputs.add(new FixedPositionedStack(mRecipe.getOutput(tStartIndex), 120, 23, mRecipe.getOutputChance(tStartIndex))); } tStartIndex++; //New fluid display behaviour when 3 fluid inputs are detected. (Basically a mix of the code below for outputs an the code above for 9 input slots.) - if (aRecipe.mFluidInputs.length >= 1) { - if ((aRecipe.mFluidInputs[0] != null) && (aRecipe.mFluidInputs[0].getFluid() != null)) { - this.mInputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(aRecipe.mFluidInputs[0], true), 3, 31)); + if (mRecipe.mFluidInputs.length >= 1) { + if ((mRecipe.mFluidInputs[0] != null) && (mRecipe.mFluidInputs[0].getFluid() != null)) { + this.mInputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(mRecipe.mFluidInputs[0], true), 3, 31)); } - if ((aRecipe.mFluidInputs.length > 1) && (aRecipe.mFluidInputs[1] != null) && (aRecipe.mFluidInputs[1].getFluid() != null)) { - this.mInputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(aRecipe.mFluidInputs[1], true), 21, 31)); + if ((mRecipe.mFluidInputs.length > 1) && (mRecipe.mFluidInputs[1] != null) && (mRecipe.mFluidInputs[1].getFluid() != null)) { + this.mInputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(mRecipe.mFluidInputs[1], true), 21, 31)); } - if ((aRecipe.mFluidInputs.length > 2) && (aRecipe.mFluidInputs[2] != null) && (aRecipe.mFluidInputs[2].getFluid() != null)) { - this.mInputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(aRecipe.mFluidInputs[2], true), 39, 31)); + if ((mRecipe.mFluidInputs.length > 2) && (mRecipe.mFluidInputs[2] != null) && (mRecipe.mFluidInputs[2].getFluid() != null)) { + this.mInputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(mRecipe.mFluidInputs[2], true), 39, 31)); } - if ((aRecipe.mFluidInputs.length > 3) && (aRecipe.mFluidInputs[3] != null) && (aRecipe.mFluidInputs[3].getFluid() != null)) { - this.mInputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(aRecipe.mFluidInputs[3], true), 57, 31)); + if ((mRecipe.mFluidInputs.length > 3) && (mRecipe.mFluidInputs[3] != null) && (mRecipe.mFluidInputs[3].getFluid() != null)) { + this.mInputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(mRecipe.mFluidInputs[3], true), 57, 31)); } } - if (aRecipe.mFluidOutputs.length > 0) { - if ((aRecipe.mFluidOutputs[0] != null) && (aRecipe.mFluidOutputs[0].getFluid() != null)) { - this.mOutputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(aRecipe.mFluidOutputs[0], true), 138, 5)); + if (mRecipe.mFluidOutputs.length > 0) { + if ((mRecipe.mFluidOutputs[0] != null) && (mRecipe.mFluidOutputs[0].getFluid() != null)) { + this.mOutputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(mRecipe.mFluidOutputs[0], true), 138, 5)); } - if ((aRecipe.mFluidOutputs.length > 1) && (aRecipe.mFluidOutputs[1] != null) && (aRecipe.mFluidOutputs[1].getFluid() != null)) { - this.mOutputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(aRecipe.mFluidOutputs[1], true), 138, 23)); + if ((mRecipe.mFluidOutputs.length > 1) && (mRecipe.mFluidOutputs[1] != null) && (mRecipe.mFluidOutputs[1].getFluid() != null)) { + this.mOutputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(mRecipe.mFluidOutputs[1], true), 138, 23)); } } } - - @Override - public List getIngredients() { - return this.getCycledIngredients(GT_NEI_MillingMachine.this.cycleticks / 10, this.mInputs); - } - - @Override - public PositionedStack getResult() { - return null; - } - - @Override - public List getOtherStacks() { - return this.mOutputs; - } } } diff --git a/src/Java/gtPlusPlus/nei/GT_NEI_RFPP.java b/src/Java/gtPlusPlus/nei/GT_NEI_RFPP.java index 93ad7a775b..a4926f5d7e 100644 --- a/src/Java/gtPlusPlus/nei/GT_NEI_RFPP.java +++ b/src/Java/gtPlusPlus/nei/GT_NEI_RFPP.java @@ -1,62 +1,14 @@ package gtPlusPlus.nei; -import java.awt.Point; -import java.awt.Rectangle; -import java.util.*; +import codechicken.nei.recipe.TemplateRecipeHandler; +import gregtech.api.util.GTPP_Recipe.GTPP_Recipe_Map; +import gregtech.api.util.GT_Recipe; +import gregtech.api.util.GT_Utility; -import org.lwjgl.opengl.GL11; - -import codechicken.lib.gui.GuiDraw; -import codechicken.nei.PositionedStack; -import codechicken.nei.guihook.GuiContainerManager; -import codechicken.nei.guihook.IContainerInputHandler; -import codechicken.nei.guihook.IContainerTooltipHandler; -import codechicken.nei.recipe.*; -import cpw.mods.fml.common.event.FMLInterModComms; -import gregtech.api.enums.GT_Values; -import gregtech.api.enums.OrePrefixes; -import gregtech.api.gui.GT_GUIContainer_BasicMachine; -import gregtech.api.objects.ItemData; -import gregtech.api.util.*; -import gregtech.api.util.GTPP_Recipe.GTPP_Recipe_Map_Internal; -import gtPlusPlus.core.util.minecraft.ItemUtils; -import net.minecraft.client.Minecraft; -import net.minecraft.client.gui.inventory.GuiContainer; -import net.minecraft.init.Blocks; -import net.minecraft.item.ItemStack; -import net.minecraftforge.fluids.FluidContainerRegistry; -import net.minecraftforge.fluids.FluidStack; - -public class GT_NEI_RFPP -extends TemplateRecipeHandler { - public static final int sOffsetX = 5; - public static final int sOffsetY = 11; - - static { - GuiContainerManager.addInputHandler(new GT_RectHandler()); - GuiContainerManager.addTooltipHandler(new GT_RectHandler()); - } - - protected GTPP_Recipe_Map_Internal mRecipeMap; +public class GT_NEI_RFPP extends GTPP_NEI_DefaultHandler { public GT_NEI_RFPP() { - this.mRecipeMap = GTPP_Recipe.GTPP_Recipe_Map.sFissionFuelProcessing; - this.transferRects.add(new TemplateRecipeHandler.RecipeTransferRect(new Rectangle(65, 13, 36, 18), this.getRecipeMapName(), new Object[0])); - if (!NEI_GT_Config.sIsAdded) { - FMLInterModComms.sendRuntimeMessage(GT_Values.GT, "NEIPlugins", "register-crafting-handler", "gregtechplusplus@" + this.getRecipeName() + "@" + this.getRecipeMapName()); - GuiCraftingRecipe.craftinghandlers.add(this); - GuiUsageRecipe.usagehandlers.add(this); - } - } - - public List getSortedRecipes() { - List result = new ArrayList(this.mRecipeMap.mRecipeList); - Collections.sort(result); - return result; - } - - public static void drawText(final int aX, final int aY, final String aString, final int aColor) { - Minecraft.getMinecraft().fontRenderer.drawString(aString, aX, aY, aColor); + super(GTPP_Recipe_Map.sFissionFuelProcessing); } @Override @@ -65,451 +17,136 @@ extends TemplateRecipeHandler { } @Override - public void loadCraftingRecipes(final String outputId, final Object... results) { - if (outputId.equals(getRecipeMapName())) { - for (GTPP_Recipe tRecipe : getSortedRecipes()) { - if (!tRecipe.mHidden) { - this.arecipes.add(new CachedDefaultRecipe(tRecipe)); - } - } - } else { - super.loadCraftingRecipes(outputId, results); - } - } - - @Override - public void loadCraftingRecipes(final ItemStack aResult) { - ItemData tPrefixMaterial = GT_OreDictUnificator.getAssociation(aResult); - - ArrayList tResults = new ArrayList(); - tResults.add(aResult); - tResults.add(GT_OreDictUnificator.get(true, aResult)); - if ((tPrefixMaterial != null) && (!tPrefixMaterial.mBlackListed) && (!tPrefixMaterial.mPrefix.mFamiliarPrefixes.isEmpty())) { - for (OrePrefixes tPrefix : tPrefixMaterial.mPrefix.mFamiliarPrefixes) { - tResults.add(GT_OreDictUnificator.get(tPrefix, tPrefixMaterial.mMaterial.mMaterial, 1L)); - } - } - FluidStack tFluid = GT_Utility.getFluidForFilledItem(aResult, true); - if (tFluid != null) { - tResults.add(GT_Utility.getFluidDisplayStack(tFluid, false)); - for (FluidContainerRegistry.FluidContainerData tData : FluidContainerRegistry.getRegisteredFluidContainerData()) { - if (tData.fluid.isFluidEqual(tFluid)) { - tResults.add(GT_Utility.copy(new Object[]{tData.filledContainer})); - } - } - } - for (GTPP_Recipe tRecipe : getSortedRecipes()) { - if (!tRecipe.mHidden) { - CachedDefaultRecipe tNEIRecipe = new CachedDefaultRecipe(tRecipe); - for (ItemStack tStack : tResults) { - if (tNEIRecipe.contains(tNEIRecipe.mOutputs, tStack)) { - this.arecipes.add(tNEIRecipe); - break; - } - } - } - } - //CachedDefaultRecipe tNEIRecipe; - } - - public void loadUsageRecipes(ItemStack aInput) { - ItemData tPrefixMaterial = GT_OreDictUnificator.getAssociation(aInput); - - ArrayList tInputs = new ArrayList(); - tInputs.add(aInput); - tInputs.add(GT_OreDictUnificator.get(false, aInput)); - if ((tPrefixMaterial != null) && (!tPrefixMaterial.mPrefix.mFamiliarPrefixes.isEmpty())) { - for (OrePrefixes tPrefix : tPrefixMaterial.mPrefix.mFamiliarPrefixes) { - tInputs.add(GT_OreDictUnificator.get(tPrefix, tPrefixMaterial.mMaterial.mMaterial, 1L)); - } - } - FluidStack tFluid = GT_Utility.getFluidForFilledItem(aInput, true); - if (tFluid != null) { - tInputs.add(GT_Utility.getFluidDisplayStack(tFluid, false)); - for (FluidContainerRegistry.FluidContainerData tData : FluidContainerRegistry.getRegisteredFluidContainerData()) { - if (tData.fluid.isFluidEqual(tFluid)) { - tInputs.add(GT_Utility.copy(new Object[]{tData.filledContainer})); - } - } - } - for (GTPP_Recipe tRecipe : getSortedRecipes()) { - if (!tRecipe.mHidden) { - CachedDefaultRecipe tNEIRecipe = new CachedDefaultRecipe(tRecipe); - for (ItemStack tStack : tInputs) { - if (tNEIRecipe.contains(tNEIRecipe.mInputs, tStack)) { - this.arecipes.add(tNEIRecipe); - break; - } - } - } - } - //CachedDefaultRecipe tNEIRecipe; - } - - public String getRecipeMapName() { - return this.mRecipeMap.mNEIName; - } - - @Override - public String getOverlayIdentifier() { - return this.mRecipeMap.mNEIName; - } - - @Override - public void drawBackground(final int recipe) { - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - GuiDraw.changeTexture(this.getGuiTexture()); - GuiDraw.drawTexturedModalRect(-4, -8, 1, 3, 174, 78); - } - - @Override - public int recipiesPerPage() { - return 1; - } - - @Override - public String getRecipeName() { - return GT_LanguageManager.getTranslation(this.mRecipeMap.mUnlocalizedName); - } - - @Override - public String getGuiTexture() { - return this.mRecipeMap.mNEIGUIPath; - } + public CachedDefaultRecipe createCachedRecipe(GT_Recipe aRecipe) { + return new FFPPDefaultRecipe(aRecipe); + } - @Override - public List handleItemTooltip(final GuiRecipe gui, final ItemStack aStack, final List currenttip, final int aRecipeIndex) { - final TemplateRecipeHandler.CachedRecipe tObject = this.arecipes.get(aRecipeIndex); - if ((tObject instanceof CachedDefaultRecipe)) { - final CachedDefaultRecipe tRecipe = (CachedDefaultRecipe) tObject; - for (final PositionedStack tStack : tRecipe.mOutputs) { - if (aStack == tStack.item) { - if ((!(tStack instanceof FixedPositionedStack)) || (((FixedPositionedStack) tStack).mChance <= 0) || (((FixedPositionedStack) tStack).mChance == 10000)) { - break; - } - currenttip.add("Chance: " + (((FixedPositionedStack) tStack).mChance / 100) + "." + ((((FixedPositionedStack) tStack).mChance % 100) < 10 ? "0" + (((FixedPositionedStack) tStack).mChance % 100) : Integer.valueOf(((FixedPositionedStack) tStack).mChance % 100)) + "%"); - break; - } - } - for (final PositionedStack tStack : tRecipe.mInputs) { - if (GT_Utility.areStacksEqual(aStack, tStack.item)) { - if ((gregtech.api.enums.ItemList.Display_Fluid.isStackEqual(tStack.item, true, true)) || - (tStack.item.stackSize != 0)) { - break; - } - if (ItemUtils.isControlCircuit(aStack)) { - currenttip.add("Does not get consumed in the process"); - } - break; - } - } - } - return currenttip; - } + public class FFPPDefaultRecipe extends CachedDefaultRecipe { - @Override - public void drawExtras(final int aRecipeIndex) { - final long tEUt = ((CachedDefaultRecipe) this.arecipes.get(aRecipeIndex)).mRecipe.mEUt; - final int tDuration = ((CachedDefaultRecipe) this.arecipes.get(aRecipeIndex)).mRecipe.mDuration; - if (tEUt != 0) { - drawText(10, 73, "Total: " + (long) (tDuration * tEUt) + " EU", -16777216); - //drawText(10, 83, "Usage: " + tEUt + " EU/t", -16777216); - if (this.mRecipeMap.mShowVoltageAmperageInNEI) { - drawText(10, 83, "Voltage: " + (tEUt / this.mRecipeMap.mAmperage) + " EU/t", -16777216); - drawText(10, 93, "Amperage: " + this.mRecipeMap.mAmperage, -16777216); - } else { - drawText(10, 93, "Voltage: unspecified", -16777216); - drawText(10, 103, "Amperage: unspecified", -16777216); - } + public FFPPDefaultRecipe(final GT_Recipe aRecipe) { + super(aRecipe); } - if (tDuration > 0) { - drawText(10, 103, "Time: " + (tDuration < 20 ? "< 1" : Integer.valueOf(tDuration / 20)) + " secs", -16777216); - } - //if ((GT_Utility.isStringValid(this.mRecipeMap.mNEISpecialValuePre)) || (GT_Utility.isStringValid(this.mRecipeMap.mNEISpecialValuePost))) { - //drawText(10, 113, this.mRecipeMap.mNEISpecialValuePre + (((CachedDefaultRecipe) this.arecipes.get(aRecipeIndex)).mRecipe.mSpecialValue * this.mRecipeMap.mNEISpecialValueMultiplier) + this.mRecipeMap.mNEISpecialValuePost, -16777216); - //} - } - public static class GT_RectHandler - implements IContainerInputHandler, IContainerTooltipHandler { @Override - public boolean mouseClicked(final GuiContainer gui, final int mousex, final int mousey, final int button) { - if (this.canHandle(gui)) { - if (button == 0) { - return this.transferRect(gui, false); - } - if (button == 1) { - return this.transferRect(gui, true); - } - } - return false; - } - - @Override - public boolean lastKeyTyped(final GuiContainer gui, final char keyChar, final int keyCode) { - return false; - } - - public boolean canHandle(final GuiContainer gui) { - return (((gui instanceof GT_GUIContainer_BasicMachine)) && (GT_Utility.isStringValid(((GT_GUIContainer_BasicMachine) gui).mNEI)) /*|| ((gui instanceof GT_GUIContainer_FusionReactor)) && (GT_Utility.isStringValid(((GT_GUIContainer_FusionReactor) gui).mNEI))*/); - } - - @Override - public List handleTooltip(final GuiContainer gui, final int mousex, final int mousey, final List currenttip) { - if ((this.canHandle(gui)) && (currenttip.isEmpty())) { - if ((gui instanceof GT_GUIContainer_BasicMachine) && new Rectangle(65, 13, 36, 18).contains(new Point(GuiDraw.getMousePosition().x - ((GT_GUIContainer_BasicMachine) gui).getLeft() - codechicken.nei.recipe.RecipeInfo.getGuiOffset(gui)[0], GuiDraw.getMousePosition().y - ((GT_GUIContainer_BasicMachine) gui).getTop() - codechicken.nei.recipe.RecipeInfo.getGuiOffset(gui)[1]))) { - currenttip.add("Recipes"); - } /*else if (gui instanceof GT_GUIContainer_FusionReactor && new Rectangle(145, 0, 24, 24).contains(new Point(GuiDraw.getMousePosition().x - ((GT_GUIContainer_FusionReactor) gui).getLeft() - codechicken.nei.recipe.RecipeInfo.getGuiOffset(gui)[0], GuiDraw.getMousePosition().y - ((GT_GUIContainer_FusionReactor) gui).getTop() - codechicken.nei.recipe.RecipeInfo.getGuiOffset(gui)[1]))) { - currenttip.add("Recipes"); - }*/ - - } - return currenttip; - } - - private boolean transferRect(final GuiContainer gui, final boolean usage) { - if (gui instanceof GT_GUIContainer_BasicMachine) { - return (this.canHandle(gui)) && (new Rectangle(65, 13, 36, 18).contains(new Point(GuiDraw.getMousePosition().x - ((GT_GUIContainer_BasicMachine) gui).getLeft() - codechicken.nei.recipe.RecipeInfo.getGuiOffset(gui)[0], GuiDraw.getMousePosition().y - ((GT_GUIContainer_BasicMachine) gui).getTop() - codechicken.nei.recipe.RecipeInfo.getGuiOffset(gui)[1]))) && (usage ? GuiUsageRecipe.openRecipeGui(((GT_GUIContainer_BasicMachine) gui).mNEI, new Object[0]) : GuiCraftingRecipe.openRecipeGui(((GT_GUIContainer_BasicMachine) gui).mNEI, new Object[0])); - } /*else if (gui instanceof GT_GUIContainer_FusionReactor) { - return (canHandle(gui)) && (new Rectangle(145, 0, 24, 24).contains(new Point(GuiDraw.getMousePosition().x - ((GT_GUIContainer_FusionReactor) gui).getLeft() - codechicken.nei.recipe.RecipeInfo.getGuiOffset(gui)[0], GuiDraw.getMousePosition().y - ((GT_GUIContainer_FusionReactor) gui).getTop() - codechicken.nei.recipe.RecipeInfo.getGuiOffset(gui)[1]))) && (usage ? GuiUsageRecipe.openRecipeGui(((GT_GUIContainer_FusionReactor) gui).mNEI, new Object[0]) : GuiCraftingRecipe.openRecipeGui(((GT_GUIContainer_FusionReactor) gui).mNEI, new Object[0])); - }*/ - return false; - } - - @Override - public List handleItemDisplayName(final GuiContainer gui, final ItemStack itemstack, final List currenttip) { - return currenttip; - } - - @Override - public List handleItemTooltip(final GuiContainer gui, final ItemStack itemstack, final int mousex, final int mousey, final List currenttip) { - return currenttip; - } - - @Override - public boolean keyTyped(final GuiContainer gui, final char keyChar, final int keyCode) { - return false; - } - - @Override - public void onKeyTyped(final GuiContainer gui, final char keyChar, final int keyID) { - } - - @Override - public void onMouseClicked(final GuiContainer gui, final int mousex, final int mousey, final int button) { - } - - @Override - public void onMouseUp(final GuiContainer gui, final int mousex, final int mousey, final int button) { - } - - @Override - public boolean mouseScrolled(final GuiContainer gui, final int mousex, final int mousey, final int scrolled) { - return false; - } - - @Override - public void onMouseScrolled(final GuiContainer gui, final int mousex, final int mousey, final int scrolled) { - } - - @Override - public void onMouseDragged(final GuiContainer gui, final int mousex, final int mousey, final int button, final long heldTime) { - } - } - - public class FixedPositionedStack - extends PositionedStack { - public final int mChance; - public boolean permutated = false; - - public FixedPositionedStack(final Object object, final int x, final int y) { - this(object, x, y, 0); - } - - public FixedPositionedStack(final Object object, final int x, final int y, final int aChance) { - super(object, x, y, true); - this.mChance = aChance; - } - - @Override - public void generatePermutations() { - if (this.permutated) { - return; - } - final ArrayList tDisplayStacks = new ArrayList(); - for (final ItemStack tStack : this.items) { - if (GT_Utility.isStackValid(tStack)) { - if (tStack.getItemDamage() == 32767) { - final List permutations = codechicken.nei.ItemList.itemMap.get(tStack.getItem()); - if (!permutations.isEmpty()) { - ItemStack stack; - for (final Iterator i$ = permutations.iterator(); i$.hasNext(); tDisplayStacks.add(GT_Utility.copyAmount(tStack.stackSize, new Object[]{stack}))) { - stack = i$.next(); - } - } else { - final ItemStack base = new ItemStack(tStack.getItem(), tStack.stackSize); - base.stackTagCompound = tStack.stackTagCompound; - tDisplayStacks.add(base); - } - } else { - tDisplayStacks.add(GT_Utility.copy(new Object[]{tStack})); - } - } - } - this.items = (tDisplayStacks.toArray(new ItemStack[0])); - if (this.items.length == 0) { - this.items = new ItemStack[]{new ItemStack(Blocks.fire)}; - } - this.permutated = true; - this.setPermutationToRender(0); - } - } - - public class CachedDefaultRecipe - extends TemplateRecipeHandler.CachedRecipe { - public final GT_Recipe mRecipe; - public final List mOutputs = new ArrayList(); - public final List mInputs = new ArrayList(); - - public CachedDefaultRecipe(final GT_Recipe aRecipe) { - super(); - this.mRecipe = aRecipe; - - int tStartIndex = 0; - - - if (aRecipe.getRepresentativeInput(tStartIndex) != null) { - this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 12, 5)); + public void handleSlots() { + int tStartIndex = 0; + if (mRecipe.getRepresentativeInput(tStartIndex) != null) { + this.mInputs.add(new FixedPositionedStack(mRecipe.getRepresentativeInput(tStartIndex), 12, 5)); } tStartIndex++; - if (aRecipe.getRepresentativeInput(tStartIndex) != null) { - this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 30, 5)); + if (mRecipe.getRepresentativeInput(tStartIndex) != null) { + this.mInputs.add(new FixedPositionedStack(mRecipe.getRepresentativeInput(tStartIndex), 30, 5)); } tStartIndex++; - if (aRecipe.getRepresentativeInput(tStartIndex) != null) { - this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 48, 5)); + if (mRecipe.getRepresentativeInput(tStartIndex) != null) { + this.mInputs.add(new FixedPositionedStack(mRecipe.getRepresentativeInput(tStartIndex), 48, 5)); } tStartIndex++; - if (aRecipe.getRepresentativeInput(tStartIndex) != null) { - this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 12, 23)); + if (mRecipe.getRepresentativeInput(tStartIndex) != null) { + this.mInputs.add(new FixedPositionedStack(mRecipe.getRepresentativeInput(tStartIndex), 12, 23)); } tStartIndex++; - if (aRecipe.getRepresentativeInput(tStartIndex) != null) { - this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 30, 23)); + if (mRecipe.getRepresentativeInput(tStartIndex) != null) { + this.mInputs.add(new FixedPositionedStack(mRecipe.getRepresentativeInput(tStartIndex), 30, 23)); } tStartIndex++; - if (aRecipe.getRepresentativeInput(tStartIndex) != null) { - this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 48, 23)); + if (mRecipe.getRepresentativeInput(tStartIndex) != null) { + this.mInputs.add(new FixedPositionedStack(mRecipe.getRepresentativeInput(tStartIndex), 48, 23)); } tStartIndex++; - if (aRecipe.mSpecialItems != null) { - this.mInputs.add(new FixedPositionedStack(aRecipe.mSpecialItems, 120, 52)); + if (mRecipe.mSpecialItems != null) { + this.mInputs.add(new FixedPositionedStack(mRecipe.mSpecialItems, 120, 52)); } tStartIndex = 0; //Four Output Slots - if (aRecipe.getOutput(tStartIndex) != null) { - this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 102, 5, aRecipe.getOutputChance(tStartIndex))); + if (mRecipe.getOutput(tStartIndex) != null) { + this.mOutputs.add(new FixedPositionedStack(mRecipe.getOutput(tStartIndex), 102, 5, mRecipe.getOutputChance(tStartIndex))); } tStartIndex++; - if (aRecipe.getOutput(tStartIndex) != null) { - this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 120, 5, aRecipe.getOutputChance(tStartIndex))); + if (mRecipe.getOutput(tStartIndex) != null) { + this.mOutputs.add(new FixedPositionedStack(mRecipe.getOutput(tStartIndex), 120, 5, mRecipe.getOutputChance(tStartIndex))); } tStartIndex++; - if (aRecipe.getOutput(tStartIndex) != null) { - this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 102, 23, aRecipe.getOutputChance(tStartIndex))); + if (mRecipe.getOutput(tStartIndex) != null) { + this.mOutputs.add(new FixedPositionedStack(mRecipe.getOutput(tStartIndex), 102, 23, mRecipe.getOutputChance(tStartIndex))); } tStartIndex++; - if (aRecipe.getOutput(tStartIndex) != null) { - this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 120, 23, aRecipe.getOutputChance(tStartIndex))); + if (mRecipe.getOutput(tStartIndex) != null) { + this.mOutputs.add(new FixedPositionedStack(mRecipe.getOutput(tStartIndex), 120, 23, mRecipe.getOutputChance(tStartIndex))); } tStartIndex++; //New fluid display behaviour when 3 fluid inputs are detected. (Basically a mix of the code below for outputs an the code above for 9 input slots.) - if (aRecipe.mFluidInputs.length > 2) { - if ((aRecipe.mFluidInputs[0] != null) && (aRecipe.mFluidInputs[0].getFluid() != null)) { - this.mInputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(aRecipe.mFluidInputs[0], true), 12, 5)); + if (mRecipe.mFluidInputs.length > 2) { + if ((mRecipe.mFluidInputs[0] != null) && (mRecipe.mFluidInputs[0].getFluid() != null)) { + this.mInputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(mRecipe.mFluidInputs[0], true), 12, 5)); } - if ((aRecipe.mFluidInputs[1] != null) && (aRecipe.mFluidInputs[1].getFluid() != null)) { - this.mInputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(aRecipe.mFluidInputs[1], true), 30, 5)); + if ((mRecipe.mFluidInputs[1] != null) && (mRecipe.mFluidInputs[1].getFluid() != null)) { + this.mInputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(mRecipe.mFluidInputs[1], true), 30, 5)); } - if ((aRecipe.mFluidInputs.length > 2) && (aRecipe.mFluidInputs[2] != null) && (aRecipe.mFluidInputs[2].getFluid() != null)) { - this.mInputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(aRecipe.mFluidInputs[2], true), 48, 5)); + if ((mRecipe.mFluidInputs.length > 2) && (mRecipe.mFluidInputs[2] != null) && (mRecipe.mFluidInputs[2].getFluid() != null)) { + this.mInputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(mRecipe.mFluidInputs[2], true), 48, 5)); } - if ((aRecipe.mFluidInputs.length > 3) && (aRecipe.mFluidInputs[3] != null) && (aRecipe.mFluidInputs[3].getFluid() != null)) { - this.mInputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(aRecipe.mFluidInputs[3], true), 12, 23)); + if ((mRecipe.mFluidInputs.length > 3) && (mRecipe.mFluidInputs[3] != null) && (mRecipe.mFluidInputs[3].getFluid() != null)) { + this.mInputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(mRecipe.mFluidInputs[3], true), 12, 23)); } - if ((aRecipe.mFluidInputs.length > 4) && (aRecipe.mFluidInputs[4] != null) && (aRecipe.mFluidInputs[4].getFluid() != null)) { - this.mInputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(aRecipe.mFluidInputs[4], true), 30, 23)); + if ((mRecipe.mFluidInputs.length > 4) && (mRecipe.mFluidInputs[4] != null) && (mRecipe.mFluidInputs[4].getFluid() != null)) { + this.mInputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(mRecipe.mFluidInputs[4], true), 30, 23)); } - if ((aRecipe.mFluidInputs.length > 5) && (aRecipe.mFluidInputs[5] != null) && (aRecipe.mFluidInputs[5].getFluid() != null)) { - this.mInputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(aRecipe.mFluidInputs[5], true), 48, 23)); + if ((mRecipe.mFluidInputs.length > 5) && (mRecipe.mFluidInputs[5] != null) && (mRecipe.mFluidInputs[5].getFluid() != null)) { + this.mInputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(mRecipe.mFluidInputs[5], true), 48, 23)); } - if ((aRecipe.mFluidInputs.length > 6) && (aRecipe.mFluidInputs[6] != null) && (aRecipe.mFluidInputs[6].getFluid() != null)) { - this.mInputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(aRecipe.mFluidInputs[6], true), 12, 41)); + if ((mRecipe.mFluidInputs.length > 6) && (mRecipe.mFluidInputs[6] != null) && (mRecipe.mFluidInputs[6].getFluid() != null)) { + this.mInputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(mRecipe.mFluidInputs[6], true), 12, 41)); } - if ((aRecipe.mFluidInputs.length > 7) && (aRecipe.mFluidInputs[7] != null) && (aRecipe.mFluidInputs[7].getFluid() != null)) { - this.mInputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(aRecipe.mFluidInputs[7], true), 30, 41)); + if ((mRecipe.mFluidInputs.length > 7) && (mRecipe.mFluidInputs[7] != null) && (mRecipe.mFluidInputs[7].getFluid() != null)) { + this.mInputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(mRecipe.mFluidInputs[7], true), 30, 41)); } - if ((aRecipe.mFluidInputs.length > 8) && (aRecipe.mFluidInputs[8] != null) && (aRecipe.mFluidInputs[8].getFluid() != null)) { - this.mInputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(aRecipe.mFluidInputs[8], true), 48, 41)); + if ((mRecipe.mFluidInputs.length > 8) && (mRecipe.mFluidInputs[8] != null) && (mRecipe.mFluidInputs[8].getFluid() != null)) { + this.mInputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(mRecipe.mFluidInputs[8], true), 48, 41)); } } //Returns to old behaviour if fluid inputs < 3 - else if ((aRecipe.mFluidInputs.length > 0) && (aRecipe.mFluidInputs[0] != null) && (aRecipe.mFluidInputs[0].getFluid() != null)) { - this.mInputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(aRecipe.mFluidInputs[0], true), 48, 52)); - if ((aRecipe.mFluidInputs.length == 2) && (aRecipe.mFluidInputs[1] != null) && (aRecipe.mFluidInputs[1].getFluid() != null)) { - this.mInputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(aRecipe.mFluidInputs[1], true), 30, 52)); + else if ((mRecipe.mFluidInputs.length > 0) && (mRecipe.mFluidInputs[0] != null) && (mRecipe.mFluidInputs[0].getFluid() != null)) { + this.mInputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(mRecipe.mFluidInputs[0], true), 48, 52)); + if ((mRecipe.mFluidInputs.length == 2) && (mRecipe.mFluidInputs[1] != null) && (mRecipe.mFluidInputs[1].getFluid() != null)) { + this.mInputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(mRecipe.mFluidInputs[1], true), 30, 52)); } } - if (aRecipe.mFluidOutputs.length > 1) { - if ((aRecipe.mFluidOutputs[0] != null) && (aRecipe.mFluidOutputs[0].getFluid() != null)) { - this.mOutputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(aRecipe.mFluidOutputs[0], true), 102, 5)); + if (mRecipe.mFluidOutputs.length > 1) { + if ((mRecipe.mFluidOutputs[0] != null) && (mRecipe.mFluidOutputs[0].getFluid() != null)) { + this.mOutputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(mRecipe.mFluidOutputs[0], true), 102, 5)); } - if ((aRecipe.mFluidOutputs[1] != null) && (aRecipe.mFluidOutputs[1].getFluid() != null)) { - this.mOutputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(aRecipe.mFluidOutputs[1], true), 120, 5)); + if ((mRecipe.mFluidOutputs[1] != null) && (mRecipe.mFluidOutputs[1].getFluid() != null)) { + this.mOutputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(mRecipe.mFluidOutputs[1], true), 120, 5)); } - if ((aRecipe.mFluidOutputs.length > 2) && (aRecipe.mFluidOutputs[2] != null) && (aRecipe.mFluidOutputs[2].getFluid() != null)) { - this.mOutputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(aRecipe.mFluidOutputs[2], true), 138, 5)); + if ((mRecipe.mFluidOutputs.length > 2) && (mRecipe.mFluidOutputs[2] != null) && (mRecipe.mFluidOutputs[2].getFluid() != null)) { + this.mOutputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(mRecipe.mFluidOutputs[2], true), 138, 5)); } - if ((aRecipe.mFluidOutputs.length > 3) && (aRecipe.mFluidOutputs[3] != null) && (aRecipe.mFluidOutputs[3].getFluid() != null)) { - this.mOutputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(aRecipe.mFluidOutputs[3], true), 102, 23)); + if ((mRecipe.mFluidOutputs.length > 3) && (mRecipe.mFluidOutputs[3] != null) && (mRecipe.mFluidOutputs[3].getFluid() != null)) { + this.mOutputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(mRecipe.mFluidOutputs[3], true), 102, 23)); } - if ((aRecipe.mFluidOutputs.length > 4) && (aRecipe.mFluidOutputs[4] != null) && (aRecipe.mFluidOutputs[4].getFluid() != null)) { - this.mOutputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(aRecipe.mFluidOutputs[4], true), 120, 23)); + if ((mRecipe.mFluidOutputs.length > 4) && (mRecipe.mFluidOutputs[4] != null) && (mRecipe.mFluidOutputs[4].getFluid() != null)) { + this.mOutputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(mRecipe.mFluidOutputs[4], true), 120, 23)); } - if ((aRecipe.mFluidOutputs.length > 5) && (aRecipe.mFluidOutputs[5] != null) && (aRecipe.mFluidOutputs[5].getFluid() != null)) { - this.mOutputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(aRecipe.mFluidOutputs[5], true), 138, 23)); + if ((mRecipe.mFluidOutputs.length > 5) && (mRecipe.mFluidOutputs[5] != null) && (mRecipe.mFluidOutputs[5].getFluid() != null)) { + this.mOutputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(mRecipe.mFluidOutputs[5], true), 138, 23)); } - if ((aRecipe.mFluidOutputs.length > 6) && (aRecipe.mFluidOutputs[6] != null) && (aRecipe.mFluidOutputs[6].getFluid() != null)) { - this.mOutputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(aRecipe.mFluidOutputs[6], true), 102, 41)); + if ((mRecipe.mFluidOutputs.length > 6) && (mRecipe.mFluidOutputs[6] != null) && (mRecipe.mFluidOutputs[6].getFluid() != null)) { + this.mOutputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(mRecipe.mFluidOutputs[6], true), 102, 41)); } - if ((aRecipe.mFluidOutputs.length > 7) && (aRecipe.mFluidOutputs[7] != null) && (aRecipe.mFluidOutputs[7].getFluid() != null)) { - this.mOutputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(aRecipe.mFluidOutputs[7], true), 120, 41)); + if ((mRecipe.mFluidOutputs.length > 7) && (mRecipe.mFluidOutputs[7] != null) && (mRecipe.mFluidOutputs[7].getFluid() != null)) { + this.mOutputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(mRecipe.mFluidOutputs[7], true), 120, 41)); } - if ((aRecipe.mFluidOutputs.length > 8) && (aRecipe.mFluidOutputs[8] != null) && (aRecipe.mFluidOutputs[8].getFluid() != null)) { - this.mOutputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(aRecipe.mFluidOutputs[8], true), 138, 41)); + if ((mRecipe.mFluidOutputs.length > 8) && (mRecipe.mFluidOutputs[8] != null) && (mRecipe.mFluidOutputs[8].getFluid() != null)) { + this.mOutputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(mRecipe.mFluidOutputs[8], true), 138, 41)); } - } else if ((aRecipe.mFluidOutputs.length > 0) && (aRecipe.mFluidOutputs[0] != null) && (aRecipe.mFluidOutputs[0].getFluid() != null)) { - this.mOutputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(aRecipe.mFluidOutputs[0], true), 102, 5)); + } else if ((mRecipe.mFluidOutputs.length > 0) && (mRecipe.mFluidOutputs[0] != null) && (mRecipe.mFluidOutputs[0].getFluid() != null)) { + this.mOutputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(mRecipe.mFluidOutputs[0], true), 102, 5)); } } - - @Override - public List getIngredients() { - return this.getCycledIngredients(GT_NEI_RFPP.this.cycleticks / 10, this.mInputs); - } - - @Override - public PositionedStack getResult() { - return null; - } - - @Override - public List getOtherStacks() { - return this.mOutputs; - } } } diff --git a/src/Java/gtPlusPlus/nei/GT_NEI_VacFurnace.java b/src/Java/gtPlusPlus/nei/GT_NEI_VacFurnace.java index e17bc6b15e..5fe63c4c61 100644 --- a/src/Java/gtPlusPlus/nei/GT_NEI_VacFurnace.java +++ b/src/Java/gtPlusPlus/nei/GT_NEI_VacFurnace.java @@ -1,63 +1,14 @@ package gtPlusPlus.nei; -import java.awt.Point; -import java.awt.Rectangle; -import java.util.*; - -import org.lwjgl.opengl.GL11; - -import codechicken.lib.gui.GuiDraw; -import codechicken.nei.PositionedStack; -import codechicken.nei.guihook.GuiContainerManager; -import codechicken.nei.guihook.IContainerInputHandler; -import codechicken.nei.guihook.IContainerTooltipHandler; -import codechicken.nei.recipe.*; -import cpw.mods.fml.common.event.FMLInterModComms; -import gregtech.api.enums.GT_Values; -import gregtech.api.enums.OrePrefixes; -import gregtech.api.gui.GT_GUIContainer_BasicMachine; -import gregtech.api.objects.ItemData; -import gregtech.api.util.*; -import gregtech.api.util.GT_Recipe.GT_Recipe_Map; +import codechicken.nei.recipe.TemplateRecipeHandler; import gregtech.api.util.GTPP_Recipe.GTPP_Recipe_Map; -import gtPlusPlus.core.util.minecraft.ItemUtils; -import net.minecraft.client.Minecraft; -import net.minecraft.client.gui.inventory.GuiContainer; -import net.minecraft.init.Blocks; -import net.minecraft.item.ItemStack; -import net.minecraftforge.fluids.FluidContainerRegistry; -import net.minecraftforge.fluids.FluidStack; - -public class GT_NEI_VacFurnace -extends TemplateRecipeHandler { - public static final int sOffsetX = 5; - public static final int sOffsetY = 11; - - static { - GuiContainerManager.addInputHandler(new GT_RectHandler()); - GuiContainerManager.addTooltipHandler(new GT_RectHandler()); - } +import gregtech.api.util.GT_Recipe; +import gregtech.api.util.GT_Utility; - protected GT_Recipe_Map mRecipeMap; +public class GT_NEI_VacFurnace extends GTPP_NEI_DefaultHandler { public GT_NEI_VacFurnace() { - this.mRecipeMap = GTPP_Recipe_Map.sVacuumFurnaceRecipes; - this.transferRects.add(new TemplateRecipeHandler.RecipeTransferRect(new Rectangle(65, 13, 36, 18), this.getRecipeMapName(), new Object[0])); - if (!NEI_GT_Config.sIsAdded) { - FMLInterModComms.sendRuntimeMessage(GT_Values.GT, "NEIPlugins", "register-crafting-handler", "gregtechplusplus@" + this.getRecipeName() + "@" + this.getRecipeMapName()); - GuiCraftingRecipe.craftinghandlers.add(this); - GuiUsageRecipe.usagehandlers.add(this); - } - } - - public List getSortedRecipes() { - List result = new ArrayList(this.mRecipeMap.mRecipeList); - Collections.sort(result); - return result; - } - - public static void drawText(final int aX, final int aY, final String aString, final int aColor) { - Minecraft.getMinecraft().fontRenderer.drawString(aString, aX, aY, aColor); + super(GTPP_Recipe_Map.sVacuumFurnaceRecipes); } @Override @@ -66,417 +17,103 @@ extends TemplateRecipeHandler { } @Override - public void loadCraftingRecipes(final String outputId, final Object... results) { - if (outputId.equals(getRecipeMapName())) { - for (GTPP_Recipe tRecipe : getSortedRecipes()) { - if (!tRecipe.mHidden) { - this.arecipes.add(new CachedDefaultRecipe(tRecipe)); - } - } - } else { - super.loadCraftingRecipes(outputId, results); - } - } - - @Override - public void loadCraftingRecipes(final ItemStack aResult) { - ItemData tPrefixMaterial = GT_OreDictUnificator.getAssociation(aResult); - - ArrayList tResults = new ArrayList(); - tResults.add(aResult); - tResults.add(GT_OreDictUnificator.get(true, aResult)); - if ((tPrefixMaterial != null) && (!tPrefixMaterial.mBlackListed) && (!tPrefixMaterial.mPrefix.mFamiliarPrefixes.isEmpty())) { - for (OrePrefixes tPrefix : tPrefixMaterial.mPrefix.mFamiliarPrefixes) { - tResults.add(GT_OreDictUnificator.get(tPrefix, tPrefixMaterial.mMaterial.mMaterial, 1L)); - } - } - FluidStack tFluid = GT_Utility.getFluidForFilledItem(aResult, true); - if (tFluid != null) { - tResults.add(GT_Utility.getFluidDisplayStack(tFluid, false)); - for (FluidContainerRegistry.FluidContainerData tData : FluidContainerRegistry.getRegisteredFluidContainerData()) { - if (tData.fluid.isFluidEqual(tFluid)) { - tResults.add(GT_Utility.copy(new Object[]{tData.filledContainer})); - } - } - } - for (GTPP_Recipe tRecipe : getSortedRecipes()) { - if (!tRecipe.mHidden) { - CachedDefaultRecipe tNEIRecipe = new CachedDefaultRecipe(tRecipe); - for (ItemStack tStack : tResults) { - if (tNEIRecipe.contains(tNEIRecipe.mOutputs, tStack)) { - this.arecipes.add(tNEIRecipe); - break; - } - } - } - } - //CachedDefaultRecipe tNEIRecipe; - } - - public void loadUsageRecipes(ItemStack aInput) { - ItemData tPrefixMaterial = GT_OreDictUnificator.getAssociation(aInput); - - ArrayList tInputs = new ArrayList(); - tInputs.add(aInput); - tInputs.add(GT_OreDictUnificator.get(false, aInput)); - if ((tPrefixMaterial != null) && (!tPrefixMaterial.mPrefix.mFamiliarPrefixes.isEmpty())) { - for (OrePrefixes tPrefix : tPrefixMaterial.mPrefix.mFamiliarPrefixes) { - tInputs.add(GT_OreDictUnificator.get(tPrefix, tPrefixMaterial.mMaterial.mMaterial, 1L)); - } - } - FluidStack tFluid = GT_Utility.getFluidForFilledItem(aInput, true); - if (tFluid != null) { - tInputs.add(GT_Utility.getFluidDisplayStack(tFluid, false)); - for (FluidContainerRegistry.FluidContainerData tData : FluidContainerRegistry.getRegisteredFluidContainerData()) { - if (tData.fluid.isFluidEqual(tFluid)) { - tInputs.add(GT_Utility.copy(new Object[]{tData.filledContainer})); - } - } - } - for (GTPP_Recipe tRecipe : getSortedRecipes()) { - if (!tRecipe.mHidden) { - CachedDefaultRecipe tNEIRecipe = new CachedDefaultRecipe(tRecipe); - for (ItemStack tStack : tInputs) { - if (tNEIRecipe.contains(tNEIRecipe.mInputs, tStack)) { - this.arecipes.add(tNEIRecipe); - break; - } - } - } - } - //CachedDefaultRecipe tNEIRecipe; - } - - public String getRecipeMapName() { - return this.mRecipeMap.mNEIName; - } - - @Override - public String getOverlayIdentifier() { - return this.mRecipeMap.mNEIName; - } - - @Override - public void drawBackground(final int recipe) { - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - GuiDraw.changeTexture(this.getGuiTexture()); - GuiDraw.drawTexturedModalRect(-4, -8, 1, 3, 174, 78); - } - - @Override - public int recipiesPerPage() { - return 1; - } - - @Override - public String getRecipeName() { - return GT_LanguageManager.getTranslation(this.mRecipeMap.mUnlocalizedName); - } - - @Override - public String getGuiTexture() { - return GTPP_Recipe.GTPP_Recipe_Map.sFissionFuelProcessing.mNEIGUIPath; - } - - @Override - public List handleItemTooltip(final GuiRecipe gui, final ItemStack aStack, final List currenttip, final int aRecipeIndex) { - final TemplateRecipeHandler.CachedRecipe tObject = this.arecipes.get(aRecipeIndex); - if ((tObject instanceof CachedDefaultRecipe)) { - final CachedDefaultRecipe tRecipe = (CachedDefaultRecipe) tObject; - for (final PositionedStack tStack : tRecipe.mOutputs) { - if (aStack == tStack.item) { - if ((!(tStack instanceof FixedPositionedStack)) || (((FixedPositionedStack) tStack).mChance <= 0) || (((FixedPositionedStack) tStack).mChance == 10000)) { - break; - } - currenttip.add("Chance: " + (((FixedPositionedStack) tStack).mChance / 100) + "." + ((((FixedPositionedStack) tStack).mChance % 100) < 10 ? "0" + (((FixedPositionedStack) tStack).mChance % 100) : Integer.valueOf(((FixedPositionedStack) tStack).mChance % 100)) + "%"); - break; - } - } - for (final PositionedStack tStack : tRecipe.mInputs) { - if (GT_Utility.areStacksEqual(aStack, tStack.item)) { - if ((gregtech.api.enums.ItemList.Display_Fluid.isStackEqual(tStack.item, true, true)) || - (tStack.item.stackSize != 0)) { - break; - } - if (ItemUtils.isControlCircuit(aStack)) { - currenttip.add("Does not get consumed in the process"); - } - break; - } - } - } - return currenttip; - } - - @Override - public void drawExtras(final int aRecipeIndex) { - final long tEUt = ((CachedDefaultRecipe) this.arecipes.get(aRecipeIndex)).mRecipe.mEUt; - final int tDuration = ((CachedDefaultRecipe) this.arecipes.get(aRecipeIndex)).mRecipe.mDuration; - if (tEUt != 0) { - drawText(10, 88, "Total: " + (long) (tDuration * tEUt) + " EU", -16777216); - drawText(10, 98, "Usage: " + tEUt + " EU/t", -16777216); - /*if (this.mRecipeMap.mShowVoltageAmperageInNEI) { - drawText(10, 83, "Voltage: " + (tEUt / this.mRecipeMap.mAmperage) + " EU/t", -16777216); - drawText(10, 93, "Amperage: " + this.mRecipeMap.mAmperage, -16777216); - } else { - drawText(10, 93, "Voltage: unspecified", -16777216); - drawText(10, 103, "Amperage: unspecified", -16777216); - }*/ - } - if (tDuration > 0) { - drawText(10, 108, "Time: " + (tDuration < 20 ? "< 1" : Integer.valueOf(tDuration / 20)) + " secs", -16777216); - } - if ((GT_Utility.isStringValid(this.mRecipeMap.mNEISpecialValuePre)) || (GT_Utility.isStringValid(this.mRecipeMap.mNEISpecialValuePost))) { - drawText(10, 118, this.mRecipeMap.mNEISpecialValuePre + (((CachedDefaultRecipe) this.arecipes.get(aRecipeIndex)).mRecipe.mSpecialValue * this.mRecipeMap.mNEISpecialValueMultiplier) + this.mRecipeMap.mNEISpecialValuePost, -16777216); - } - } + public CachedDefaultRecipe createCachedRecipe(GT_Recipe aRecipe) { + return new VacFurnaceDefaultRecipe(aRecipe); + } - public static class GT_RectHandler - implements IContainerInputHandler, IContainerTooltipHandler { - @Override - public boolean mouseClicked(final GuiContainer gui, final int mousex, final int mousey, final int button) { - if (this.canHandle(gui)) { - if (button == 0) { - return this.transferRect(gui, false); - } - if (button == 1) { - return this.transferRect(gui, true); - } - } - return false; - } + public class VacFurnaceDefaultRecipe extends CachedDefaultRecipe { - @Override - public boolean lastKeyTyped(final GuiContainer gui, final char keyChar, final int keyCode) { - return false; - } - - public boolean canHandle(final GuiContainer gui) { - return (((gui instanceof GT_GUIContainer_BasicMachine)) && (GT_Utility.isStringValid(((GT_GUIContainer_BasicMachine) gui).mNEI)) /*|| ((gui instanceof GT_GUIContainer_FusionReactor)) && (GT_Utility.isStringValid(((GT_GUIContainer_FusionReactor) gui).mNEI))*/); + public VacFurnaceDefaultRecipe(final GT_Recipe aRecipe) { + super(aRecipe); } @Override - public List handleTooltip(final GuiContainer gui, final int mousex, final int mousey, final List currenttip) { - if ((this.canHandle(gui)) && (currenttip.isEmpty())) { - if ((gui instanceof GT_GUIContainer_BasicMachine) && new Rectangle(65, 13, 36, 18).contains(new Point(GuiDraw.getMousePosition().x - ((GT_GUIContainer_BasicMachine) gui).getLeft() - codechicken.nei.recipe.RecipeInfo.getGuiOffset(gui)[0], GuiDraw.getMousePosition().y - ((GT_GUIContainer_BasicMachine) gui).getTop() - codechicken.nei.recipe.RecipeInfo.getGuiOffset(gui)[1]))) { - currenttip.add("Recipes"); - } /*else if (gui instanceof GT_GUIContainer_FusionReactor && new Rectangle(145, 0, 24, 24).contains(new Point(GuiDraw.getMousePosition().x - ((GT_GUIContainer_FusionReactor) gui).getLeft() - codechicken.nei.recipe.RecipeInfo.getGuiOffset(gui)[0], GuiDraw.getMousePosition().y - ((GT_GUIContainer_FusionReactor) gui).getTop() - codechicken.nei.recipe.RecipeInfo.getGuiOffset(gui)[1]))) { - currenttip.add("Recipes"); - }*/ + public void handleSlots() { + int tStartIndex = 0; - } - return currenttip; - } - - private boolean transferRect(final GuiContainer gui, final boolean usage) { - if (gui instanceof GT_GUIContainer_BasicMachine) { - return (this.canHandle(gui)) && (new Rectangle(65, 13, 36, 18).contains(new Point(GuiDraw.getMousePosition().x - ((GT_GUIContainer_BasicMachine) gui).getLeft() - codechicken.nei.recipe.RecipeInfo.getGuiOffset(gui)[0], GuiDraw.getMousePosition().y - ((GT_GUIContainer_BasicMachine) gui).getTop() - codechicken.nei.recipe.RecipeInfo.getGuiOffset(gui)[1]))) && (usage ? GuiUsageRecipe.openRecipeGui(((GT_GUIContainer_BasicMachine) gui).mNEI, new Object[0]) : GuiCraftingRecipe.openRecipeGui(((GT_GUIContainer_BasicMachine) gui).mNEI, new Object[0])); - } /*else if (gui instanceof GT_GUIContainer_FusionReactor) { - return (canHandle(gui)) && (new Rectangle(145, 0, 24, 24).contains(new Point(GuiDraw.getMousePosition().x - ((GT_GUIContainer_FusionReactor) gui).getLeft() - codechicken.nei.recipe.RecipeInfo.getGuiOffset(gui)[0], GuiDraw.getMousePosition().y - ((GT_GUIContainer_FusionReactor) gui).getTop() - codechicken.nei.recipe.RecipeInfo.getGuiOffset(gui)[1]))) && (usage ? GuiUsageRecipe.openRecipeGui(((GT_GUIContainer_FusionReactor) gui).mNEI, new Object[0]) : GuiCraftingRecipe.openRecipeGui(((GT_GUIContainer_FusionReactor) gui).mNEI, new Object[0])); - }*/ - return false; - } - - @Override - public List handleItemDisplayName(final GuiContainer gui, final ItemStack itemstack, final List currenttip) { - return currenttip; - } - - @Override - public List handleItemTooltip(final GuiContainer gui, final ItemStack itemstack, final int mousex, final int mousey, final List currenttip) { - return currenttip; - } - - @Override - public boolean keyTyped(final GuiContainer gui, final char keyChar, final int keyCode) { - return false; - } - - @Override - public void onKeyTyped(final GuiContainer gui, final char keyChar, final int keyID) { - } - - @Override - public void onMouseClicked(final GuiContainer gui, final int mousex, final int mousey, final int button) { - } - - @Override - public void onMouseUp(final GuiContainer gui, final int mousex, final int mousey, final int button) { - } - - @Override - public boolean mouseScrolled(final GuiContainer gui, final int mousex, final int mousey, final int scrolled) { - return false; - } - - @Override - public void onMouseScrolled(final GuiContainer gui, final int mousex, final int mousey, final int scrolled) { - } - - @Override - public void onMouseDragged(final GuiContainer gui, final int mousex, final int mousey, final int button, final long heldTime) { - } - } - - public class FixedPositionedStack - extends PositionedStack { - public final int mChance; - public boolean permutated = false; - - public FixedPositionedStack(final Object object, final int x, final int y) { - this(object, x, y, 0); - } - - public FixedPositionedStack(final Object object, final int x, final int y, final int aChance) { - super(object, x, y, true); - this.mChance = aChance; - } - - @Override - public void generatePermutations() { - if (this.permutated) { - return; - } - final ArrayList tDisplayStacks = new ArrayList(); - for (final ItemStack tStack : this.items) { - if (GT_Utility.isStackValid(tStack)) { - if (tStack.getItemDamage() == 32767) { - final List permutations = codechicken.nei.ItemList.itemMap.get(tStack.getItem()); - if (!permutations.isEmpty()) { - ItemStack stack; - for (final Iterator i$ = permutations.iterator(); i$.hasNext(); tDisplayStacks.add(GT_Utility.copyAmount(tStack.stackSize, new Object[]{stack}))) { - stack = i$.next(); - } - } else { - final ItemStack base = new ItemStack(tStack.getItem(), tStack.stackSize); - base.stackTagCompound = tStack.stackTagCompound; - tDisplayStacks.add(base); - } - } else { - tDisplayStacks.add(GT_Utility.copy(new Object[]{tStack})); - } - } - } - this.items = (tDisplayStacks.toArray(new ItemStack[0])); - if (this.items.length == 0) { - this.items = new ItemStack[]{new ItemStack(Blocks.fire)}; - } - this.permutated = true; - this.setPermutationToRender(0); - } - } - - public class CachedDefaultRecipe - extends TemplateRecipeHandler.CachedRecipe { - public final GT_Recipe mRecipe; - public final List mOutputs = new ArrayList(); - public final List mInputs = new ArrayList(); - - public CachedDefaultRecipe(final GT_Recipe aRecipe) { - super(); - this.mRecipe = aRecipe; - - int tStartIndex = 0; - - - if (aRecipe.getRepresentativeInput(tStartIndex) != null) { - this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 12, 5)); + if (mRecipe.getRepresentativeInput(tStartIndex) != null) { + this.mInputs.add(new FixedPositionedStack(mRecipe.getRepresentativeInput(tStartIndex), 12, 5)); } tStartIndex++; - if (aRecipe.getRepresentativeInput(tStartIndex) != null) { - this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 30, 5)); + if (mRecipe.getRepresentativeInput(tStartIndex) != null) { + this.mInputs.add(new FixedPositionedStack(mRecipe.getRepresentativeInput(tStartIndex), 30, 5)); } tStartIndex++; - if (aRecipe.getRepresentativeInput(tStartIndex) != null) { - this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 48, 5)); + if (mRecipe.getRepresentativeInput(tStartIndex) != null) { + this.mInputs.add(new FixedPositionedStack(mRecipe.getRepresentativeInput(tStartIndex), 48, 5)); } tStartIndex++; - if (aRecipe.getRepresentativeInput(tStartIndex) != null) { - this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 12, 23)); + if (mRecipe.getRepresentativeInput(tStartIndex) != null) { + this.mInputs.add(new FixedPositionedStack(mRecipe.getRepresentativeInput(tStartIndex), 12, 23)); } tStartIndex++; - if (aRecipe.getRepresentativeInput(tStartIndex) != null) { - this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 30, 23)); + if (mRecipe.getRepresentativeInput(tStartIndex) != null) { + this.mInputs.add(new FixedPositionedStack(mRecipe.getRepresentativeInput(tStartIndex), 30, 23)); } tStartIndex++; - if (aRecipe.getRepresentativeInput(tStartIndex) != null) { - this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 48, 23)); + if (mRecipe.getRepresentativeInput(tStartIndex) != null) { + this.mInputs.add(new FixedPositionedStack(mRecipe.getRepresentativeInput(tStartIndex), 48, 23)); } tStartIndex++; - if (aRecipe.mSpecialItems != null) { - this.mInputs.add(new FixedPositionedStack(aRecipe.mSpecialItems, 120, 52)); + if (mRecipe.mSpecialItems != null) { + this.mInputs.add(new FixedPositionedStack(mRecipe.mSpecialItems, 120, 52)); } tStartIndex = 0; //9 Output Slots - if (aRecipe.getOutput(tStartIndex) != null) { - this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 101, 4, aRecipe.getOutputChance(tStartIndex))); + if (mRecipe.getOutput(tStartIndex) != null) { + this.mOutputs.add(new FixedPositionedStack(mRecipe.getOutput(tStartIndex), 101, 4, mRecipe.getOutputChance(tStartIndex))); } tStartIndex++; - if (aRecipe.getOutput(tStartIndex) != null) { - this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 119, 4, aRecipe.getOutputChance(tStartIndex))); + if (mRecipe.getOutput(tStartIndex) != null) { + this.mOutputs.add(new FixedPositionedStack(mRecipe.getOutput(tStartIndex), 119, 4, mRecipe.getOutputChance(tStartIndex))); } tStartIndex++; - if (aRecipe.getOutput(tStartIndex) != null) { - this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 137, 4, aRecipe.getOutputChance(tStartIndex))); + if (mRecipe.getOutput(tStartIndex) != null) { + this.mOutputs.add(new FixedPositionedStack(mRecipe.getOutput(tStartIndex), 137, 4, mRecipe.getOutputChance(tStartIndex))); } tStartIndex++; - if (aRecipe.getOutput(tStartIndex) != null) { - this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 101, 22, aRecipe.getOutputChance(tStartIndex))); + if (mRecipe.getOutput(tStartIndex) != null) { + this.mOutputs.add(new FixedPositionedStack(mRecipe.getOutput(tStartIndex), 101, 22, mRecipe.getOutputChance(tStartIndex))); } tStartIndex++; - if (aRecipe.getOutput(tStartIndex) != null) { - this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 119, 22, aRecipe.getOutputChance(tStartIndex))); + if (mRecipe.getOutput(tStartIndex) != null) { + this.mOutputs.add(new FixedPositionedStack(mRecipe.getOutput(tStartIndex), 119, 22, mRecipe.getOutputChance(tStartIndex))); } tStartIndex++; - if (aRecipe.getOutput(tStartIndex) != null) { - this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 137, 22, aRecipe.getOutputChance(tStartIndex))); + if (mRecipe.getOutput(tStartIndex) != null) { + this.mOutputs.add(new FixedPositionedStack(mRecipe.getOutput(tStartIndex), 137, 22, mRecipe.getOutputChance(tStartIndex))); } tStartIndex++; - if (aRecipe.getOutput(tStartIndex) != null) { - this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 101, 40, aRecipe.getOutputChance(tStartIndex))); + if (mRecipe.getOutput(tStartIndex) != null) { + this.mOutputs.add(new FixedPositionedStack(mRecipe.getOutput(tStartIndex), 101, 40, mRecipe.getOutputChance(tStartIndex))); } tStartIndex++; - if (aRecipe.getOutput(tStartIndex) != null) { - this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 119, 40, aRecipe.getOutputChance(tStartIndex))); + if (mRecipe.getOutput(tStartIndex) != null) { + this.mOutputs.add(new FixedPositionedStack(mRecipe.getOutput(tStartIndex), 119, 40, mRecipe.getOutputChance(tStartIndex))); } tStartIndex++; - if (aRecipe.getOutput(tStartIndex) != null) { - this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 137, 40, aRecipe.getOutputChance(tStartIndex))); + if (mRecipe.getOutput(tStartIndex) != null) { + this.mOutputs.add(new FixedPositionedStack(mRecipe.getOutput(tStartIndex), 137, 40, mRecipe.getOutputChance(tStartIndex))); } tStartIndex++; - if ((aRecipe.mFluidInputs.length > 0) && (aRecipe.mFluidInputs[0] != null) && (aRecipe.mFluidInputs[0].getFluid() != null)) { - this.mInputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(aRecipe.mFluidInputs[0], true), 12, 60)); - if ((aRecipe.mFluidInputs.length > 1) && (aRecipe.mFluidInputs[1] != null) && (aRecipe.mFluidInputs[1].getFluid() != null)) { - this.mInputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(aRecipe.mFluidInputs[1], true), 30, 60)); + if ((mRecipe.mFluidInputs.length > 0) && (mRecipe.mFluidInputs[0] != null) && (mRecipe.mFluidInputs[0].getFluid() != null)) { + this.mInputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(mRecipe.mFluidInputs[0], true), 12, 60)); + if ((mRecipe.mFluidInputs.length > 1) && (mRecipe.mFluidInputs[1] != null) && (mRecipe.mFluidInputs[1].getFluid() != null)) { + this.mInputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(mRecipe.mFluidInputs[1], true), 30, 60)); } } - if (aRecipe.mFluidOutputs.length > 0) { - if ((aRecipe.mFluidOutputs[0] != null) && (aRecipe.mFluidOutputs[0].getFluid() != null)) { - this.mOutputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(aRecipe.mFluidOutputs[0], true), 101, 60)); + if (mRecipe.mFluidOutputs.length > 0) { + if ((mRecipe.mFluidOutputs[0] != null) && (mRecipe.mFluidOutputs[0].getFluid() != null)) { + this.mOutputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(mRecipe.mFluidOutputs[0], true), 101, 60)); } - if ((aRecipe.mFluidOutputs.length > 1) && (aRecipe.mFluidOutputs[1] != null) && (aRecipe.mFluidOutputs[1].getFluid() != null)) { - this.mOutputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(aRecipe.mFluidOutputs[1], true), 119, 60)); + if ((mRecipe.mFluidOutputs.length > 1) && (mRecipe.mFluidOutputs[1] != null) && (mRecipe.mFluidOutputs[1].getFluid() != null)) { + this.mOutputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(mRecipe.mFluidOutputs[1], true), 119, 60)); } } } - - @Override - public List getIngredients() { - return this.getCycledIngredients(GT_NEI_VacFurnace.this.cycleticks / 10, this.mInputs); - } - - @Override - public PositionedStack getResult() { - return null; - } - - @Override - public List getOtherStacks() { - return this.mOutputs; - } } } diff --git a/src/Java/gtPlusPlus/nei/GT_NEI_multiCentriElectroFreezer.java b/src/Java/gtPlusPlus/nei/GT_NEI_multiCentriElectroFreezer.java index 793f53f127..3f22b15f3b 100644 --- a/src/Java/gtPlusPlus/nei/GT_NEI_multiCentriElectroFreezer.java +++ b/src/Java/gtPlusPlus/nei/GT_NEI_multiCentriElectroFreezer.java @@ -1,91 +1,17 @@ package gtPlusPlus.nei; -import java.awt.Point; -import java.awt.Rectangle; -import java.util.*; +import java.util.HashMap; -import org.lwjgl.opengl.GL11; - -import codechicken.lib.gui.GuiDraw; -import codechicken.nei.PositionedStack; -import codechicken.nei.guihook.GuiContainerManager; -import codechicken.nei.guihook.IContainerInputHandler; -import codechicken.nei.guihook.IContainerTooltipHandler; -import codechicken.nei.recipe.*; -import cpw.mods.fml.common.event.FMLInterModComms; -import gregtech.api.enums.GT_Values; -import gregtech.api.enums.OrePrefixes; -import gregtech.api.gui.GT_GUIContainer_BasicMachine; -import gregtech.api.objects.ItemData; -import gregtech.api.util.*; -import gregtech.api.util.GTPP_Recipe.GTPP_Recipe_Map_Internal; -import gtPlusPlus.api.objects.Logger; +import codechicken.nei.recipe.TemplateRecipeHandler; +import gregtech.api.util.GT_Recipe; +import gregtech.api.util.GT_Recipe.GT_Recipe_Map; +import gregtech.api.util.GT_Utility; import gtPlusPlus.api.objects.data.Pair; -import gtPlusPlus.core.util.minecraft.ItemUtils; -import net.minecraft.client.Minecraft; -import net.minecraft.client.gui.inventory.GuiContainer; -import net.minecraft.init.Blocks; -import net.minecraft.item.ItemStack; -import net.minecraftforge.fluids.FluidContainerRegistry; -import net.minecraftforge.fluids.FluidStack; - -public class GT_NEI_multiCentriElectroFreezer -extends TemplateRecipeHandler { - public static final int sOffsetX = 5; - public static final int sOffsetY = 11; - - static { - GuiContainerManager.addInputHandler(new GT_RectHandler()); - GuiContainerManager.addTooltipHandler(new GT_RectHandler()); - } - protected GTPP_Recipe_Map_Internal mRecipeMap; +public class GT_NEI_multiCentriElectroFreezer extends GTPP_NEI_DefaultHandler { - public GT_NEI_multiCentriElectroFreezer(GTPP_Recipe_Map_Internal aMap) { - this.mRecipeMap = aMap; - this.transferRects.add(new TemplateRecipeHandler.RecipeTransferRect(new Rectangle(65, 13, 36, 18), this.getRecipeMapName(), new Object[0])); - if (!NEI_GT_Config.sIsAdded) { - FMLInterModComms.sendRuntimeMessage(GT_Values.GT, "NEIPlugins", "register-crafting-handler", "gregtechplusplus@" + this.getRecipeName() + "@" + this.getRecipeMapName()); - GuiCraftingRecipe.craftinghandlers.add(this); - GuiUsageRecipe.usagehandlers.add(this); - } - } - - public static void logRecipeError(GT_Recipe aRecipe) { - if (aRecipe == null) { - Logger.INFO("Tried to handle null recipe. :("); - } - else { - ItemStack[] aInputs = aRecipe.mInputs; - ItemStack[] aOutputs = aRecipe.mOutputs; - FluidStack[] aFluidInputs = aRecipe.mFluidInputs; - FluidStack[] aFluidOutputs = aRecipe.mFluidOutputs; - int aEU = aRecipe.mEUt; - int aTime = aRecipe.mDuration; - int aSpecialValue = aRecipe.mSpecialValue; - String aInputitems = ItemUtils.getArrayStackNames(aInputs); - String aOutputitems = ItemUtils.getArrayStackNames(aOutputs); - String aInputFluids = ItemUtils.getArrayStackNames(aFluidInputs); - String aOutputFluids = ItemUtils.getArrayStackNames(aFluidOutputs); - Logger.INFO("Logging Broken Recipe Details:"); - Logger.INFO("Input Items - "+aInputitems); - Logger.INFO("Output Items - "+aOutputitems); - Logger.INFO("Input Fluids - "+aInputFluids); - Logger.INFO("Output Fluids - "+aOutputFluids); - Logger.INFO("EU/t - "+aEU); - Logger.INFO("Duration - "+aTime); - Logger.INFO("Special Value - "+aSpecialValue); - } - } - - public List getSortedRecipes() { - List result = new ArrayList(this.mRecipeMap.mRecipeList); - Collections.sort(result); - return result; - } - - public static void drawText(final int aX, final int aY, final String aString, final int aColor) { - Minecraft.getMinecraft().fontRenderer.drawString(aString, aX, aY, aColor); + public GT_NEI_multiCentriElectroFreezer(GT_Recipe_Map aMap) { + super(aMap); } @Override @@ -94,313 +20,10 @@ extends TemplateRecipeHandler { } @Override - public void loadCraftingRecipes(final String outputId, final Object... results) { - if (outputId.equals(getRecipeMapName())) { - for (GTPP_Recipe tRecipe : getSortedRecipes()) { - if (!tRecipe.mHidden) { - CachedDefaultRecipe tNEIRecipe = getCachedRecipe(tRecipe); - if (tNEIRecipe == null) { - continue; - } - this.arecipes.add(tNEIRecipe); - } - } - } else { - super.loadCraftingRecipes(outputId, results); - } - } - - @Override - public void loadCraftingRecipes(final ItemStack aResult) { - ItemData tPrefixMaterial = GT_OreDictUnificator.getAssociation(aResult); - - ArrayList tResults = new ArrayList(); - tResults.add(aResult); - tResults.add(GT_OreDictUnificator.get(true, aResult)); - if ((tPrefixMaterial != null) && (!tPrefixMaterial.mBlackListed) && (!tPrefixMaterial.mPrefix.mFamiliarPrefixes.isEmpty())) { - for (OrePrefixes tPrefix : tPrefixMaterial.mPrefix.mFamiliarPrefixes) { - tResults.add(GT_OreDictUnificator.get(tPrefix, tPrefixMaterial.mMaterial.mMaterial, 1L)); - } - } - FluidStack tFluid = GT_Utility.getFluidForFilledItem(aResult, true); - if (tFluid != null) { - tResults.add(GT_Utility.getFluidDisplayStack(tFluid, false)); - for (FluidContainerRegistry.FluidContainerData tData : FluidContainerRegistry.getRegisteredFluidContainerData()) { - if (tData.fluid.isFluidEqual(tFluid)) { - tResults.add(GT_Utility.copy(new Object[]{tData.filledContainer})); - } - } - } - for (GTPP_Recipe tRecipe : getSortedRecipes()) { - if (!tRecipe.mHidden) { - CachedDefaultRecipe tNEIRecipe = getCachedRecipe(tRecipe); - if (tNEIRecipe == null) { - continue; - } - for (ItemStack tStack : tResults) { - if (tNEIRecipe.contains(tNEIRecipe.mOutputs, tStack)) { - this.arecipes.add(tNEIRecipe); - break; - } - } - } - } - //CachedDefaultRecipe tNEIRecipe; - } - - public void loadUsageRecipes(ItemStack aInput) { - ItemData tPrefixMaterial = GT_OreDictUnificator.getAssociation(aInput); - - ArrayList tInputs = new ArrayList(); - tInputs.add(aInput); - tInputs.add(GT_OreDictUnificator.get(false, aInput)); - if ((tPrefixMaterial != null) && (!tPrefixMaterial.mPrefix.mFamiliarPrefixes.isEmpty())) { - for (OrePrefixes tPrefix : tPrefixMaterial.mPrefix.mFamiliarPrefixes) { - tInputs.add(GT_OreDictUnificator.get(tPrefix, tPrefixMaterial.mMaterial.mMaterial, 1L)); - } - } - FluidStack tFluid = GT_Utility.getFluidForFilledItem(aInput, true); - if (tFluid != null) { - tInputs.add(GT_Utility.getFluidDisplayStack(tFluid, false)); - for (FluidContainerRegistry.FluidContainerData tData : FluidContainerRegistry.getRegisteredFluidContainerData()) { - if (tData.fluid.isFluidEqual(tFluid)) { - tInputs.add(GT_Utility.copy(new Object[]{tData.filledContainer})); - } - } - } - for (GTPP_Recipe tRecipe : getSortedRecipes()) { - if (!tRecipe.mHidden) { - CachedDefaultRecipe tNEIRecipe = getCachedRecipe(tRecipe); - if (tNEIRecipe == null) { - continue; - } - for (ItemStack tStack : tInputs) { - if (tNEIRecipe.contains(tNEIRecipe.mInputs, tStack)) { - this.arecipes.add(tNEIRecipe); - break; - } - } - } - } - //CachedDefaultRecipe tNEIRecipe; - } - - public String getRecipeMapName() { - return this.mRecipeMap.mNEIName; - } - - @Override - public String getOverlayIdentifier() { - return this.mRecipeMap.mNEIName; - } - - @Override - public void drawBackground(final int recipe) { - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - GuiDraw.changeTexture(this.getGuiTexture()); - GuiDraw.drawTexturedModalRect(-4, -8, 1, 3, 174, 78); - } - - @Override - public int recipiesPerPage() { - return 1; - } - - @Override - public String getRecipeName() { - return GT_LanguageManager.getTranslation(this.mRecipeMap.mUnlocalizedName); - } - - @Override - public String getGuiTexture() { - return this.mRecipeMap.mNEIGUIPath; - } - - @Override - public List handleItemTooltip(final GuiRecipe gui, final ItemStack aStack, final List currenttip, final int aRecipeIndex) { - final TemplateRecipeHandler.CachedRecipe tObject = this.arecipes.get(aRecipeIndex); - if ((tObject instanceof CachedDefaultRecipe)) { - final CachedDefaultRecipe tRecipe = (CachedDefaultRecipe) tObject; - for (final PositionedStack tStack : tRecipe.mOutputs) { - if (aStack == tStack.item) { - if ((!(tStack instanceof FixedPositionedStack)) || (((FixedPositionedStack) tStack).mChance <= 0) || (((FixedPositionedStack) tStack).mChance == 10000)) { - break; - } - currenttip.add("Chance: " + (((FixedPositionedStack) tStack).mChance / 100) + "." + ((((FixedPositionedStack) tStack).mChance % 100) < 10 ? "0" + (((FixedPositionedStack) tStack).mChance % 100) : Integer.valueOf(((FixedPositionedStack) tStack).mChance % 100)) + "%"); - break; - } - } - for (final PositionedStack tStack : tRecipe.mInputs) { - if (aStack == tStack.item) { - if ((gregtech.api.enums.ItemList.Display_Fluid.isStackEqual(tStack.item, true, true)) || - (tStack.item.stackSize != 0)) { - break; - } - currenttip.add("Does not get consumed in the process"); - break; - } - } - } - return currenttip; - } - - @Override - public void drawExtras(final int aRecipeIndex) { - final long tEUt = ((CachedDefaultRecipe) this.arecipes.get(aRecipeIndex)).mRecipe.mEUt; - final int tDuration = ((CachedDefaultRecipe) this.arecipes.get(aRecipeIndex)).mRecipe.mDuration; - if (tEUt != 0) { - drawText(10, 83, "Total: " + (tDuration * tEUt) + " EU", -16777216); - drawText(10, 93, "Usage: " + tEUt + " EU/t", -16777216); - if (this.mRecipeMap.mShowVoltageAmperageInNEI) { - drawText(10, 103, "Voltage: " + (tEUt / this.mRecipeMap.mAmperage) + " EU", -16777216); - drawText(10, 113, "Amperage: " + this.mRecipeMap.mAmperage, -16777216); - } else { - drawText(10, 103, "Voltage: unspecified", -16777216); - drawText(10, 113, "Amperage: unspecified", -16777216); - } - } - if (tDuration > 0) { - drawText(10, 123, "Time: " + (tDuration < 20 ? "< 1" : Integer.valueOf(tDuration / 20)) + " secs", -16777216); - } - if ((GT_Utility.isStringValid(this.mRecipeMap.mNEISpecialValuePre)) || (GT_Utility.isStringValid(this.mRecipeMap.mNEISpecialValuePost))) { - drawText(10, 133, this.mRecipeMap.mNEISpecialValuePre + (((CachedDefaultRecipe) this.arecipes.get(aRecipeIndex)).mRecipe.mSpecialValue * this.mRecipeMap.mNEISpecialValueMultiplier) + this.mRecipeMap.mNEISpecialValuePost, -16777216); - } - } - - public static class GT_RectHandler - implements IContainerInputHandler, IContainerTooltipHandler { - @Override - public boolean mouseClicked(final GuiContainer gui, final int mousex, final int mousey, final int button) { - if (this.canHandle(gui)) { - if (button == 0) { - return this.transferRect(gui, false); - } - if (button == 1) { - return this.transferRect(gui, true); - } - } - return false; - } - - @Override - public boolean lastKeyTyped(final GuiContainer gui, final char keyChar, final int keyCode) { - return false; - } - - public boolean canHandle(final GuiContainer gui) { - return (((gui instanceof GT_GUIContainer_BasicMachine)) && (GT_Utility.isStringValid(((GT_GUIContainer_BasicMachine) gui).mNEI)) /*|| ((gui instanceof GT_GUIContainer_FusionReactor)) && (GT_Utility.isStringValid(((GT_GUIContainer_FusionReactor) gui).mNEI))*/); - } - - @Override - public List handleTooltip(final GuiContainer gui, final int mousex, final int mousey, final List currenttip) { - if ((this.canHandle(gui)) && (currenttip.isEmpty())) { - if ((gui instanceof GT_GUIContainer_BasicMachine) && new Rectangle(65, 13, 36, 18).contains(new Point(GuiDraw.getMousePosition().x - ((GT_GUIContainer_BasicMachine) gui).getLeft() - codechicken.nei.recipe.RecipeInfo.getGuiOffset(gui)[0], GuiDraw.getMousePosition().y - ((GT_GUIContainer_BasicMachine) gui).getTop() - codechicken.nei.recipe.RecipeInfo.getGuiOffset(gui)[1]))) { - currenttip.add("Recipes"); - } /*else if (gui instanceof GT_GUIContainer_FusionReactor && new Rectangle(145, 0, 24, 24).contains(new Point(GuiDraw.getMousePosition().x - ((GT_GUIContainer_FusionReactor) gui).getLeft() - codechicken.nei.recipe.RecipeInfo.getGuiOffset(gui)[0], GuiDraw.getMousePosition().y - ((GT_GUIContainer_FusionReactor) gui).getTop() - codechicken.nei.recipe.RecipeInfo.getGuiOffset(gui)[1]))) { - currenttip.add("Recipes"); - }*/ - - } - return currenttip; - } - - private boolean transferRect(final GuiContainer gui, final boolean usage) { - if (gui instanceof GT_GUIContainer_BasicMachine) { - return (this.canHandle(gui)) && (new Rectangle(65, 13, 36, 18).contains(new Point(GuiDraw.getMousePosition().x - ((GT_GUIContainer_BasicMachine) gui).getLeft() - codechicken.nei.recipe.RecipeInfo.getGuiOffset(gui)[0], GuiDraw.getMousePosition().y - ((GT_GUIContainer_BasicMachine) gui).getTop() - codechicken.nei.recipe.RecipeInfo.getGuiOffset(gui)[1]))) && (usage ? GuiUsageRecipe.openRecipeGui(((GT_GUIContainer_BasicMachine) gui).mNEI, new Object[0]) : GuiCraftingRecipe.openRecipeGui(((GT_GUIContainer_BasicMachine) gui).mNEI, new Object[0])); - } /*else if (gui instanceof GT_GUIContainer_FusionReactor) { - return (canHandle(gui)) && (new Rectangle(145, 0, 24, 24).contains(new Point(GuiDraw.getMousePosition().x - ((GT_GUIContainer_FusionReactor) gui).getLeft() - codechicken.nei.recipe.RecipeInfo.getGuiOffset(gui)[0], GuiDraw.getMousePosition().y - ((GT_GUIContainer_FusionReactor) gui).getTop() - codechicken.nei.recipe.RecipeInfo.getGuiOffset(gui)[1]))) && (usage ? GuiUsageRecipe.openRecipeGui(((GT_GUIContainer_FusionReactor) gui).mNEI, new Object[0]) : GuiCraftingRecipe.openRecipeGui(((GT_GUIContainer_FusionReactor) gui).mNEI, new Object[0])); - }*/ - return false; - } - - @Override - public List handleItemDisplayName(final GuiContainer gui, final ItemStack itemstack, final List currenttip) { - return currenttip; - } - - @Override - public List handleItemTooltip(final GuiContainer gui, final ItemStack itemstack, final int mousex, final int mousey, final List currenttip) { - return currenttip; - } - - @Override - public boolean keyTyped(final GuiContainer gui, final char keyChar, final int keyCode) { - return false; - } - - @Override - public void onKeyTyped(final GuiContainer gui, final char keyChar, final int keyID) { - } - - @Override - public void onMouseClicked(final GuiContainer gui, final int mousex, final int mousey, final int button) { - } - - @Override - public void onMouseUp(final GuiContainer gui, final int mousex, final int mousey, final int button) { - } - - @Override - public boolean mouseScrolled(final GuiContainer gui, final int mousex, final int mousey, final int scrolled) { - return false; - } - - @Override - public void onMouseScrolled(final GuiContainer gui, final int mousex, final int mousey, final int scrolled) { - } - - @Override - public void onMouseDragged(final GuiContainer gui, final int mousex, final int mousey, final int button, final long heldTime) { - } - } - - public class FixedPositionedStack - extends PositionedStack { - public final int mChance; - public boolean permutated = false; - - public FixedPositionedStack(final Object object, final int x, final int y) { - this(object, x, y, 0); - } - - public FixedPositionedStack(final Object object, final int x, final int y, final int aChance) { - super(object, x, y, true); - this.mChance = aChance; - } - - @Override - public void generatePermutations() { - if (this.permutated) { - return; - } - final ArrayList tDisplayStacks = new ArrayList(); - for (final ItemStack tStack : this.items) { - if (GT_Utility.isStackValid(tStack)) { - if (tStack.getItemDamage() == 32767) { - final List permutations = codechicken.nei.ItemList.itemMap.get(tStack.getItem()); - if (!permutations.isEmpty()) { - ItemStack stack; - for (final Iterator i$ = permutations.iterator(); i$.hasNext(); tDisplayStacks.add(GT_Utility.copyAmount(tStack.stackSize, new Object[]{stack}))) { - stack = i$.next(); - } - } else { - final ItemStack base = new ItemStack(tStack.getItem(), tStack.stackSize); - base.stackTagCompound = tStack.stackTagCompound; - tDisplayStacks.add(base); - } - } else { - tDisplayStacks.add(GT_Utility.copy(new Object[]{tStack})); - } - } - } - this.items = (tDisplayStacks.toArray(new ItemStack[0])); - if (this.items.length == 0) { - this.items = new ItemStack[]{new ItemStack(Blocks.fire)}; - } - this.permutated = true; - this.setPermutationToRender(0); - } - } + public CachedDefaultRecipe createCachedRecipe(GT_Recipe aRecipe) { + return new NoCellMultiDefaultRecipe(aRecipe); + } + private static final HashMap> mInputSlotMap = new HashMap>(); private static final HashMap> mOutputSlotMap = new HashMap>(); @@ -440,28 +63,17 @@ extends TemplateRecipeHandler { mOutputSlotMap.put(10, new Pair(aSlotX_2, aSlotY_10)); mOutputSlotMap.put(11, new Pair(aSlotX_3, aSlotY_10)); } - - private CachedDefaultRecipe getCachedRecipe(GT_Recipe aRecipe) { - try { - return new CachedDefaultRecipe(aRecipe); - } - catch(Throwable e) { - logRecipeError(aRecipe); + + public class NoCellMultiDefaultRecipe extends CachedDefaultRecipe { + + public NoCellMultiDefaultRecipe(final GT_Recipe aRecipe) { + super(aRecipe); + } - return null; - } - public class CachedDefaultRecipe - extends TemplateRecipeHandler.CachedRecipe { - - - public final GT_Recipe mRecipe; - public final List mOutputs = new ArrayList(); - public final List mInputs = new ArrayList(); + @Override + public void handleSlots() { - public CachedDefaultRecipe(final GT_Recipe aRecipe) { - super(); - this.mRecipe = aRecipe; int aInputItemsCount = this.mRecipe.mInputs.length; int aInputFluidsCount = this.mRecipe.mFluidInputs.length; int aOutputItemsCount = this.mRecipe.mOutputs.length; @@ -471,8 +83,8 @@ extends TemplateRecipeHandler { int aSlotToCheck = 0; // Special Slot - if (aRecipe.mSpecialItems != null) { - this.mInputs.add(new FixedPositionedStack(aRecipe.mSpecialItems, 120, 52)); + if (mRecipe.mSpecialItems != null) { + this.mInputs.add(new FixedPositionedStack(mRecipe.mSpecialItems, 120, 52)); } /* @@ -487,7 +99,7 @@ extends TemplateRecipeHandler { for (int i=0;i getIngredients() { - return this.getCycledIngredients(GT_NEI_multiCentriElectroFreezer.this.cycleticks / 10, this.mInputs); - } - - @Override - public PositionedStack getResult() { - return null; - } - - @Override - public List getOtherStacks() { - return this.mOutputs; } } } diff --git a/src/Java/gtPlusPlus/nei/NEI_GT_Config.java b/src/Java/gtPlusPlus/nei/NEI_GT_Config.java index be05961785..57da808f1d 100644 --- a/src/Java/gtPlusPlus/nei/NEI_GT_Config.java +++ b/src/Java/gtPlusPlus/nei/NEI_GT_Config.java @@ -5,7 +5,6 @@ import codechicken.nei.api.IConfigureNEI; import gregtech.api.util.GTPP_Recipe; import gregtech.api.util.GTPP_Recipe.GTPP_Recipe_Map; import gregtech.api.util.GT_Recipe.GT_Recipe_Map; -import gregtech.nei.GT_NEI_DefaultHandler; import gtPlusPlus.api.objects.Logger; import gtPlusPlus.api.objects.data.AutoMap; import gtPlusPlus.core.util.Utils; @@ -56,7 +55,7 @@ implements IConfigureNEI { if (tMap.mNEIAllowed) { if (!mUniqueRecipeMapHandling.contains(tMap.mUnlocalizedName)) { Logger.INFO("NEI Registration: Registering NEI handler for "+tMap.mNEIName); - new GT_NEI_DefaultHandler(tMap); + new GTPP_NEI_DefaultHandler(tMap); } else { Logger.INFO("NEI Registration: Not allowed to register NEI handler for "+tMap.mNEIName); diff --git a/src/Java/gtPlusPlus/preloader/asm/Preloader_FMLLoadingPlugin.java b/src/Java/gtPlusPlus/preloader/asm/Preloader_FMLLoadingPlugin.java index 8aa449df5d..22568e6de7 100644 --- a/src/Java/gtPlusPlus/preloader/asm/Preloader_FMLLoadingPlugin.java +++ b/src/Java/gtPlusPlus/preloader/asm/Preloader_FMLLoadingPlugin.java @@ -1,11 +1,14 @@ package gtPlusPlus.preloader.asm; import java.io.File; +import java.text.NumberFormat; +import java.util.Locale; import java.util.Map; import cpw.mods.fml.relauncher.IFMLLoadingPlugin; import cpw.mods.fml.relauncher.IFMLLoadingPlugin.MCVersion; import cpw.mods.fml.relauncher.IFMLLoadingPlugin.SortingIndex; +import gtPlusPlus.core.util.reflect.ReflectionUtils; import gtPlusPlus.preloader.CORE_Preloader; import gtPlusPlus.preloader.Preloader_Logger; import gtPlusPlus.preloader.asm.transformers.Preloader_Transformer_Handler; @@ -71,6 +74,11 @@ public class Preloader_FMLLoadingPlugin implements IFMLLoadingPlugin { CORE_Preloader.DEV_ENVIRONMENT = (Boolean) Launch.blackboard.get("fml.deobfuscatedEnvironment"); CORE_Preloader.DEBUG_MODE = AsmConfig.debugMode; Preloader_Logger.INFO("Running on "+gtPlusPlus.preloader.CORE_Preloader.JAVA_VERSION+" | Development Environment: "+CORE_Preloader.DEV_ENVIRONMENT); + Locale aDefaultLocale = Locale.getDefault(); + NumberFormat aFormat = NumberFormat.getInstance(); + Locale aDisplayLocale = (Locale) ReflectionUtils.getFieldValue(ReflectionUtils.getField(Locale.class, "defaultDisplayLocale")); + Locale aFormatLocale = (Locale) ReflectionUtils.getFieldValue(ReflectionUtils.getField(Locale.class, "defaultFormatLocale")); + Preloader_Logger.INFO("Locale: "+aDefaultLocale+" | Test: "+aFormat.format(1000000000)+" | Display: "+aDisplayLocale+" | Format: "+aFormatLocale); } } \ No newline at end of file diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/interfaces/internal/IGregtech_RecipeAdder.java b/src/Java/gtPlusPlus/xmod/gregtech/api/interfaces/internal/IGregtech_RecipeAdder.java index 34d1290de9..254655215e 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/api/interfaces/internal/IGregtech_RecipeAdder.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/api/interfaces/internal/IGregtech_RecipeAdder.java @@ -304,7 +304,7 @@ public interface IGregtech_RecipeAdder { public boolean addFuelForRTG(ItemStack aFuelPellet, int aFuelDays, int aVoltage); - public boolean addColdTrapRecipe(int aCircuit, ItemStack aInput, FluidStack aFluidInput, ItemStack[] aOutputs, FluidStack aFluidOutput, int aTime, int aEU); + public boolean addColdTrapRecipe(int aCircuit, ItemStack aInput, FluidStack aFluidInput, ItemStack[] aOutputs, int[] aChances, FluidStack aFluidOutput, int aTime, int aEU); public boolean addReactorProcessingUnitRecipe(ItemStack aInput1, ItemStack aInput2, FluidStack aFluidInput, ItemStack[] aOutputs, int[] aChances, FluidStack aFluidOutput, int aTime, int aEU); diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaTileEntity_ReactorColdTrap.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaTileEntity_ReactorColdTrap.java index 58bdba18a5..85e2df42c9 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaTileEntity_ReactorColdTrap.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaTileEntity_ReactorColdTrap.java @@ -16,7 +16,7 @@ public class GregtechMetaTileEntity_ReactorColdTrap extends GT_MetaTileEntity_Ba public GregtechMetaTileEntity_ReactorColdTrap(int aID, String aName, String aNameRegional, int aTier) { super(aID, aName, aNameRegional, aTier, 1, - "Just like the Arctic", 1, 1, "ChemicalReactor.png", "", + "Just like the Arctic", 2, 9, "Dehydrator.png", "", new ITexture[]{ new GT_RenderedTexture(TexturesGtBlock.OVERLAY_REACTOR_COLDTRAP_SIDE_ACTIVE), new GT_RenderedTexture(TexturesGtBlock.OVERLAY_REACTOR_COLDTRAP_SIDE), diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaTileEntity_ReactorProcessingUnit.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaTileEntity_ReactorProcessingUnit.java index 75259a0b88..60e2ec8c0a 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaTileEntity_ReactorProcessingUnit.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaTileEntity_ReactorProcessingUnit.java @@ -16,7 +16,7 @@ public class GregtechMetaTileEntity_ReactorProcessingUnit extends GT_MetaTileEnt public GregtechMetaTileEntity_ReactorProcessingUnit(int aID, String aName, String aNameRegional, int aTier) { super(aID, aName, aNameRegional, aTier, 1, - "Processes Nuclear things", 1, 1, "ChemicalReactor.png", "", + "Processes Nuclear things", 2, 9, "Dehydrator.png", "", new ITexture[]{ new GT_RenderedTexture(TexturesGtBlock.OVERLAY_REACTOR_PROCESSINGUNIT_SIDE_ACTIVE), new GT_RenderedTexture(TexturesGtBlock.OVERLAY_REACTOR_PROCESSINGUNIT_SIDE), diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/chemplant/GregtechMTE_ChemicalPlant.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/chemplant/GregtechMTE_ChemicalPlant.java index 4a2747a3db..5d08210da3 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/chemplant/GregtechMTE_ChemicalPlant.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/chemplant/GregtechMTE_ChemicalPlant.java @@ -1,6 +1,8 @@ package gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.production.chemplant; -import static com.gtnewhorizon.structurelib.structure.StructureUtility.*; +import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofChain; +import static com.gtnewhorizon.structurelib.structure.StructureUtility.onElementPass; +import static com.gtnewhorizon.structurelib.structure.StructureUtility.transpose; import static gregtech.api.util.GT_StructureUtility.ofHatchAdder; import static gtPlusPlus.core.util.data.ArrayUtils.removeNulls; @@ -8,14 +10,12 @@ import java.util.ArrayList; import java.util.HashMap; import java.util.List; +import org.apache.commons.lang3.ArrayUtils; + import com.gtnewhorizon.structurelib.StructureLibAPI; import com.gtnewhorizon.structurelib.structure.IStructureDefinition; import com.gtnewhorizon.structurelib.structure.IStructureElement; import com.gtnewhorizon.structurelib.structure.StructureDefinition; -import gregtech.api.metatileentity.implementations.*; -import gregtech.api.util.*; -import net.minecraft.world.World; -import org.apache.commons.lang3.ArrayUtils; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; @@ -24,7 +24,19 @@ import gregtech.api.enums.Textures; import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Energy; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Input; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_InputBus; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Maintenance; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Output; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_OutputBus; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_TieredMachineBlock; import gregtech.api.objects.GT_RenderedTexture; +import gregtech.api.util.GTPP_Recipe; +import gregtech.api.util.GT_Multiblock_Tooltip_Builder; +import gregtech.api.util.GT_Recipe; +import gregtech.api.util.GT_Utility; import gtPlusPlus.api.objects.Logger; import gtPlusPlus.api.objects.data.AutoMap; import gtPlusPlus.api.objects.data.Triplet; @@ -39,6 +51,7 @@ import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock; import net.minecraft.block.Block; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.world.World; import net.minecraftforge.common.util.ForgeDirection; import net.minecraftforge.fluids.FluidStack; @@ -414,7 +427,7 @@ public class GregtechMTE_ChemicalPlant extends GregtechMeta_MultiBlockBase { } public static void generateRecipes() { - for (GTPP_Recipe i : GTPP_Recipe.GTPP_Recipe_Map.sChemicalPlantRecipes.mRecipeList) { + for (GT_Recipe i : GTPP_Recipe.GTPP_Recipe_Map.sChemicalPlantRecipes.mRecipeList) { GTPP_Recipe.GTPP_Recipe_Map.sChemicalPlant_GT.add(i); } } diff --git a/src/Java/gtPlusPlus/xmod/gregtech/loaders/recipe/RecipeLoader_Nuclear.java b/src/Java/gtPlusPlus/xmod/gregtech/loaders/recipe/RecipeLoader_Nuclear.java index 1397ddc1eb..712caae6a2 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/loaders/recipe/RecipeLoader_Nuclear.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/loaders/recipe/RecipeLoader_Nuclear.java @@ -64,7 +64,7 @@ public class RecipeLoader_Nuclear { ItemUtils.getItemStackOfAmountFromOreDict("dustBerylliumFluoride", 1), GT_Values.NF, GT_Values.NF, - ItemUtils.getItemStackOfAmountFromOreDict("dustLi2BeF4", 3), + ItemUtils.getSimpleStack(ModItems.dustLi2BeF4, 3), null, 60 * 20, 2000, 3000); @@ -495,7 +495,7 @@ public class RecipeLoader_Nuclear { private static void fluidExtractorRecipes() { //FLiBe fuel - CORE.RA.addFluidExtractionRecipe(ItemUtils.getItemStackOfAmountFromOreDict("dustLi2BeF4", 1), + CORE.RA.addFluidExtractionRecipe(ItemUtils.getSimpleStack(ModItems.dustLi2BeF4, 1), new FluidStack(ModItems.fluidFLiBeSalt, 144), 100, 500); //LFTR Fuel 1 CORE.RA.addFluidExtractionRecipe(NUCLIDE.LiFBeF2ZrF4U235.getDust(1), diff --git a/src/Java/gtPlusPlus/xmod/gregtech/loaders/recipe/RecipeLoader_NuclearFuelProcessing.java b/src/Java/gtPlusPlus/xmod/gregtech/loaders/recipe/RecipeLoader_NuclearFuelProcessing.java index 764d7cffdd..7ca838a8f0 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/loaders/recipe/RecipeLoader_NuclearFuelProcessing.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/loaders/recipe/RecipeLoader_NuclearFuelProcessing.java @@ -1,14 +1,18 @@ package gtPlusPlus.xmod.gregtech.loaders.recipe; import gregtech.api.enums.Materials; +import gtPlusPlus.api.objects.Logger; import gtPlusPlus.core.item.ModItems; import gtPlusPlus.core.item.chemistry.NuclearChem; import gtPlusPlus.core.lib.CORE; import gtPlusPlus.core.material.ELEMENT; import gtPlusPlus.core.material.nuclear.FLUORIDES; import gtPlusPlus.core.material.nuclear.NUCLIDE; +import gtPlusPlus.core.recipe.common.CI; import gtPlusPlus.core.util.minecraft.FluidUtils; +import gtPlusPlus.core.util.minecraft.ItemUtils; import gtPlusPlus.core.util.minecraft.MaterialUtils; +import net.minecraft.item.ItemStack; import net.minecraftforge.fluids.FluidStack; public class RecipeLoader_NuclearFuelProcessing { @@ -72,10 +76,73 @@ public class RecipeLoader_NuclearFuelProcessing { final FluidStack aBurntLiFBeF2ZrF4U235 = new FluidStack(NuclearChem.Burnt_LiFBeF2ZrF4U235, 17); final FluidStack aBurntLiFBeF2ZrF4UF4 = new FluidStack(NuclearChem.Burnt_LiFBeF2ZrF4UF4, 17); final FluidStack aBurntLiFBeF2ThF4UF4 = new FluidStack(NuclearChem.Burnt_LiFBeF2ThF4UF4, 17); + FluidStack Li2BeF4 = new FluidStack(ModItems.fluidFLiBeSalt, 34); final FluidStack aBurntLi2BeF4 = new FluidStack(ModItems.fluidFLiBeSaltBurnt, 34); final FluidStack aHelium = Materials.Helium.getGas(1000); final FluidStack aFluorine = Materials.Fluorine.getGas(1000); + + // Reactor Blanket step 1 - Fluorination + boolean a1 = CORE.RA.addReactorProcessingUnitRecipe( + CI.getNumberedAdvancedCircuit(7), + ELEMENT.getInstance().FLUORINE.getCell(10), + NUCLIDE.LiFThF4.getFluid(10000), + new ItemStack[] { + CI.emptyCells(8), + ELEMENT.getInstance().LITHIUM.getCell(2), + ItemUtils.getSimpleStack(ModItems.dustProtactinium233), + ItemUtils.getSimpleStack(ModItems.dustProtactinium233), + ItemUtils.getSimpleStack(ModItems.dustProtactinium233), + ItemUtils.getSimpleStack(ModItems.dustProtactinium233), + ItemUtils.getSimpleStack(ModItems.dustProtactinium233), + ItemUtils.getSimpleStack(ModItems.dustProtactinium233) + }, + new int[] {10000, 10000, 2000, 2000, 2000, 2000, 2000, 2000}, + NUCLIDE.UF6F2.getFluid(10000), + 20 * 60 * 5, + MaterialUtils.getVoltageForTier(5)); + boolean a2 = CORE.RA.addReactorProcessingUnitRecipe( + CI.getNumberedAdvancedCircuit(8), + ELEMENT.getInstance().FLUORINE.getCell(10), + NUCLIDE.LiFBeF2ThF4.getFluid(10000), + new ItemStack[] { + CI.emptyCells(6), + ELEMENT.getInstance().LITHIUM.getCell(2), + FLUORIDES.BERYLLIUM_FLUORIDE.getCell(2), + ItemUtils.getSimpleStack(ModItems.dustProtactinium233), + ItemUtils.getSimpleStack(ModItems.dustProtactinium233), + ItemUtils.getSimpleStack(ModItems.dustProtactinium233), + ItemUtils.getSimpleStack(ModItems.dustProtactinium233), + ItemUtils.getSimpleStack(ModItems.dustProtactinium233), + ItemUtils.getSimpleStack(ModItems.dustProtactinium233) + }, + new int[] {10000, 10000, 10000, 2000, 2000, 2000, 2000, 2000, 2000}, + NUCLIDE.UF6F2.getFluid(10000), + 20 * 60 * 5, + MaterialUtils.getVoltageForTier(5)); + Logger.INFO("Adding LFTR Blanket step 1 - Fluorination ["+a1+"|"+a2+"]"); + + // Reactor Blanket step 2 - Sorption + Cold Trap + boolean a3 = CORE.RA.addColdTrapRecipe( + 8, + FLUORIDES.SODIUM_FLUORIDE.getCell(2), + NUCLIDE.UF6F2.getFluid(3000), + new ItemStack[] { + ELEMENT.getInstance().FLUORINE.getCell(2), + ELEMENT.getInstance().URANIUM233.getDust(1), + ELEMENT.getInstance().URANIUM233.getDust(1), + ELEMENT.getInstance().URANIUM233.getDust(1) + }, + new int[] {10000, 3000, 2000, 1000}, + FLUORIDES.URANIUM_HEXAFLUORIDE.getFluid(1000), + 20 * 60 * 10, + MaterialUtils.getVoltageForTier(3)); + Logger.INFO("Adding LFTR Blanket step 2 - Sorption + Cold Trap ["+a3+"]"); + + + + + CORE.RA.addFissionFuel( FluidUtils.getFluidStack(aBurntLiFBeF2ZrF4U235, 500), FluidUtils.getFluidStack(aBerylliumFluoride, 280), diff --git a/src/Java/gtPlusPlus/xmod/gregtech/recipes/GregtechRecipeAdder.java b/src/Java/gtPlusPlus/xmod/gregtech/recipes/GregtechRecipeAdder.java index 2b5b2b3097..4d7dfed724 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/recipes/GregtechRecipeAdder.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/recipes/GregtechRecipeAdder.java @@ -1757,13 +1757,13 @@ public class GregtechRecipeAdder implements IGregtech_RecipeAdder { @Override - public boolean addColdTrapRecipe(int aCircuit, ItemStack aInput, FluidStack aFluidInput, ItemStack[] aOutputs, FluidStack aFluidOutput, int aTime, int aEU) { + public boolean addColdTrapRecipe(int aCircuit, ItemStack aInput, FluidStack aFluidInput, ItemStack[] aOutputs, int[] aChances, FluidStack aFluidOutput, int aTime, int aEU) { GTPP_Recipe aRecipe = new GTPP_Recipe( false, new ItemStack[] {CI.getNumberedAdvancedCircuit(aCircuit), aInput}, aOutputs, null, - new int[] {}, + aChances, new FluidStack[] {aFluidInput}, new FluidStack[] {aFluidOutput}, aTime, -- cgit From a00d9f9245db7dc0c425044c0aeff84d15092dfd Mon Sep 17 00:00:00 2001 From: Alkalus <3060479+draknyte1@users.noreply.github.com> Date: Mon, 6 Dec 2021 18:07:22 +0000 Subject: Better handling of Material chemical formulae. Fixed some broken recipes. --- src/Java/gtPlusPlus/core/item/ModItems.java | 7 +++++++ src/Java/gtPlusPlus/core/item/base/BaseItemComponent.java | 9 +++------ src/Java/gtPlusPlus/core/item/base/ore/BaseOreComponent.java | 11 ++++++++--- src/Java/gtPlusPlus/core/item/chemistry/RocketFuels.java | 2 +- src/Java/gtPlusPlus/core/material/Material.java | 3 +++ .../loaders/RecipeGen_MultisUsingFluidInsteadOfCells.java | 5 +++++ 6 files changed, 27 insertions(+), 10 deletions(-) (limited to 'src/Java/gtPlusPlus/core/item') diff --git a/src/Java/gtPlusPlus/core/item/ModItems.java b/src/Java/gtPlusPlus/core/item/ModItems.java index e66206a6bc..272b16fbfb 100644 --- a/src/Java/gtPlusPlus/core/item/ModItems.java +++ b/src/Java/gtPlusPlus/core/item/ModItems.java @@ -13,6 +13,7 @@ import gtPlusPlus.core.common.compat.COMPAT_Baubles; import gtPlusPlus.core.creative.AddToCreativeTab; import gtPlusPlus.core.item.base.*; import gtPlusPlus.core.item.base.BaseItemComponent.ComponentTypes; +import gtPlusPlus.core.item.base.dusts.BaseItemDust; import gtPlusPlus.core.item.base.foil.BaseItemFoil; import gtPlusPlus.core.item.base.foods.BaseItemFood; import gtPlusPlus.core.item.base.foods.BaseItemHotFood; @@ -255,6 +256,7 @@ public final class ModItems { public static Item itemDoublePlateClay; public static Item itemDoublePlateEuropium; public static Item itemFoilUranium235; + public static Item itemDustIndium; public static BlockBaseModular blockRawMeat; public static Item itemBoilerChassis; @@ -856,6 +858,11 @@ public final class ModItems { else { itemHotTitaniumIngot = ItemUtils.getItemStackOfAmountFromOreDictNoBroken("ingotHotTitanium", 1); } + + //Need this for Laurenium + if (ItemUtils.getItemStackOfAmountFromOreDictNoBroken("dustIndium", 1) == null){ + itemDustIndium = new BaseItemDust(ELEMENT.getInstance().INDIUM); + } //Industrial Diamonds itemExquisiteIndustrialDiamond = new CoreItem("IndustrialDiamondExquisite", "High Quality Industrial Diamond", tabMisc); diff --git a/src/Java/gtPlusPlus/core/item/base/BaseItemComponent.java b/src/Java/gtPlusPlus/core/item/base/BaseItemComponent.java index 1975e7770d..9ad8ea3feb 100644 --- a/src/Java/gtPlusPlus/core/item/base/BaseItemComponent.java +++ b/src/Java/gtPlusPlus/core/item/base/BaseItemComponent.java @@ -46,8 +46,6 @@ public class BaseItemComponent extends Item{ public final int componentColour; public Object extraData; - private static HashMap mChemicalFormula = new HashMap(); - protected IIcon base; protected IIcon overlay; @@ -61,7 +59,6 @@ public class BaseItemComponent extends Item{ this.setMaxStackSize(64); //this.setTextureName(this.getCorrectTextures()); this.componentColour = material.getRgbAsHex(); - mChemicalFormula.put(materialName.toLowerCase(), material.vChemicalFormula); GameRegistry.registerItem(this, this.unlocalName); //if (componentType != ComponentTypes.DUST) @@ -182,10 +179,10 @@ public class BaseItemComponent extends Item{ if (this.componentMaterial != null){ - if (!this.componentMaterial.vChemicalFormula.contains("?") && this.componentMaterial.getState() != MaterialState.PURE_LIQUID) { + if (!this.componentMaterial.vChemicalFormula.contains("?")) { list.add(Utils.sanitizeStringKeepBrackets(this.componentMaterial.vChemicalFormula)); } - else if (this.componentMaterial.vChemicalFormula.contains("?") && this.componentMaterial.getState() != MaterialState.PURE_LIQUID) { + else if (this.componentMaterial.vChemicalFormula.contains("?")) { String temp = componentMaterial.vChemicalFormula; temp = temp.replace(" ", ""); temp = temp.replace("-", ""); @@ -208,7 +205,7 @@ public class BaseItemComponent extends Item{ } } else { - String aChemicalFormula = mChemicalFormula.get(materialName.toLowerCase()); + String aChemicalFormula = Material.sChemicalFormula.get(materialName.toLowerCase()); if (aChemicalFormula != null && aChemicalFormula.length() > 0) { list.add(Utils.sanitizeStringKeepBrackets(aChemicalFormula)); } diff --git a/src/Java/gtPlusPlus/core/item/base/ore/BaseOreComponent.java b/src/Java/gtPlusPlus/core/item/base/ore/BaseOreComponent.java index 883eb241da..2cb23b3f97 100644 --- a/src/Java/gtPlusPlus/core/item/base/ore/BaseOreComponent.java +++ b/src/Java/gtPlusPlus/core/item/base/ore/BaseOreComponent.java @@ -14,7 +14,6 @@ import gtPlusPlus.core.creative.AddToCreativeTab; import gtPlusPlus.core.lib.CORE; import gtPlusPlus.core.lib.LoadedMods; import gtPlusPlus.core.material.Material; -import gtPlusPlus.core.material.state.MaterialState; import gtPlusPlus.core.util.Utils; import gtPlusPlus.core.util.minecraft.EntityUtils; import gtPlusPlus.core.util.minecraft.ItemUtils; @@ -124,10 +123,10 @@ public class BaseOreComponent extends Item{ public final void addInformation(final ItemStack stack, final EntityPlayer aPlayer, final List list, final boolean bool) { if (this.materialName != null && !this.materialName.equals("")){ if (this.componentMaterial != null){ - if (!this.componentMaterial.vChemicalFormula.contains("?") && this.componentMaterial.getState() != MaterialState.PURE_LIQUID) { + if (!this.componentMaterial.vChemicalFormula.contains("?")) { list.add(Utils.sanitizeStringKeepBrackets(this.componentMaterial.vChemicalFormula)); } - else if (this.componentMaterial.vChemicalFormula.contains("?") && this.componentMaterial.getState() != MaterialState.PURE_LIQUID) { + else if (this.componentMaterial.vChemicalFormula.contains("?")) { String temp = componentMaterial.vChemicalFormula; temp = temp.replace(" ", ""); temp = temp.replace("-", ""); @@ -142,6 +141,12 @@ public class BaseOreComponent extends Item{ list.add(CORE.GT_Tooltip_Radioactive+" | Level: "+this.componentMaterial.vRadiationLevel); } } + else { + String aChemicalFormula = Material.sChemicalFormula.get(materialName.toLowerCase()); + if (aChemicalFormula != null && aChemicalFormula.length() > 0) { + list.add(Utils.sanitizeStringKeepBrackets(aChemicalFormula)); + } + } } super.addInformation(stack, aPlayer, list, bool); } diff --git a/src/Java/gtPlusPlus/core/item/chemistry/RocketFuels.java b/src/Java/gtPlusPlus/core/item/chemistry/RocketFuels.java index c03566c1a8..b96e0c76ea 100644 --- a/src/Java/gtPlusPlus/core/item/chemistry/RocketFuels.java +++ b/src/Java/gtPlusPlus/core/item/chemistry/RocketFuels.java @@ -200,7 +200,7 @@ public class RocketFuels extends ItemPackage { } private static void createLOH() { - GT_Values.RA.addVacuumFreezerRecipe(ItemUtils.getItemStackOfAmountFromOreDict("cellHydrogen", 1), ItemUtils.getItemStackOfAmountFromOreDict("cellLiquidhydrogen", 1), 20*16); + GT_Values.RA.addVacuumFreezerRecipe(ItemUtils.getItemStackOfAmountFromOreDict("cellHydrogen", 1), ItemUtils.getItemStackOfAmountFromOreDict("cellLiquidHydrogen", 1), 20*16); CORE.RA.addAdvancedFreezerRecipe(new ItemStack[] {}, new FluidStack[] {FluidUtils.getFluidStack("hydrogen", 300)}, new FluidStack[] {FluidUtils.getFluidStack(Liquid_Hydrogen, 300)}, new ItemStack[] {}, new int[] {}, 20*4, 540, 0); } diff --git a/src/Java/gtPlusPlus/core/material/Material.java b/src/Java/gtPlusPlus/core/material/Material.java index b8e006b021..404c5c7918 100644 --- a/src/Java/gtPlusPlus/core/material/Material.java +++ b/src/Java/gtPlusPlus/core/material/Material.java @@ -41,6 +41,8 @@ public class Material { public static final Map> mComponentMap = new HashMap>(); + public static HashMap sChemicalFormula = new HashMap(); + private String unlocalizedName; private String localizedName; @@ -518,6 +520,7 @@ public class Material { } } + sChemicalFormula.put(materialName.toLowerCase(), this.vChemicalFormula); Logger.MATERIALS("Creating a Material instance for "+materialName); Logger.MATERIALS("Formula: "+this.vChemicalFormula + " Smallest Stack: "+this.smallestStackSizeWhenProcessing+" Smallest Ratio:"+ratio); Logger.MATERIALS("Protons: "+this.vProtons); diff --git a/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_MultisUsingFluidInsteadOfCells.java b/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_MultisUsingFluidInsteadOfCells.java index 90d7aaa806..a76322e4f4 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_MultisUsingFluidInsteadOfCells.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_MultisUsingFluidInsteadOfCells.java @@ -151,6 +151,11 @@ public class RecipeGen_MultisUsingFluidInsteadOfCells { for (int i = 0; i < aOutputFluidsMap.size(); i++) { aNewFluidOutputs[i] = aOutputFluidsMap.get(i); } + + if (!ItemUtils.checkForInvalidItems(aNewItemInputs, aNewItemOutputs)) { + aInvalidRecipesToConvert++; + continue recipe; // Skip this recipe entirely if we find an item we don't like + } // Add Recipe to map GT_Recipe aNewRecipe = new GTPP_Recipe( -- cgit From 43e67b5f97543c2a1ea51b89ed745d0773f94751 Mon Sep 17 00:00:00 2001 From: Alkalus <3060479+draknyte1@users.noreply.github.com> Date: Tue, 7 Dec 2021 14:37:22 +0000 Subject: Added more nuclear processing recipes. Removed lots of useless nuclear generated items. More NEI improvements. Made Dehydrator and FFPP recipe handling more lenient. --- src/Java/gtPlusPlus/core/item/ModItems.java | 59 ++++---- .../core/item/chemistry/GenericChem.java | 36 ++--- src/Java/gtPlusPlus/core/material/Material.java | 27 ++-- .../core/material/MaterialGenerator.java | 45 +++++- src/Java/gtPlusPlus/core/material/ORES.java | 9 +- .../gtPlusPlus/core/material/nuclear/NUCLIDE.java | 65 +++++++++ .../gtPlusPlus/core/recipe/RECIPES_GREGTECH.java | 54 ++++---- .../gtPlusPlus/core/recipe/RECIPES_Machines.java | 64 ++++----- .../core/recipe/RECIPES_RareEarthProcessing.java | 8 +- .../core/recipe/RECIPES_SeleniumProcessing.java | 16 +-- src/Java/gtPlusPlus/core/recipe/common/CI.java | 2 +- .../machines/TileEntityPestKiller.java | 4 +- .../gtPlusPlus/nei/GTPP_NEI_DefaultHandler.java | 109 ++++++++++++++- src/Java/gtPlusPlus/nei/GT_NEI_MultiNoCell.java | 59 ++++++++ src/Java/gtPlusPlus/nei/GT_NEI_RFPP.java | 152 --------------------- src/Java/gtPlusPlus/nei/GT_NEI_VacFurnace.java | 119 ---------------- .../nei/GT_NEI_multiCentriElectroFreezer.java | 150 -------------------- src/Java/gtPlusPlus/nei/NEI_GT_Config.java | 61 +++------ .../gtPlusPlus/plugin/agrichem/BioRecipes.java | 6 +- .../production/GregtechMTE_NuclearReactor.java | 9 +- .../GregtechMetaTileEntity_LargeRocketEngine.java | 4 +- .../gregtech/loaders/RecipeGen_BlastSmelter.java | 20 +-- .../gregtech/loaders/RecipeGen_DustGeneration.java | 4 +- .../xmod/gregtech/loaders/RecipeGen_Fluids.java | 34 ++--- .../xmod/gregtech/loaders/RecipeGen_Recycling.java | 4 +- .../gregtech/loaders/recipe/RecipeLoader_LFTR.java | 58 ++++---- .../loaders/recipe/RecipeLoader_Nuclear.java | 129 ++++++++++------- .../recipe/RecipeLoader_NuclearFuelProcessing.java | 124 ++++++++++++----- .../xmod/gregtech/recipes/GregtechRecipeAdder.java | 28 ++-- .../gtPlusPlus/xmod/ic2/recipe/RECIPE_IC2.java | 8 +- .../xmod/tinkers/material/BaseTinkersMaterial.java | 10 +- .../gtPlusPlus/xmod/tinkers/util/TinkersUtils.java | 10 +- .../textures/gui/basicmachines/FissionFuel.png | Bin 1149 -> 2393 bytes 33 files changed, 699 insertions(+), 788 deletions(-) create mode 100644 src/Java/gtPlusPlus/nei/GT_NEI_MultiNoCell.java delete mode 100644 src/Java/gtPlusPlus/nei/GT_NEI_RFPP.java delete mode 100644 src/Java/gtPlusPlus/nei/GT_NEI_VacFurnace.java delete mode 100644 src/Java/gtPlusPlus/nei/GT_NEI_multiCentriElectroFreezer.java (limited to 'src/Java/gtPlusPlus/core/item') diff --git a/src/Java/gtPlusPlus/core/item/ModItems.java b/src/Java/gtPlusPlus/core/item/ModItems.java index 272b16fbfb..5447bec472 100644 --- a/src/Java/gtPlusPlus/core/item/ModItems.java +++ b/src/Java/gtPlusPlus/core/item/ModItems.java @@ -5,6 +5,7 @@ import static gtPlusPlus.core.lib.CORE.LOAD_ALL_CONTENT; import cpw.mods.fml.common.registry.GameRegistry; import gregtech.api.enums.Materials; +import gregtech.api.enums.OrePrefixes; import gregtech.api.util.GT_OreDictUnificator; import gtPlusPlus.api.objects.Logger; import gtPlusPlus.core.block.base.BasicBlock.BlockTypes; @@ -232,8 +233,8 @@ public final class ModItems { public static Item dustFertUN18; public static Item dustFertUN32; - public static Fluid fluidFLiBeSalt; - public static Fluid fluidFLiBeSaltBurnt; + //public static Fluid fluidFLiBeSalt; + //public static Fluid fluidFLiBeSaltBurnt; public static Fluid fluidLftrCore1; public static Fluid fluidLftrCore2; @@ -549,30 +550,31 @@ public final class ModItems { MaterialGenerator.generate(ALLOY.TUNGSTEN_TITANIUM_CARBIDE); //LFTR Fuel components - MaterialGenerator.generate(MISC_MATERIALS.HYDROXIDE); //LFTR fuel component - MaterialGenerator.generate(MISC_MATERIALS.AMMONIA); //LFTR fuel component - MaterialGenerator.generate(MISC_MATERIALS.AMMONIUM); //LFTR fuel component - MaterialGenerator.generate(FLUORIDES.AMMONIUM_BIFLUORIDE); //LFTR fuel component - MaterialGenerator.generate(FLUORIDES.BERYLLIUM_HYDROXIDE); //LFTR fuel component - MaterialGenerator.generate(FLUORIDES.AMMONIUM_TETRAFLUOROBERYLLATE); //LFTR fuel component + //MaterialGenerator.generate(MISC_MATERIALS.HYDROXIDE); //LFTR fuel component + //MaterialGenerator.generate(MISC_MATERIALS.AMMONIA); //LFTR fuel component + //MaterialGenerator.generate(MISC_MATERIALS.AMMONIUM); //LFTR fuel component + MaterialGenerator.generateNuclearDusts(FLUORIDES.AMMONIUM_BIFLUORIDE); //LFTR fuel component + MaterialGenerator.generateNuclearDusts(FLUORIDES.BERYLLIUM_HYDROXIDE); //LFTR fuel component + MaterialGenerator.generateNuclearDusts(FLUORIDES.AMMONIUM_TETRAFLUOROBERYLLATE); //LFTR fuel component //Generate Fluorides - MaterialGenerator.generateNuclearMaterial(FLUORIDES.BERYLLIUM_FLUORIDE); - MaterialGenerator.generateNuclearMaterial(FLUORIDES.LITHIUM_FLUORIDE); - MaterialGenerator.generateNuclearMaterial(FLUORIDES.THORIUM_TETRAFLUORIDE); - MaterialGenerator.generateNuclearMaterial(FLUORIDES.THORIUM_HEXAFLUORIDE); - MaterialGenerator.generateNuclearMaterial(FLUORIDES.URANIUM_TETRAFLUORIDE); - MaterialGenerator.generateNuclearMaterial(FLUORIDES.URANIUM_HEXAFLUORIDE); - MaterialGenerator.generateNuclearMaterial(FLUORIDES.ZIRCONIUM_TETRAFLUORIDE); + MaterialGenerator.generateNuclearDusts(FLUORIDES.BERYLLIUM_FLUORIDE); + MaterialGenerator.generateNuclearDusts(FLUORIDES.LITHIUM_FLUORIDE); + MaterialGenerator.generateNuclearDusts(FLUORIDES.THORIUM_TETRAFLUORIDE); + MaterialGenerator.generateNuclearDusts(FLUORIDES.THORIUM_HEXAFLUORIDE); + MaterialGenerator.generateNuclearDusts(FLUORIDES.URANIUM_TETRAFLUORIDE, false); + MaterialGenerator.generateNuclearDusts(FLUORIDES.URANIUM_HEXAFLUORIDE, false); + MaterialGenerator.generateNuclearDusts(FLUORIDES.ZIRCONIUM_TETRAFLUORIDE); //LFTR Fluoride outputs - MaterialGenerator.generateNuclearMaterial(FLUORIDES.NEPTUNIUM_HEXAFLUORIDE); - MaterialGenerator.generateNuclearMaterial(FLUORIDES.TECHNETIUM_HEXAFLUORIDE); - MaterialGenerator.generateNuclearMaterial(FLUORIDES.SELENIUM_HEXAFLUORIDE); + MaterialGenerator.generateNuclearDusts(FLUORIDES.NEPTUNIUM_HEXAFLUORIDE); + MaterialGenerator.generateNuclearDusts(FLUORIDES.TECHNETIUM_HEXAFLUORIDE); + MaterialGenerator.generateNuclearDusts(FLUORIDES.SELENIUM_HEXAFLUORIDE); //Generate Reactor Fuel Salts - MaterialGenerator.generateNuclearMaterial(NUCLIDE.LiFBeF2ZrF4U235, false); - MaterialGenerator.generateNuclearMaterial(NUCLIDE.LiFBeF2ZrF4UF4, false); - MaterialGenerator.generateNuclearMaterial(NUCLIDE.LiFBeF2ThF4UF4, false); + MaterialGenerator.generateNuclearDusts(NUCLIDE.LiFBeF2ZrF4U235); + MaterialGenerator.generateNuclearDusts(NUCLIDE.LiFBeF2ZrF4UF4); + MaterialGenerator.generateNuclearDusts(NUCLIDE.LiFBeF2ThF4UF4); + //MaterialGenerator.generateNuclearMaterial(NUCLIDE.Li2BeF4, false); //Generate some Alloys @@ -725,10 +727,11 @@ public final class ModItems { dustLi2CO3CaOH2 = ItemUtils.generateSpecialUseDusts("Li2CO3CaOH2", "Li2CO3 + Ca(OH)2 Compound", "Li2CO3CaOH2", Utils.rgbtoHexValue(255, 255, 255))[0]; //https://en.wikipedia.org/wiki/Calcium_carbonate //FLiBe Fuel Compounds - dustLi2BeF4 = ItemUtils.generateSpecialUseDusts("Li2BeF4", "Li2BeF4 Fuel Compound", "Li2BeF4", Utils.rgbtoHexValue(255, 255, 255))[0]; //https://en.wikipedia.org/wiki/FLiBe + dustLi2BeF4 = ItemUtils.generateSpecialUseDusts("Li2BeF4", "Lithium Tetrafluoroberyllate Fuel Compound", "Li2BeF4", Utils.rgbtoHexValue(255, 255, 255))[0]; //https://en.wikipedia.org/wiki/FLiBe + Material.registerComponentForMaterial(NUCLIDE.Li2BeF4, OrePrefixes.dust, ItemUtils.getSimpleStack(dustLi2BeF4)); //fluidFLiBeSalt = ("Li2BeF4", "Li2BeF4", 7430, new short[]{255, 255, 255, 100}, 0); - fluidFLiBeSalt = FluidUtils.addGTFluidNoPrefix("Li2BeF4", "Li2BeF4", new short[]{255, 255, 255, 100}, 0, 743, null, CI.emptyCells(1), 1000, true); - fluidFLiBeSaltBurnt = FluidUtils.addGTFluidNoPrefix("Li2BeF2UF4", "Li2BeF2UF4", new short[]{50, 255, 50, 100}, 0, 743, null, CI.emptyCells(1), 1000, true); + //fluidFLiBeSalt = FluidUtils.addGTFluidNoPrefix("Li2BeF4", "Lithium Tetrafluoroberyllate", new short[]{255, 255, 255, 100}, 0, 743, null, CI.emptyCells(1), 1000, true); + //fluidFLiBeSaltBurnt = FluidUtils.addGTFluidNoPrefix("Li2BeF2UF4", "Li2BeF2UF4", new short[]{50, 255, 50, 100}, 0, 743, null, CI.emptyCells(1), 1000, true); // LFTR Core Fluid Processing //fluidLftrCore1 = FluidUtils.addGTFluidNoPrefix("LiBeF2UF4FP", "LiBeF2UF4FP", new short[]{110, 255, 110, 100}, 0, 800, null, CI.emptyCells(1), 1000, true); @@ -1069,10 +1072,10 @@ public final class ModItems { GT_OreDictUnificator.registerOre("platePhasedIron", ItemUtils.getSimpleStack(itemPlatePulsatingIron)); GT_OreDictUnificator.registerOre("blockVibrantAlloy", ItemUtils.getItemStackOfAmountFromOreDict("blockPhasedGold", 1)); - CORE.RA.addFluidExtractionRecipe(MaterialEIO.REDSTONE_ALLOY.getPlate(1), MaterialEIO.REDSTONE_ALLOY.getFluid(144), 16, 4*9); - CORE.RA.addFluidExtractionRecipe(MaterialEIO.REDSTONE_ALLOY.getIngot(1), MaterialEIO.REDSTONE_ALLOY.getFluid(144), 16, 4*9); - CORE.RA.addFluidExtractionRecipe(MaterialEIO.REDSTONE_ALLOY.getNugget(1), MaterialEIO.REDSTONE_ALLOY.getFluid(16), 16, 4); - CORE.RA.addFluidExtractionRecipe(MaterialEIO.REDSTONE_ALLOY.getBlock(1), MaterialEIO.REDSTONE_ALLOY.getFluid(1294), 16, 4*9*9); + CORE.RA.addFluidExtractionRecipe(MaterialEIO.REDSTONE_ALLOY.getPlate(1), MaterialEIO.REDSTONE_ALLOY.getFluidStack(144), 16, 4*9); + CORE.RA.addFluidExtractionRecipe(MaterialEIO.REDSTONE_ALLOY.getIngot(1), MaterialEIO.REDSTONE_ALLOY.getFluidStack(144), 16, 4*9); + CORE.RA.addFluidExtractionRecipe(MaterialEIO.REDSTONE_ALLOY.getNugget(1), MaterialEIO.REDSTONE_ALLOY.getFluidStack(16), 16, 4); + CORE.RA.addFluidExtractionRecipe(MaterialEIO.REDSTONE_ALLOY.getBlock(1), MaterialEIO.REDSTONE_ALLOY.getFluidStack(1294), 16, 4*9*9); } else { diff --git a/src/Java/gtPlusPlus/core/item/chemistry/GenericChem.java b/src/Java/gtPlusPlus/core/item/chemistry/GenericChem.java index f61a2096b7..ecdc97357f 100644 --- a/src/Java/gtPlusPlus/core/item/chemistry/GenericChem.java +++ b/src/Java/gtPlusPlus/core/item/chemistry/GenericChem.java @@ -351,7 +351,7 @@ public class GenericChem extends ItemPackage { }, new FluidStack[] { - ELEMENT.getInstance().HYDROGEN.getFluid(2000) + ELEMENT.getInstance().HYDROGEN.getFluidStack(2000) }, 20 *20, 120, @@ -433,8 +433,8 @@ public class GenericChem extends ItemPackage { private void recipeHydricSulfur() { ItemStack aCellHydricSulfide = ItemUtils.getItemStackOfAmountFromOreDict("cellHydrogenSulfide", 1); - GT_Values.RA.addChemicalRecipe( ELEMENT.getInstance().SULFUR.getDust(1), GT_Utility.getIntegratedCircuit(1), ELEMENT.getInstance().HYDROGEN.getFluid(2000), FluidUtils.getFluidStack(Hydrogen_Sulfide, 3000), GT_Values.NI, 60, 8); - GT_Values.RA.addChemicalRecipeForBasicMachineOnly(ELEMENT.getInstance().SULFUR.getDust(1), CI.emptyCells(3), ELEMENT.getInstance().HYDROGEN.getFluid(2000), GT_Values.NF, ItemUtils.getSimpleStack(aCellHydricSulfide, 3), GT_Values.NI, 60, 8); + GT_Values.RA.addChemicalRecipe( ELEMENT.getInstance().SULFUR.getDust(1), GT_Utility.getIntegratedCircuit(1), ELEMENT.getInstance().HYDROGEN.getFluidStack(2000), FluidUtils.getFluidStack(Hydrogen_Sulfide, 3000), GT_Values.NI, 60, 8); + GT_Values.RA.addChemicalRecipeForBasicMachineOnly(ELEMENT.getInstance().SULFUR.getDust(1), CI.emptyCells(3), ELEMENT.getInstance().HYDROGEN.getFluidStack(2000), GT_Values.NF, ItemUtils.getSimpleStack(aCellHydricSulfide, 3), GT_Values.NI, 60, 8); } @@ -516,9 +516,9 @@ public class GenericChem extends ItemPackage { private void recipeNitrogenDioxide() { ItemStack aNitricOxideCell = ItemUtils.getItemStackOfAmountFromOreDict("cellNitricOxide", 1); ItemStack aNitrogenDioxideCell = ItemUtils.getItemStackOfAmountFromOreDict("cellNitrogenDioxide", 1); - GT_Values.RA.addChemicalRecipe( ItemUtils.getSimpleStack(aNitricOxideCell, 2), GT_Utility.getIntegratedCircuit(1), ELEMENT.getInstance().OXYGEN.getFluid(1000), FluidUtils.getFluidStack(Nitrogen_Dioxide, 3000), CI.emptyCells(2), 160); + GT_Values.RA.addChemicalRecipe( ItemUtils.getSimpleStack(aNitricOxideCell, 2), GT_Utility.getIntegratedCircuit(1), ELEMENT.getInstance().OXYGEN.getFluidStack(1000), FluidUtils.getFluidStack(Nitrogen_Dioxide, 3000), CI.emptyCells(2), 160); GT_Values.RA.addChemicalRecipe( ELEMENT.getInstance().OXYGEN.getCell(1), GT_Utility.getIntegratedCircuit(1), FluidUtils.getFluidStack(Nitric_Oxide, 2000), FluidUtils.getFluidStack(Nitrogen_Dioxide, 3000), CI.emptyCells(1), 160); - GT_Values.RA.addChemicalRecipeForBasicMachineOnly(ItemUtils.getSimpleStack(aNitricOxideCell, 2), CI.emptyCells(1), ELEMENT.getInstance().OXYGEN.getFluid(1000), GT_Values.NF, ItemUtils.getSimpleStack(aNitrogenDioxideCell, 3), GT_Values.NI, 160, 30); + GT_Values.RA.addChemicalRecipeForBasicMachineOnly(ItemUtils.getSimpleStack(aNitricOxideCell, 2), CI.emptyCells(1), ELEMENT.getInstance().OXYGEN.getFluidStack(1000), GT_Values.NF, ItemUtils.getSimpleStack(aNitrogenDioxideCell, 3), GT_Values.NI, 160, 30); GT_Values.RA.addChemicalRecipeForBasicMachineOnly(ELEMENT.getInstance().OXYGEN.getCell(1), CI.emptyCells(2), FluidUtils.getFluidStack(Nitric_Oxide, 2000), GT_Values.NF, ItemUtils.getSimpleStack(aNitrogenDioxideCell, 3), GT_Values.NI, 160, 30); GT_Values.RA.addChemicalRecipeForBasicMachineOnly(ItemUtils.getSimpleStack(aNitricOxideCell, 2), ELEMENT.getInstance().OXYGEN.getCell(1), GT_Values.NF, GT_Values.NF, ItemUtils.getSimpleStack(aNitrogenDioxideCell, 3), GT_Values.NI, 160, 30); } @@ -527,16 +527,16 @@ public class GenericChem extends ItemPackage { private void recipeNitricOxide() { ItemStack aWaterCell = ItemUtils.getItemStackOfAmountFromOreDict("cellWater", 1); ItemStack aNitricOxideCell = ItemUtils.getItemStackOfAmountFromOreDict("cellNitricOxide", 1); - GT_Values.RA.addChemicalRecipeForBasicMachineOnly(MISC_MATERIALS.AMMONIA.getCell(8), CI.emptyCells(1), ELEMENT.getInstance().OXYGEN.getFluid(5000), FluidUtils.getFluidStack(Nitric_Oxide, 4000), ItemUtils.getSimpleStack(aWaterCell, 9), GT_Values.NI, 160, 30); - GT_Values.RA.addChemicalRecipeForBasicMachineOnly(ELEMENT.getInstance().OXYGEN.getCell(5), CI.emptyCells(4), MISC_MATERIALS.AMMONIA.getFluid(8000), FluidUtils.getFluidStack(Nitric_Oxide, 4000), ItemUtils.getSimpleStack(aWaterCell, 9), GT_Values.NI, 160, 30); - GT_Values.RA.addChemicalRecipe( MISC_MATERIALS.AMMONIA.getCell(8), GT_Utility.getIntegratedCircuit(11), ELEMENT.getInstance().OXYGEN.getFluid(5000), FluidUtils.getWater(9000), ItemUtils.getSimpleStack(aNitricOxideCell, 4), CI.emptyCells(4), 160); - GT_Values.RA.addChemicalRecipe( ELEMENT.getInstance().OXYGEN.getCell(5), GT_Utility.getIntegratedCircuit(11), MISC_MATERIALS.AMMONIA.getFluid(8000), FluidUtils.getWater(9000), ItemUtils.getSimpleStack(aNitricOxideCell, 4), CI.emptyCells(1), 160); - GT_Values.RA.addChemicalRecipe( MISC_MATERIALS.AMMONIA.getCell(8), GT_Utility.getIntegratedCircuit(2), ELEMENT.getInstance().OXYGEN.getFluid(5000), FluidUtils.getFluidStack(Nitric_Oxide, 4000), CI.emptyCells(8), 320); - GT_Values.RA.addChemicalRecipe( ELEMENT.getInstance().OXYGEN.getCell(5), GT_Utility.getIntegratedCircuit(2), MISC_MATERIALS.AMMONIA.getFluid(8000), FluidUtils.getFluidStack(Nitric_Oxide, 4000), CI.emptyCells(5), 320); - GT_Values.RA.addChemicalRecipe( MISC_MATERIALS.AMMONIA.getCell(8), GT_Utility.getIntegratedCircuit(12), ELEMENT.getInstance().OXYGEN.getFluid(5000), GT_Values.NF, ItemUtils.getSimpleStack(aNitricOxideCell, 4), CI.emptyCells(4), 160); - GT_Values.RA.addChemicalRecipe( ELEMENT.getInstance().OXYGEN.getCell(5), GT_Utility.getIntegratedCircuit(12), MISC_MATERIALS.AMMONIA.getFluid(8000), GT_Values.NF, ItemUtils.getSimpleStack(aNitricOxideCell, 4), CI.emptyCells(1), 160); + GT_Values.RA.addChemicalRecipeForBasicMachineOnly(MISC_MATERIALS.AMMONIA.getCell(8), CI.emptyCells(1), ELEMENT.getInstance().OXYGEN.getFluidStack(5000), FluidUtils.getFluidStack(Nitric_Oxide, 4000), ItemUtils.getSimpleStack(aWaterCell, 9), GT_Values.NI, 160, 30); + GT_Values.RA.addChemicalRecipeForBasicMachineOnly(ELEMENT.getInstance().OXYGEN.getCell(5), CI.emptyCells(4), MISC_MATERIALS.AMMONIA.getFluidStack(8000), FluidUtils.getFluidStack(Nitric_Oxide, 4000), ItemUtils.getSimpleStack(aWaterCell, 9), GT_Values.NI, 160, 30); + GT_Values.RA.addChemicalRecipe( MISC_MATERIALS.AMMONIA.getCell(8), GT_Utility.getIntegratedCircuit(11), ELEMENT.getInstance().OXYGEN.getFluidStack(5000), FluidUtils.getWater(9000), ItemUtils.getSimpleStack(aNitricOxideCell, 4), CI.emptyCells(4), 160); + GT_Values.RA.addChemicalRecipe( ELEMENT.getInstance().OXYGEN.getCell(5), GT_Utility.getIntegratedCircuit(11), MISC_MATERIALS.AMMONIA.getFluidStack(8000), FluidUtils.getWater(9000), ItemUtils.getSimpleStack(aNitricOxideCell, 4), CI.emptyCells(1), 160); + GT_Values.RA.addChemicalRecipe( MISC_MATERIALS.AMMONIA.getCell(8), GT_Utility.getIntegratedCircuit(2), ELEMENT.getInstance().OXYGEN.getFluidStack(5000), FluidUtils.getFluidStack(Nitric_Oxide, 4000), CI.emptyCells(8), 320); + GT_Values.RA.addChemicalRecipe( ELEMENT.getInstance().OXYGEN.getCell(5), GT_Utility.getIntegratedCircuit(2), MISC_MATERIALS.AMMONIA.getFluidStack(8000), FluidUtils.getFluidStack(Nitric_Oxide, 4000), CI.emptyCells(5), 320); + GT_Values.RA.addChemicalRecipe( MISC_MATERIALS.AMMONIA.getCell(8), GT_Utility.getIntegratedCircuit(12), ELEMENT.getInstance().OXYGEN.getFluidStack(5000), GT_Values.NF, ItemUtils.getSimpleStack(aNitricOxideCell, 4), CI.emptyCells(4), 160); + GT_Values.RA.addChemicalRecipe( ELEMENT.getInstance().OXYGEN.getCell(5), GT_Utility.getIntegratedCircuit(12), MISC_MATERIALS.AMMONIA.getFluidStack(8000), GT_Values.NF, ItemUtils.getSimpleStack(aNitricOxideCell, 4), CI.emptyCells(1), 160); GT_Values.RA.addChemicalRecipeForBasicMachineOnly(MISC_MATERIALS.AMMONIA.getCell(8), ELEMENT.getInstance().OXYGEN.getCell(5), GT_Values.NF, GT_Values.NF, ItemUtils.getSimpleStack(aNitricOxideCell, 4), ItemUtils.getSimpleStack(aWaterCell, 9), 160, 30); - GT_Values.RA.addMultiblockChemicalRecipe(new ItemStack[]{GT_Utility.getIntegratedCircuit(1)}, new FluidStack[]{MISC_MATERIALS.AMMONIA.getFluid(8000), ELEMENT.getInstance().OXYGEN.getFluid(5000)}, new FluidStack[]{FluidUtils.getFluidStack(Nitric_Oxide, 4000), FluidUtils.getWater(9000)}, null, 160, 30); + GT_Values.RA.addMultiblockChemicalRecipe(new ItemStack[]{GT_Utility.getIntegratedCircuit(1)}, new FluidStack[]{MISC_MATERIALS.AMMONIA.getFluidStack(8000), ELEMENT.getInstance().OXYGEN.getFluidStack(5000)}, new FluidStack[]{FluidUtils.getFluidStack(Nitric_Oxide, 4000), FluidUtils.getWater(9000)}, null, 160, 30); } @@ -547,7 +547,7 @@ public class GenericChem extends ItemPackage { CORE.RA.addChemicalRecipe( ELEMENT.getInstance().CHLORINE.getCell(1), GT_Utility.getIntegratedCircuit(1), - ELEMENT.getInstance().HYDROGEN.getFluid(1000), + ELEMENT.getInstance().HYDROGEN.getFluidStack(1000), FluidUtils.getFluidStack(HydrochloricAcid, 2000), CI.emptyCells(1), 60, @@ -556,7 +556,7 @@ public class GenericChem extends ItemPackage { CORE.RA.addChemicalRecipe( ELEMENT.getInstance().HYDROGEN.getCell(1), GT_Utility.getIntegratedCircuit(1), - ELEMENT.getInstance().CHLORINE.getFluid(1000), + ELEMENT.getInstance().CHLORINE.getFluidStack(1000), FluidUtils.getFluidStack(HydrochloricAcid, 2000), CI.emptyCells(1), 60, @@ -566,7 +566,7 @@ public class GenericChem extends ItemPackage { CI.emptyCells(1), GT_Utility.getIntegratedCircuit(1), FluidUtils.getFluidStack(HydrochloricAcid, 2000), - ELEMENT.getInstance().CHLORINE.getFluid(1000), + ELEMENT.getInstance().CHLORINE.getFluidStack(1000), ELEMENT.getInstance().HYDROGEN.getCell(1), GT_Values.NI, GT_Values.NI, @@ -581,7 +581,7 @@ public class GenericChem extends ItemPackage { CI.emptyCells(1), GT_Utility.getIntegratedCircuit(11), FluidUtils.getFluidStack(HydrochloricAcid, 2000), - ELEMENT.getInstance().HYDROGEN.getFluid(1000), + ELEMENT.getInstance().HYDROGEN.getFluidStack(1000), ELEMENT.getInstance().CHLORINE.getCell(1), GT_Values.NI, GT_Values.NI, diff --git a/src/Java/gtPlusPlus/core/material/Material.java b/src/Java/gtPlusPlus/core/material/Material.java index 404c5c7918..cc7e21656b 100644 --- a/src/Java/gtPlusPlus/core/material/Material.java +++ b/src/Java/gtPlusPlus/core/material/Material.java @@ -49,7 +49,7 @@ public class Material { private MaterialState materialState; private TextureSet textureSet; - private Fluid vMoltenFluid; + private Fluid mFluid; private Fluid vPlasma; private boolean vGenerateCells; @@ -478,7 +478,7 @@ public class Material { final Materials isValid = Materials.get(this.getLocalizedName()); FluidStack aTest = FluidUtils.getWildcardFluidStack(localizedName, 1); if (aTest != null){ - this.vMoltenFluid = aTest.getFluid(); + this.mFluid = aTest.getFluid(); } else { if (isValid == null || isValid == Materials._NULL){ @@ -487,7 +487,7 @@ public class Material { else { FluidStack aTest2 = FluidUtils.getWildcardFluidStack(localizedName, 1); if (aTest2 != null){ - this.vMoltenFluid = aTest2.getFluid(); + this.mFluid = aTest2.getFluid(); } else { queueFluidGeneration(); @@ -497,7 +497,7 @@ public class Material { this.vPlasma = this.generatePlasma(); } else { - this.vMoltenFluid = null; + this.mFluid = null; this.vPlasma = null; } String ratio = ""; @@ -1104,7 +1104,7 @@ public class Material { public final static void generateQueuedFluids() { for (Material m : mMaterialMap) { if (m.isFluidQueued) { - m.vMoltenFluid = m.generateFluid(); + m.mFluid = m.generateFluid(); } } } @@ -1249,18 +1249,21 @@ public class Material { } + public Fluid getFluid() { + return mFluid; + } - final public FluidStack getFluid(final int fluidAmount) { - if (this.vMoltenFluid == null){ + final public FluidStack getFluidStack(final int fluidAmount) { + if (this.mFluid == null){ return null; } - final FluidStack moltenFluid = new FluidStack(this.vMoltenFluid, fluidAmount); + final FluidStack moltenFluid = new FluidStack(this.mFluid, fluidAmount); return moltenFluid; } final public boolean setFluid(Fluid aFluid) { - if (this.vMoltenFluid == null){ - this.vMoltenFluid = aFluid; + if (this.mFluid == null){ + this.mFluid = aFluid; return true; } return false; @@ -1353,8 +1356,8 @@ public class Material { } private static boolean registerComponentForMaterial(Material componentMaterial, FluidStack aStack) { - if (componentMaterial != null && aStack != null && componentMaterial.vMoltenFluid == null) { - componentMaterial.vMoltenFluid = aStack.getFluid(); + if (componentMaterial != null && aStack != null && componentMaterial.mFluid == null) { + componentMaterial.mFluid = aStack.getFluid(); return true; } return false; diff --git a/src/Java/gtPlusPlus/core/material/MaterialGenerator.java b/src/Java/gtPlusPlus/core/material/MaterialGenerator.java index 68026d1cac..4a3af94f6d 100644 --- a/src/Java/gtPlusPlus/core/material/MaterialGenerator.java +++ b/src/Java/gtPlusPlus/core/material/MaterialGenerator.java @@ -29,7 +29,10 @@ import gtPlusPlus.core.item.base.rods.BaseItemRod; import gtPlusPlus.core.item.base.rods.BaseItemRodLong; import gtPlusPlus.core.item.base.rotors.BaseItemRotor; import gtPlusPlus.core.item.base.screws.BaseItemScrew; +import gtPlusPlus.core.lib.CORE; +import gtPlusPlus.core.material.nuclear.FLUORIDES; import gtPlusPlus.core.material.state.MaterialState; +import gtPlusPlus.core.recipe.common.CI; import gtPlusPlus.core.util.Utils; import gtPlusPlus.core.util.minecraft.FluidUtils; import gtPlusPlus.core.util.minecraft.ItemUtils; @@ -262,13 +265,47 @@ public class MaterialGenerator { generateNuclearMaterial(matInfo, true); } + + public static void generateNuclearDusts(final Material matInfo){ + generateNuclearDusts(matInfo, true); + } + + public static void generateNuclearDusts(final Material matInfo, boolean generateDehydratorRecipe){ + generateNuclearMaterial(matInfo, false, true, false, false); + if (generateDehydratorRecipe && matInfo.getFluid() != null && matInfo.getDust(0) != null) { + CORE.RA.addDehydratorRecipe( + new ItemStack[] { + + }, + matInfo.getFluidStack(144), + null, + new ItemStack[] { + matInfo.getDust(1), + }, + new int[] { 10000 }, + 10*(matInfo.vVoltageMultiplier/5), // Time in ticks + matInfo.vVoltageMultiplier); // EU + } + } + public static void generateNuclearMaterial(final Material matInfo, final boolean generatePlates){ + generateNuclearMaterial(matInfo, true, true, true, generatePlates); + } + + public static void generateNuclearMaterial(final Material matInfo, final boolean generateBlock, + final boolean generateDusts, final boolean generateIngot, final boolean generatePlates){ try { - tempBlock = new BlockBaseModular(matInfo,BlockTypes.STANDARD); - temp = new BaseItemDust(matInfo); - temp = new BaseItemIngot(matInfo); - temp = new BaseItemNugget(matInfo); + if (generateBlock) { + tempBlock = new BlockBaseModular(matInfo,BlockTypes.STANDARD); + } + if (generateDusts) { + temp = new BaseItemDust(matInfo); + } + if (generateIngot) { + temp = new BaseItemIngot(matInfo); + temp = new BaseItemNugget(matInfo); + } if (generatePlates) { temp = new BaseItemPlate(matInfo); diff --git a/src/Java/gtPlusPlus/core/material/ORES.java b/src/Java/gtPlusPlus/core/material/ORES.java index c2556b60f1..363708859f 100644 --- a/src/Java/gtPlusPlus/core/material/ORES.java +++ b/src/Java/gtPlusPlus/core/material/ORES.java @@ -263,10 +263,11 @@ public final class ORES { -1, -1, //Radiation new MaterialStack[]{ - new MaterialStack(ELEMENT.getInstance().YTTRIUM, 1), - new MaterialStack(ELEMENT.getInstance().YTTERBIUM, 1), - new MaterialStack(ELEMENT.getInstance().PHOSPHORUS, 1), - new MaterialStack(ELEMENT.getInstance().OXYGEN, 4) + new MaterialStack(ELEMENT.getInstance().YTTRIUM, 2), + new MaterialStack(ELEMENT.getInstance().YTTERBIUM, 2), + new MaterialStack(ELEMENT.getInstance().EUROPIUM, 1), + new MaterialStack(ELEMENT.getInstance().PHOSPHORUS, 2), + new MaterialStack(ELEMENT.getInstance().OXYGEN, 8) }); public static final Material YTTRIALITE = new Material( diff --git a/src/Java/gtPlusPlus/core/material/nuclear/NUCLIDE.java b/src/Java/gtPlusPlus/core/material/nuclear/NUCLIDE.java index 9e59758f73..8fe99f16e7 100644 --- a/src/Java/gtPlusPlus/core/material/nuclear/NUCLIDE.java +++ b/src/Java/gtPlusPlus/core/material/nuclear/NUCLIDE.java @@ -10,6 +10,24 @@ import gtPlusPlus.core.util.data.StringUtils; public final class NUCLIDE { + public static final Material Li2BeF4 = new Material( + "Lithium Tetrafluoroberyllate", //Material Name + MaterialState.LIQUID, //State + TextureSets.NUCLEAR.get(), + null, //Material Colour + 566, //Melting Point in C + 870, //Boiling Point in C + -1, //Protons + -1, //Neutrons + false, //Uses Blast furnace? + StringUtils.subscript(StringUtils.superscript("7")+"Li2BeF4"), //Chemical Formula + 4, //Radioactivity Level + //Material Stacks with Percentage of required elements. + new MaterialStack[]{ + new MaterialStack(FLUORIDES.LITHIUM_FLUORIDE, 2), + new MaterialStack(FLUORIDES.BERYLLIUM_FLUORIDE, 1) + }); + public static final Material LiFBeF2ThF4UF4 = new Material( "LiFBeF2ThF4UF4", //Material Name MaterialState.LIQUID, //State @@ -70,6 +88,44 @@ public final class NUCLIDE { new MaterialStack(ELEMENT.getInstance().URANIUM235, 14) }); + // Misc + public static final Material BurntLftrFuel_MK1 = new Material( + "Burnt Reactor Fuel I", //Material Name + MaterialState.PURE_LIQUID, //State + null, //Material Colour + -1, //Melting Point in C + -1, //Boiling Point in C + -1, //Protons + -1, //Neutrons + false, //Uses Blast furnace? + StringUtils.subscript(StringUtils.superscript("7")+"LiBeF2UF4FP"), //Chemical Formula + //Material Stacks with Percentage of required elements. + new MaterialStack[]{ + new MaterialStack(ELEMENT.getInstance().LITHIUM, 1), + new MaterialStack(FLUORIDES.BERYLLIUM_FLUORIDE, 1), + new MaterialStack(FLUORIDES.URANIUM_TETRAFLUORIDE, 1), + new MaterialStack(ELEMENT.getInstance().PROTACTINIUM, 1) + }); + + public static final Material BurntLftrFuel_MK2 = new Material( + "Burnt Reactor Fuel II", //Material Name + MaterialState.PURE_LIQUID, //State + null, //Material Colour + -1, //Melting Point in C + -1, //Boiling Point in C + -1, //Protons + -1, //Neutrons + false, //Uses Blast furnace? + StringUtils.subscript(StringUtils.superscript("7")+"LiBeF2UF4FP"), //Chemical Formula + //Material Stacks with Percentage of required elements. + new MaterialStack[]{ + new MaterialStack(ELEMENT.getInstance().LITHIUM, 1), + new MaterialStack(FLUORIDES.BERYLLIUM_FLUORIDE, 1), + new MaterialStack(FLUORIDES.URANIUM_TETRAFLUORIDE, 1), + new MaterialStack(ELEMENT.getInstance().PROTACTINIUM, 1) + }); + + // LFTR Core Fluids public static final Material LiBeF2UF4FP = new Material( @@ -81,6 +137,7 @@ public final class NUCLIDE { -1, //Protons -1, //Neutrons false, //Uses Blast furnace? + StringUtils.subscript(StringUtils.superscript("7")+"LiBeF2UF4FP"), //Chemical Formula //Material Stacks with Percentage of required elements. new MaterialStack[]{ new MaterialStack(ELEMENT.getInstance().LITHIUM, 1), @@ -98,6 +155,7 @@ public final class NUCLIDE { -1, //Protons -1, //Neutrons false, //Uses Blast furnace? + StringUtils.subscript("UF6F2FP"), //Chemical Formula //Material Stacks with Percentage of required elements. new MaterialStack[]{ new MaterialStack(FLUORIDES.URANIUM_HEXAFLUORIDE, 1), @@ -114,6 +172,7 @@ public final class NUCLIDE { -1, //Protons -1, //Neutrons false, //Uses Blast furnace? + StringUtils.subscript(StringUtils.superscript("7")+"LiFBeF2"), //Chemical Formula //Material Stacks with Percentage of required elements. new MaterialStack[]{ new MaterialStack(FLUORIDES.LITHIUM_FLUORIDE, 1), @@ -129,6 +188,7 @@ public final class NUCLIDE { -1, //Protons -1, //Neutrons false, //Uses Blast furnace? + StringUtils.subscript(StringUtils.superscript("7")+"LiFBeF2UF4"), //Chemical Formula //Material Stacks with Percentage of required elements. new MaterialStack[]{ new MaterialStack(LiFBeF2, 1), @@ -142,6 +202,7 @@ public final class NUCLIDE { // LFTR Blanket Fluids + // Tier 1 Fuel blanket output public static final Material LiFThF4 = new Material( "LiFThF4", //Material Name MaterialState.PURE_LIQUID, //State @@ -151,12 +212,14 @@ public final class NUCLIDE { -1, //Protons -1, //Neutrons false, //Uses Blast furnace? + StringUtils.subscript(StringUtils.superscript("7")+"LiFThF4"), //Chemical Formula //Material Stacks with Percentage of required elements. new MaterialStack[]{ new MaterialStack(FLUORIDES.LITHIUM_FLUORIDE, 1), new MaterialStack(FLUORIDES.THORIUM_TETRAFLUORIDE, 1) }); + // Tier 2 Fuel blanket output public static final Material LiFBeF2ThF4 = new Material( "LiFBeF2ThF4", //Material Name MaterialState.PURE_LIQUID, //State @@ -166,6 +229,7 @@ public final class NUCLIDE { -1, //Protons -1, //Neutrons false, //Uses Blast furnace? + StringUtils.subscript(StringUtils.superscript("7")+"LiFBeF2ThF4"), //Chemical Formula //Material Stacks with Percentage of required elements. new MaterialStack[]{ new MaterialStack(FLUORIDES.LITHIUM_FLUORIDE, 1), @@ -182,6 +246,7 @@ public final class NUCLIDE { -1, //Protons -1, //Neutrons false, //Uses Blast furnace? + StringUtils.subscript("UF6F2"), //Chemical Formula //Material Stacks with Percentage of required elements. new MaterialStack[]{ new MaterialStack(FLUORIDES.URANIUM_HEXAFLUORIDE, 1), diff --git a/src/Java/gtPlusPlus/core/recipe/RECIPES_GREGTECH.java b/src/Java/gtPlusPlus/core/recipe/RECIPES_GREGTECH.java index e475f00451..b263f8ff52 100644 --- a/src/Java/gtPlusPlus/core/recipe/RECIPES_GREGTECH.java +++ b/src/Java/gtPlusPlus/core/recipe/RECIPES_GREGTECH.java @@ -447,17 +447,17 @@ public class RECIPES_GREGTECH { //Hypogen Creation GT_Values.RA.addFusionReactorRecipe( Materials.Neutronium.getMolten(128), - ALLOY.QUANTUM.getFluid(256), - ELEMENT.STANDALONE.HYPOGEN.getFluid(4), + ALLOY.QUANTUM.getFluidStack(256), + ELEMENT.STANDALONE.HYPOGEN.getFluidStack(4), 2048 * 4, (int) MaterialUtils.getVoltageForTier(9), 600000000 * 2); //Rhugnor GT_Values.RA.addFusionReactorRecipe( - GenericChem.TEFLON.getFluid(64), - ALLOY.PIKYONIUM.getFluid(128), - ELEMENT.STANDALONE.RHUGNOR.getFluid(8), + GenericChem.TEFLON.getFluidStack(64), + ALLOY.PIKYONIUM.getFluidStack(128), + ELEMENT.STANDALONE.RHUGNOR.getFluidStack(8), 2048 * 4, (int) MaterialUtils.getVoltageForTier(7), 150000000 * 2); @@ -499,10 +499,10 @@ public class RECIPES_GREGTECH { aCoilWire[3] }, new FluidStack[] { - ALLOY.NITINOL_60.getFluid(144 * 9 * (GTNH ? 4 : 2)), - ALLOY.ENERGYCRYSTAL.getFluid(144 * 9 * (GTNH ? 8 : 4)), - ALLOY.TUMBAGA.getFluid(144 * 9 * (GTNH ? 32 : 8)), - ALLOY.NICHROME.getFluid(144 * 1 * (GTNH ? 16 : 4)), + ALLOY.NITINOL_60.getFluidStack(144 * 9 * (GTNH ? 4 : 2)), + ALLOY.ENERGYCRYSTAL.getFluidStack(144 * 9 * (GTNH ? 8 : 4)), + ALLOY.TUMBAGA.getFluidStack(144 * 9 * (GTNH ? 32 : 8)), + ALLOY.NICHROME.getFluidStack(144 * 1 * (GTNH ? 16 : 4)), }, ItemUtils.getSimpleStack(ModBlocks.blockCasings3Misc, 15, 32), @@ -581,8 +581,8 @@ public class RECIPES_GREGTECH { CI.getTieredFluid(8, 144 * 32), CI.getAlternativeTieredFluid(7, 144 * 16), CI.getTertiaryTieredFluid(7, 144 * 16), - ALLOY.BABBIT_ALLOY.getFluid(128 * 144), - ALLOY.ZERON_100.getFluid(144 * 64) + ALLOY.BABBIT_ALLOY.getFluidStack(128 * 144), + ALLOY.ZERON_100.getFluidStack(144 * 64) }, GregtechItemList.Hatch_Input_TurbineHousing.get(4), @@ -934,7 +934,7 @@ public class RECIPES_GREGTECH { ELEMENT.getInstance().CARBON.getDust(1), ELEMENT.getInstance().SILICON.getDust(4) }, - ALLOY.EGLIN_STEEL.getFluid(16 * 144), + ALLOY.EGLIN_STEEL.getFluidStack(16 * 144), 0, 20 * 45, 120); @@ -948,8 +948,8 @@ public class RECIPES_GREGTECH { ELEMENT.getInstance().CALCIUM.getDust(2), ELEMENT.getInstance().COPPER.getDust(3), }, - ELEMENT.getInstance().OXYGEN.getFluid(8000), - ALLOY.HG1223.getFluid(16 * 144), + ELEMENT.getInstance().OXYGEN.getFluidStack(8000), + ALLOY.HG1223.getFluidStack(16 * 144), new ItemStack[] { CI.emptyCells(1) }, @@ -964,7 +964,7 @@ public class RECIPES_GREGTECH { ELEMENT.getInstance().TITANIUM.getDust(3), ELEMENT.getInstance().NICKEL.getDust(2) }, - ALLOY.NITINOL_60.getFluid(5 * 144), + ALLOY.NITINOL_60.getFluidStack(5 * 144), 0, 20 * 75, 7680); @@ -981,7 +981,7 @@ public class RECIPES_GREGTECH { ELEMENT.getInstance().CARBON.getDust(32), }, Materials.SulfuricAcid.getFluid(2000), - ELEMENT.getInstance().GERMANIUM.getFluid(288), + ELEMENT.getInstance().GERMANIUM.getFluidStack(288), 0, 20 * 300, 4000); @@ -995,7 +995,7 @@ public class RECIPES_GREGTECH { ELEMENT.getInstance().CARBON.getDust(32), }, Materials.SulfuricAcid.getFluid(2000), - ELEMENT.getInstance().RUTHENIUM.getFluid(288), + ELEMENT.getInstance().RUTHENIUM.getFluidStack(288), 0, 20 * 300, 8000); @@ -1006,7 +1006,7 @@ public class RECIPES_GREGTECH { ELEMENT.getInstance().CARBON.getDust(32), }, Materials.SulfuricAcid.getFluid(2000), - ELEMENT.getInstance().RUTHENIUM.getFluid(288), + ELEMENT.getInstance().RUTHENIUM.getFluidStack(288), 0, 20 * 300, 8000); @@ -1017,7 +1017,7 @@ public class RECIPES_GREGTECH { ELEMENT.getInstance().CARBON.getDust(32), }, Materials.SulfuricAcid.getFluid(2000), - ELEMENT.getInstance().RUTHENIUM.getFluid(288), + ELEMENT.getInstance().RUTHENIUM.getFluidStack(288), 0, 20 * 300, 8000); @@ -1028,7 +1028,7 @@ public class RECIPES_GREGTECH { ELEMENT.getInstance().CARBON.getDust(32), }, Materials.SulfuricAcid.getFluid(8000), - ELEMENT.getInstance().RUTHENIUM.getFluid(144), + ELEMENT.getInstance().RUTHENIUM.getFluidStack(144), 0, 20 * 300, 8000); @@ -1041,7 +1041,7 @@ public class RECIPES_GREGTECH { ELEMENT.getInstance().CARBON.getDust(32), }, Materials.SulfuricAcid.getFluid(10000), - ELEMENT.getInstance().RHENIUM.getFluid(144), + ELEMENT.getInstance().RHENIUM.getFluidStack(144), 0, 20 * 300, 4000); @@ -1052,7 +1052,7 @@ public class RECIPES_GREGTECH { ELEMENT.getInstance().CARBON.getDust(32), }, Materials.SulfuricAcid.getFluid(7500), - ELEMENT.getInstance().RHENIUM.getFluid(144), + ELEMENT.getInstance().RHENIUM.getFluidStack(144), 0, 20 * 300, 4000); @@ -1063,7 +1063,7 @@ public class RECIPES_GREGTECH { ELEMENT.getInstance().CARBON.getDust(32), }, Materials.SulfuricAcid.getFluid(5000), - ELEMENT.getInstance().RHENIUM.getFluid(288), + ELEMENT.getInstance().RHENIUM.getFluidStack(288), 0, 20 * 300, 4000); @@ -1077,7 +1077,7 @@ public class RECIPES_GREGTECH { ELEMENT.getInstance().CARBON.getDust(64), }, Materials.SulfuricAcid.getFluid(5000), - ELEMENT.getInstance().THALLIUM.getFluid(288+144), + ELEMENT.getInstance().THALLIUM.getFluidStack(288+144), 0, 20 * 300, 8000); @@ -1092,7 +1092,7 @@ public class RECIPES_GREGTECH { ELEMENT.getInstance().ALUMINIUM.getDust(8), }, null, - ELEMENT.getInstance().OXYGEN.getFluid(8000), + ELEMENT.getInstance().OXYGEN.getFluidStack(8000), new ItemStack[] { ELEMENT.getInstance().ALUMINIUM.getIngot(8), ELEMENT.getInstance().STRONTIUM.getIngot(8) @@ -1822,7 +1822,7 @@ public class RECIPES_GREGTECH { GT_Values.RA.addBlastRecipe( CI.getNumberedCircuit(22), ALLOY.SILICON_CARBIDE.getDust(16), - ELEMENT.getInstance().NITROGEN.getFluid(4000), + ELEMENT.getInstance().NITROGEN.getFluidStack(4000), GT_Values.NF, ItemUtils.getItemStackOfAmountFromOreDict("dustGraphite", 8), ItemUtils.getItemStackOfAmountFromOreDict("dustSmallSilicon", 8), @@ -1834,7 +1834,7 @@ public class RECIPES_GREGTECH { GT_Values.RA.addBlastRecipe( GregtechItemList.Bomb_Cast.get(4), ALLOY.STEEL.getDust(16), - ELEMENT.getInstance().OXYGEN.getFluid(2000), + ELEMENT.getInstance().OXYGEN.getFluidStack(2000), GT_Values.NF, GregtechItemList.Bomb_Cast_Molten.get(4), null, diff --git a/src/Java/gtPlusPlus/core/recipe/RECIPES_Machines.java b/src/Java/gtPlusPlus/core/recipe/RECIPES_Machines.java index e7c0ce3f38..4998d4bdbd 100644 --- a/src/Java/gtPlusPlus/core/recipe/RECIPES_Machines.java +++ b/src/Java/gtPlusPlus/core/recipe/RECIPES_Machines.java @@ -311,7 +311,7 @@ public class RECIPES_Machines { CI.getTieredComponentOfMaterial(Materials.CobaltBrass, OrePrefixes.dust, 16), CI.getTieredComponent(OrePrefixes.frameGt, 2, 4), }, - ALLOY.STEEL.getFluid(2 * (144 * 4)), + ALLOY.STEEL.getFluidStack(2 * (144 * 4)), GregtechItemList.ChemicalPlant_Controller.get(1), 120 * 20, MaterialUtils.getVoltageForTier(2)); @@ -326,7 +326,7 @@ public class RECIPES_Machines { CI.getTieredComponentOfMaterial(Materials.Lead, OrePrefixes.plate, 48), CI.getTieredComponentOfMaterial(Materials.SolderingAlloy, OrePrefixes.wireFine, 16), }, - ALLOY.BRONZE.getFluid(2 * (144 * 4)), + ALLOY.BRONZE.getFluidStack(2 * (144 * 4)), GregtechItemList.Bus_Catalysts.get(1), 60 * 20, MaterialUtils.getVoltageForTier(2)); @@ -354,7 +354,7 @@ public class RECIPES_Machines { CI.getTieredComponentOfMaterial(Materials.Bronze, OrePrefixes.bolt, 16), CI.getTieredComponentOfMaterial(Materials.Redstone, OrePrefixes.dust, 32), }, - ALLOY.POTIN.getFluid(2 * (144 * 4)), + ALLOY.POTIN.getFluidStack(2 * (144 * 4)), GregtechItemList.AlgaeFarm_Controller.get(1), 60 * 20, MaterialUtils.getVoltageForTier(1)); @@ -372,10 +372,10 @@ public class RECIPES_Machines { CI.getTieredComponent(OrePrefixes.circuit, 6, 8) }, new FluidStack[] { - ALLOY.AQUATIC_STEEL.getFluid(144 * 32), - ALLOY.BABBIT_ALLOY.getFluid(144 * 16), - ALLOY.BRONZE.getFluid(144 * 64), - ALLOY.KANTHAL.getFluid(144 * 16), + ALLOY.AQUATIC_STEEL.getFluidStack(144 * 32), + ALLOY.BABBIT_ALLOY.getFluidStack(144 * 16), + ALLOY.BRONZE.getFluidStack(144 * 64), + ALLOY.KANTHAL.getFluidStack(144 * 16), }, new ItemStack[] { GregtechItemList.Machine_Adv_DistillationTower.get(1) @@ -412,7 +412,7 @@ public class RECIPES_Machines { CI.getTransmissionComponent(i - 1, 8), CI.getTieredComponent(OrePrefixes.cableGt08, i, 16) }, - ALLOY.EGLIN_STEEL.getFluid(i * (144 * 4)), + ALLOY.EGLIN_STEEL.getFluidStack(i * (144 * 4)), aOutputs[aIndex++].copy(), 300 * 20, MaterialUtils.getVoltageForTier(i)); @@ -552,7 +552,7 @@ public class RECIPES_Machines { CI.machineHull_IV, ItemUtils.getItemStackOfAmountFromOreDict(CI.getTieredCircuitOreDictName(7), 2) }, - ELEMENT.getInstance().TANTALUM.getFluid(144 * 16), + ELEMENT.getInstance().TANTALUM.getFluidStack(144 * 16), GregtechItemList.Gregtech_Computer_Cube.get(1), 60 * 20 * 3, 8000); @@ -566,7 +566,7 @@ public class RECIPES_Machines { ItemUtils.getItemStackOfAmountFromOreDict(CI.getTieredCircuitOreDictName(1), 2), ItemUtils.getItemStackOfAmountFromOreDict(CI.getTieredCircuitOreDictName(2), 2) }, - ELEMENT.getInstance().IRON.getFluid(144 * 4), + ELEMENT.getInstance().IRON.getFluidStack(144 * 4), ItemUtils.getSimpleStack(ModBlocks.blockCircuitProgrammer), 60 * 10 * 1, 30); @@ -579,7 +579,7 @@ public class RECIPES_Machines { ItemUtils.getItemStackOfAmountFromOreDict("plateDenseLead", 9), ItemUtils.getSimpleStack(Blocks.chest) }, - ELEMENT.getInstance().LEAD.getFluid(144 * 16), + ELEMENT.getInstance().LEAD.getFluidStack(144 * 16), ItemUtils.getSimpleStack(ModBlocks.blockDecayablesChest), 60 * 10 * 3, 60); @@ -594,7 +594,7 @@ public class RECIPES_Machines { ItemUtils.getItemStackOfAmountFromOreDict("wireFinePlatinum", GTNH ? 64 : 32), ItemUtils.getItemStackOfAmountFromOreDict(CI.getTieredCircuitOreDictName(GTNH ? 7 : 6), GTNH ? 5 : 4) }, - ALLOY.NIOBIUM_CARBIDE.getFluid(144 * 16), + ALLOY.NIOBIUM_CARBIDE.getFluidStack(144 * 16), GregtechItemList.RTG.get(1), 60 * 20 * 10, 8000); @@ -607,7 +607,7 @@ public class RECIPES_Machines { ItemUtils.getItemStackOfAmountFromOreDict("plateTumbaga", 8), ItemUtils.getSimpleStack(Blocks.jukebox) }, - ELEMENT.getInstance().COPPER.getFluid(144 * 2), + ELEMENT.getInstance().COPPER.getFluidStack(144 * 2), ItemUtils.getSimpleStack(ModBlocks.blockCustomJukebox), 20 * 30, 30); @@ -624,7 +624,7 @@ public class RECIPES_Machines { ALLOY.EGLIN_STEEL.getPlate(GTNH ? 8 : 4), ALLOY.POTIN.getScrew(GTNH ? 12 : 6) }, - ALLOY.TUMBAGA.getFluid(144 * 4), + ALLOY.TUMBAGA.getFluidStack(144 * 4), ItemUtils.getSimpleStack(ModBlocks.blockPooCollector), 20 * 60, 30); @@ -1058,9 +1058,9 @@ public class RECIPES_Machines { CI.getGear(3, GTNH ? 4 : 2) }; FluidStack[] aSemiFluidFluidInputs = new FluidStack[] { - ALLOY.BRONZE.getFluid(144 * 8), - ALLOY.STEEL.getFluid(144 * 8), - ELEMENT.getInstance().ALUMINIUM.getFluid(144 * 8), + ALLOY.BRONZE.getFluidStack(144 * 8), + ALLOY.STEEL.getFluidStack(144 * 8), + ELEMENT.getInstance().ALUMINIUM.getFluidStack(144 * 8), }; //ItemUtils.simpleMetaStack("IC2:blockGenerator:7", 7, 1); @@ -1516,7 +1516,7 @@ public class RECIPES_Machines { ALLOY.EGLIN_STEEL.getLongRod(GTNH ? 16 : 4), CI.getElectricPiston(3, GTNH ? 4 : 2) }, - ALLOY.ZIRCONIUM_CARBIDE.getFluid(144 * 8), //Input Fluid + ALLOY.ZIRCONIUM_CARBIDE.getFluidStack(144 * 8), //Input Fluid RECIPE_CyclotronOuterCasing, 30 * 20 * 2, MaterialUtils.getVoltageForTier(4)); @@ -1532,7 +1532,7 @@ public class RECIPES_Machines { ALLOY.INCOLOY_020.getScrew(GTNH ? 64 : 32), CI.getFieldGenerator(4, GTNH ? 2 : 1) }, - ALLOY.HG1223.getFluid(144 * 5), //Input Fluid + ALLOY.HG1223.getFluidStack(144 * 5), //Input Fluid RECIPE_CyclotronInnerCoil, 60 * 20 * 2, MaterialUtils.getVoltageForTier(5)); @@ -1548,7 +1548,7 @@ public class RECIPES_Machines { ALLOY.INCOLOY_MA956.getScrew(GTNH ? 64 : 16), ItemUtils.getItemStackOfAmountFromOreDict(CI.getTieredCircuitOreDictName(GTNH ? 6 : 5), GTNH ? 8 : 16) }, - ALLOY.INCOLOY_020.getFluid(144 * 9), //Input Fluid + ALLOY.INCOLOY_020.getFluidStack(144 * 9), //Input Fluid RECIPE_CyclotronController, 60 * 20 * 5, MaterialUtils.getVoltageForTier(5)); @@ -1855,8 +1855,8 @@ public class RECIPES_Machines { GregtechItemList.Casing_Fusion_Internal.get(1) }, new FluidStack[] { - ALLOY.PIKYONIUM.getFluid(32 * 144 * (GTNH ? 2 : 1)), - ALLOY.HG1223.getFluid(64 * 144) + ALLOY.PIKYONIUM.getFluidStack(32 * 144 * (GTNH ? 2 : 1)), + ALLOY.HG1223.getFluidStack(64 * 144) }, GregtechItemList.FusionComputer_UV2.get(1), (int) GT_Values.V[6], @@ -1878,7 +1878,7 @@ public class RECIPES_Machines { }, new FluidStack[] { Materials.NaquadahAlloy.getMolten(576 * (GTNH ? 2 : 1)), - ALLOY.ZERON_100.getFluid(16 * 144) + ALLOY.ZERON_100.getFluidStack(16 * 144) }, GregtechItemList.Casing_Fusion_External.get(1), (int) GT_Values.V[5], @@ -1900,8 +1900,8 @@ public class RECIPES_Machines { ItemList.Casing_Fusion_Coil.get(1) }, new FluidStack[] { - ALLOY.CINOBITE.getFluid(16 * 144 * (GTNH ? 2 : 1)), - ALLOY.ABYSSAL.getFluid(64 * 144) + ALLOY.CINOBITE.getFluidStack(16 * 144 * (GTNH ? 2 : 1)), + ALLOY.ABYSSAL.getFluidStack(64 * 144) }, GregtechItemList.Casing_Fusion_Internal.get(1), (int) GT_Values.V[5], @@ -1935,7 +1935,7 @@ public class RECIPES_Machines { ALLOY.TRINIUM_REINFORCED_STEEL.getPlateDouble(4 * (GTNH ? 2 : 1)), ItemUtils.getSimpleStack((GTNH ? CI.machineHull_UV : CI.machineHull_LuV), 1 * (GTNH ? 2 : 1)), }, - ALLOY.MARAGING350.getFluid(144 * 16 * (GTNH ? 2 : 1)), + ALLOY.MARAGING350.getFluidStack(144 * 16 * (GTNH ? 2 : 1)), GregtechItemList.Casing_BedrockMiner.get(1), (int) GT_Values.V[4], (int) GT_Values.V[6]); @@ -2084,7 +2084,7 @@ public class RECIPES_Machines { ItemUtils.getItemStackFromFQRN("miscutils:item.itemBufferCore"+(GTNH ? "2" : "1"), GTNH ? 4 : 2), ItemUtils.getItemStackOfAmountFromOreDict(CI.getTieredCircuitOreDictName(GTNH ? 3 : 2), GTNH ? 10 : 5) }, - aMat_B[3].getFluid(144 * 8), //Input Fluid + aMat_B[3].getFluidStack(144 * 8), //Input Fluid GregtechItemList.Hatch_Control_Core.get(1), 60 * 20 * 5, MaterialUtils.getVoltageForTier(3)); @@ -2455,7 +2455,7 @@ public class RECIPES_Machines { ALLOY.INCONEL_625.getPlate(16), ALLOY.ZERON_100.getBolt(16), }, - ALLOY.TUNGSTENSTEEL.getFluid(8 * 144), + ALLOY.TUNGSTENSTEEL.getFluidStack(8 * 144), GregtechItemList.Casing_IsaMill_Gearbox.get(1), 60 * 20 * 2, MaterialUtils.getVoltageForTier(6)); @@ -2470,7 +2470,7 @@ public class RECIPES_Machines { CI.getTieredComponentOfMaterial(Materials.HSSG, OrePrefixes.gearGtSmall, 4), ALLOY.ZERON_100.getScrew(8), }, - ELEMENT.getInstance().TITANIUM.getFluid(4 * 144), + ELEMENT.getInstance().TITANIUM.getFluidStack(4 * 144), GregtechItemList.Casing_IsaMill_Casing.get(1), 60 * 20 * 2, MaterialUtils.getVoltageForTier(6)); @@ -2485,7 +2485,7 @@ public class RECIPES_Machines { CI.getTieredComponentOfMaterial(Materials.HSSE, OrePrefixes.plate, 8), ALLOY.INCOLOY_MA956.getBolt(16), }, - ELEMENT.getInstance().ALUMINIUM.getFluid(8 * 144), + ELEMENT.getInstance().ALUMINIUM.getFluidStack(8 * 144), GregtechItemList.Casing_IsaMill_Pipe.get(1), 60 * 20 * 8, MaterialUtils.getVoltageForTier(4)); @@ -2529,7 +2529,7 @@ public class RECIPES_Machines { CI.getTieredComponentOfMaterial(Materials.HSSG, OrePrefixes.plateDouble, 4), ALLOY.HASTELLOY_N.getScrew(8), }, - ALLOY.STAINLESS_STEEL.getFluid(8 * 144), + ALLOY.STAINLESS_STEEL.getFluidStack(8 * 144), GregtechItemList.Casing_Flotation_Cell.get(1), 60 * 20 * 2, MaterialUtils.getVoltageForTier(6)); @@ -2544,7 +2544,7 @@ public class RECIPES_Machines { CI.getTieredComponentOfMaterial(Materials.TungstenSteel, OrePrefixes.plate, 32), CI.getTieredComponentOfMaterial(Materials.SolderingAlloy, OrePrefixes.wireFine, 16), }, - ELEMENT.getInstance().TUNGSTEN.getFluid(8 * 144), + ELEMENT.getInstance().TUNGSTEN.getFluidStack(8 * 144), GregtechItemList.Bus_Milling_Balls.get(1), 60 * 20 * 4, MaterialUtils.getVoltageForTier(5)); diff --git a/src/Java/gtPlusPlus/core/recipe/RECIPES_RareEarthProcessing.java b/src/Java/gtPlusPlus/core/recipe/RECIPES_RareEarthProcessing.java index d3c0b4c093..97636e9e65 100644 --- a/src/Java/gtPlusPlus/core/recipe/RECIPES_RareEarthProcessing.java +++ b/src/Java/gtPlusPlus/core/recipe/RECIPES_RareEarthProcessing.java @@ -51,7 +51,7 @@ public class RECIPES_RareEarthProcessing { if (mSaltWater == null) { Fluid f = SALT_WATER.generateFluid(); SALT_WATER.registerComponentForMaterial(FluidUtils.getFluidStack(f, 1000)); - mSaltWater = SALT_WATER.getFluid(1000); + mSaltWater = SALT_WATER.getFluidStack(1000); } else { SALT_WATER.registerComponentForMaterial(FluidUtils.getFluidStack(mSaltWater, 1000)); @@ -62,7 +62,7 @@ public class RECIPES_RareEarthProcessing { if (mBrine == null) { Fluid f = BRINE.generateFluid(); BRINE.registerComponentForMaterial(FluidUtils.getFluidStack(f, 1000)); - mBrine = BRINE.getFluid(1000); + mBrine = BRINE.getFluidStack(1000); } else { BRINE.registerComponentForMaterial(FluidUtils.getFluidStack(mBrine, 1000)); @@ -88,7 +88,7 @@ public class RECIPES_RareEarthProcessing { mHydrogenChloride = FluidUtils.getFluidStack("hydrogenchloride", 1000); if (mHydrogenChloride == null) { HYDROGEN_CHLORIDE.generateFluid(); - mHydrogenChloride = BRINE.getFluid(1000); + mHydrogenChloride = BRINE.getFluidStack(1000); } else { HYDROGEN_CHLORIDE.registerComponentForMaterial(FluidUtils.getFluidStack(mHydrogenChloride, 1000)); @@ -98,7 +98,7 @@ public class RECIPES_RareEarthProcessing { // Add Process for creating Brine CORE.RA.addBrewingRecipe( ItemUtils.getSimpleStack(mDustSalt, 16), - MISC_MATERIALS.SALT_WATER.getFluid(2000), + MISC_MATERIALS.SALT_WATER.getFluidStack(2000), FluidUtils.getFluidStack(mBrine, 4000), 20 * 20, 120, diff --git a/src/Java/gtPlusPlus/core/recipe/RECIPES_SeleniumProcessing.java b/src/Java/gtPlusPlus/core/recipe/RECIPES_SeleniumProcessing.java index 0156031a95..9a2ea8bad0 100644 --- a/src/Java/gtPlusPlus/core/recipe/RECIPES_SeleniumProcessing.java +++ b/src/Java/gtPlusPlus/core/recipe/RECIPES_SeleniumProcessing.java @@ -23,10 +23,10 @@ public class RECIPES_SeleniumProcessing { processCopperRecipes(); //Liquify the Dried Dioxide - AddGregtechRecipe.addCokeAndPyrolyseRecipes(MISC_MATERIALS.SELENIUM_DIOXIDE.getDust(1), 13, FluidUtils.getSteam(500), null, MISC_MATERIALS.SELENIUM_DIOXIDE.getFluid(1000), 20, 1024); + AddGregtechRecipe.addCokeAndPyrolyseRecipes(MISC_MATERIALS.SELENIUM_DIOXIDE.getDust(1), 13, FluidUtils.getSteam(500), null, MISC_MATERIALS.SELENIUM_DIOXIDE.getFluidStack(1000), 20, 1024); // Produce Selenious Acid - AddGregtechRecipe.addCokeAndPyrolyseRecipes(MISC_MATERIALS.SELENIUM_DIOXIDE.getCell(1), 14, FluidUtils.getHotWater(4000), CI.emptyCells(1), MISC_MATERIALS.SELENIOUS_ACID.getFluid(1000), 20, 2048); + AddGregtechRecipe.addCokeAndPyrolyseRecipes(MISC_MATERIALS.SELENIUM_DIOXIDE.getCell(1), 14, FluidUtils.getHotWater(4000), CI.emptyCells(1), MISC_MATERIALS.SELENIOUS_ACID.getFluidStack(1000), 20, 2048); // Make Selenium CORE.RA.addBlastSmelterRecipe( @@ -35,8 +35,8 @@ public class RECIPES_SeleniumProcessing { ItemUtils.getItemStackOfAmountFromOreDict("cellSulfuricAcid", 8), ELEMENT.getInstance().CARBON.getDust(16), }, - MISC_MATERIALS.SELENIOUS_ACID.getFluid(750), - ELEMENT.getInstance().SELENIUM.getFluid(144 * 1), + MISC_MATERIALS.SELENIOUS_ACID.getFluidStack(750), + ELEMENT.getInstance().SELENIUM.getFluidStack(144 * 1), new ItemStack[] { CI.emptyCells(8), ELEMENT.getInstance().SELENIUM.getIngot(1), @@ -93,7 +93,7 @@ public class RECIPES_SeleniumProcessing { ItemUtils.getOrePrefixStack(OrePrefixes.crushedPurified, Materials.Copper, 1), // Item Input }, FluidUtils.getHotWater(1000), // Fluid - MISC_MATERIALS.SELENIUM_DIOXIDE.getFluid(20), // Fluid + MISC_MATERIALS.SELENIUM_DIOXIDE.getFluidStack(20), // Fluid new ItemStack[] { ItemUtils.getOrePrefixStack(OrePrefixes.crushedCentrifuged, Materials.Copper, 1), MISC_MATERIALS.SELENIUM_DIOXIDE.getDust(1), @@ -126,7 +126,7 @@ public class RECIPES_SeleniumProcessing { ItemUtils.getOrePrefixStack(OrePrefixes.crushedPurified, Materials.Tetrahedrite, 1), // Item Input }, FluidUtils.getHotWater(1000), // Fluid - MISC_MATERIALS.SELENIUM_DIOXIDE.getFluid(10), // Fluid + MISC_MATERIALS.SELENIUM_DIOXIDE.getFluidStack(10), // Fluid new ItemStack[] { ItemUtils.getOrePrefixStack(OrePrefixes.crushedCentrifuged, Materials.Tetrahedrite, 1), MISC_MATERIALS.SELENIUM_DIOXIDE.getDust(1), @@ -159,7 +159,7 @@ public class RECIPES_SeleniumProcessing { ItemUtils.getOrePrefixStack(OrePrefixes.crushedPurified, Materials.Chalcopyrite, 1), // Item Input }, FluidUtils.getHotWater(1000), // Fluid - MISC_MATERIALS.SELENIUM_DIOXIDE.getFluid(10), // Fluid + MISC_MATERIALS.SELENIUM_DIOXIDE.getFluidStack(10), // Fluid new ItemStack[] { ItemUtils.getOrePrefixStack(OrePrefixes.crushedCentrifuged, Materials.Chalcopyrite, 1), MISC_MATERIALS.SELENIUM_DIOXIDE.getDust(1), @@ -192,7 +192,7 @@ public class RECIPES_SeleniumProcessing { ItemUtils.getOrePrefixStack(OrePrefixes.crushedPurified, Materials.Malachite, 1), // Item Input }, FluidUtils.getHotWater(1000), // Fluid - MISC_MATERIALS.SELENIUM_DIOXIDE.getFluid(10), // Fluid + MISC_MATERIALS.SELENIUM_DIOXIDE.getFluidStack(10), // Fluid new ItemStack[] { ItemUtils.getOrePrefixStack(OrePrefixes.crushedCentrifuged, Materials.Malachite, 1), MISC_MATERIALS.SELENIUM_DIOXIDE.getDust(1), diff --git a/src/Java/gtPlusPlus/core/recipe/common/CI.java b/src/Java/gtPlusPlus/core/recipe/common/CI.java index 93ede378a8..35d0a0ec07 100644 --- a/src/Java/gtPlusPlus/core/recipe/common/CI.java +++ b/src/Java/gtPlusPlus/core/recipe/common/CI.java @@ -632,7 +632,7 @@ public class CI { }*/ // Modern Handling - FluidStack a = aMaster[aType][aTier].getFluid(aAmount); + FluidStack a = aMaster[aType][aTier].getFluidStack(aAmount); if (a == null) { ItemStack aCell = getTieredComponent(OrePrefixes.liquid, aTier, 1); if (aCell != null) { diff --git a/src/Java/gtPlusPlus/core/tileentities/machines/TileEntityPestKiller.java b/src/Java/gtPlusPlus/core/tileentities/machines/TileEntityPestKiller.java index 3ebe5be40d..012c9f4ff5 100644 --- a/src/Java/gtPlusPlus/core/tileentities/machines/TileEntityPestKiller.java +++ b/src/Java/gtPlusPlus/core/tileentities/machines/TileEntityPestKiller.java @@ -183,7 +183,7 @@ public class TileEntityPestKiller extends TileEntity implements ISidedInventory, if (f != null) { if (f.isFluidEqual(FluidUtils.getWildcardFluidStack("formaldehyde", 1))) { return 1; - } else if (f.isFluidEqual(MISC_MATERIALS.HYDROGEN_CYANIDE.getFluid(1))) { + } else if (f.isFluidEqual(MISC_MATERIALS.HYDROGEN_CYANIDE.getFluidStack(1))) { return 2; } } @@ -443,7 +443,7 @@ public class TileEntityPestKiller extends TileEntity implements ISidedInventory, ArrayList t2Cells = OreDictionary.getOres("cellHydrogenCyanide"); didFill = addFluid(t1Cells, aInput, FluidUtils.getWildcardFluidStack("formaldehyde", 1000)); if (!didFill) { - didFill = addFluid(t2Cells, aInput, MISC_MATERIALS.HYDROGEN_CYANIDE.getFluid(1000)); + didFill = addFluid(t2Cells, aInput, MISC_MATERIALS.HYDROGEN_CYANIDE.getFluidStack(1000)); } } diff --git a/src/Java/gtPlusPlus/nei/GTPP_NEI_DefaultHandler.java b/src/Java/gtPlusPlus/nei/GTPP_NEI_DefaultHandler.java index dd27a19528..832ef780e0 100644 --- a/src/Java/gtPlusPlus/nei/GTPP_NEI_DefaultHandler.java +++ b/src/Java/gtPlusPlus/nei/GTPP_NEI_DefaultHandler.java @@ -5,6 +5,7 @@ import java.awt.Rectangle; import java.lang.ref.SoftReference; import java.util.ArrayList; import java.util.Collections; +import java.util.HashMap; import java.util.Iterator; import java.util.List; import java.util.stream.Collectors; @@ -30,6 +31,7 @@ import gregtech.api.util.GT_OreDictUnificator; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Recipe.GT_Recipe_Map; import gregtech.api.util.GT_Utility; +import gtPlusPlus.api.objects.data.Pair; import gtPlusPlus.core.util.math.MathUtils; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.inventory.GuiContainer; @@ -37,16 +39,35 @@ import net.minecraft.init.Blocks; import net.minecraft.item.ItemStack; import net.minecraftforge.fluids.FluidStack; -public class GTPP_NEI_DefaultHandler -extends TemplateRecipeHandler { +public class GTPP_NEI_DefaultHandler extends TemplateRecipeHandler { public static final int sOffsetX = 5; public static final int sOffsetY = 11; private SoftReference> mCachedRecipes = null; + + private static final HashMap> mInputSlotMap = new HashMap>(); + private static final HashMap> mOutputSlotMap = new HashMap>(); static { GuiContainerManager.addInputHandler(new GT_RectHandler()); GuiContainerManager.addTooltipHandler(new GT_RectHandler()); + int[] aSlotX = new int[] {12, 30, 48}; + int[] aSlotY = new int[] {5, 23, 41, 64}; + // Input slots + int aIndex = 0; + for (int y=0; y(aSlotX[x], aSlotY[y])); + } + } + // Output slots + aSlotX = new int[] {102, 120, 138}; + aIndex = 0; + for (int y=0; y(aSlotX[x], aSlotY[y])); + } + } } protected final GT_Recipe_Map mRecipeMap; @@ -829,4 +850,88 @@ extends TemplateRecipeHandler { return this.mOutputs; } } + + public class NoCellMultiDefaultRecipe extends CachedDefaultRecipe { + + public NoCellMultiDefaultRecipe(final GT_Recipe aRecipe) { + super(aRecipe); + + } + + @Override + public void handleSlots() { + + int aInputItemsCount = this.mRecipe.mInputs.length; + int aInputFluidsCount = this.mRecipe.mFluidInputs.length; + int aOutputItemsCount = this.mRecipe.mOutputs.length; + int aOutputFluidsCount = this.mRecipe.mFluidOutputs.length; + int aInputSlotsUsed = 0; + int aOutputSlotsUsed = 0; + int aSlotToCheck = 0; + + // Special Slot + if (mRecipe.mSpecialItems != null) { + this.mInputs.add(new FixedPositionedStack(mRecipe.mSpecialItems, 120, 52)); + } + + /* + * Items + */ + + // Upto 9 Inputs Slots + if (aInputItemsCount > 0) { + if (aInputItemsCount > 9) { + aInputItemsCount = 9; + } + for (int i=0;i 0) { + if (aOutputItemsCount > 9) { + aOutputItemsCount = 9; + } + for (int i=0;i 0) { + for (int i=0;i 0) { + for (int i=0;i 0) { + drawText(10, 110, "Time: " + (tDuration < 20 ? "< 1" : MathUtils.formatNumbers(Integer.valueOf(tDuration / 20))) + " secs", -16777216); + } + if ((GT_Utility.isStringValid(this.mRecipeMap.mNEISpecialValuePre)) || (GT_Utility.isStringValid(this.mRecipeMap.mNEISpecialValuePost))) { + drawText(10, 120, this.mRecipeMap.mNEISpecialValuePre + MathUtils.formatNumbers((((CachedDefaultRecipe) this.arecipes.get(aRecipeIndex)).mRecipe.mSpecialValue * this.mRecipeMap.mNEISpecialValueMultiplier)) + this.mRecipeMap.mNEISpecialValuePost, -16777216); + } + } + +} diff --git a/src/Java/gtPlusPlus/nei/GT_NEI_RFPP.java b/src/Java/gtPlusPlus/nei/GT_NEI_RFPP.java deleted file mode 100644 index a4926f5d7e..0000000000 --- a/src/Java/gtPlusPlus/nei/GT_NEI_RFPP.java +++ /dev/null @@ -1,152 +0,0 @@ -package gtPlusPlus.nei; - -import codechicken.nei.recipe.TemplateRecipeHandler; -import gregtech.api.util.GTPP_Recipe.GTPP_Recipe_Map; -import gregtech.api.util.GT_Recipe; -import gregtech.api.util.GT_Utility; - -public class GT_NEI_RFPP extends GTPP_NEI_DefaultHandler { - - public GT_NEI_RFPP() { - super(GTPP_Recipe_Map.sFissionFuelProcessing); - } - - @Override - public TemplateRecipeHandler newInstance() { - return new GT_NEI_RFPP(); - } - - @Override - public CachedDefaultRecipe createCachedRecipe(GT_Recipe aRecipe) { - return new FFPPDefaultRecipe(aRecipe); - } - - public class FFPPDefaultRecipe extends CachedDefaultRecipe { - - public FFPPDefaultRecipe(final GT_Recipe aRecipe) { - super(aRecipe); - } - - @Override - public void handleSlots() { - int tStartIndex = 0; - if (mRecipe.getRepresentativeInput(tStartIndex) != null) { - this.mInputs.add(new FixedPositionedStack(mRecipe.getRepresentativeInput(tStartIndex), 12, 5)); - } - tStartIndex++; - if (mRecipe.getRepresentativeInput(tStartIndex) != null) { - this.mInputs.add(new FixedPositionedStack(mRecipe.getRepresentativeInput(tStartIndex), 30, 5)); - } - tStartIndex++; - if (mRecipe.getRepresentativeInput(tStartIndex) != null) { - this.mInputs.add(new FixedPositionedStack(mRecipe.getRepresentativeInput(tStartIndex), 48, 5)); - } - tStartIndex++; - if (mRecipe.getRepresentativeInput(tStartIndex) != null) { - this.mInputs.add(new FixedPositionedStack(mRecipe.getRepresentativeInput(tStartIndex), 12, 23)); - } - tStartIndex++; - if (mRecipe.getRepresentativeInput(tStartIndex) != null) { - this.mInputs.add(new FixedPositionedStack(mRecipe.getRepresentativeInput(tStartIndex), 30, 23)); - } - tStartIndex++; - if (mRecipe.getRepresentativeInput(tStartIndex) != null) { - this.mInputs.add(new FixedPositionedStack(mRecipe.getRepresentativeInput(tStartIndex), 48, 23)); - } - tStartIndex++; - - if (mRecipe.mSpecialItems != null) { - this.mInputs.add(new FixedPositionedStack(mRecipe.mSpecialItems, 120, 52)); - } - tStartIndex = 0; - - //Four Output Slots - if (mRecipe.getOutput(tStartIndex) != null) { - this.mOutputs.add(new FixedPositionedStack(mRecipe.getOutput(tStartIndex), 102, 5, mRecipe.getOutputChance(tStartIndex))); - } - tStartIndex++; - if (mRecipe.getOutput(tStartIndex) != null) { - this.mOutputs.add(new FixedPositionedStack(mRecipe.getOutput(tStartIndex), 120, 5, mRecipe.getOutputChance(tStartIndex))); - } - tStartIndex++; - if (mRecipe.getOutput(tStartIndex) != null) { - this.mOutputs.add(new FixedPositionedStack(mRecipe.getOutput(tStartIndex), 102, 23, mRecipe.getOutputChance(tStartIndex))); - } - tStartIndex++; - if (mRecipe.getOutput(tStartIndex) != null) { - this.mOutputs.add(new FixedPositionedStack(mRecipe.getOutput(tStartIndex), 120, 23, mRecipe.getOutputChance(tStartIndex))); - } - tStartIndex++; - - //New fluid display behaviour when 3 fluid inputs are detected. (Basically a mix of the code below for outputs an the code above for 9 input slots.) - if (mRecipe.mFluidInputs.length > 2) { - if ((mRecipe.mFluidInputs[0] != null) && (mRecipe.mFluidInputs[0].getFluid() != null)) { - this.mInputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(mRecipe.mFluidInputs[0], true), 12, 5)); - } - if ((mRecipe.mFluidInputs[1] != null) && (mRecipe.mFluidInputs[1].getFluid() != null)) { - this.mInputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(mRecipe.mFluidInputs[1], true), 30, 5)); - } - if ((mRecipe.mFluidInputs.length > 2) && (mRecipe.mFluidInputs[2] != null) && (mRecipe.mFluidInputs[2].getFluid() != null)) { - this.mInputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(mRecipe.mFluidInputs[2], true), 48, 5)); - } - if ((mRecipe.mFluidInputs.length > 3) && (mRecipe.mFluidInputs[3] != null) && (mRecipe.mFluidInputs[3].getFluid() != null)) { - this.mInputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(mRecipe.mFluidInputs[3], true), 12, 23)); - } - if ((mRecipe.mFluidInputs.length > 4) && (mRecipe.mFluidInputs[4] != null) && (mRecipe.mFluidInputs[4].getFluid() != null)) { - this.mInputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(mRecipe.mFluidInputs[4], true), 30, 23)); - } - if ((mRecipe.mFluidInputs.length > 5) && (mRecipe.mFluidInputs[5] != null) && (mRecipe.mFluidInputs[5].getFluid() != null)) { - this.mInputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(mRecipe.mFluidInputs[5], true), 48, 23)); - } - if ((mRecipe.mFluidInputs.length > 6) && (mRecipe.mFluidInputs[6] != null) && (mRecipe.mFluidInputs[6].getFluid() != null)) { - this.mInputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(mRecipe.mFluidInputs[6], true), 12, 41)); - } - if ((mRecipe.mFluidInputs.length > 7) && (mRecipe.mFluidInputs[7] != null) && (mRecipe.mFluidInputs[7].getFluid() != null)) { - this.mInputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(mRecipe.mFluidInputs[7], true), 30, 41)); - } - if ((mRecipe.mFluidInputs.length > 8) && (mRecipe.mFluidInputs[8] != null) && (mRecipe.mFluidInputs[8].getFluid() != null)) { - this.mInputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(mRecipe.mFluidInputs[8], true), 48, 41)); - } - } - //Returns to old behaviour if fluid inputs < 3 - else if ((mRecipe.mFluidInputs.length > 0) && (mRecipe.mFluidInputs[0] != null) && (mRecipe.mFluidInputs[0].getFluid() != null)) { - this.mInputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(mRecipe.mFluidInputs[0], true), 48, 52)); - if ((mRecipe.mFluidInputs.length == 2) && (mRecipe.mFluidInputs[1] != null) && (mRecipe.mFluidInputs[1].getFluid() != null)) { - this.mInputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(mRecipe.mFluidInputs[1], true), 30, 52)); - } - } - - if (mRecipe.mFluidOutputs.length > 1) { - if ((mRecipe.mFluidOutputs[0] != null) && (mRecipe.mFluidOutputs[0].getFluid() != null)) { - this.mOutputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(mRecipe.mFluidOutputs[0], true), 102, 5)); - } - if ((mRecipe.mFluidOutputs[1] != null) && (mRecipe.mFluidOutputs[1].getFluid() != null)) { - this.mOutputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(mRecipe.mFluidOutputs[1], true), 120, 5)); - } - if ((mRecipe.mFluidOutputs.length > 2) && (mRecipe.mFluidOutputs[2] != null) && (mRecipe.mFluidOutputs[2].getFluid() != null)) { - this.mOutputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(mRecipe.mFluidOutputs[2], true), 138, 5)); - } - if ((mRecipe.mFluidOutputs.length > 3) && (mRecipe.mFluidOutputs[3] != null) && (mRecipe.mFluidOutputs[3].getFluid() != null)) { - this.mOutputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(mRecipe.mFluidOutputs[3], true), 102, 23)); - } - if ((mRecipe.mFluidOutputs.length > 4) && (mRecipe.mFluidOutputs[4] != null) && (mRecipe.mFluidOutputs[4].getFluid() != null)) { - this.mOutputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(mRecipe.mFluidOutputs[4], true), 120, 23)); - } - if ((mRecipe.mFluidOutputs.length > 5) && (mRecipe.mFluidOutputs[5] != null) && (mRecipe.mFluidOutputs[5].getFluid() != null)) { - this.mOutputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(mRecipe.mFluidOutputs[5], true), 138, 23)); - } - if ((mRecipe.mFluidOutputs.length > 6) && (mRecipe.mFluidOutputs[6] != null) && (mRecipe.mFluidOutputs[6].getFluid() != null)) { - this.mOutputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(mRecipe.mFluidOutputs[6], true), 102, 41)); - } - if ((mRecipe.mFluidOutputs.length > 7) && (mRecipe.mFluidOutputs[7] != null) && (mRecipe.mFluidOutputs[7].getFluid() != null)) { - this.mOutputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(mRecipe.mFluidOutputs[7], true), 120, 41)); - } - if ((mRecipe.mFluidOutputs.length > 8) && (mRecipe.mFluidOutputs[8] != null) && (mRecipe.mFluidOutputs[8].getFluid() != null)) { - this.mOutputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(mRecipe.mFluidOutputs[8], true), 138, 41)); - } - } else if ((mRecipe.mFluidOutputs.length > 0) && (mRecipe.mFluidOutputs[0] != null) && (mRecipe.mFluidOutputs[0].getFluid() != null)) { - this.mOutputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(mRecipe.mFluidOutputs[0], true), 102, 5)); - } - } - } -} diff --git a/src/Java/gtPlusPlus/nei/GT_NEI_VacFurnace.java b/src/Java/gtPlusPlus/nei/GT_NEI_VacFurnace.java deleted file mode 100644 index 5fe63c4c61..0000000000 --- a/src/Java/gtPlusPlus/nei/GT_NEI_VacFurnace.java +++ /dev/null @@ -1,119 +0,0 @@ -package gtPlusPlus.nei; - -import codechicken.nei.recipe.TemplateRecipeHandler; -import gregtech.api.util.GTPP_Recipe.GTPP_Recipe_Map; -import gregtech.api.util.GT_Recipe; -import gregtech.api.util.GT_Utility; - -public class GT_NEI_VacFurnace extends GTPP_NEI_DefaultHandler { - - public GT_NEI_VacFurnace() { - super(GTPP_Recipe_Map.sVacuumFurnaceRecipes); - } - - @Override - public TemplateRecipeHandler newInstance() { - return new GT_NEI_VacFurnace(); - } - - @Override - public CachedDefaultRecipe createCachedRecipe(GT_Recipe aRecipe) { - return new VacFurnaceDefaultRecipe(aRecipe); - } - - public class VacFurnaceDefaultRecipe extends CachedDefaultRecipe { - - public VacFurnaceDefaultRecipe(final GT_Recipe aRecipe) { - super(aRecipe); - } - - @Override - public void handleSlots() { - int tStartIndex = 0; - - if (mRecipe.getRepresentativeInput(tStartIndex) != null) { - this.mInputs.add(new FixedPositionedStack(mRecipe.getRepresentativeInput(tStartIndex), 12, 5)); - } - tStartIndex++; - if (mRecipe.getRepresentativeInput(tStartIndex) != null) { - this.mInputs.add(new FixedPositionedStack(mRecipe.getRepresentativeInput(tStartIndex), 30, 5)); - } - tStartIndex++; - if (mRecipe.getRepresentativeInput(tStartIndex) != null) { - this.mInputs.add(new FixedPositionedStack(mRecipe.getRepresentativeInput(tStartIndex), 48, 5)); - } - tStartIndex++; - if (mRecipe.getRepresentativeInput(tStartIndex) != null) { - this.mInputs.add(new FixedPositionedStack(mRecipe.getRepresentativeInput(tStartIndex), 12, 23)); - } - tStartIndex++; - if (mRecipe.getRepresentativeInput(tStartIndex) != null) { - this.mInputs.add(new FixedPositionedStack(mRecipe.getRepresentativeInput(tStartIndex), 30, 23)); - } - tStartIndex++; - if (mRecipe.getRepresentativeInput(tStartIndex) != null) { - this.mInputs.add(new FixedPositionedStack(mRecipe.getRepresentativeInput(tStartIndex), 48, 23)); - } - tStartIndex++; - - if (mRecipe.mSpecialItems != null) { - this.mInputs.add(new FixedPositionedStack(mRecipe.mSpecialItems, 120, 52)); - } - tStartIndex = 0; - - //9 Output Slots - if (mRecipe.getOutput(tStartIndex) != null) { - this.mOutputs.add(new FixedPositionedStack(mRecipe.getOutput(tStartIndex), 101, 4, mRecipe.getOutputChance(tStartIndex))); - } - tStartIndex++; - if (mRecipe.getOutput(tStartIndex) != null) { - this.mOutputs.add(new FixedPositionedStack(mRecipe.getOutput(tStartIndex), 119, 4, mRecipe.getOutputChance(tStartIndex))); - } - tStartIndex++; - if (mRecipe.getOutput(tStartIndex) != null) { - this.mOutputs.add(new FixedPositionedStack(mRecipe.getOutput(tStartIndex), 137, 4, mRecipe.getOutputChance(tStartIndex))); - } - tStartIndex++; - if (mRecipe.getOutput(tStartIndex) != null) { - this.mOutputs.add(new FixedPositionedStack(mRecipe.getOutput(tStartIndex), 101, 22, mRecipe.getOutputChance(tStartIndex))); - } - tStartIndex++; - if (mRecipe.getOutput(tStartIndex) != null) { - this.mOutputs.add(new FixedPositionedStack(mRecipe.getOutput(tStartIndex), 119, 22, mRecipe.getOutputChance(tStartIndex))); - } - tStartIndex++; - if (mRecipe.getOutput(tStartIndex) != null) { - this.mOutputs.add(new FixedPositionedStack(mRecipe.getOutput(tStartIndex), 137, 22, mRecipe.getOutputChance(tStartIndex))); - } - tStartIndex++; - if (mRecipe.getOutput(tStartIndex) != null) { - this.mOutputs.add(new FixedPositionedStack(mRecipe.getOutput(tStartIndex), 101, 40, mRecipe.getOutputChance(tStartIndex))); - } - tStartIndex++; - if (mRecipe.getOutput(tStartIndex) != null) { - this.mOutputs.add(new FixedPositionedStack(mRecipe.getOutput(tStartIndex), 119, 40, mRecipe.getOutputChance(tStartIndex))); - } - tStartIndex++; - if (mRecipe.getOutput(tStartIndex) != null) { - this.mOutputs.add(new FixedPositionedStack(mRecipe.getOutput(tStartIndex), 137, 40, mRecipe.getOutputChance(tStartIndex))); - } - tStartIndex++; - - if ((mRecipe.mFluidInputs.length > 0) && (mRecipe.mFluidInputs[0] != null) && (mRecipe.mFluidInputs[0].getFluid() != null)) { - this.mInputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(mRecipe.mFluidInputs[0], true), 12, 60)); - if ((mRecipe.mFluidInputs.length > 1) && (mRecipe.mFluidInputs[1] != null) && (mRecipe.mFluidInputs[1].getFluid() != null)) { - this.mInputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(mRecipe.mFluidInputs[1], true), 30, 60)); - } - } - - if (mRecipe.mFluidOutputs.length > 0) { - if ((mRecipe.mFluidOutputs[0] != null) && (mRecipe.mFluidOutputs[0].getFluid() != null)) { - this.mOutputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(mRecipe.mFluidOutputs[0], true), 101, 60)); - } - if ((mRecipe.mFluidOutputs.length > 1) && (mRecipe.mFluidOutputs[1] != null) && (mRecipe.mFluidOutputs[1].getFluid() != null)) { - this.mOutputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(mRecipe.mFluidOutputs[1], true), 119, 60)); - } - } - } - } -} diff --git a/src/Java/gtPlusPlus/nei/GT_NEI_multiCentriElectroFreezer.java b/src/Java/gtPlusPlus/nei/GT_NEI_multiCentriElectroFreezer.java deleted file mode 100644 index 3f22b15f3b..0000000000 --- a/src/Java/gtPlusPlus/nei/GT_NEI_multiCentriElectroFreezer.java +++ /dev/null @@ -1,150 +0,0 @@ -package gtPlusPlus.nei; - -import java.util.HashMap; - -import codechicken.nei.recipe.TemplateRecipeHandler; -import gregtech.api.util.GT_Recipe; -import gregtech.api.util.GT_Recipe.GT_Recipe_Map; -import gregtech.api.util.GT_Utility; -import gtPlusPlus.api.objects.data.Pair; - -public class GT_NEI_multiCentriElectroFreezer extends GTPP_NEI_DefaultHandler { - - public GT_NEI_multiCentriElectroFreezer(GT_Recipe_Map aMap) { - super(aMap); - } - - @Override - public TemplateRecipeHandler newInstance() { - return new GT_NEI_multiCentriElectroFreezer(mRecipeMap); - } - - @Override - public CachedDefaultRecipe createCachedRecipe(GT_Recipe aRecipe) { - return new NoCellMultiDefaultRecipe(aRecipe); - } - - private static final HashMap> mInputSlotMap = new HashMap>(); - private static final HashMap> mOutputSlotMap = new HashMap>(); - - static { - int aSlotX_1 = 12; - int aSlotX_2 = 30; - int aSlotX_3 = 48; - int aSlotY_1 = 5; - int aSlotY_2 = 23; - int aSlotY_3 = 41; - int aSlotY_10 = 65; // Only if 9 input items and a FLuid - mInputSlotMap.put(0, new Pair(aSlotX_1, aSlotY_1)); - mInputSlotMap.put(1, new Pair(aSlotX_2, aSlotY_1)); - mInputSlotMap.put(2, new Pair(aSlotX_3, aSlotY_1)); - mInputSlotMap.put(3, new Pair(aSlotX_1, aSlotY_2)); - mInputSlotMap.put(4, new Pair(aSlotX_2, aSlotY_2)); - mInputSlotMap.put(5, new Pair(aSlotX_3, aSlotY_2)); - mInputSlotMap.put(6, new Pair(aSlotX_1, aSlotY_3)); - mInputSlotMap.put(7, new Pair(aSlotX_2, aSlotY_3)); - mInputSlotMap.put(8, new Pair(aSlotX_3, aSlotY_3)); - mInputSlotMap.put(9, new Pair(aSlotX_1, aSlotY_10)); - mInputSlotMap.put(10, new Pair(aSlotX_2, aSlotY_10)); - mInputSlotMap.put(11, new Pair(aSlotX_3, aSlotY_10)); - aSlotX_1 = 102; - aSlotX_2 = 120; - aSlotX_3 = 138; - mOutputSlotMap.put(0, new Pair(aSlotX_1, aSlotY_1)); - mOutputSlotMap.put(1, new Pair(aSlotX_2, aSlotY_1)); - mOutputSlotMap.put(2, new Pair(aSlotX_3, aSlotY_1)); - mOutputSlotMap.put(3, new Pair(aSlotX_1, aSlotY_2)); - mOutputSlotMap.put(4, new Pair(aSlotX_2, aSlotY_2)); - mOutputSlotMap.put(5, new Pair(aSlotX_3, aSlotY_2)); - mOutputSlotMap.put(6, new Pair(aSlotX_1, aSlotY_3)); - mOutputSlotMap.put(7, new Pair(aSlotX_2, aSlotY_3)); - mOutputSlotMap.put(8, new Pair(aSlotX_3, aSlotY_3)); - mOutputSlotMap.put(9, new Pair(aSlotX_1, aSlotY_10)); - mOutputSlotMap.put(10, new Pair(aSlotX_2, aSlotY_10)); - mOutputSlotMap.put(11, new Pair(aSlotX_3, aSlotY_10)); - } - - public class NoCellMultiDefaultRecipe extends CachedDefaultRecipe { - - public NoCellMultiDefaultRecipe(final GT_Recipe aRecipe) { - super(aRecipe); - - } - - @Override - public void handleSlots() { - - int aInputItemsCount = this.mRecipe.mInputs.length; - int aInputFluidsCount = this.mRecipe.mFluidInputs.length; - int aOutputItemsCount = this.mRecipe.mOutputs.length; - int aOutputFluidsCount = this.mRecipe.mFluidOutputs.length; - int aInputSlotsUsed = 0; - int aOutputSlotsUsed = 0; - int aSlotToCheck = 0; - - // Special Slot - if (mRecipe.mSpecialItems != null) { - this.mInputs.add(new FixedPositionedStack(mRecipe.mSpecialItems, 120, 52)); - } - - /* - * Items - */ - - // Upto 9 Inputs Slots - if (aInputItemsCount > 0) { - if (aInputItemsCount > 9) { - aInputItemsCount = 9; - } - for (int i=0;i 0) { - if (aOutputItemsCount > 9) { - aOutputItemsCount = 9; - } - for (int i=0;i 0) { - for (int i=0;i 0) { - for (int i=0;i 0 && tRecipeList != null) { - if (tFluids.contains(MISC_MATERIALS.CARBON_DIOXIDE.getFluid(this.boostEu ? 3 : 1)) || tFluids.contains(FluidUtils.getFluidStack("carbondioxide", (this.boostEu ? 3 : 1)))) { + if (tFluids.contains(MISC_MATERIALS.CARBON_DIOXIDE.getFluidStack(this.boostEu ? 3 : 1)) || tFluids.contains(FluidUtils.getFluidStack("carbondioxide", (this.boostEu ? 3 : 1)))) { if (this.mRuntime % 72 == 0 || this.mRuntime == 0) { if (!consumeCO2()) { freeFuelTicks = 0; @@ -421,7 +421,7 @@ public class GregtechMetaTileEntity_LargeRocketEngine extends GregtechMeta_Multi } public boolean consumeCO2() { - if (this.depleteInput(MISC_MATERIALS.CARBON_DIOXIDE.getFluid(this.boostEu ? 3 : 1)) || this.depleteInput(FluidUtils.getFluidStack("carbondioxide", (this.boostEu ? 3 : 1)))) { + if (this.depleteInput(MISC_MATERIALS.CARBON_DIOXIDE.getFluidStack(this.boostEu ? 3 : 1)) || this.depleteInput(FluidUtils.getFluidStack("carbondioxide", (this.boostEu ? 3 : 1)))) { return true; } else { diff --git a/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_BlastSmelter.java b/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_BlastSmelter.java index 9e00ada163..9e58d486d3 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_BlastSmelter.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_BlastSmelter.java @@ -131,13 +131,13 @@ public class RecipeGen_BlastSmelter extends RecipeGen_Base { //Generate Recipes for all singular materials that can be made molten. if (hasMoreInputThanACircuit){ if (M.requiresBlastFurnace()) { - if (CORE.RA.addBlastSmelterRecipe(tItemStackTest, M.getFluid(fluidAmount), 100, (duration/(mTotalPartsCounter > 0 ? mTotalPartsCounter : 1)), (int) aVoltage)){ + if (CORE.RA.addBlastSmelterRecipe(tItemStackTest, M.getFluidStack(fluidAmount), 100, (duration/(mTotalPartsCounter > 0 ? mTotalPartsCounter : 1)), (int) aVoltage)){ Logger.WARNING("[BAS] Success."); Logger.WARNING("[BAS] Success, Also added a Fluid solidifier recipe."); - if (GT_Values.RA.addFluidExtractionRecipe(M.getIngot(1), null, M.getFluid(144), 100, duration, 120)){ + if (GT_Values.RA.addFluidExtractionRecipe(M.getIngot(1), null, M.getFluidStack(144), 100, duration, 120)){ Logger.WARNING("[BAS] Success, Also added a Fluid Extractor recipe."); } - if (GT_Values.RA.addFluidExtractionRecipe(M.getNugget(1), null, M.getFluid(16), 100, duration/9, 120)){ + if (GT_Values.RA.addFluidExtractionRecipe(M.getNugget(1), null, M.getFluidStack(16), 100, duration/9, 120)){ Logger.WARNING("[BAS] Success, Also added a Fluid Extractor recipe."); } /*if (GT_Values.RA.addFluidExtractionRecipe(M.getSmallDust(1), null, M.getFluid(36), 100, duration/4, 120)){ @@ -153,14 +153,14 @@ public class RecipeGen_BlastSmelter extends RecipeGen_Base { } } else { - if (CORE.RA.addBlastSmelterRecipe(tItemStackTest, M.getFluid(fluidAmount), 100, duration/(mTotalPartsCounter > 0 ? mTotalPartsCounter : 1)/2, (int) aVoltage)){ + if (CORE.RA.addBlastSmelterRecipe(tItemStackTest, M.getFluidStack(fluidAmount), 100, duration/(mTotalPartsCounter > 0 ? mTotalPartsCounter : 1)/2, (int) aVoltage)){ Logger.WARNING("[BAS] Success."); - if (GT_Values.RA.addFluidSolidifierRecipe(ItemList.Shape_Mold_Ingot.get(0), M.getFluid(144), M.getIngot(1), duration/2, 60)){ + if (GT_Values.RA.addFluidSolidifierRecipe(ItemList.Shape_Mold_Ingot.get(0), M.getFluidStack(144), M.getIngot(1), duration/2, 60)){ Logger.WARNING("[BAS] Success, Also added a Fluid solidifier recipe."); - if (GT_Values.RA.addFluidExtractionRecipe(M.getIngot(1), null, M.getFluid(144), 100, duration/2, 60)){ + if (GT_Values.RA.addFluidExtractionRecipe(M.getIngot(1), null, M.getFluidStack(144), 100, duration/2, 60)){ Logger.WARNING("[BAS] Success, Also added a Fluid Extractor recipe."); } - if (GT_Values.RA.addFluidExtractionRecipe(M.getNugget(1), null, M.getFluid(16), 100, duration/2/9, 60)){ + if (GT_Values.RA.addFluidExtractionRecipe(M.getNugget(1), null, M.getFluidStack(16), 100, duration/2/9, 60)){ Logger.WARNING("[BAS] Success, Also added a Fluid Extractor recipe."); } /*if (GT_Values.RA.addFluidExtractionRecipe(M.getSmallDust(1), null, M.getFluid(36), 100, duration/2/4, 60)){ @@ -212,7 +212,7 @@ public class RecipeGen_BlastSmelter extends RecipeGen_Base { final int xr = r; if ((xr > 0) && (xr <= 100)){ final int mathmatics = (r*1000); - componentsFluid = FluidUtils.getFluidStack(M.getComposites().get(irc).getStackMaterial().getFluid(mathmatics), mathmatics); + componentsFluid = FluidUtils.getFluidStack(M.getComposites().get(irc).getStackMaterial().getFluidStack(mathmatics), mathmatics); } } else { @@ -254,7 +254,7 @@ public class RecipeGen_BlastSmelter extends RecipeGen_Base { //Adds Recipe if (M.requiresBlastFurnace()) { - if (CORE.RA.addBlastSmelterRecipe(components, componentsFluid, M.getFluid(fluidAmount), 100, duration, (int) aVoltage)){ + if (CORE.RA.addBlastSmelterRecipe(components, componentsFluid, M.getFluidStack(fluidAmount), 100, duration, (int) aVoltage)){ Logger.WARNING("[BAS] Success."); } else { @@ -262,7 +262,7 @@ public class RecipeGen_BlastSmelter extends RecipeGen_Base { } } else { - if (CORE.RA.addBlastSmelterRecipe(components, componentsFluid, M.getFluid(fluidAmount), 100, duration, (int) aVoltage/2)){ + if (CORE.RA.addBlastSmelterRecipe(components, componentsFluid, M.getFluidStack(fluidAmount), 100, duration, (int) aVoltage/2)){ Logger.WARNING("[BAS] Success."); } else { diff --git a/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_DustGeneration.java b/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_DustGeneration.java index 173d11c97b..24c8eb488f 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_DustGeneration.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_DustGeneration.java @@ -193,7 +193,7 @@ public class RecipeGen_DustGeneration extends RecipeGen_Base { if (x.getStackMaterial() != null){ if (x.getStackMaterial().getDust(1) == null){ if (x.getStackMaterial().getState() != MaterialState.SOLID && x.getStackMaterial().getState() != MaterialState.ORE && x.getStackMaterial().getState() != MaterialState.PLASMA){ - oxygen = x.getStackMaterial().getFluid(1000); + oxygen = x.getStackMaterial().getFluidStack(1000); break; } } @@ -299,7 +299,7 @@ public class RecipeGen_DustGeneration extends RecipeGen_Base { if (x.getStackMaterial().getDust(1) == null){ MaterialState f = x.getStackMaterial().getState(); if (f == MaterialState.GAS || f == MaterialState.LIQUID || f == MaterialState.PURE_LIQUID || f == MaterialState.PURE_GAS){ - oxygen = x.getStackMaterial().getFluid((int) (material.vSmallestRatio[compSlot] * 1000)); + oxygen = x.getStackMaterial().getFluidStack((int) (material.vSmallestRatio[compSlot] * 1000)); } } } diff --git a/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Fluids.java b/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Fluids.java index 3c74c4166d..e87fc08c90 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Fluids.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Fluids.java @@ -41,8 +41,8 @@ public class RecipeGen_Fluids extends RecipeGen_Base { } // Melting Shapes to fluid - if (material.getFluid(1) != null - && !material.getFluid(1).getUnlocalizedName().toLowerCase().contains("plasma")) { + if (material.getFluidStack(1) != null + && !material.getFluidStack(1).getUnlocalizedName().toLowerCase().contains("plasma")) { if (!material.requiresBlastFurnace()) { @@ -50,7 +50,7 @@ public class RecipeGen_Fluids extends RecipeGen_Base { if (ItemUtils.checkForInvalidItems(material.getIngot(1))) if (CORE.RA.addFluidExtractionRecipe( material.getIngot(1), // Input - material.getFluid(144), // Fluid Output + material.getFluidStack(144), // Fluid Output 1 * 20, // Duration material.vVoltageMultiplier // Eu Tick )) { @@ -65,7 +65,7 @@ public class RecipeGen_Fluids extends RecipeGen_Base { if (ItemUtils.checkForInvalidItems(material.getPlate(1))) if (CORE.RA.addFluidExtractionRecipe( material.getPlate(1), // Input - material.getFluid(144), // Fluid Output + material.getFluidStack(144), // Fluid Output 1 * 20, // Duration material.vVoltageMultiplier // Eu Tick )) { @@ -80,7 +80,7 @@ public class RecipeGen_Fluids extends RecipeGen_Base { if (ItemUtils.checkForInvalidItems(material.getPlateDouble(1))) if (CORE.RA.addFluidExtractionRecipe( material.getPlateDouble(1), // Input - material.getFluid(288), // Fluid Output + material.getFluidStack(288), // Fluid Output 1 * 20, // Duration material.vVoltageMultiplier // Eu Tick )) { @@ -95,7 +95,7 @@ public class RecipeGen_Fluids extends RecipeGen_Base { if (ItemUtils.checkForInvalidItems(material.getNugget(1))) if (CORE.RA.addFluidExtractionRecipe( material.getNugget(1), // Input - material.getFluid(16), // Fluid Output + material.getFluidStack(16), // Fluid Output 16, // Duration material.vVoltageMultiplier // Eu Tick )) { @@ -110,7 +110,7 @@ public class RecipeGen_Fluids extends RecipeGen_Base { if (ItemUtils.checkForInvalidItems(material.getBlock(1))) if (CORE.RA.addFluidExtractionRecipe( material.getBlock(1), // Input - material.getFluid(144 * 9), // Fluid Output + material.getFluidStack(144 * 9), // Fluid Output 288, // Duration material.vVoltageMultiplier // Eu Tick )) { @@ -128,7 +128,7 @@ public class RecipeGen_Fluids extends RecipeGen_Base { // Ingot if (ItemUtils.checkForInvalidItems(material.getIngot(1))) if (GT_Values.RA.addFluidSolidifierRecipe(ItemList.Shape_Mold_Ingot.get(0), // Item Shape - material.getFluid(144), // Fluid Input + material.getFluidStack(144), // Fluid Input material.getIngot(1), // output 32, // Duration material.vVoltageMultiplier // Eu Tick @@ -143,7 +143,7 @@ public class RecipeGen_Fluids extends RecipeGen_Base { // Plate if (ItemUtils.checkForInvalidItems(material.getPlate(1))) if (GT_Values.RA.addFluidSolidifierRecipe(ItemList.Shape_Mold_Plate.get(0), // Item Shape - material.getFluid(144), // Fluid Input + material.getFluidStack(144), // Fluid Input material.getPlate(1), // output 32, // Duration material.vVoltageMultiplier // Eu Tick @@ -158,7 +158,7 @@ public class RecipeGen_Fluids extends RecipeGen_Base { // Nugget if (ItemUtils.checkForInvalidItems(material.getNugget(1))) if (GT_Values.RA.addFluidSolidifierRecipe(ItemList.Shape_Mold_Nugget.get(0), // Item Shape - material.getFluid(16), // Fluid Input + material.getFluidStack(16), // Fluid Input material.getNugget(1), // output 16, // Duration material.vVoltageMultiplier // Eu Tick @@ -173,7 +173,7 @@ public class RecipeGen_Fluids extends RecipeGen_Base { // Gears if (ItemUtils.checkForInvalidItems(material.getGear(1))) if (GT_Values.RA.addFluidSolidifierRecipe(ItemList.Shape_Mold_Gear.get(0), // Item Shape - material.getFluid(576), // Fluid Input + material.getFluidStack(576), // Fluid Input material.getGear(1), // output 128, // Duration material.vVoltageMultiplier // Eu Tick @@ -187,7 +187,7 @@ public class RecipeGen_Fluids extends RecipeGen_Base { // Blocks if (ItemUtils.checkForInvalidItems(material.getBlock(1))) if (GT_Values.RA.addFluidSolidifierRecipe(ItemList.Shape_Mold_Block.get(0), // Item Shape - material.getFluid(144 * 9), // Fluid Input + material.getFluidStack(144 * 9), // Fluid Input material.getBlock(1), // output 288, // Duration material.vVoltageMultiplier // Eu Tick @@ -219,7 +219,7 @@ public class RecipeGen_Fluids extends RecipeGen_Base { // Rod if (ItemUtils.checkForInvalidItems(material.getRod(1))) if (mold_Rod != null && GT_Values.RA.addFluidSolidifierRecipe(mold_Rod.get(0), // Item Shape - material.getFluid(72), // Fluid Input + material.getFluidStack(72), // Fluid Input material.getRod(1), // output 150, // Duration material.vVoltageMultiplier // Eu Tick @@ -235,7 +235,7 @@ public class RecipeGen_Fluids extends RecipeGen_Base { if (ItemUtils.checkForInvalidItems(material.getLongRod(1))) if (mold_Rod_Long != null && GT_Values.RA.addFluidSolidifierRecipe(mold_Rod_Long.get(0), // Item // Shape - material.getFluid(144), // Fluid Input + material.getFluidStack(144), // Fluid Input material.getLongRod(1), // output 300, // Duration material.vVoltageMultiplier // Eu Tick @@ -250,7 +250,7 @@ public class RecipeGen_Fluids extends RecipeGen_Base { // Bolt if (ItemUtils.checkForInvalidItems(material.getBolt(1))) if (mold_Bolt != null && GT_Values.RA.addFluidSolidifierRecipe(mold_Bolt.get(0), // Item Shape - material.getFluid(18), // Fluid Input + material.getFluidStack(18), // Fluid Input material.getBolt(1), // output 50, // Duration material.vVoltageMultiplier // Eu Tick @@ -265,7 +265,7 @@ public class RecipeGen_Fluids extends RecipeGen_Base { // Screw if (ItemUtils.checkForInvalidItems(material.getScrew(1))) if (mold_Screw != null && GT_Values.RA.addFluidSolidifierRecipe(mold_Screw.get(0), // Item Shape - material.getFluid(18), // Fluid Input + material.getFluidStack(18), // Fluid Input material.getScrew(1), // output 50, // Duration material.vVoltageMultiplier // Eu Tick @@ -280,7 +280,7 @@ public class RecipeGen_Fluids extends RecipeGen_Base { // Ring if (ItemUtils.checkForInvalidItems(material.getRing(1))) if (mold_Ring != null && GT_Values.RA.addFluidSolidifierRecipe(mold_Ring.get(0), // Item Shape - material.getFluid(36), // Fluid Input + material.getFluidStack(36), // Fluid Input material.getRing(1), // output 100, // Duration material.vVoltageMultiplier // Eu Tick diff --git a/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Recycling.java b/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Recycling.java index 84188a44aa..acb7e5fe02 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Recycling.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Recycling.java @@ -137,9 +137,9 @@ public class RecipeGen_Recycling implements Runnable { //Fluid Extractor if (ItemUtils.checkForInvalidItems(tempStack)) { // mValidItems[mSlotIndex++] = tempStack; - if ((mDust != null) && CORE.RA.addFluidExtractionRecipe(tempStack, material.getFluid(mFluidAmount), 30, material.vVoltageMultiplier)) { + if ((mDust != null) && CORE.RA.addFluidExtractionRecipe(tempStack, material.getFluidStack(mFluidAmount), 30, material.vVoltageMultiplier)) { Logger.WARNING("Fluid Recycle Recipe: " + material.getLocalizedName() + " - Success - Recycle " - + tempStack.getDisplayName() + " and obtain " + mFluidAmount+"mb of "+material.getFluid(1).getLocalizedName()+"."); + + tempStack.getDisplayName() + " and obtain " + mFluidAmount+"mb of "+material.getFluidStack(1).getLocalizedName()+"."); } else { Logger.WARNING("Fluid Recycle Recipe: " + material.getLocalizedName() + " - Failed"); diff --git a/src/Java/gtPlusPlus/xmod/gregtech/loaders/recipe/RecipeLoader_LFTR.java b/src/Java/gtPlusPlus/xmod/gregtech/loaders/recipe/RecipeLoader_LFTR.java index 43097413be..3e2f8e061d 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/loaders/recipe/RecipeLoader_LFTR.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/loaders/recipe/RecipeLoader_LFTR.java @@ -3,17 +3,12 @@ package gtPlusPlus.xmod.gregtech.loaders.recipe; import gregtech.api.enums.Materials; import gregtech.api.util.GTPP_Recipe; import gregtech.api.util.GT_Recipe; -import gregtech.api.util.GasSpargingRecipe; import gregtech.api.util.GasSpargingRecipeMap; import gtPlusPlus.api.objects.data.AutoMap; -import gtPlusPlus.api.objects.data.Pair; -import gtPlusPlus.core.item.ModItems; import gtPlusPlus.core.item.chemistry.NuclearChem; import gtPlusPlus.core.material.ELEMENT; import gtPlusPlus.core.material.nuclear.FLUORIDES; import gtPlusPlus.core.material.nuclear.NUCLIDE; -import gtPlusPlus.core.util.minecraft.FluidUtils; -import gtPlusPlus.xmod.gregtech.api.enums.GregtechOrePrefixes.GT_Materials; import net.minecraft.item.ItemStack; import net.minecraftforge.fluids.Fluid; import net.minecraftforge.fluids.FluidStack; @@ -33,20 +28,20 @@ public class RecipeLoader_LFTR { if (mNobleGases == null) { mNobleGases = new AutoMap(); mNobleGases.add(mSpargeGases.get(0)); - mNobleGases.add(ELEMENT.getInstance().XENON.getFluid(1).getFluid()); - mNobleGases.add(ELEMENT.getInstance().NEON.getFluid(1).getFluid()); - mNobleGases.add(ELEMENT.getInstance().ARGON.getFluid(1).getFluid()); - mNobleGases.add(ELEMENT.getInstance().KRYPTON.getFluid(1).getFluid()); - mNobleGases.add(ELEMENT.getInstance().RADON.getFluid(1).getFluid()); + mNobleGases.add(ELEMENT.getInstance().XENON.getFluid()); + mNobleGases.add(ELEMENT.getInstance().NEON.getFluid()); + mNobleGases.add(ELEMENT.getInstance().ARGON.getFluid()); + mNobleGases.add(ELEMENT.getInstance().KRYPTON.getFluid()); + mNobleGases.add(ELEMENT.getInstance().RADON.getFluid()); } if (mFluorideGases == null) { mFluorideGases = new AutoMap(); mFluorideGases.add(mSpargeGases.get(1)); - mFluorideGases.add(FLUORIDES.LITHIUM_FLUORIDE.getFluid(1).getFluid()); - mFluorideGases.add(FLUORIDES.NEPTUNIUM_HEXAFLUORIDE.getFluid(1).getFluid()); - mFluorideGases.add(FLUORIDES.TECHNETIUM_HEXAFLUORIDE.getFluid(1).getFluid()); - mFluorideGases.add(FLUORIDES.SELENIUM_HEXAFLUORIDE.getFluid(1).getFluid()); - mFluorideGases.add(FLUORIDES.THORIUM_TETRAFLUORIDE.getFluid(1).getFluid()); + mFluorideGases.add(FLUORIDES.LITHIUM_FLUORIDE.getFluid()); + mFluorideGases.add(FLUORIDES.NEPTUNIUM_HEXAFLUORIDE.getFluid()); + mFluorideGases.add(FLUORIDES.TECHNETIUM_HEXAFLUORIDE.getFluid()); + mFluorideGases.add(FLUORIDES.SELENIUM_HEXAFLUORIDE.getFluid()); + mFluorideGases.add(FLUORIDES.THORIUM_TETRAFLUORIDE.getFluid()); } } @@ -59,66 +54,65 @@ public class RecipeLoader_LFTR { //1l/10t= 1000l/2.5hr LiFBeF2ZrF4U235 configureSparging(); - FluidStack Li2BeF4 = new FluidStack(ModItems.fluidFLiBeSalt, 34); - FluidStack aBurntLi2BeF4 = new FluidStack(ModItems.fluidFLiBeSaltBurnt, 34); + FluidStack Li2BeF4 = NUCLIDE.Li2BeF4.getFluidStack(34); - //LiFBeF2ThF4UF4 + //LiFBeF2ThF4UF4 - T3 GT_Recipe LFTR1 = new GTPP_Recipe( true, new ItemStack[] {}, new ItemStack[] {}, null, new int[] {10000, 10000, 5000, 2500}, new FluidStack[] { - NUCLIDE.LiFBeF2ThF4UF4.getFluid(17), + NUCLIDE.LiFBeF2ThF4UF4.getFluidStack(17), Li2BeF4 }, new FluidStack[] { new FluidStack(NuclearChem.Burnt_LiFBeF2ThF4UF4, 17), - aBurntLi2BeF4, - FluidUtils.getFluidStack("molten.uraniumhexafluoride", 10), - FluidUtils.getFluidStack("molten.uraniumhexafluoride", 5) + NUCLIDE.LiFBeF2ThF4.getFluidStack(34), + FLUORIDES.URANIUM_HEXAFLUORIDE.getFluidStack(10), + FLUORIDES.URANIUM_HEXAFLUORIDE.getFluidStack(5) }, 12000,//time 0,//cost 8192//fuel value ); - //LiFBeF2ZrF4UF4 + //LiFBeF2ZrF4UF4 - T2 GT_Recipe LFTR2 = new GTPP_Recipe( true, new ItemStack[] {}, new ItemStack[] {}, null, new int[] {10000, 10000, 2500, 1250}, new FluidStack[] { - NUCLIDE.LiFBeF2ZrF4UF4.getFluid(17), + NUCLIDE.LiFBeF2ZrF4UF4.getFluidStack(17), Li2BeF4 }, new FluidStack[] { new FluidStack(NuclearChem.Burnt_LiFBeF2ZrF4UF4, 17), - aBurntLi2BeF4, - FluidUtils.getFluidStack("molten.uraniumhexafluoride", 4), - FluidUtils.getFluidStack("molten.uraniumhexafluoride", 2) + NUCLIDE.LiFBeF2ThF4.getFluidStack(34), + FLUORIDES.URANIUM_HEXAFLUORIDE.getFluidStack(4), + FLUORIDES.URANIUM_HEXAFLUORIDE.getFluidStack(2) }, 6000,//time 0,//cost 8192//fuel value ); - //LiFBeF2ZrF4U235 + //LiFBeF2ZrF4U235 - T1 GT_Recipe LFTR3 = new GTPP_Recipe( true, new ItemStack[] {}, new ItemStack[] {}, null, new int[] {10000, 10000, 1000, 500}, new FluidStack[] { - NUCLIDE.LiFBeF2ZrF4U235.getFluid(17), + NUCLIDE.LiFBeF2ZrF4U235.getFluidStack(17), Li2BeF4 }, new FluidStack[] { new FluidStack(NuclearChem.Burnt_LiFBeF2ZrF4U235, 17), - aBurntLi2BeF4, - FluidUtils.getFluidStack("molten.uraniumhexafluoride", 2), - FluidUtils.getFluidStack("molten.uraniumhexafluoride", 1) + NUCLIDE.LiFThF4.getFluidStack(34), + FLUORIDES.URANIUM_HEXAFLUORIDE.getFluidStack(2), + FLUORIDES.URANIUM_HEXAFLUORIDE.getFluidStack(1) }, 3000,//time 0,//cost diff --git a/src/Java/gtPlusPlus/xmod/gregtech/loaders/recipe/RecipeLoader_Nuclear.java b/src/Java/gtPlusPlus/xmod/gregtech/loaders/recipe/RecipeLoader_Nuclear.java index 712caae6a2..ba8241d804 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/loaders/recipe/RecipeLoader_Nuclear.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/loaders/recipe/RecipeLoader_Nuclear.java @@ -6,11 +6,11 @@ import gregtech.api.enums.GT_Values; import gregtech.api.enums.ItemList; import gregtech.api.util.GT_ModHandler; import gtPlusPlus.api.objects.Logger; -import gtPlusPlus.core.item.ModItems; import gtPlusPlus.core.item.chemistry.GenericChem; import gtPlusPlus.core.lib.CORE; import gtPlusPlus.core.lib.LoadedMods; import gtPlusPlus.core.material.ELEMENT; +import gtPlusPlus.core.material.MISC_MATERIALS; import gtPlusPlus.core.material.nuclear.FLUORIDES; import gtPlusPlus.core.material.nuclear.NUCLIDE; import gtPlusPlus.core.recipe.common.CI; @@ -60,11 +60,11 @@ public class RecipeLoader_Nuclear { private static void blastFurnace() { GT_Values.RA.addBlastRecipe( - ItemUtils.getItemStackOfAmountFromOreDict("dustLithiumFluoride", 2), - ItemUtils.getItemStackOfAmountFromOreDict("dustBerylliumFluoride", 1), + FLUORIDES.LITHIUM_FLUORIDE.getDust(2), + FLUORIDES.BERYLLIUM_FLUORIDE.getDust(1), GT_Values.NF, GT_Values.NF, - ItemUtils.getSimpleStack(ModItems.dustLi2BeF4, 3), + NUCLIDE.Li2BeF4.getDust(3), null, 60 * 20, 2000, 3000); @@ -92,7 +92,7 @@ public class RecipeLoader_Nuclear { CI.getNumberedCircuit(20), ItemUtils.getItemStackFromFQRN("IC2:reactorUraniumSimpledepleted", 8), GT_Values.NF, - ELEMENT.getInstance().KRYPTON.getFluid(60), + ELEMENT.getInstance().KRYPTON.getFluidStack(60), ItemList.IC2_Fuel_Rod_Empty.get(8), ELEMENT.getInstance().URANIUM238.getDust(2), ELEMENT.getInstance().URANIUM232.getSmallDust(1), @@ -105,7 +105,7 @@ public class RecipeLoader_Nuclear { CI.getNumberedCircuit(20), ItemUtils.getItemStackFromFQRN("IC2:reactorMOXSimpledepleted", 8), GT_Values.NF, - ELEMENT.getInstance().KRYPTON.getFluid(90), + ELEMENT.getInstance().KRYPTON.getFluidStack(90), ItemList.IC2_Fuel_Rod_Empty.get(8), ELEMENT.getInstance().PLUTONIUM244.getDust(2), ELEMENT.getInstance().PLUTONIUM241.getTinyDust(1), @@ -119,7 +119,7 @@ public class RecipeLoader_Nuclear { CI.getNumberedCircuit(20), ItemList.Depleted_Thorium_1.get(8), GT_Values.NF, - ELEMENT.getInstance().KRYPTON.getFluid(30), + ELEMENT.getInstance().KRYPTON.getFluidStack(30), ItemList.IC2_Fuel_Rod_Empty.get(8), ELEMENT.getInstance().THORIUM.getDust(2), ELEMENT.getInstance().THORIUM232.getDust(1), @@ -202,26 +202,43 @@ public class RecipeLoader_Nuclear { // LFTR Fuel Related Compounds if (GTNH) { // Hydroxide - AddGregtechRecipe.addChemicalRecipeForBasicMachineOnly( - ItemUtils.getItemStackOfAmountFromOreDict("cellOxygen", 1), - ItemUtils.getItemStackOfAmountFromOreDict("cellHydrogen", 1), GT_Values.NF, - FluidUtils.getFluidStack("hydroxide", 2000), - CI.emptyCells(2), GT_Values.NI, 8 * 20, 30); + GT_Values.RA.addChemicalRecipe( + ItemUtils.getGregtechCircuit(3), + ELEMENT.getInstance().OXYGEN.getCell(1), + ELEMENT.getInstance().HYDROGEN.getFluidStack(1000), + MISC_MATERIALS.HYDROXIDE.getFluidStack(2000), + CI.emptyCells(2), + GT_Values.NI, + 8 * 20, + 30); // Beryllium Hydroxide - GT_Values.RA.addChemicalRecipe(ItemUtils.getItemStackOfAmountFromOreDict("dustBeryllium", 7), - ItemUtils.getGregtechCircuit(3), FluidUtils.getFluidStack("hydroxide", 1000), - FluidUtils.getFluidStack("berylliumhydroxide", 2000), GT_Values.NI, 8 * 20); + GT_Values.RA.addChemicalRecipe( + ItemUtils.getGregtechCircuit(3), + ELEMENT.getInstance().BERYLLIUM.getDust(7), + MISC_MATERIALS.HYDROXIDE.getFluidStack(1000), + FLUORIDES.BERYLLIUM_HYDROXIDE.getFluidStack(2000), + GT_Values.NI, + 8 * 20, + 30); // Ammonium Bifluoride - GT_Values.RA.addChemicalRecipe(ItemUtils.getItemStackOfAmountFromOreDict("cellHydrofluoricAcid", 1), - ItemUtils.getGregtechCircuit(3), FluidUtils.getFluidStack("ammonium", 1000), - FluidUtils.getFluidStack("ammoniumbifluoride", 2000), - CI.emptyCells(1), 26 * 20); + GT_Values.RA.addChemicalRecipe( + ItemUtils.getGregtechCircuit(3), + ItemUtils.getItemStackOfAmountFromOreDict("cellHydrofluoricAcid", 1), + MISC_MATERIALS.AMMONIUM.getFluidStack(1000), + FLUORIDES.AMMONIUM_BIFLUORIDE.getFluidStack(2000), + CI.emptyCells(1), + 20 * 20, + 30); // Ammonium - AddGregtechRecipe.addChemicalRecipeForBasicMachineOnly( - ItemUtils.getItemStackOfAmountFromOreDict("cellAmmonia", 1), - ItemUtils.getItemStackOfAmountFromOreDict("cellHydrogen", 1), GT_Values.NF, - FluidUtils.getFluidStack("ammonium", 2000), - CI.emptyCells(2), GT_Values.NI, 20 * 20, 30); + GT_Values.RA.addChemicalRecipe( + ItemUtils.getGregtechCircuit(3), + ELEMENT.getInstance().HYDROGEN.getCell(1), + MISC_MATERIALS.AMMONIA.getFluidStack(1000), + MISC_MATERIALS.AMMONIUM.getFluidStack(2000), + CI.emptyCells(1), + GT_Values.NI, + 20 * 20, + 30); } if (!GTNH) { @@ -254,8 +271,8 @@ public class RecipeLoader_Nuclear { //Technetium GT_Values.RA.addChemicalRecipe( + CI.getNumberedAdvancedCircuit(22), ItemUtils.getItemStackOfAmountFromOreDict("dustTechnetium99", 1), - null, FluidUtils.getFluidStack("sulfuricacid", 1000), FluidUtils.getFluidStack("sulfuricacid", 144 * 2), ItemUtils.getItemStackOfAmountFromOreDict("dustTechnetium", 1), @@ -310,10 +327,10 @@ public class RecipeLoader_Nuclear { CI.getNumberedAdvancedCircuit(13), ItemUtils.getItemStackOfAmountFromOreDict("cellWater", 10) }, - FluidUtils.getFluidStack("molten.uraniumtetrafluoride", 1440), + FLUORIDES.URANIUM_TETRAFLUORIDE.getFluidStack(1440), null, new ItemStack[] { - ItemUtils.getItemStackOfAmountFromOreDict("dustUraniumTetrafluoride", 10), + FLUORIDES.URANIUM_TETRAFLUORIDE.getDust(10), CI.emptyCells(10) }, new int[] { 10000 }, @@ -326,10 +343,10 @@ public class RecipeLoader_Nuclear { CI.getNumberedAdvancedCircuit(12), ItemUtils.getItemStackOfAmountFromOreDict("cellWater", 10) }, // Item - FluidUtils.getFluidStack("molten.uraniumhexafluoride", 1440), // Fluid + FLUORIDES.URANIUM_HEXAFLUORIDE.getFluidStack(1440), null, // Fluid output (slot 2) new ItemStack[] { - ItemUtils.getItemStackOfAmountFromOreDict("dustUraniumHexafluoride", 10), + FLUORIDES.URANIUM_HEXAFLUORIDE.getDust(10), CI.emptyCells(10) }, // Output new int[] { 10000 }, 300 * 20, // Time in ticks @@ -369,7 +386,7 @@ public class RecipeLoader_Nuclear { }, // Item null, // Fluid input (slot 1) null, // Fluid output (slot 2) - new ItemStack[] { + new ItemStack[] { ItemUtils.getItemStackOfAmountFromOreDict("dustLithiumHydroxide", 2), ItemUtils.getItemStackOfAmountFromOreDict("dustCalciumCarbonate", 3) }, // Output @@ -429,10 +446,10 @@ public class RecipeLoader_Nuclear { CORE.RA.addDehydratorRecipe( new ItemStack[] { CI.getNumberedAdvancedCircuit(6), - ItemUtils.getItemStackOfAmountFromOreDict("cellAmmoniumBifluoride", 4) + FLUORIDES.AMMONIUM_BIFLUORIDE.getCell(4) }, - FluidUtils.getFluidStack("berylliumhydroxide", 2000), // Fluid input (slot 1) - FluidUtils.getFluidStack("ammoniumtetrafluoroberyllate", 6000), + FLUORIDES.BERYLLIUM_HYDROXIDE.getFluidStack(2000), // Fluid input (slot 1) + FLUORIDES.AMMONIUM_TETRAFLUOROBERYLLATE.getFluidStack(6000), new ItemStack[] { ItemUtils.getItemStackOfAmountFromOreDict("cellWater", 4) }, @@ -446,18 +463,17 @@ public class RecipeLoader_Nuclear { CI.getNumberedAdvancedCircuit(17), CI.emptyCells(5) }, - FluidUtils.getFluidStack("ammoniumtetrafluoroberyllate", 5000), + FLUORIDES.AMMONIUM_TETRAFLUOROBERYLLATE.getFluidStack(5000), null, new ItemStack[] { - ItemUtils.getItemStackOfAmountFromOreDict("cellAmmonia", 2), + MISC_MATERIALS.AMMONIA.getCell(2), ItemUtils.getItemStackOfAmountFromOreDict("cellHydrofluoricAcid", 2), - ItemUtils.getItemStackOfAmountFromOreDict("cellBerylliumFluoride", 1) + FLUORIDES.BERYLLIUM_FLUORIDE.getCell(1) }, new int[] {10000, 10000, 10000}, 5 * 60 * 20, 120); - } private static void electroMagneticSeperator() { @@ -495,19 +511,34 @@ public class RecipeLoader_Nuclear { private static void fluidExtractorRecipes() { //FLiBe fuel - CORE.RA.addFluidExtractionRecipe(ItemUtils.getSimpleStack(ModItems.dustLi2BeF4, 1), - new FluidStack(ModItems.fluidFLiBeSalt, 144), 100, 500); + CORE.RA.addFluidExtractionRecipe( + NUCLIDE.Li2BeF4.getDust(1), + NUCLIDE.Li2BeF4.getFluidStack(144), + 100, + 500); //LFTR Fuel 1 - CORE.RA.addFluidExtractionRecipe(NUCLIDE.LiFBeF2ZrF4U235.getDust(1), - NUCLIDE.LiFBeF2ZrF4U235.getFluid(144), 250, 1000); - CORE.RA.addFluidExtractionRecipe(NUCLIDE.LiFBeF2ZrF4UF4.getDust(1), - NUCLIDE.LiFBeF2ZrF4UF4.getFluid(144), 150, 2000); - CORE.RA.addFluidExtractionRecipe(NUCLIDE.LiFBeF2ThF4UF4.getDust(1), - NUCLIDE.LiFBeF2ThF4UF4.getFluid(144), 200, 1500); + CORE.RA.addFluidExtractionRecipe( + NUCLIDE.LiFBeF2ZrF4U235.getDust(1), + NUCLIDE.LiFBeF2ZrF4U235.getFluidStack(144), + 250, + 1000); + CORE.RA.addFluidExtractionRecipe( + NUCLIDE.LiFBeF2ZrF4UF4.getDust(1), + NUCLIDE.LiFBeF2ZrF4UF4.getFluidStack(144), + 150, + 1500); + CORE.RA.addFluidExtractionRecipe( + NUCLIDE.LiFBeF2ThF4UF4.getDust(1), + NUCLIDE.LiFBeF2ThF4UF4.getFluidStack(144), + 150, + 2000); //ZIRCONIUM_TETRAFLUORIDE - CORE.RA.addFluidExtractionRecipe(FLUORIDES.ZIRCONIUM_TETRAFLUORIDE.getDust(1), - FluidUtils.getFluidStack(ModItems.fluidZrF4, 144), 200, 512+256); + CORE.RA.addFluidExtractionRecipe( + FLUORIDES.ZIRCONIUM_TETRAFLUORIDE.getDust(1), + FLUORIDES.ZIRCONIUM_TETRAFLUORIDE.getFluidStack(144), + 200, + 512+256); } @@ -526,8 +557,8 @@ public class RecipeLoader_Nuclear { ItemUtils.getItemStackOfAmountFromOreDict("dustUranium235", 1), null, null, - FluidUtils.getFluidStack("hydrofluoricacid", 144 * 5), - FluidUtils.getFluidStack("molten.uraniumtetrafluoride", 144 * 5), + FluidUtils.getFluidStack("hydrofluoricacid", 5000), + FLUORIDES.URANIUM_TETRAFLUORIDE.getFluidStack(5000), null, 3000, 500); diff --git a/src/Java/gtPlusPlus/xmod/gregtech/loaders/recipe/RecipeLoader_NuclearFuelProcessing.java b/src/Java/gtPlusPlus/xmod/gregtech/loaders/recipe/RecipeLoader_NuclearFuelProcessing.java index 7ca838a8f0..90901e6847 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/loaders/recipe/RecipeLoader_NuclearFuelProcessing.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/loaders/recipe/RecipeLoader_NuclearFuelProcessing.java @@ -1,7 +1,6 @@ package gtPlusPlus.xmod.gregtech.loaders.recipe; import gregtech.api.enums.Materials; -import gtPlusPlus.api.objects.Logger; import gtPlusPlus.core.item.ModItems; import gtPlusPlus.core.item.chemistry.NuclearChem; import gtPlusPlus.core.lib.CORE; @@ -21,15 +20,15 @@ public class RecipeLoader_NuclearFuelProcessing { // Create Fuels - final FluidStack aLithiumFluoride = FLUORIDES.LITHIUM_FLUORIDE.getFluid(100); - final FluidStack aBerylliumFluoride = FLUORIDES.BERYLLIUM_FLUORIDE.getFluid(100); - final FluidStack aThoriumFluoride = FLUORIDES.THORIUM_TETRAFLUORIDE.getFluid(100); - final FluidStack aZirconiumFluoride = FLUORIDES.ZIRCONIUM_TETRAFLUORIDE.getFluid(100); - final FluidStack aUraniumTetraFluoride = FLUORIDES.URANIUM_TETRAFLUORIDE.getFluid(100); - final FluidStack aUranium235 = ELEMENT.getInstance().URANIUM235.getFluid(1000); - final FluidStack aLiFBeF2ZrF4U235 = NUCLIDE.LiFBeF2ZrF4U235.getFluid(100); - final FluidStack aLiFBeF2ZrF4UF4 = NUCLIDE.LiFBeF2ZrF4UF4.getFluid(100); - final FluidStack aLiFBeF2ThF4UF4 = NUCLIDE.LiFBeF2ThF4UF4.getFluid(100); + final FluidStack aLithiumFluoride = FLUORIDES.LITHIUM_FLUORIDE.getFluidStack(100); + final FluidStack aBerylliumFluoride = FLUORIDES.BERYLLIUM_FLUORIDE.getFluidStack(100); + final FluidStack aThoriumFluoride = FLUORIDES.THORIUM_TETRAFLUORIDE.getFluidStack(100); + final FluidStack aZirconiumFluoride = FLUORIDES.ZIRCONIUM_TETRAFLUORIDE.getFluidStack(100); + final FluidStack aUraniumTetraFluoride = FLUORIDES.URANIUM_TETRAFLUORIDE.getFluidStack(100); + final FluidStack aUranium235 = ELEMENT.getInstance().URANIUM235.getFluidStack(1000); + final FluidStack aLiFBeF2ZrF4U235 = NUCLIDE.LiFBeF2ZrF4U235.getFluidStack(100); + final FluidStack aLiFBeF2ZrF4UF4 = NUCLIDE.LiFBeF2ZrF4UF4.getFluidStack(100); + final FluidStack aLiFBeF2ThF4UF4 = NUCLIDE.LiFBeF2ThF4UF4.getFluidStack(100); // 7LiF - BeF2 - ZrF4 - U235 - 590C CORE.RA.addFissionFuel( @@ -76,16 +75,85 @@ public class RecipeLoader_NuclearFuelProcessing { final FluidStack aBurntLiFBeF2ZrF4U235 = new FluidStack(NuclearChem.Burnt_LiFBeF2ZrF4U235, 17); final FluidStack aBurntLiFBeF2ZrF4UF4 = new FluidStack(NuclearChem.Burnt_LiFBeF2ZrF4UF4, 17); final FluidStack aBurntLiFBeF2ThF4UF4 = new FluidStack(NuclearChem.Burnt_LiFBeF2ThF4UF4, 17); - FluidStack Li2BeF4 = new FluidStack(ModItems.fluidFLiBeSalt, 34); - final FluidStack aBurntLi2BeF4 = new FluidStack(ModItems.fluidFLiBeSaltBurnt, 34); final FluidStack aHelium = Materials.Helium.getGas(1000); final FluidStack aFluorine = Materials.Fluorine.getGas(1000); + + // Reactor Core step 0 - Process Burnt Salt + + + + // Tier 1 Fuel - Gives back FLIBE and breeds U233 + CORE.RA.addReactorProcessingUnitRecipe( + CI.getNumberedAdvancedCircuit(1), + CI.emptyCells(2), + new FluidStack(NuclearChem.Burnt_LiFBeF2ZrF4U235, 4000), + new ItemStack[] { + FLUORIDES.LITHIUM_FLUORIDE.getCell(1), + ELEMENT.getInstance().URANIUM233.getCell(1) + }, + new int[] {10000, 10000}, + NUCLIDE.LiFBeF2.getFluidStack(2000), + 20 * 60 * 60, + MaterialUtils.getVoltageForTier(3)); + + // Tier 2 Fuel + CORE.RA.addFissionFuel( + new FluidStack(NuclearChem.Burnt_LiFBeF2ZrF4UF4, 3000), + null, null, null, null, null, null, null, null, // Extra 5 inputs + FLUORIDES.ZIRCONIUM_TETRAFLUORIDE.getFluidStack(1000), + NUCLIDE.LiFBeF2UF4.getFluidStack(2000), + 60 * 60 * 20, // Duration + MaterialUtils.getVoltageForTier(4) + ); + + // Tier 3 Fuel + CORE.RA.addFissionFuel( + new FluidStack(NuclearChem.Burnt_LiFBeF2ThF4UF4, 3000), + null, null, null, null, null, null, null, null, // Extra 5 inputs + FLUORIDES.THORIUM_TETRAFLUORIDE.getFluidStack(1000), + NUCLIDE.LiFBeF2UF4.getFluidStack(2000), + 120 * 60 * 20, // Duration + MaterialUtils.getVoltageForTier(4) + ); + + + + + + + + + + + + + + + + + + + + // Reactor Blanket step 0 - Splitting + /* CORE.RA.addReactorProcessingUnitRecipe( + CI.getNumberedAdvancedCircuit(6), + CI.emptyCells(1), + new FluidStack(ModItems.fluidFLiBeSaltBurnt, 3000), + new ItemStack[] { + FLUORIDES.LITHIUM_FLUORIDE.getCell(1) + }, + new int[] {10000}, + NUCLIDE.LiFBeF2.getFluidStack(2000), + 20 * 60 * 60, + MaterialUtils.getVoltageForTier(3));*/ + + // Reactor Blanket step 1 - Fluorination - boolean a1 = CORE.RA.addReactorProcessingUnitRecipe( + CORE.RA.addReactorProcessingUnitRecipe( CI.getNumberedAdvancedCircuit(7), ELEMENT.getInstance().FLUORINE.getCell(10), - NUCLIDE.LiFThF4.getFluid(10000), + NUCLIDE.LiFThF4.getFluidStack(10000), new ItemStack[] { CI.emptyCells(8), ELEMENT.getInstance().LITHIUM.getCell(2), @@ -97,13 +165,13 @@ public class RecipeLoader_NuclearFuelProcessing { ItemUtils.getSimpleStack(ModItems.dustProtactinium233) }, new int[] {10000, 10000, 2000, 2000, 2000, 2000, 2000, 2000}, - NUCLIDE.UF6F2.getFluid(10000), + NUCLIDE.UF6F2.getFluidStack(10000), 20 * 60 * 5, MaterialUtils.getVoltageForTier(5)); - boolean a2 = CORE.RA.addReactorProcessingUnitRecipe( + CORE.RA.addReactorProcessingUnitRecipe( CI.getNumberedAdvancedCircuit(8), ELEMENT.getInstance().FLUORINE.getCell(10), - NUCLIDE.LiFBeF2ThF4.getFluid(10000), + NUCLIDE.LiFBeF2ThF4.getFluidStack(10000), new ItemStack[] { CI.emptyCells(6), ELEMENT.getInstance().LITHIUM.getCell(2), @@ -116,17 +184,16 @@ public class RecipeLoader_NuclearFuelProcessing { ItemUtils.getSimpleStack(ModItems.dustProtactinium233) }, new int[] {10000, 10000, 10000, 2000, 2000, 2000, 2000, 2000, 2000}, - NUCLIDE.UF6F2.getFluid(10000), + NUCLIDE.UF6F2.getFluidStack(10000), 20 * 60 * 5, MaterialUtils.getVoltageForTier(5)); - Logger.INFO("Adding LFTR Blanket step 1 - Fluorination ["+a1+"|"+a2+"]"); // Reactor Blanket step 2 - Sorption + Cold Trap - boolean a3 = CORE.RA.addColdTrapRecipe( + CORE.RA.addColdTrapRecipe( 8, FLUORIDES.SODIUM_FLUORIDE.getCell(2), - NUCLIDE.UF6F2.getFluid(3000), + NUCLIDE.UF6F2.getFluidStack(3000), new ItemStack[] { ELEMENT.getInstance().FLUORINE.getCell(2), ELEMENT.getInstance().URANIUM233.getDust(1), @@ -134,26 +201,15 @@ public class RecipeLoader_NuclearFuelProcessing { ELEMENT.getInstance().URANIUM233.getDust(1) }, new int[] {10000, 3000, 2000, 1000}, - FLUORIDES.URANIUM_HEXAFLUORIDE.getFluid(1000), + FLUORIDES.URANIUM_HEXAFLUORIDE.getFluidStack(1000), 20 * 60 * 10, MaterialUtils.getVoltageForTier(3)); - Logger.INFO("Adding LFTR Blanket step 2 - Sorption + Cold Trap ["+a3+"]"); - CORE.RA.addFissionFuel( - FluidUtils.getFluidStack(aBurntLiFBeF2ZrF4U235, 500), - FluidUtils.getFluidStack(aBerylliumFluoride, 280), - FluidUtils.getFluidStack(aThoriumFluoride, 70), - FluidUtils.getFluidStack(aUraniumTetraFluoride, 70), - null, null, null, null, null, // Extra 5 inputs - FluidUtils.getFluidStack(aLiFBeF2ThF4UF4, 1000), - null, - 150 * 60 * 20, // Duration - MaterialUtils.getVoltageForTier(5) - ); + } } diff --git a/src/Java/gtPlusPlus/xmod/gregtech/recipes/GregtechRecipeAdder.java b/src/Java/gtPlusPlus/xmod/gregtech/recipes/GregtechRecipeAdder.java index 4d7dfed724..f31d103cf3 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/recipes/GregtechRecipeAdder.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/recipes/GregtechRecipeAdder.java @@ -396,32 +396,26 @@ public class GregtechRecipeAdder implements IGregtech_RecipeAdder { final int aEUt) throws IndexOutOfBoundsException { Logger.WARNING("Trying to add a Dehydrator recipe."); try { - if (aInput[0] != null) { - Logger.WARNING("Recipe requires input: " + aInput[0].getDisplayName() + " x" + aInput[0].stackSize); - } - if (aInput.length > 1) { - if (aInput[1] != null) { - Logger.WARNING("Recipe requires input: " + aInput[1].getDisplayName() + " x" + aInput[1].stackSize); + if (aInput != null && aInput.length > 0) { + if (aInput[0] != null) { + Logger.WARNING("Recipe requires input: " + aInput[0].getDisplayName() + " x" + aInput[0].stackSize); + } + if (aInput.length > 1) { + if (aInput[1] != null) { + Logger.WARNING("Recipe requires input: " + aInput[1].getDisplayName() + " x" + aInput[1].stackSize); + } } } if (aFluidInput != null) { Logger.WARNING("Recipe requires input: " + aFluidInput.getFluid().getName() + " " + aFluidInput.amount - + "mbst"); - } - if (((aInput[0] == null) && (aFluidInput == null)) || ((aOutputItems == null) && (aFluidOutput == null))) { - return false; + + "mbs"); } - if ((aOutputItems != null) - && ((aDuration = GregTech_API.sRecipeFile.get("dehydrator", aOutputItems[0], aDuration)) <= 0)) { + if (((aInput == null || aInput.length == 0) && (aFluidInput == null)) || ((aOutputItems == null || aOutputItems.length == 0) && (aFluidOutput == null))) { return false; } if (aOutputItems != null) { Logger.WARNING("Recipe will output: " + ItemUtils.getArrayStackNames(aOutputItems)); } - if ((aFluidOutput != null) && ((aDuration = GregTech_API.sRecipeFile.get("dehydrator", - aFluidOutput.getFluid().getName(), aDuration)) <= 0)) { - return false; - } if (aFluidOutput != null) { Logger.WARNING("Recipe will output: " + aFluidOutput.getFluid().getName()); } @@ -574,7 +568,7 @@ public class GregtechRecipeAdder implements IGregtech_RecipeAdder { final FluidStack aInput8, final FluidStack aInput9, final FluidStack aOutput1, final FluidStack aOutput2, final int aDuration, final int aEUt) { - if ((aInput1 == null) || (aInput2 == null) || (aOutput1 == null) || (aDuration < 1) || (aEUt < 1)) { + if ((aInput1 == null) || (aOutput1 == null) || (aDuration < 1) || (aEUt < 1)) { return false; } final FluidStack inputs[] = { aInput1, aInput2, aInput3, aInput4, aInput5, aInput6, aInput7, aInput8, aInput9 }; diff --git a/src/Java/gtPlusPlus/xmod/ic2/recipe/RECIPE_IC2.java b/src/Java/gtPlusPlus/xmod/ic2/recipe/RECIPE_IC2.java index e22a609814..1b090cc51a 100644 --- a/src/Java/gtPlusPlus/xmod/ic2/recipe/RECIPE_IC2.java +++ b/src/Java/gtPlusPlus/xmod/ic2/recipe/RECIPE_IC2.java @@ -272,7 +272,7 @@ public class RECIPE_IC2 { ItemUtils.getSimpleStack(aCoilIC2, 8), ItemUtils.getSimpleStack(aGearSmallAluminium, 4), }, - aRubber.getFluid(144 * 4), + aRubber.getFluidStack(144 * 4), GregtechItemList.Armour_Hazmat_Advanced_Helmet.get(1), 30 * 20, MaterialUtils.getVoltageForTier(2)); @@ -287,7 +287,7 @@ public class RECIPE_IC2 { ItemUtils.getSimpleStack(aPlateCobalt, 16), ItemUtils.getSimpleStack(aGearSiliconCarbide, 8), }, - aRubber.getFluid(144 * 10), + aRubber.getFluidStack(144 * 10), GregtechItemList.Armour_Hazmat_Advanced_Chest.get(1), 90 * 20, MaterialUtils.getVoltageForTier(2)); @@ -302,7 +302,7 @@ public class RECIPE_IC2 { ItemUtils.getSimpleStack(aPlateCobalt, 8), ItemUtils.getSimpleStack(aGearSiliconCarbide, 4), }, - aRubber.getFluid(144 * 8), + aRubber.getFluidStack(144 * 8), GregtechItemList.Armour_Hazmat_Advanced_Legs.get(1), 75 * 20, MaterialUtils.getVoltageForTier(2)); @@ -317,7 +317,7 @@ public class RECIPE_IC2 { ItemUtils.getSimpleStack(aGearSmallSteel, 8), ItemUtils.getSimpleStack(aGearPotin, 4), }, - aRubber.getFluid(144 * 6), + aRubber.getFluidStack(144 * 6), GregtechItemList.Armour_Hazmat_Advanced_Boots.get(1), 45 * 20, MaterialUtils.getVoltageForTier(2)); diff --git a/src/Java/gtPlusPlus/xmod/tinkers/material/BaseTinkersMaterial.java b/src/Java/gtPlusPlus/xmod/tinkers/material/BaseTinkersMaterial.java index 6f47909a01..0d2c79db08 100644 --- a/src/Java/gtPlusPlus/xmod/tinkers/material/BaseTinkersMaterial.java +++ b/src/Java/gtPlusPlus/xmod/tinkers/material/BaseTinkersMaterial.java @@ -204,7 +204,7 @@ public class BaseTinkersMaterial { try { aMatBlock = aMaterial.getBlock(); aMelt = aMaterial.getMeltingPointC(); - aFluid = aMaterial.getFluid(0).getFluid(); + aFluid = aMaterial.getFluidStack(0).getFluid(); } catch (Throwable t) { return false; @@ -217,14 +217,14 @@ public class BaseTinkersMaterial { //Smeltery.addMelting(new ItemStack(ExtraUtils.unstableIngot, 1, 0), ExtraUtils.decorative1, 5, 850, aMaterial.getFluid(72)); TinkersUtils.registerFluidType(mLocalName, aMatBlock, 0, aMelt, aFluid, true); - TinkersUtils.addMelting(aMaterial.getBlock(1), aMatBlock, 0, aMelt, aMaterial.getFluid(144*9)); - TinkersUtils.addMelting(aMaterial.getIngot(1), aMatBlock, 0, aMelt, aMaterial.getFluid(144)); + TinkersUtils.addMelting(aMaterial.getBlock(1), aMatBlock, 0, aMelt, aMaterial.getFluidStack(144*9)); + TinkersUtils.addMelting(aMaterial.getIngot(1), aMatBlock, 0, aMelt, aMaterial.getFluidStack(144)); if (aMelt <= 3600) { ItemStack ingotcast = TinkersUtils.getPattern(1); TinkersUtils.addBasinRecipe(aMaterial.getBlock(1), - aMaterial.getFluid(144*9), (ItemStack) null, true, 100); + aMaterial.getFluidStack(144*9), (ItemStack) null, true, 100); TinkersUtils.addCastingTableRecipe(aMaterial.getIngot(1), - aMaterial.getFluid(144), ingotcast, false, 50); + aMaterial.getFluidStack(144), ingotcast, false, 50); } boolean extended = TinkersUtils.generateCastingRecipes(aMaterial, aID); diff --git a/src/Java/gtPlusPlus/xmod/tinkers/util/TinkersUtils.java b/src/Java/gtPlusPlus/xmod/tinkers/util/TinkersUtils.java index 15ca3b497e..cf3284bfae 100644 --- a/src/Java/gtPlusPlus/xmod/tinkers/util/TinkersUtils.java +++ b/src/Java/gtPlusPlus/xmod/tinkers/util/TinkersUtils.java @@ -180,8 +180,8 @@ public class TinkersUtils { public static boolean addBaseMeltingRecipes(Material aMaterial) { - return addMelting(aMaterial.getBlock(1), aMaterial.getBlock(), 0, aMaterial.getMeltingPointC(), aMaterial.getFluid(144*9)) && - addMelting(aMaterial.getIngot(1), aMaterial.getBlock(), 0, aMaterial.getMeltingPointC(), aMaterial.getFluid(144)); + return addMelting(aMaterial.getBlock(1), aMaterial.getBlock(), 0, aMaterial.getMeltingPointC(), aMaterial.getFluidStack(144*9)) && + addMelting(aMaterial.getIngot(1), aMaterial.getBlock(), 0, aMaterial.getMeltingPointC(), aMaterial.getFluidStack(144)); } public static boolean addMelting(ItemStack input, Block block, int metadata, int temperature, FluidStack liquid) { @@ -221,7 +221,7 @@ public class TinkersUtils { public static boolean addBaseBasinRecipes(Material aMaterial) { - return addBasinRecipe(aMaterial.getBlock(1), aMaterial.getFluid(144*9), (ItemStack) null, true, 100); + return addBasinRecipe(aMaterial.getBlock(1), aMaterial.getFluidStack(144*9), (ItemStack) null, true, 100); } public static boolean addBasinRecipe(ItemStack output, FluidStack metal, ItemStack cast, boolean consume, int delay) { @@ -245,7 +245,7 @@ public class TinkersUtils { public static boolean addBaseCastingRecipes(Material aMaterial) { ItemStack ingotcast = getPattern(1); - return addCastingTableRecipe(aMaterial.getIngot(1), aMaterial.getFluid(144), ingotcast, false, 50); + return addCastingTableRecipe(aMaterial.getIngot(1), aMaterial.getFluidStack(144), ingotcast, false, 50); } public static boolean addCastingTableRecipe(ItemStack output, FluidStack metal, ItemStack cast, boolean consume, int delay) { @@ -482,7 +482,7 @@ public class TinkersUtils { //CastingRecipe recipe = (CastingRecipe) i$.next(); ItemStack output = recipe.getResult().copy(); output.setItemDamage(aID); - FluidStack liquid2 = new FluidStack(aMaterial.getFluid(0).getFluid(), recipe.castingMetal.amount); + FluidStack liquid2 = new FluidStack(aMaterial.getFluidStack(0).getFluid(), recipe.castingMetal.amount); addCastingTableRecipe(output, liquid2, recipe.cast, recipe.consumeCast, recipe.coolTime); addMelting(ft, output, 0, liquid2.amount / 2); } diff --git a/src/resources/assets/gregtech/textures/gui/basicmachines/FissionFuel.png b/src/resources/assets/gregtech/textures/gui/basicmachines/FissionFuel.png index 163dd0d4a0..e95be5c31a 100644 Binary files a/src/resources/assets/gregtech/textures/gui/basicmachines/FissionFuel.png and b/src/resources/assets/gregtech/textures/gui/basicmachines/FissionFuel.png differ -- cgit From a4779df4755d9312936529aca3de1297fed7a904 Mon Sep 17 00:00:00 2001 From: Alkalus <3060479+draknyte1@users.noreply.github.com> Date: Tue, 7 Dec 2021 17:16:23 +0000 Subject: Removed some useless materials. Fixed Plasma generation and implemented plasma recipes for them. --- src/Java/gtPlusPlus/core/common/CommonProxy.java | 2 +- .../core/item/chemistry/GenericChem.java | 18 ++++------ .../core/material/MaterialGenerator.java | 7 ++++ .../xmod/gregtech/loaders/RecipeGen_Plasma.java | 42 ++++++++++++++++++++++ 4 files changed, 56 insertions(+), 13 deletions(-) create mode 100644 src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Plasma.java (limited to 'src/Java/gtPlusPlus/core/item') diff --git a/src/Java/gtPlusPlus/core/common/CommonProxy.java b/src/Java/gtPlusPlus/core/common/CommonProxy.java index f77938f713..c038afce8f 100644 --- a/src/Java/gtPlusPlus/core/common/CommonProxy.java +++ b/src/Java/gtPlusPlus/core/common/CommonProxy.java @@ -219,7 +219,7 @@ public class CommonProxy { } public void registerCustomItemsForMaterials() { - Material.registerComponentForMaterial(GenericChem.CARBYNE, OrePrefixes.plate, GregtechItemList.Carbyne_Sheet_Finished.get(1)); + //Material.registerComponentForMaterial(GenericChem.CARBYNE, OrePrefixes.plate, GregtechItemList.Carbyne_Sheet_Finished.get(1)); } public void registerCustomMobDrops() { diff --git a/src/Java/gtPlusPlus/core/item/chemistry/GenericChem.java b/src/Java/gtPlusPlus/core/item/chemistry/GenericChem.java index ecdc97357f..a42d179f65 100644 --- a/src/Java/gtPlusPlus/core/item/chemistry/GenericChem.java +++ b/src/Java/gtPlusPlus/core/item/chemistry/GenericChem.java @@ -36,9 +36,9 @@ public class GenericChem extends ItemPackage { * Materials */ - public static final Material BAKELITE = new Material("Bakelite", MaterialState.SOLID, TextureSet.SET_DULL, new short[]{90, 140, 140}, 120, 240, 23, 24, true, null, 0);//Not a GT Inherited Material - public static final Material NYLON = new Material("Nylon", MaterialState.SOLID, TextureSet.SET_SHINY, new short[]{45, 45, 45}, 300, 600, 44, 48, true, null, 0);//Not a GT Inherited Material - public static final Material CARBYNE = new Material("Carbyne", MaterialState.SOLID, TextureSet.SET_DULL, new short[]{25, 25, 25}, 2500, 5000, 63, 52, true, null, 0);//Not a GT Inherited Material + //public static final Material BAKELITE = new Material("Bakelite", MaterialState.SOLID, TextureSet.SET_DULL, new short[]{90, 140, 140}, 120, 240, 23, 24, true, null, 0);//Not a GT Inherited Material + //public static final Material NYLON = new Material("Nylon", MaterialState.SOLID, TextureSet.SET_SHINY, new short[]{45, 45, 45}, 300, 600, 44, 48, true, null, 0);//Not a GT Inherited Material + //public static final Material CARBYNE = new Material("Carbyne", MaterialState.SOLID, TextureSet.SET_DULL, new short[]{25, 25, 25}, 2500, 5000, 63, 52, true, null, 0);//Not a GT Inherited Material //Refined PTFE @@ -57,13 +57,7 @@ public class GenericChem extends ItemPackage { new MaterialStack(NONMATERIAL.PLASTIC, 15), new MaterialStack(ELEMENT.getInstance().CARBON, 5), new MaterialStack(ELEMENT.getInstance().SODIUM, 5) - });// Not a GT - // Inherited - // Material - - //public static final Material HYPOGEN = new Material("Hypogen", MaterialState.SOLID, TextureSets.NUCLEAR.get(), new short[]{220, 120, 75}, 12255, 19377, 240, 251, true, "Hy⚶", 0);//Not a GT Inherited Material - //public static final Material HYPOGEN = new Material("Hypogen", MaterialState.SOLID, TextureSets.NUCLEAR.get(), new short[]{220, 120, 75}, 12255, 19377, 240, 251, true, "Hy⚶", 0);//Not a GT Inherited Material - //public static final Material Nylon = new Material(); + }); /** * Fluids @@ -123,8 +117,8 @@ public class GenericChem extends ItemPackage { @Override public void items() { PhenolicResins = ItemUtils.generateSpecialUseDusts("phenolicresins", "Phenolic Resin", "HOC6H4CH2OH", Utils.rgbtoHexValue(80, 40, 40))[0]; - MaterialGenerator.generate(BAKELITE, false); - MaterialGenerator.generate(NYLON, false); + //MaterialGenerator.generate(BAKELITE, false); + //MaterialGenerator.generate(NYLON, false); MaterialGenerator.generate(TEFLON, false); mGenericChemItem1 = new ItemGenericChemBase(); diff --git a/src/Java/gtPlusPlus/core/material/MaterialGenerator.java b/src/Java/gtPlusPlus/core/material/MaterialGenerator.java index d3d901ed6e..85562c78b1 100644 --- a/src/Java/gtPlusPlus/core/material/MaterialGenerator.java +++ b/src/Java/gtPlusPlus/core/material/MaterialGenerator.java @@ -2,6 +2,9 @@ package gtPlusPlus.core.material; import java.util.Set; +import gregtech.api.enums.GT_Values; +import gregtech.api.enums.OrePrefixes; +import gregtech.api.util.GT_Utility; import gtPlusPlus.api.interfaces.RunnableWithInfo; import gtPlusPlus.api.objects.Logger; import gtPlusPlus.api.objects.data.AutoMap; @@ -45,6 +48,7 @@ import gtPlusPlus.xmod.gregtech.loaders.RecipeGen_FluidCanning; import gtPlusPlus.xmod.gregtech.loaders.RecipeGen_Fluids; import gtPlusPlus.xmod.gregtech.loaders.RecipeGen_MaterialProcessing; import gtPlusPlus.xmod.gregtech.loaders.RecipeGen_Ore; +import gtPlusPlus.xmod.gregtech.loaders.RecipeGen_Plasma; import gtPlusPlus.xmod.gregtech.loaders.RecipeGen_Plates; import gtPlusPlus.xmod.gregtech.loaders.RecipeGen_Recycling; import gtPlusPlus.xmod.gregtech.loaders.RecipeGen_ShapedCrafting; @@ -217,6 +221,8 @@ public class MaterialGenerator { new RecipeGen_DustGeneration(matInfo); new RecipeGen_Recycling(matInfo); + new RecipeGen_Plasma(matInfo); + return true; } catch (final Throwable t) @@ -323,6 +329,7 @@ public class MaterialGenerator { new RecipeGen_MaterialProcessing(matInfo); new RecipeGen_DustGeneration(matInfo, true); new RecipeGen_Recycling(matInfo); + new RecipeGen_Plasma(matInfo); } catch (final Throwable t){ Logger.MATERIALS(""+matInfo.getLocalizedName()+" failed to generate."); diff --git a/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Plasma.java b/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Plasma.java new file mode 100644 index 0000000000..5f53defc2f --- /dev/null +++ b/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Plasma.java @@ -0,0 +1,42 @@ +package gtPlusPlus.xmod.gregtech.loaders; + +import java.util.HashSet; +import java.util.Set; + +import gregtech.api.enums.GT_Values; +import gregtech.api.util.GT_Utility; +import gtPlusPlus.api.interfaces.RunnableWithInfo; +import gtPlusPlus.core.material.Material; +import gtPlusPlus.core.material.MaterialGenerator; +import net.minecraft.item.ItemStack; + +public class RecipeGen_Plasma extends RecipeGen_Base { + + public final static Set> mRecipeGenMap = new HashSet>(); + static { + MaterialGenerator.mRecipeMapsToGenerate.put(mRecipeGenMap); + } + + public RecipeGen_Plasma(final Material M){ + this.toGenerate = M; + mRecipeGenMap.add(this); + } + + @Override + public void run() { + generateRecipes(this.toGenerate); + } + + private void generateRecipes(final Material material) { + // Cool Plasma + ItemStack aPlasmaCell = material.getPlasmaCell(1); + ItemStack aCell = material.getCell(1); + if (material.getPlasmaCell(1) != null){ + GT_Values.RA.addFuel(GT_Utility.copyAmount(1L, aPlasmaCell), GT_Utility.getFluidForFilledItem(aPlasmaCell, true) == null ? GT_Utility.getContainerItem(aPlasmaCell, true) : null, (int) Math.max(1024L, 1024L * material.getMass()), 4); + } + if (material.getCell(1) != null && material.getPlasmaCell(1) != null){ + GT_Values.RA.addVacuumFreezerRecipe(aPlasmaCell, aCell, (int) Math.max(material.getMass() * 2L, 1L)); + } + } + +} -- cgit From f59af4cca6ba29e355f4ebde31f4ae16131f4230 Mon Sep 17 00:00:00 2001 From: Alkalus <3060479+draknyte1@users.noreply.github.com> Date: Tue, 7 Dec 2021 19:14:28 +0000 Subject: Added more LFTR fuel processing. --- .../core/item/chemistry/NuclearChem.java | 5 +- .../core/material/MaterialGenerator.java | 8 +- .../gtPlusPlus/core/material/nuclear/NUCLIDE.java | 2 +- .../recipe/RecipeLoader_NuclearFuelProcessing.java | 256 ++++++++++++++------- 4 files changed, 181 insertions(+), 90 deletions(-) (limited to 'src/Java/gtPlusPlus/core/item') diff --git a/src/Java/gtPlusPlus/core/item/chemistry/NuclearChem.java b/src/Java/gtPlusPlus/core/item/chemistry/NuclearChem.java index db41da43b2..f112b0d2a5 100644 --- a/src/Java/gtPlusPlus/core/item/chemistry/NuclearChem.java +++ b/src/Java/gtPlusPlus/core/item/chemistry/NuclearChem.java @@ -18,6 +18,9 @@ public class NuclearChem extends ItemPackage { public static Fluid Burnt_LiFBeF2ZrF4UF4; public static Fluid Burnt_LiFBeF2ZrF4U235; + + public static Fluid Impure_LiFBeF2; + public static Fluid GeneticMutagen; private static boolean generateMutagenRecipe = false; @@ -65,7 +68,7 @@ public class NuclearChem extends ItemPackage { Burnt_LiFBeF2ThF4UF4 = FluidUtils.generateFluidNonMolten("BurntLiFBeF2ThF4UF4", "Burnt LiFBeF2ThF4UF4 Salt", 545, new short[]{48, 175, 48, 100}, null, null); Burnt_LiFBeF2ZrF4UF4 = FluidUtils.generateFluidNonMolten("BurntLiFBeF2ZrF4UF4", "Burnt LiFBeF2ZrF4UF4 Salt", 520, new short[]{48, 168, 68, 100}, null, null); Burnt_LiFBeF2ZrF4U235 = FluidUtils.generateFluidNonMolten("BurntLiFBeF2ZrF4U235", "Burnt LiFBeF2ZrF4U235 Salt", 533, new short[]{68, 185, 48, 100}, null, null); - + Impure_LiFBeF2 = FluidUtils.generateFluidNonMolten("ImpureLiFBeF2", "Impure LiFBeF2 Salt", 533, new short[]{110, 75, 186, 100}, null, null); if (FluidUtils.getFluidStack("fluid.Mutagen", 1) == null) { GeneticMutagen = FluidUtils.generateFluidNonMolten("GeneticMutagen", "Genetic Mutagen", 12, new short[]{22, 148, 185, 100}, null, null); generateMutagenRecipe = true; diff --git a/src/Java/gtPlusPlus/core/material/MaterialGenerator.java b/src/Java/gtPlusPlus/core/material/MaterialGenerator.java index a8dcb37f02..f48ed9f5cb 100644 --- a/src/Java/gtPlusPlus/core/material/MaterialGenerator.java +++ b/src/Java/gtPlusPlus/core/material/MaterialGenerator.java @@ -277,7 +277,7 @@ public class MaterialGenerator { } public static void generateNuclearDusts(final Material matInfo, boolean generateDehydratorRecipe){ - generateNuclearMaterial(matInfo, false, true, false, false, false); + generateNuclearMaterial(matInfo, false, true, false, false, true); if (generateDehydratorRecipe && matInfo.getFluid() != null && matInfo.getDust(0) != null) { CORE.RA.addDehydratorRecipe( new ItemStack[] { @@ -302,7 +302,7 @@ public class MaterialGenerator { } public static void generateNuclearMaterial(final Material matInfo, final boolean generateBlock, - final boolean generateDusts, final boolean generateIngot, final boolean generatePlates, final boolean generateMiscRecipes){ + final boolean generateDusts, final boolean generateIngot, final boolean generatePlates, final boolean disableOptionalRecipes){ try { if (generateBlock) { @@ -324,14 +324,14 @@ public class MaterialGenerator { new RecipeGen_Assembler(matInfo); } - if (generateMiscRecipes) { + if (!disableOptionalRecipes) { new RecipeGen_ShapedCrafting(matInfo); new RecipeGen_Fluids(matInfo); new RecipeGen_MaterialProcessing(matInfo); new RecipeGen_Recycling(matInfo); } - new RecipeGen_DustGeneration(matInfo, generateMiscRecipes); + new RecipeGen_DustGeneration(matInfo, disableOptionalRecipes); new RecipeGen_Plasma(matInfo); } catch (final Throwable t){ diff --git a/src/Java/gtPlusPlus/core/material/nuclear/NUCLIDE.java b/src/Java/gtPlusPlus/core/material/nuclear/NUCLIDE.java index 8fe99f16e7..4d3233f948 100644 --- a/src/Java/gtPlusPlus/core/material/nuclear/NUCLIDE.java +++ b/src/Java/gtPlusPlus/core/material/nuclear/NUCLIDE.java @@ -160,7 +160,7 @@ public final class NUCLIDE { new MaterialStack[]{ new MaterialStack(FLUORIDES.URANIUM_HEXAFLUORIDE, 1), new MaterialStack(ELEMENT.getInstance().FLUORINE, 3), - new MaterialStack(ELEMENT.getInstance().PROTACTINIUM, 1) + new MaterialStack(ELEMENT.getInstance().PHOSPHORUS, 1) }); public static final Material LiFBeF2 = new Material( diff --git a/src/Java/gtPlusPlus/xmod/gregtech/loaders/recipe/RecipeLoader_NuclearFuelProcessing.java b/src/Java/gtPlusPlus/xmod/gregtech/loaders/recipe/RecipeLoader_NuclearFuelProcessing.java index 90901e6847..7315acd7d2 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/loaders/recipe/RecipeLoader_NuclearFuelProcessing.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/loaders/recipe/RecipeLoader_NuclearFuelProcessing.java @@ -1,5 +1,6 @@ package gtPlusPlus.xmod.gregtech.loaders.recipe; +import gregtech.api.enums.GT_Values; import gregtech.api.enums.Materials; import gtPlusPlus.core.item.ModItems; import gtPlusPlus.core.item.chemistry.NuclearChem; @@ -19,7 +20,7 @@ public class RecipeLoader_NuclearFuelProcessing { public static void generate() { // Create Fuels - + final FluidStack aLithiumFluoride = FLUORIDES.LITHIUM_FLUORIDE.getFluidStack(100); final FluidStack aBerylliumFluoride = FLUORIDES.BERYLLIUM_FLUORIDE.getFluidStack(100); final FluidStack aThoriumFluoride = FLUORIDES.THORIUM_TETRAFLUORIDE.getFluidStack(100); @@ -42,7 +43,7 @@ public class RecipeLoader_NuclearFuelProcessing { 90 * 60 * 20, // Duration MaterialUtils.getVoltageForTier(5) ); - + // 7LiF - BeF2 - ZrF4 - UF4 - 650C CORE.RA.addFissionFuel( FluidUtils.getFluidStack(aLithiumFluoride, 650), @@ -68,8 +69,8 @@ public class RecipeLoader_NuclearFuelProcessing { 150 * 60 * 20, // Duration MaterialUtils.getVoltageForTier(5) ); - - + + // Reprocess Fuels final FluidStack aBurntLiFBeF2ZrF4U235 = new FluidStack(NuclearChem.Burnt_LiFBeF2ZrF4U235, 17); @@ -77,78 +78,11 @@ public class RecipeLoader_NuclearFuelProcessing { final FluidStack aBurntLiFBeF2ThF4UF4 = new FluidStack(NuclearChem.Burnt_LiFBeF2ThF4UF4, 17); final FluidStack aHelium = Materials.Helium.getGas(1000); final FluidStack aFluorine = Materials.Fluorine.getGas(1000); - - - // Reactor Core step 0 - Process Burnt Salt - - - // Tier 1 Fuel - Gives back FLIBE and breeds U233 - CORE.RA.addReactorProcessingUnitRecipe( - CI.getNumberedAdvancedCircuit(1), - CI.emptyCells(2), - new FluidStack(NuclearChem.Burnt_LiFBeF2ZrF4U235, 4000), - new ItemStack[] { - FLUORIDES.LITHIUM_FLUORIDE.getCell(1), - ELEMENT.getInstance().URANIUM233.getCell(1) - }, - new int[] {10000, 10000}, - NUCLIDE.LiFBeF2.getFluidStack(2000), - 20 * 60 * 60, - MaterialUtils.getVoltageForTier(3)); - - // Tier 2 Fuel - CORE.RA.addFissionFuel( - new FluidStack(NuclearChem.Burnt_LiFBeF2ZrF4UF4, 3000), - null, null, null, null, null, null, null, null, // Extra 5 inputs - FLUORIDES.ZIRCONIUM_TETRAFLUORIDE.getFluidStack(1000), - NUCLIDE.LiFBeF2UF4.getFluidStack(2000), - 60 * 60 * 20, // Duration - MaterialUtils.getVoltageForTier(4) - ); - - // Tier 3 Fuel - CORE.RA.addFissionFuel( - new FluidStack(NuclearChem.Burnt_LiFBeF2ThF4UF4, 3000), - null, null, null, null, null, null, null, null, // Extra 5 inputs - FLUORIDES.THORIUM_TETRAFLUORIDE.getFluidStack(1000), - NUCLIDE.LiFBeF2UF4.getFluidStack(2000), - 120 * 60 * 20, // Duration - MaterialUtils.getVoltageForTier(4) - ); - - - - - - - - - - - - - - - - - - // Reactor Blanket step 0 - Splitting - /* CORE.RA.addReactorProcessingUnitRecipe( - CI.getNumberedAdvancedCircuit(6), - CI.emptyCells(1), - new FluidStack(ModItems.fluidFLiBeSaltBurnt, 3000), - new ItemStack[] { - FLUORIDES.LITHIUM_FLUORIDE.getCell(1) - }, - new int[] {10000}, - NUCLIDE.LiFBeF2.getFluidStack(2000), - 20 * 60 * 60, - MaterialUtils.getVoltageForTier(3));*/ - - + + // Reactor Blanket step 1 - Fluorination CORE.RA.addReactorProcessingUnitRecipe( CI.getNumberedAdvancedCircuit(7), @@ -163,7 +97,7 @@ public class RecipeLoader_NuclearFuelProcessing { ItemUtils.getSimpleStack(ModItems.dustProtactinium233), ItemUtils.getSimpleStack(ModItems.dustProtactinium233), ItemUtils.getSimpleStack(ModItems.dustProtactinium233) - }, + }, new int[] {10000, 10000, 2000, 2000, 2000, 2000, 2000, 2000}, NUCLIDE.UF6F2.getFluidStack(10000), 20 * 60 * 5, @@ -182,34 +116,188 @@ public class RecipeLoader_NuclearFuelProcessing { ItemUtils.getSimpleStack(ModItems.dustProtactinium233), ItemUtils.getSimpleStack(ModItems.dustProtactinium233), ItemUtils.getSimpleStack(ModItems.dustProtactinium233) - }, + }, new int[] {10000, 10000, 10000, 2000, 2000, 2000, 2000, 2000, 2000}, NUCLIDE.UF6F2.getFluidStack(10000), 20 * 60 * 5, MaterialUtils.getVoltageForTier(5)); - + // Reactor Blanket step 2 - Sorption + Cold Trap CORE.RA.addColdTrapRecipe( 8, - FLUORIDES.SODIUM_FLUORIDE.getCell(2), + FLUORIDES.SODIUM_FLUORIDE.getCell(4), NUCLIDE.UF6F2.getFluidStack(3000), new ItemStack[] { ELEMENT.getInstance().FLUORINE.getCell(2), + FLUORIDES.URANIUM_HEXAFLUORIDE.getCell(2), ELEMENT.getInstance().URANIUM233.getDust(1), ELEMENT.getInstance().URANIUM233.getDust(1), ELEMENT.getInstance().URANIUM233.getDust(1) }, - new int[] {10000, 3000, 2000, 1000}, - FLUORIDES.URANIUM_HEXAFLUORIDE.getFluidStack(1000), + new int[] {10000, 10000, 3000, 2000, 1000}, + FLUORIDES.SODIUM_FLUORIDE.getFluidStack(2000), 20 * 60 * 10, - MaterialUtils.getVoltageForTier(3)); - - - - + MaterialUtils.getVoltageForTier(3)); + + + + + // Reactor Core step 0 - Process Burnt Salt + // Tier 1 Fuel - Gives back FLIBE and breeds U233 + CORE.RA.addReactorProcessingUnitRecipe( + CI.getNumberedAdvancedCircuit(1), + CI.emptyCells(2), + new FluidStack(NuclearChem.Burnt_LiFBeF2ZrF4U235, 4000), + new ItemStack[] { + FLUORIDES.LITHIUM_FLUORIDE.getCell(1), + ELEMENT.getInstance().URANIUM233.getCell(1) + }, + new int[] {10000, 10000}, + NUCLIDE.LiFBeF2.getFluidStack(2000), + 20 * 60 * 60, + MaterialUtils.getVoltageForTier(3)); + + + // LiBeF2UF4FP + F2 = LiFBeF2 & UF6F2FP + // Reactor Core step 1 - Process Burnt Salt + CORE.RA.addReactorProcessingUnitRecipe( + CI.getNumberedAdvancedCircuit(1), + ELEMENT.getInstance().FLUORINE.getCell(3), + NUCLIDE.LiBeF2UF4FP.getFluidStack(1000), + new ItemStack[] { + NUCLIDE.UF6F2FP.getCell(2) + }, + new int[] {10000}, + FluidUtils.getFluidStack(NuclearChem.Impure_LiFBeF2, 2000), + 20 * 60 * 60, + MaterialUtils.getVoltageForTier(3)); + + // Reactor Core step 2A - Sorption + Cold Trap + CORE.RA.addColdTrapRecipe( + 8, + FLUORIDES.SODIUM_FLUORIDE.getCell(3), + NUCLIDE.UF6F2FP.getFluidStack(2000), + new ItemStack[] { + ELEMENT.getInstance().FLUORINE.getCell(1), + FLUORIDES.URANIUM_HEXAFLUORIDE.getCell(2), + ELEMENT.getInstance().PHOSPHORUS.getDust(1), + ELEMENT.getInstance().PHOSPHORUS.getDust(1), + ELEMENT.getInstance().PHOSPHORUS.getDust(1), + ELEMENT.getInstance().PHOSPHORUS.getDust(1), + ELEMENT.getInstance().PHOSPHORUS.getDust(1), + ELEMENT.getInstance().PHOSPHORUS.getDust(1), + ELEMENT.getInstance().PHOSPHORUS.getDust(1) + }, + new int[] {10000, 10000, 5000, 5000, 5000, 5000, 5000, 5000, 5000}, + FLUORIDES.SODIUM_FLUORIDE.getFluidStack(2000), + 20 * 60 * 10, + MaterialUtils.getVoltageForTier(4)); + + + // Reactor Core step 2B - Distillation + GT_Values.RA.addDistillationTowerRecipe( + FluidUtils.getFluidStack(NuclearChem.Impure_LiFBeF2, 1000), + new FluidStack[] { + NUCLIDE.LiFBeF2.getFluidStack(250) + }, + null, + 120 * 60 * 20, + MaterialUtils.getVoltageForTier(3)); + + + // UF6 -> UF4 reduction + // UF6 + LiFBeF2 + H2 -> LiFBeF2UF4 + HF + CORE.RA.addBlastRecipe( + new ItemStack[] { + FLUORIDES.URANIUM_HEXAFLUORIDE.getCell(1), + NUCLIDE.LiFBeF2.getCell(1) + }, + new FluidStack[] { + ELEMENT.getInstance().HYDROGEN.getFluidStack(2000) + }, + new ItemStack[] { + ItemUtils.getItemStackOfAmountFromOreDict("cellHydrofluoricAcid", 2), + CI.emptyCells(1) + }, + new FluidStack[] { + NUCLIDE.LiFBeF2UF4.getFluidStack(3000) + }, + 20 * 60 * 10, + MaterialUtils.getVoltageForTier(4), + 6500); + + + + + // LiFBeF2ZrF4U235 - We can't add both ZrF4 and U235 here, so best we leave this disabled. + /*CORE.RA.addReactorProcessingUnitRecipe( + CI.getNumberedAdvancedCircuit(8), + NUCLIDE.LiFBeF2UF4.getCell(9), + ELEMENT.getInstance().URANIUM235.getFluidStack(1000), + new ItemStack[] { + CI.emptyCells(9) + }, + new int[] {10000}, + NUCLIDE.LiFBeF2ZrF4U235.getFluidStack(10000), + 20 * 60 * 5, + MaterialUtils.getVoltageForTier(4));*/ + + // LiFBeF2ZrF4UF4 + CORE.RA.addReactorProcessingUnitRecipe( + CI.getNumberedAdvancedCircuit(9), + NUCLIDE.LiFBeF2UF4.getCell(9), + FLUORIDES.ZIRCONIUM_TETRAFLUORIDE.getFluidStack(1000), + new ItemStack[] { + CI.emptyCells(9) + }, + new int[] {10000}, + NUCLIDE.LiFBeF2ZrF4UF4.getFluidStack(10000), + 20 * 60 * 5, + MaterialUtils.getVoltageForTier(5)); + + CORE.RA.addReactorProcessingUnitRecipe( + CI.getNumberedAdvancedCircuit(9), + FLUORIDES.ZIRCONIUM_TETRAFLUORIDE.getCell(1), + NUCLIDE.LiFBeF2UF4.getFluidStack(9000), + new ItemStack[] { + CI.emptyCells(1) + }, + new int[] {10000}, + NUCLIDE.LiFBeF2ZrF4UF4.getFluidStack(10000), + 20 * 60 * 5, + MaterialUtils.getVoltageForTier(5)); + + // LiFBeF2ThF4UF4 + CORE.RA.addReactorProcessingUnitRecipe( + CI.getNumberedAdvancedCircuit(10), + NUCLIDE.LiFBeF2UF4.getCell(9), + FLUORIDES.THORIUM_TETRAFLUORIDE.getFluidStack(1000), + new ItemStack[] { + CI.emptyCells(9) + }, + new int[] {10000}, + NUCLIDE.LiFBeF2ThF4UF4.getFluidStack(10000), + 20 * 60 * 5, + MaterialUtils.getVoltageForTier(5)); + + CORE.RA.addReactorProcessingUnitRecipe( + CI.getNumberedAdvancedCircuit(10), + FLUORIDES.THORIUM_TETRAFLUORIDE.getCell(1), + NUCLIDE.LiFBeF2UF4.getFluidStack(9000), + new ItemStack[] { + CI.emptyCells(1) + }, + new int[] {10000}, + NUCLIDE.LiFBeF2ThF4UF4.getFluidStack(10000), + 20 * 60 * 5, + MaterialUtils.getVoltageForTier(5)); + + + + } } -- cgit From 34ae5537683e986c5bf31c6889cd45b050836815 Mon Sep 17 00:00:00 2001 From: Alkalus <3060479+draknyte1@users.noreply.github.com> Date: Tue, 7 Dec 2021 20:00:42 +0000 Subject: More Nuclear Fuel recipe work. --- src/Java/gtPlusPlus/core/item/ModItems.java | 2 +- .../gtPlusPlus/core/material/nuclear/NUCLIDE.java | 8 +-- .../interfaces/internal/IGregtech_RecipeAdder.java | 3 ++ .../gregtech/loaders/recipe/RecipeLoader_LFTR.java | 31 ++++++----- .../loaders/recipe/RecipeLoader_Nuclear.java | 63 +++++++++++----------- .../recipe/RecipeLoader_NuclearFuelProcessing.java | 26 ++++----- .../xmod/gregtech/recipes/GregtechRecipeAdder.java | 9 +++- src/resources/assets/miscutils/lang/en_US.lang | 2 +- 8 files changed, 76 insertions(+), 68 deletions(-) (limited to 'src/Java/gtPlusPlus/core/item') diff --git a/src/Java/gtPlusPlus/core/item/ModItems.java b/src/Java/gtPlusPlus/core/item/ModItems.java index 5447bec472..a594d5705c 100644 --- a/src/Java/gtPlusPlus/core/item/ModItems.java +++ b/src/Java/gtPlusPlus/core/item/ModItems.java @@ -725,7 +725,7 @@ public final class ModItems { GT_OreDictUnificator.registerOre("dustCalciumSulfate", ItemUtils.getItemStackOfAmountFromOreDictNoBroken("dustGypsum", 1)); } dustLi2CO3CaOH2 = ItemUtils.generateSpecialUseDusts("Li2CO3CaOH2", "Li2CO3 + Ca(OH)2 Compound", "Li2CO3CaOH2", Utils.rgbtoHexValue(255, 255, 255))[0]; //https://en.wikipedia.org/wiki/Calcium_carbonate - + MaterialUtils.generateSpecialDustAndAssignToAMaterial(FLUORIDES.SODIUM_FLUORIDE, false); //FLiBe Fuel Compounds dustLi2BeF4 = ItemUtils.generateSpecialUseDusts("Li2BeF4", "Lithium Tetrafluoroberyllate Fuel Compound", "Li2BeF4", Utils.rgbtoHexValue(255, 255, 255))[0]; //https://en.wikipedia.org/wiki/FLiBe Material.registerComponentForMaterial(NUCLIDE.Li2BeF4, OrePrefixes.dust, ItemUtils.getSimpleStack(dustLi2BeF4)); diff --git a/src/Java/gtPlusPlus/core/material/nuclear/NUCLIDE.java b/src/Java/gtPlusPlus/core/material/nuclear/NUCLIDE.java index 4d3233f948..cd28ef01fd 100644 --- a/src/Java/gtPlusPlus/core/material/nuclear/NUCLIDE.java +++ b/src/Java/gtPlusPlus/core/material/nuclear/NUCLIDE.java @@ -128,8 +128,8 @@ public final class NUCLIDE { // LFTR Core Fluids - public static final Material LiBeF2UF4FP = new Material( - "LiBeF2UF4FP", //Material Name + public static final Material LiFBeF2UF4FP = new Material( + "LiFBeF2UF4FP", //Material Name MaterialState.PURE_LIQUID, //State null, //Material Colour -1, //Melting Point in C @@ -137,10 +137,10 @@ public final class NUCLIDE { -1, //Protons -1, //Neutrons false, //Uses Blast furnace? - StringUtils.subscript(StringUtils.superscript("7")+"LiBeF2UF4FP"), //Chemical Formula + StringUtils.subscript(StringUtils.superscript("7")+"LiFBeF2UF4FP"), //Chemical Formula //Material Stacks with Percentage of required elements. new MaterialStack[]{ - new MaterialStack(ELEMENT.getInstance().LITHIUM, 1), + new MaterialStack(FLUORIDES.LITHIUM_FLUORIDE, 1), new MaterialStack(FLUORIDES.BERYLLIUM_FLUORIDE, 1), new MaterialStack(FLUORIDES.URANIUM_TETRAFLUORIDE, 1), new MaterialStack(ELEMENT.getInstance().PROTACTINIUM, 1) diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/interfaces/internal/IGregtech_RecipeAdder.java b/src/Java/gtPlusPlus/xmod/gregtech/api/interfaces/internal/IGregtech_RecipeAdder.java index 254655215e..d7bb6324a0 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/api/interfaces/internal/IGregtech_RecipeAdder.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/api/interfaces/internal/IGregtech_RecipeAdder.java @@ -1,6 +1,8 @@ package gtPlusPlus.xmod.gregtech.api.interfaces.internal; +import gregtech.api.GregTech_API; import gregtech.api.enums.Materials; +import gregtech.api.util.GT_Recipe; import gtPlusPlus.core.material.Material; import net.minecraft.item.ItemStack; @@ -308,5 +310,6 @@ public interface IGregtech_RecipeAdder { public boolean addReactorProcessingUnitRecipe(ItemStack aInput1, ItemStack aInput2, FluidStack aFluidInput, ItemStack[] aOutputs, int[] aChances, FluidStack aFluidOutput, int aTime, int aEU); + public boolean addFluidHeaterRecipe(ItemStack aCircuit, FluidStack aInput, FluidStack aOutput, int aDuration, int aEUt); } diff --git a/src/Java/gtPlusPlus/xmod/gregtech/loaders/recipe/RecipeLoader_LFTR.java b/src/Java/gtPlusPlus/xmod/gregtech/loaders/recipe/RecipeLoader_LFTR.java index 3e2f8e061d..819c03756d 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/loaders/recipe/RecipeLoader_LFTR.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/loaders/recipe/RecipeLoader_LFTR.java @@ -5,7 +5,6 @@ import gregtech.api.util.GTPP_Recipe; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GasSpargingRecipeMap; import gtPlusPlus.api.objects.data.AutoMap; -import gtPlusPlus.core.item.chemistry.NuclearChem; import gtPlusPlus.core.material.ELEMENT; import gtPlusPlus.core.material.nuclear.FLUORIDES; import gtPlusPlus.core.material.nuclear.NUCLIDE; @@ -54,42 +53,42 @@ public class RecipeLoader_LFTR { //1l/10t= 1000l/2.5hr LiFBeF2ZrF4U235 configureSparging(); - FluidStack Li2BeF4 = NUCLIDE.Li2BeF4.getFluidStack(34); + FluidStack Li2BeF4 = NUCLIDE.Li2BeF4.getFluidStack(36); //LiFBeF2ThF4UF4 - T3 GT_Recipe LFTR1 = new GTPP_Recipe( - true, + false, new ItemStack[] {}, new ItemStack[] {}, null, new int[] {10000, 10000, 5000, 2500}, new FluidStack[] { - NUCLIDE.LiFBeF2ThF4UF4.getFluidStack(17), + NUCLIDE.LiFBeF2ThF4UF4.getFluidStack(18), Li2BeF4 }, new FluidStack[] { - new FluidStack(NuclearChem.Burnt_LiFBeF2ThF4UF4, 17), - NUCLIDE.LiFBeF2ThF4.getFluidStack(34), + NUCLIDE.LiFBeF2UF4FP.getFluidStack(18), + NUCLIDE.LiFBeF2ThF4.getFluidStack(36), FLUORIDES.URANIUM_HEXAFLUORIDE.getFluidStack(10), FLUORIDES.URANIUM_HEXAFLUORIDE.getFluidStack(5) }, - 12000,//time + 9000,//time 0,//cost - 8192//fuel value + 8192*4//fuel value ); //LiFBeF2ZrF4UF4 - T2 GT_Recipe LFTR2 = new GTPP_Recipe( - true, + false, new ItemStack[] {}, new ItemStack[] {}, null, new int[] {10000, 10000, 2500, 1250}, new FluidStack[] { - NUCLIDE.LiFBeF2ZrF4UF4.getFluidStack(17), + NUCLIDE.LiFBeF2ZrF4UF4.getFluidStack(18), Li2BeF4 }, new FluidStack[] { - new FluidStack(NuclearChem.Burnt_LiFBeF2ZrF4UF4, 17), - NUCLIDE.LiFBeF2ThF4.getFluidStack(34), + NUCLIDE.LiFBeF2UF4FP.getFluidStack(12), + NUCLIDE.LiFBeF2ThF4.getFluidStack(24), FLUORIDES.URANIUM_HEXAFLUORIDE.getFluidStack(4), FLUORIDES.URANIUM_HEXAFLUORIDE.getFluidStack(2) }, @@ -100,17 +99,17 @@ public class RecipeLoader_LFTR { //LiFBeF2ZrF4U235 - T1 GT_Recipe LFTR3 = new GTPP_Recipe( - true, + false, new ItemStack[] {}, new ItemStack[] {}, null, new int[] {10000, 10000, 1000, 500}, new FluidStack[] { - NUCLIDE.LiFBeF2ZrF4U235.getFluidStack(17), + NUCLIDE.LiFBeF2ZrF4U235.getFluidStack(18), Li2BeF4 }, new FluidStack[] { - new FluidStack(NuclearChem.Burnt_LiFBeF2ZrF4U235, 17), - NUCLIDE.LiFThF4.getFluidStack(34), + NUCLIDE.LiFBeF2UF4FP.getFluidStack(6), + NUCLIDE.LiFThF4.getFluidStack(12), FLUORIDES.URANIUM_HEXAFLUORIDE.getFluidStack(2), FLUORIDES.URANIUM_HEXAFLUORIDE.getFluidStack(1) }, diff --git a/src/Java/gtPlusPlus/xmod/gregtech/loaders/recipe/RecipeLoader_Nuclear.java b/src/Java/gtPlusPlus/xmod/gregtech/loaders/recipe/RecipeLoader_Nuclear.java index 4611382977..330d507115 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/loaders/recipe/RecipeLoader_Nuclear.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/loaders/recipe/RecipeLoader_Nuclear.java @@ -17,7 +17,6 @@ import gtPlusPlus.core.recipe.common.CI; import gtPlusPlus.core.util.Utils; import gtPlusPlus.core.util.minecraft.FluidUtils; import gtPlusPlus.core.util.minecraft.ItemUtils; -import gtPlusPlus.core.util.reflect.AddGregtechRecipe; import net.minecraft.item.ItemStack; import net.minecraftforge.fluids.FluidStack; @@ -40,6 +39,7 @@ public class RecipeLoader_Nuclear { dehydratorRecipes(); electroMagneticSeperator(); fluidExtractorRecipes(); + fluidHeater(); macerator(); mixerRecipes(); sifter(); @@ -325,6 +325,25 @@ public class RecipeLoader_Nuclear { FluidUtils.getFluidStack("sulfuricacid", 144 * 2), ItemUtils.getItemStackOfAmountFromOreDict("dustTechnetium", 1), 100 * 20); + + // Sodium Hydroxide + GT_Values.RA.addChemicalRecipe( + CI.getNumberedBioCircuit(15), + ItemUtils.getItemStackOfAmountFromOreDict("dustSodiumHydroxide", 1), + FluidUtils.getFluidStack("hydrofluoricacid", 500), + FluidUtils.getWater(1000), + FLUORIDES.SODIUM_FLUORIDE.getDust(1), + 60 * 20); + + if (FluidUtils.doesFluidExist("hydrofluoricacid_gt5u")) { + GT_Values.RA.addChemicalRecipe( + CI.getNumberedBioCircuit(15), + ItemUtils.getItemStackOfAmountFromOreDict("dustSodiumHydroxide", 1), + FluidUtils.getFluidStack("hydrofluoricacid_gt5u", 1000), + FluidUtils.getWater(1000), + FLUORIDES.SODIUM_FLUORIDE.getDust(1), + 60 * 20); + } } @@ -369,37 +388,6 @@ public class RecipeLoader_Nuclear { 75 * 20, // Time in ticks 1000); // EU - // Makes Uranium Tetrafluoride - CORE.RA.addDehydratorRecipe( - new ItemStack[] { - CI.getNumberedAdvancedCircuit(13), - ItemUtils.getItemStackOfAmountFromOreDict("cellWater", 10) - }, - FLUORIDES.URANIUM_TETRAFLUORIDE.getFluidStack(1440), - null, - new ItemStack[] { - FLUORIDES.URANIUM_TETRAFLUORIDE.getDust(10), - CI.emptyCells(10) - }, - new int[] { 10000 }, - 150 * 20, // Time in ticks - 2000); // EU - - // Makes Uranium Hexafluoride - CORE.RA.addDehydratorRecipe( - new ItemStack[] { - CI.getNumberedAdvancedCircuit(12), - ItemUtils.getItemStackOfAmountFromOreDict("cellWater", 10) - }, // Item - FLUORIDES.URANIUM_HEXAFLUORIDE.getFluidStack(1440), - null, // Fluid output (slot 2) - new ItemStack[] { - FLUORIDES.URANIUM_HEXAFLUORIDE.getDust(10), - CI.emptyCells(10) }, // Output - new int[] { 10000 }, - 300 * 20, // Time in ticks - 4000); // EU - // Calcium Hydroxide if ((ItemUtils.checkForInvalidItems(ItemUtils.getItemStackOfAmountFromOreDict("dustQuicklime", 1))) || LoadedMods.IHL) { CORE.RA.addDehydratorRecipe( @@ -692,5 +680,16 @@ public class RecipeLoader_Nuclear { 20 * 30, 500); } + + private static void fluidHeater() { + + CORE.RA.addFluidHeaterRecipe( + FLUORIDES.SODIUM_FLUORIDE.getDust(1), + null, + FLUORIDES.SODIUM_FLUORIDE.getFluidStack(144), + 20 * 30, + 500); + + } } diff --git a/src/Java/gtPlusPlus/xmod/gregtech/loaders/recipe/RecipeLoader_NuclearFuelProcessing.java b/src/Java/gtPlusPlus/xmod/gregtech/loaders/recipe/RecipeLoader_NuclearFuelProcessing.java index 7315acd7d2..0d1512bd1c 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/loaders/recipe/RecipeLoader_NuclearFuelProcessing.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/loaders/recipe/RecipeLoader_NuclearFuelProcessing.java @@ -145,18 +145,18 @@ public class RecipeLoader_NuclearFuelProcessing { // Reactor Core step 0 - Process Burnt Salt // Tier 1 Fuel - Gives back FLIBE and breeds U233 - CORE.RA.addReactorProcessingUnitRecipe( - CI.getNumberedAdvancedCircuit(1), - CI.emptyCells(2), - new FluidStack(NuclearChem.Burnt_LiFBeF2ZrF4U235, 4000), - new ItemStack[] { - FLUORIDES.LITHIUM_FLUORIDE.getCell(1), - ELEMENT.getInstance().URANIUM233.getCell(1) - }, - new int[] {10000, 10000}, - NUCLIDE.LiFBeF2.getFluidStack(2000), - 20 * 60 * 60, - MaterialUtils.getVoltageForTier(3)); + /* CORE.RA.addReactorProcessingUnitRecipe( + CI.getNumberedAdvancedCircuit(1), + CI.emptyCells(2), + new FluidStack(NuclearChem.Burnt_LiFBeF2ZrF4U235, 4000), + new ItemStack[] { + FLUORIDES.LITHIUM_FLUORIDE.getCell(1), + ELEMENT.getInstance().URANIUM233.getCell(1) + }, + new int[] {10000, 10000}, + NUCLIDE.LiFBeF2.getFluidStack(2000), + 20 * 60 * 60, + MaterialUtils.getVoltageForTier(3));*/ // LiBeF2UF4FP + F2 = LiFBeF2 & UF6F2FP @@ -164,7 +164,7 @@ public class RecipeLoader_NuclearFuelProcessing { CORE.RA.addReactorProcessingUnitRecipe( CI.getNumberedAdvancedCircuit(1), ELEMENT.getInstance().FLUORINE.getCell(3), - NUCLIDE.LiBeF2UF4FP.getFluidStack(1000), + NUCLIDE.LiFBeF2UF4FP.getFluidStack(1000), new ItemStack[] { NUCLIDE.UF6F2FP.getCell(2) }, diff --git a/src/Java/gtPlusPlus/xmod/gregtech/recipes/GregtechRecipeAdder.java b/src/Java/gtPlusPlus/xmod/gregtech/recipes/GregtechRecipeAdder.java index f31d103cf3..e85371c146 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/recipes/GregtechRecipeAdder.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/recipes/GregtechRecipeAdder.java @@ -1790,7 +1790,14 @@ public class GregtechRecipeAdder implements IGregtech_RecipeAdder { } - + @Override + public boolean addFluidHeaterRecipe(ItemStack aInput, FluidStack aFluidInput, FluidStack aOutput, int aDuration, int aEUt) { + if ((aInput == null && aFluidInput == null) || (aOutput == null)) { + return false; + } + GT_Recipe.GT_Recipe_Map.sFluidHeaterRecipes.addRecipe(true, new ItemStack[]{aInput}, null, null, new FluidStack[]{aFluidInput}, new FluidStack[]{aOutput}, aDuration, aEUt, 0); + return true; + } diff --git a/src/resources/assets/miscutils/lang/en_US.lang b/src/resources/assets/miscutils/lang/en_US.lang index d255980a21..864c767274 100644 --- a/src/resources/assets/miscutils/lang/en_US.lang +++ b/src/resources/assets/miscutils/lang/en_US.lang @@ -3259,7 +3259,7 @@ item.itemCellLiFBeF2ThF4UF4.name=LFTR Fuel III Cell item.Li2BeF2UF4.name=Burnt Li2BeF2UF4 Cell //Added 6/12/21 -item.itemCellLiBeF2UF4FP.name=LiBeF2UF4FP Cell +item.itemCellLiFBeF2UF4FP.name=LiFBeF2UF4FP Cell item.itemCellUF6F2.name=UF6F2 Cell item.itemCellLiFBeF2ThF4.name=LiFBeF2ThF4 Cell item.itemCellUF6F2FP.name=UF6F2FP Cell -- cgit From 071ac0cca7df642adff90fe50b7028b35559c852 Mon Sep 17 00:00:00 2001 From: Alkalus <3060479+draknyte1@users.noreply.github.com> Date: Fri, 10 Dec 2021 21:46:58 +0000 Subject: Added HS-188A. Fixed NEI handling for some handlers. Fixed some tooltips. --- src/Java/gregtech/api/util/GTPP_Recipe.java | 2 +- src/Java/gtPlusPlus/core/item/ModItems.java | 1 + .../core/item/bauble/BatteryPackBaseBauble.java | 2 +- .../core/item/bauble/ElectricBaseBauble.java | 2 +- .../core/item/general/ItemHealingDevice.java | 2 +- src/Java/gtPlusPlus/core/material/ALLOY.java | 22 +++++++++++++++++- src/Java/gtPlusPlus/nei/NEI_GT_Config.java | 2 -- src/Java/gtPlusPlus/nei/NEI_IMC_Sender.java | 27 ++++++++++++++-------- src/resources/assets/miscutils/lang/en_US.lang | 15 ++++++++++++ 9 files changed, 58 insertions(+), 17 deletions(-) (limited to 'src/Java/gtPlusPlus/core/item') diff --git a/src/Java/gregtech/api/util/GTPP_Recipe.java b/src/Java/gregtech/api/util/GTPP_Recipe.java index ce8eaf1d82..1d04e8af6e 100644 --- a/src/Java/gregtech/api/util/GTPP_Recipe.java +++ b/src/Java/gregtech/api/util/GTPP_Recipe.java @@ -407,7 +407,7 @@ public class GTPP_Recipe extends GT_Recipe implements IComparableRecipe { //Special Maps for Multis public static final GTPP_Recipe_Map_Internal sFishPondRecipes = new GTPP_Recipe_Map_Internal(new HashSet(3), "gtpp.recipe.fishpond", "Zhuhai - Fishing Port", null, RES_PATH_GUI + "basicmachines/PotionBrewer", 0, 1, 0, 0, 1, "Requires Circuit: ", 1, ".", true, true); - public static final GTPP_Recipe_Map_Internal sSpargeTowerRecipes = new GTPP_Recipe_Map_Internal(new HashSet(10000), "gtpp.recipe.spargetower", "Sparging", null, RES_PATH_GUI + "basicmachines/FissionFuel", 9, 9, 0, 0, 1, E, 1, E, true, true); + public static final GTPP_Recipe_Map_Internal sSpargeTowerRecipes = new GTPP_Recipe_Map_Internal(new HashSet(10000), "gtpp.recipe.spargetower", "Sparging", null, RES_PATH_GUI + "basicmachines/FissionFuel", 9, 9, 0, 0, 1, E, 1, E, true, false); //public static final GTPP_Recipe_Map sMultiblockCentrifugeRecipes = new GT_Recipe_Map_LargeCentrifuge(); //public static final GTPP_Recipe_Map sMultiblockElectrolyzerRecipes = new GT_Recipe_Map_LargeElectrolyzer(); diff --git a/src/Java/gtPlusPlus/core/item/ModItems.java b/src/Java/gtPlusPlus/core/item/ModItems.java index a594d5705c..fa09eb03f7 100644 --- a/src/Java/gtPlusPlus/core/item/ModItems.java +++ b/src/Java/gtPlusPlus/core/item/ModItems.java @@ -647,6 +647,7 @@ public final class ModItems { MaterialGenerator.generate(ALLOY.ABYSSAL); MaterialGenerator.generate(ALLOY.LAURENIUM); MaterialGenerator.generate(ALLOY.BOTMIUM); + MaterialGenerator.generate(ALLOY.HS188A); MaterialGenerator.generate(ALLOY.TITANSTEEL); diff --git a/src/Java/gtPlusPlus/core/item/bauble/BatteryPackBaseBauble.java b/src/Java/gtPlusPlus/core/item/bauble/BatteryPackBaseBauble.java index 70de4603e7..edc1cc9b88 100644 --- a/src/Java/gtPlusPlus/core/item/bauble/BatteryPackBaseBauble.java +++ b/src/Java/gtPlusPlus/core/item/bauble/BatteryPackBaseBauble.java @@ -95,7 +95,7 @@ public class BatteryPackBaseBauble extends ElectricBaseBauble { String aEUT = aEU+"/t"; list.add(EnumChatFormatting.GREEN + aString1 + EnumChatFormatting.GRAY); - list.add(EnumChatFormatting.GREEN + aString2+" " + (int) getTransferLimit(stack) + aEUT +" "+ aString3 + EnumChatFormatting.GRAY); + list.add(EnumChatFormatting.GREEN + aString2+" " + (int) getTransferLimit(stack) + aEUT +" 7"+ aString3 + EnumChatFormatting.GRAY); list.add(EnumChatFormatting.GREEN + aString4 + EnumChatFormatting.GRAY); super.addInformation(stack, aPlayer, list, bool); } diff --git a/src/Java/gtPlusPlus/core/item/bauble/ElectricBaseBauble.java b/src/Java/gtPlusPlus/core/item/bauble/ElectricBaseBauble.java index cfa5cb363d..4316f13401 100644 --- a/src/Java/gtPlusPlus/core/item/bauble/ElectricBaseBauble.java +++ b/src/Java/gtPlusPlus/core/item/bauble/ElectricBaseBauble.java @@ -135,7 +135,7 @@ public abstract class ElectricBaseBauble extends BaseBauble implements IElectric list.add(EnumChatFormatting.GOLD + aEuInfo + EnumChatFormatting.GRAY); list.add(EnumChatFormatting.GRAY + aTier+": [" + EnumChatFormatting.YELLOW + this.getTier(stack) + EnumChatFormatting.GRAY + "] "+aInputLimit+": [" + EnumChatFormatting.YELLOW - + this.getTransferLimit(stack) + EnumChatFormatting.GRAY + aEUT); + + this.getTransferLimit(stack) + EnumChatFormatting.GRAY + aEUT+"]"); list.add(EnumChatFormatting.GRAY + aCurrentPower +": [" + EnumChatFormatting.YELLOW + (long) this.getCharge(stack) + EnumChatFormatting.GRAY + aEU +"] [" + EnumChatFormatting.YELLOW + MathUtils.findPercentage(this.getCharge(stack), this.getMaxCharge(stack)) + EnumChatFormatting.GRAY diff --git a/src/Java/gtPlusPlus/core/item/general/ItemHealingDevice.java b/src/Java/gtPlusPlus/core/item/general/ItemHealingDevice.java index 82bb29b5bf..db06af8297 100644 --- a/src/Java/gtPlusPlus/core/item/general/ItemHealingDevice.java +++ b/src/Java/gtPlusPlus/core/item/general/ItemHealingDevice.java @@ -144,7 +144,7 @@ public class ItemHealingDevice extends Item implements IElectricItem, IElectricI list.add(EnumChatFormatting.GOLD + aEuInfo + EnumChatFormatting.GRAY); list.add(EnumChatFormatting.GRAY + aTier+": [" + EnumChatFormatting.YELLOW + this.getTier(stack) + EnumChatFormatting.GRAY + "] "+aInputLimit+": [" + EnumChatFormatting.YELLOW - + this.getTransferLimit(stack) + EnumChatFormatting.GRAY + aEUT); + + this.getTransferLimit(stack) + EnumChatFormatting.GRAY + aEUT+"]"); list.add(EnumChatFormatting.GRAY + aCurrentPower +": [" + EnumChatFormatting.YELLOW + (long) this.getCharge(stack) + EnumChatFormatting.GRAY + aEU +"] [" + EnumChatFormatting.YELLOW + MathUtils.findPercentage(this.getCharge(stack), this.getMaxCharge(stack)) + EnumChatFormatting.GRAY diff --git a/src/Java/gtPlusPlus/core/material/ALLOY.java b/src/Java/gtPlusPlus/core/material/ALLOY.java index 22ffc34205..f51dbf920d 100644 --- a/src/Java/gtPlusPlus/core/material/ALLOY.java +++ b/src/Java/gtPlusPlus/core/material/ALLOY.java @@ -635,7 +635,27 @@ public final class ALLOY { new MaterialStack(ELEMENT.getInstance().COPPER, 3), new MaterialStack(ELEMENT.getInstance().OXYGEN, 8) }); - + + + public static final Material HS188A = new Material( + "HS188-A", //Material Name + MaterialState.SOLID, //State + null, //Material Colour + 4870, //Melting Point in C + 7550, //Boiling Point in C + -1, //Protons + -1, //Neutrons + true, //Uses Blast furnace? + new MaterialStack[]{ + new MaterialStack(ELEMENT.getInstance().COBALT, 20), + new MaterialStack(ELEMENT.getInstance().HAFNIUM, 20), + new MaterialStack(TALONITE, 16), + new MaterialStack(ELEMENT.getInstance().RHENIUM, 10), + new MaterialStack(NIOBIUM_CARBIDE, 10), + new MaterialStack(HASTELLOY_X, 8), + new MaterialStack(TUNGSTENSTEEL, 8), + new MaterialStack(ZIRCONIUM_CARBIDE, 8), + }); //Material Stacks with Percentage of required elements. /** * Stargate Materials - #D2FFA9 210, 255, 170 diff --git a/src/Java/gtPlusPlus/nei/NEI_GT_Config.java b/src/Java/gtPlusPlus/nei/NEI_GT_Config.java index 1595bc8c8e..b28cc933ae 100644 --- a/src/Java/gtPlusPlus/nei/NEI_GT_Config.java +++ b/src/Java/gtPlusPlus/nei/NEI_GT_Config.java @@ -70,8 +70,6 @@ implements IConfigureNEI { new GT_NEI_MultiNoCell(GTPP_Recipe_Map.sMultiblockElectrolyzerRecipes_GT); Logger.INFO("NEI Registration: Registering NEI handler for "+GTPP_Recipe_Map.sMultiblockMixerRecipes_GT.mNEIName); new GT_NEI_MultiNoCell(GTPP_Recipe_Map.sMultiblockMixerRecipes_GT); - //Logger.INFO("NEI Registration: Registering NEI handler for "+GTPP_Recipe_Map.sSpargeTowerRecipes.mNEIName); - //new GT_NEI_MultiNoCell(GTPP_Recipe_Map.sSpargeTowerRecipes); Logger.INFO("NEI Registration: Registering NEI handler for "+DecayableRecipeHandler.mNEIName); API.registerRecipeHandler(new DecayableRecipeHandler()); diff --git a/src/Java/gtPlusPlus/nei/NEI_IMC_Sender.java b/src/Java/gtPlusPlus/nei/NEI_IMC_Sender.java index e3712f5ab2..7bc2316a04 100644 --- a/src/Java/gtPlusPlus/nei/NEI_IMC_Sender.java +++ b/src/Java/gtPlusPlus/nei/NEI_IMC_Sender.java @@ -5,30 +5,37 @@ import net.minecraft.nbt.NBTTagCompound; public class NEI_IMC_Sender { public static void IMCSender() { - setNBTInfoAndSendIt("gtpp.recipe.alloyblastsmelter", "gregtech:gt.blockmachines:810"); + setNBTInfoAndSendIt("gtpp.recipe.alloyblastsmelter", "gregtech:gt.blockmachines:810", 1); setNBTInfoAndSendIt("gtpp.recipe.rocketenginefuel", "gregtech:gt.blockmachines:793"); setNBTInfoAndSendIt("gtpp.recipe.cyclotron", "gregtech:gt.blockmachines:828"); - setNBTInfoAndSendIt("gtpp.recipe.chemicaldehydrator", "gregtech:gt.blockmachines:911"); + setNBTInfoAndSendIt("gtpp.recipe.chemicaldehydrator", "gregtech:gt.blockmachines:911", 1); setNBTInfoAndSendIt("gtpp.recipe.slowfusionreactor", "gregtech:gt.blockmachines:31015"); setNBTInfoAndSendIt("gtpp.recipe.RTGgenerators", "gregtech:gt.blockmachines:869"); setNBTInfoAndSendIt("gtpp.recipe.cokeoven", "gregtech:gt.blockmachines:791"); setNBTInfoAndSendIt("gtpp.recipe.semifluidgeneratorfuels", "gregtech:gt.blockmachines:837"); - setNBTInfoAndSendIt("gtpp.recipe.fishpond", "gregtech:gt.blockmachines:829"); + setNBTInfoAndSendIt("gtpp.recipe.fishpond", "gregtech:gt.blockmachines:829", 1); setNBTInfoAndSendIt("gtpp.recipe.multimixer", "gregtech:gt.blockmachines:811"); setNBTInfoAndSendIt("gtpp.recipe.advanced.mixer", "gregtech:gt.blockmachines:811"); setNBTInfoAndSendIt("gtpp.recipe.cryogenicfreezer", "gregtech:gt.blockmachines:910"); - setNBTInfoAndSendIt("gtpp.recipe.fissionfuel", "gregtech:gt.blockmachines:835"); setNBTInfoAndSendIt("gtpp.recipe.geothermalfuel", "gregtech:gt.blockmachines:830"); - setNBTInfoAndSendIt("gtpp.recipe.lftr", "gregtech:gt.blockmachines:751"); - setNBTInfoAndSendIt("gtpp.recipe.lftr.sparging", "gregtech:gt.blockmachines:751"); setNBTInfoAndSendIt("gtpp.recipe.matterfab2", "gregtech:gt.blockmachines:799"); - setNBTInfoAndSendIt("gtpp.recipe.multicentrifuge", "gregtech:gt.blockmachines:790"); - setNBTInfoAndSendIt("gtpp.recipe.multielectro", "gregtech:gt.blockmachines:796"); + setNBTInfoAndSendIt("gtpp.recipe.multicentrifuge", "gregtech:gt.blockmachines:790", 1); + setNBTInfoAndSendIt("gtpp.recipe.multielectro", "gregtech:gt.blockmachines:796", 1); setNBTInfoAndSendIt("gtpp.recipe.simplewasher", "gregtech:gt.blockmachines:767"); - setNBTInfoAndSendIt("gtpp.recipe.vacfurnace", "gregtech:gt.blockmachines:995"); + setNBTInfoAndSendIt("gtpp.recipe.vacfurnace", "gregtech:gt.blockmachines:995", 1); + setNBTInfoAndSendIt("gtpp.recipe.fissionfuel", "gregtech:gt.blockmachines:835", 1); + setNBTInfoAndSendIt("gtpp.recipe.lftr", "gregtech:gt.blockmachines:751", 1); + setNBTInfoAndSendIt("gtpp.recipe.lftr.sparging", "gregtech:gt.blockmachines:31035", 1); + setNBTInfoAndSendIt("gtpp.recipe.coldtrap", "gregtech:gt.blockmachines:31034"); + setNBTInfoAndSendIt("gtpp.recipe.reactorprocessingunit", "gregtech:gt.blockmachines:31032"); } + private static void setNBTInfoAndSendIt(String aRecipeName, String aBlock) { + setNBTInfoAndSendIt(aRecipeName, aBlock, 2); + } + + private static void setNBTInfoAndSendIt(String aRecipeName, String aBlock, int aRecipesPerPage) { NBTTagCompound aNBT = new NBTTagCompound(); aNBT.setString("handler", aRecipeName); aNBT.setString("modName", "GT++"); @@ -38,7 +45,7 @@ public class NEI_IMC_Sender { aNBT.setInteger("yShift", 6); aNBT.setInteger("handlerHeight", 135); aNBT.setInteger("handlerWidth", 166); - aNBT.setInteger("maxRecipesPerPage", 2); + aNBT.setInteger("maxRecipesPerPage", aRecipesPerPage); FMLInterModComms.sendMessage("NotEnoughItems", "registerHandlerInfo", aNBT); } } diff --git a/src/resources/assets/miscutils/lang/en_US.lang b/src/resources/assets/miscutils/lang/en_US.lang index 4eab3e92dd..14637b95e6 100644 --- a/src/resources/assets/miscutils/lang/en_US.lang +++ b/src/resources/assets/miscutils/lang/en_US.lang @@ -3296,4 +3296,19 @@ item.ImpureLiFBeF2.name=Impure LiFBeF2 Cell item.itemCellHeliumSpargedLiFBeF2UF4FP.name=Helium Sparged LiFBeF2UF4FP Cell item.itemCellFluorineSpargedLiFThF4.name=Fluorine Sparged LiFThF4 Cell item.itemCellFluorineSpargedLiFBeF2ThF4.name=Fluorine Sparged LiFBeF2ThF4 Cell +item.itemIngotHS188A.name=HS-188A Ingot +item.itemHotIngotHS188A.name=Hot HS-188A Ingot +item.itemDustHS188A.name=HS-188A Dust +item.itemDustTinyHS188A.name=Tiny Pile of HS-188A Dust +item.itemDustSmallHS188A.name=Small Pile of HS-188A Dust +item.itemNuggetHS188A.name=HS-188A Nugget +item.itemPlateHS188A.name=HS-188A Plate +item.itemPlateDoubleHS188A.name=Double HS-188A Plate +item.itemBoltHS188A.name=HS-188A Bolt +item.itemRodHS188A.name=HS-188A Rod +item.itemRodLongHS188A.name=Long HS-188A Rod +item.itemRingHS188A.name=HS-188A Ring +item.itemScrewHS188A.name=HS-188A Screw +item.itemRotorHS188A.name=HS-188A Rotor +item.itemGearHS188A.name=HS-188A Gear -- cgit From 9729a716008abd839c48a6b18f4c74247fa27395 Mon Sep 17 00:00:00 2001 From: Alkalus <3060479+draknyte1@users.noreply.github.com> Date: Fri, 10 Dec 2021 22:21:04 +0000 Subject: Fixed hot ingot recipes. --- .../core/item/base/ingots/BaseItemIngotHot.java | 4 ++-- .../interfaces/internal/IGregtech_RecipeAdder.java | 2 ++ .../xmod/gregtech/recipes/GregtechRecipeAdder.java | 22 ++++++++++++++++++++++ 3 files changed, 26 insertions(+), 2 deletions(-) (limited to 'src/Java/gtPlusPlus/core/item') diff --git a/src/Java/gtPlusPlus/core/item/base/ingots/BaseItemIngotHot.java b/src/Java/gtPlusPlus/core/item/base/ingots/BaseItemIngotHot.java index f9acdded7e..c19fecd924 100644 --- a/src/Java/gtPlusPlus/core/item/base/ingots/BaseItemIngotHot.java +++ b/src/Java/gtPlusPlus/core/item/base/ingots/BaseItemIngotHot.java @@ -52,8 +52,8 @@ public class BaseItemIngotHot extends BaseItemIngot{ } private void generateRecipe(){ - Logger.WARNING("Adding Vacuum Freezer recipe for a Hot Ingot of "+this.materialName+"."); - GT_Values.RA.addVacuumFreezerRecipe(ItemUtils.getSimpleStack(this), this.outputIngot.copy(), 60*this.mTier); + Logger.WARNING("Adding Vacuum Freezer recipe for a Hot Ingot of "+this.materialName+"."); + CORE.RA.addVacuumFreezerRecipe(ItemUtils.getSimpleStack(this), this.outputIngot.copy(), (int) Math.max(this.componentMaterial.getMass() * 3L, 1L), this.componentMaterial.vVoltageMultiplier); } @Override diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/interfaces/internal/IGregtech_RecipeAdder.java b/src/Java/gtPlusPlus/xmod/gregtech/api/interfaces/internal/IGregtech_RecipeAdder.java index 12b4997772..217731dea7 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/api/interfaces/internal/IGregtech_RecipeAdder.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/api/interfaces/internal/IGregtech_RecipeAdder.java @@ -320,4 +320,6 @@ public interface IGregtech_RecipeAdder { public boolean addFluidHeaterRecipe(ItemStack aCircuit, FluidStack aInput, FluidStack aOutput, int aDuration, int aEUt); + public boolean addVacuumFreezerRecipe(ItemStack aInput, ItemStack aOutput, int aDuration, int aEU); + } diff --git a/src/Java/gtPlusPlus/xmod/gregtech/recipes/GregtechRecipeAdder.java b/src/Java/gtPlusPlus/xmod/gregtech/recipes/GregtechRecipeAdder.java index 7e3fab2ad8..71f618e7a9 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/recipes/GregtechRecipeAdder.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/recipes/GregtechRecipeAdder.java @@ -1808,6 +1808,28 @@ public class GregtechRecipeAdder implements IGregtech_RecipeAdder { } + @Override + public boolean addVacuumFreezerRecipe(ItemStack aInput, ItemStack aOutput, int aDuration, int aEUt) { + if ((aInput == null) || (aOutput == null)) { + return false; + } + GTPP_Recipe aRecipe = new GTPP_Recipe( + false, + new ItemStack[] {aInput}, + new ItemStack[] {aOutput}, + null, + new int[] {10000}, + new FluidStack[] {}, + new FluidStack[] {}, + aDuration, + aEUt, + 0); + + int aSize = GT_Recipe_Map.sVacuumRecipes.mRecipeList.size(); + GT_Recipe_Map.sVacuumRecipes.add(aRecipe); + return GT_Recipe_Map.sVacuumRecipes.mRecipeList.size() > aSize; + } + -- cgit From a88fed98878a081350cde7a0ee6d3fdd1a3de420 Mon Sep 17 00:00:00 2001 From: Alkalus <3060479+draknyte1@users.noreply.github.com> Date: Sat, 11 Dec 2021 18:07:47 +0000 Subject: Fixed issue of Multiblock hatches/buses not being assigned recipe maps. Removed 7 from Charge Pack tooltips. Initial work on Elemental Duplicator. --- .../core/item/bauble/BatteryPackBaseBauble.java | 2 +- .../xmod/gregtech/api/enums/GregtechItemList.java | 4 +- ...etaTileEntity_Hatch_ElementalDataOrbHolder.java | 30 +- .../base/GregtechMeta_MultiBlockBase.java | 130 ++- .../base/GregtechMeta_SteamMultiBase.java | 18 +- .../machines/multi/misc/GMTE_AmazonPackager.java | 15 +- ...gtechMetaTileEntity_IndustrialAlloySmelter.java | 15 +- ...regtechMetaTileEntity_IndustrialArcFurnace.java | 21 +- ...regtechMetaTileEntity_IndustrialCentrifuge.java | 21 +- .../GregtechMetaTileEntity_IndustrialCokeOven.java | 21 +- ...echMetaTileEntity_IndustrialCuttingMachine.java | 18 +- ...regtechMetaTileEntity_IndustrialDehydrator.java | 21 +- ...gtechMetaTileEntity_IndustrialElectrolyzer.java | 21 +- .../GregtechMetaTileEntity_IndustrialExtruder.java | 15 +- ...GregtechMetaTileEntity_IndustrialMacerator.java | 15 +- .../GregtechMetaTileEntity_IndustrialMixer.java | 21 +- ...gtechMetaTileEntity_IndustrialMultiMachine.java | 21 +- ...regtechMetaTileEntity_IndustrialPlatePress.java | 15 +- .../GregtechMetaTileEntity_IndustrialSifter.java | 15 +- ...MetaTileEntity_IndustrialThermalCentrifuge.java | 15 +- ...techMetaTileEntity_IndustrialVacuumFreezer.java | 24 +- ...GregtechMetaTileEntity_IndustrialWashPlant.java | 18 +- .../GregtechMetaTileEntity_IndustrialWireMill.java | 15 +- .../GregtechMetaTileEntity_SpargeTower.java | 18 +- ...egtechMetaTileEntity_Adv_DistillationTower.java | 24 +- .../advanced/GregtechMetaTileEntity_Adv_EBF.java | 24 +- .../GregtechMetaTileEntity_Adv_Implosion.java | 15 +- .../GregtechMetaTileEntity_SteamMacerator.java | 9 +- .../multi/production/GT4Entity_AutoCrafter.java | 18 +- .../multi/production/GT4Entity_ThermalBoiler.java | 18 +- .../GregtechMTE_ElementalDuplicator.java | 1038 ++++++++++---------- .../production/GregtechMTE_FrothFlotationCell.java | 15 +- .../production/GregtechMTE_NuclearReactor.java | 15 +- .../GregtechMetaTileEntityGeneratorArray.java | 18 +- .../GregtechMetaTileEntity_AlloyBlastSmelter.java | 18 +- .../GregtechMetaTileEntity_Cyclotron.java | 18 +- ...egtechMetaTileEntity_IndustrialFishingPond.java | 18 +- .../GregtechMetaTileEntity_LargeRocketEngine.java | 31 +- ...techMetaTileEntity_LargeSemifluidGenerator.java | 14 +- .../GregtechMetaTileEntity_MassFabricator.java | 21 +- .../GregtechMetaTileEntity_Refinery.java | 18 +- .../algae/GregtechMTE_AlgaePondBase.java | 9 +- .../chemplant/GregtechMTE_ChemicalPlant.java | 14 +- ...chMetaTileEntity_PowerSubStationController.java | 33 +- .../GregtechIndustrialElementDuplicator.java | 4 +- 45 files changed, 862 insertions(+), 1059 deletions(-) (limited to 'src/Java/gtPlusPlus/core/item') diff --git a/src/Java/gtPlusPlus/core/item/bauble/BatteryPackBaseBauble.java b/src/Java/gtPlusPlus/core/item/bauble/BatteryPackBaseBauble.java index edc1cc9b88..70de4603e7 100644 --- a/src/Java/gtPlusPlus/core/item/bauble/BatteryPackBaseBauble.java +++ b/src/Java/gtPlusPlus/core/item/bauble/BatteryPackBaseBauble.java @@ -95,7 +95,7 @@ public class BatteryPackBaseBauble extends ElectricBaseBauble { String aEUT = aEU+"/t"; list.add(EnumChatFormatting.GREEN + aString1 + EnumChatFormatting.GRAY); - list.add(EnumChatFormatting.GREEN + aString2+" " + (int) getTransferLimit(stack) + aEUT +" 7"+ aString3 + EnumChatFormatting.GRAY); + list.add(EnumChatFormatting.GREEN + aString2+" " + (int) getTransferLimit(stack) + aEUT +" "+ aString3 + EnumChatFormatting.GRAY); list.add(EnumChatFormatting.GREEN + aString4 + EnumChatFormatting.GRAY); super.addInformation(stack, aPlayer, list, bool); } diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/enums/GregtechItemList.java b/src/Java/gtPlusPlus/xmod/gregtech/api/enums/GregtechItemList.java index bd0f11f0ad..8c814489f2 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/api/enums/GregtechItemList.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/api/enums/GregtechItemList.java @@ -404,7 +404,7 @@ public enum GregtechItemList implements GregtechItemContainer { Casing_Sparge_Tower_Interior, // Elemental Duplicator - /*Controller_ElementalDuplicator,*/ + Controller_ElementalDuplicator, Casing_ElementalDuplicator, // Big Steam Macerator @@ -458,7 +458,7 @@ public enum GregtechItemList implements GregtechItemContainer { Hatch_Output_Bus_Steam, //Elemental Duplicator Data Orb Bus - /*Hatch_Input_Elemental_Duplicator,*/ + Hatch_Input_Elemental_Duplicator, //RTG Hatch Hatch_RTG_LV, diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_ElementalDataOrbHolder.java b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_ElementalDataOrbHolder.java index 71040d057c..a892346463 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_ElementalDataOrbHolder.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_ElementalDataOrbHolder.java @@ -1,5 +1,7 @@ package gtPlusPlus.xmod.gregtech.api.metatileentity.implementations; +import java.util.ArrayList; + import gregtech.api.gui.GT_Container_4by4; import gregtech.api.gui.GT_GUIContainer_4by4; import gregtech.api.interfaces.ITexture; @@ -18,14 +20,12 @@ import net.minecraft.nbt.NBTTagCompound; public class GT_MetaTileEntity_Hatch_ElementalDataOrbHolder extends GT_MetaTileEntity_Hatch { public GT_Recipe_Map mRecipeMap = null; - public boolean disableSort; public GT_MetaTileEntity_Hatch_ElementalDataOrbHolder(int aID, String aName, String aNameRegional, int aTier) { super(aID, aName, aNameRegional, aTier, 16, new String[]{ "Holds Data Orbs for the Elemental Duplicator", CORE.GT_Tooltip - }); - disableSort = true; + }); } public GT_MetaTileEntity_Hatch_ElementalDataOrbHolder(String aName, int aTier, String aDescription, ITexture[][][] aTextures) { @@ -85,7 +85,7 @@ public class GT_MetaTileEntity_Hatch_ElementalDataOrbHolder extends GT_MetaTileE @Override public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { - return new GT_GUIContainer_4by4(aPlayerInventory, aBaseMetaTileEntity, "Steam Input Bus"); + return new GT_GUIContainer_4by4(aPlayerInventory, aBaseMetaTileEntity, "Data Orb Repository"); } @Override @@ -102,28 +102,26 @@ public class GT_MetaTileEntity_Hatch_ElementalDataOrbHolder extends GT_MetaTileE } protected void fillStacksIntoFirstSlots() { - if (disableSort) { - for (int i = 0; i < mInventory.length; i++) - if (mInventory[i] != null && mInventory[i].stackSize <= 0) - mInventory[i] = null; - } + for (int i = 0; i < mInventory.length; i++) { + if (mInventory[i] != null && mInventory[i].stackSize <= 0) { + mInventory[i] = null; + } + } } @Override public void saveNBTData(NBTTagCompound aNBT) { super.saveNBTData(aNBT); - aNBT.setBoolean("disableSort", disableSort); } @Override public void loadNBTData(NBTTagCompound aNBT) { super.loadNBTData(aNBT); - disableSort = aNBT.getBoolean("disableSort"); } @Override public void onScrewdriverRightClick(byte aSide, EntityPlayer aPlayer, float aX, float aY, float aZ) { - + } public String trans(String aKey, String aEnglish) { @@ -139,5 +137,13 @@ public class GT_MetaTileEntity_Hatch_ElementalDataOrbHolder extends GT_MetaTileE public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) { return aSide == getBaseMetaTileEntity().getFrontFacing() && (mRecipeMap == null || mRecipeMap.containsInput(aStack)); } + + public ArrayList getInventory(){ + ArrayList aContents = new ArrayList(); + for (int i=0;i as it should have been +// so any method in GregtechMetaTileEntity_IndustrialDehydrator would see generic field declared in GregtechMeta_MultiBlockBase without generic parameter + public abstract class GregtechMeta_MultiBlockBase> extends GT_MetaTileEntity_EnhancedMultiBlockBase { public static final boolean DEBUG_DISABLE_CORES_TEMPORARILY = true; @@ -95,14 +98,15 @@ public abstract class GregtechMeta_MultiBlockBase mControlCoreBus = new ArrayList(); public ArrayList mAirIntakes = new ArrayList(); public ArrayList mChargeHatches = new ArrayList(); public ArrayList mDischargeHatches = new ArrayList(); + public ArrayList mAllEnergyHatches = new ArrayList(); + public ArrayList mAllDynamoHatches = new ArrayList(); // Custom Behaviour Map - private static final HashMap mCustomBehviours = new HashMap();; + private static final HashMap mCustomBehviours = new HashMap(); public GregtechMeta_MultiBlockBase(final int aID, final String aName, @@ -1468,6 +1472,8 @@ public abstract class GregtechMeta_MultiBlockBase boolean addToMachineListInternal(ArrayList aList, final IMetaTileEntity aTileEntity, - final int aBaseCasingIndex) { + public boolean addToMachineListInternal(ArrayList aList, final IGregTechTileEntity aTileEntity, final int aBaseCasingIndex) { + if (aTileEntity == null) { + return false; + } + final IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity(); + if (aMetaTileEntity == null) { + return false; + } + return addToMachineListInternal(aList, aMetaTileEntity, aBaseCasingIndex); + } + + public boolean addToMachineListInternal(ArrayList aList, final IMetaTileEntity aTileEntity, final int aBaseCasingIndex) { if (aTileEntity == null) { return false; } @@ -1669,7 +1685,15 @@ public abstract class GregtechMeta_MultiBlockBase aHatchType = ReflectionUtils.getTypeOfGenericObject(aList); if * (!aHatchType.isInstance(aTileEntity)) { return false; } */ + + // Try setRecipeMap + if (aTileEntity instanceof GT_MetaTileEntity_Hatch_Input) { + ((GT_MetaTileEntity_Hatch_Input) aTileEntity).mRecipeMap = getRecipeMap(); + } + if (aTileEntity instanceof GT_MetaTileEntity_Hatch_InputBus) { + ((GT_MetaTileEntity_Hatch_InputBus) aTileEntity).mRecipeMap = getRecipeMap(); + } if (aList.isEmpty()) { if (aTileEntity instanceof GT_MetaTileEntity_Hatch) { @@ -1780,7 +1804,7 @@ public abstract class GregtechMeta_MultiBlockBase mDynamoClass; mDynamoClass = ReflectionUtils.getClass("com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_Hatch_DynamoMulti"); if (mDynamoClass != null){ @@ -2105,11 +2132,27 @@ public abstract class GregtechMeta_MultiBlockBase mDynamoClass; mDynamoClass = ReflectionUtils.getClass("com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_Hatch_EnergyMulti"); if (mDynamoClass != null){ @@ -2151,11 +2204,26 @@ public abstract class GregtechMeta_MultiBlockBase t.onTopLayerFound(false), ofHatchAdder(GregtechMetaTileEntity_SpargeTower::addOutputToMachineList, getCasingIndex(), 3)), - onElementPass(t -> t.onTopLayerFound(false), ofHatchAdder(GregtechMetaTileEntity_SpargeTower::addMaintenanceToMachineList, getCasingIndex(), 3)), + onElementPass(t -> t.onTopLayerFound(false), ofHatchAdder(GregtechMetaTileEntity_SpargeTower::addToMachineList, getCasingIndex(), 3)), + onElementPass(t -> t.onTopLayerFound(false), ofHatchAdder(GregtechMetaTileEntity_SpargeTower::addToMachineList, getCasingIndex(), 3)), onElementPass(t -> t.onTopLayerFound(true), ofBlock(ModBlocks.blockCasings5Misc, 4)), isAir() )) diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/advanced/GregtechMetaTileEntity_Adv_DistillationTower.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/advanced/GregtechMetaTileEntity_Adv_DistillationTower.java index b8ccd0b477..23fb26ea53 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/advanced/GregtechMetaTileEntity_Adv_DistillationTower.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/advanced/GregtechMetaTileEntity_Adv_DistillationTower.java @@ -98,20 +98,15 @@ public class GregtechMetaTileEntity_Adv_DistillationTower extends GregtechMeta_M } else { IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity(); if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_InputBus){ - ((GT_MetaTileEntity_Hatch)aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mInputBusses.add((GT_MetaTileEntity_Hatch_InputBus)aMetaTileEntity); + return addToMachineList(aTileEntity, aBaseCasingIndex); } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Maintenance){ - ((GT_MetaTileEntity_Hatch)aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mMaintenanceHatches.add((GT_MetaTileEntity_Hatch_Maintenance)aMetaTileEntity); + return addToMachineList(aTileEntity, aBaseCasingIndex); } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Energy){ - ((GT_MetaTileEntity_Hatch)aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mEnergyHatches.add((GT_MetaTileEntity_Hatch_Energy)aMetaTileEntity); + return addToMachineList(aTileEntity, aBaseCasingIndex); } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_OutputBus) { - ((GT_MetaTileEntity_Hatch) aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mOutputBusses.add((GT_MetaTileEntity_Hatch_OutputBus) aMetaTileEntity); + return addToMachineList(aTileEntity, aBaseCasingIndex); } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Input) { - ((GT_MetaTileEntity_Hatch) aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mInputHatches.add((GT_MetaTileEntity_Hatch_Input) aMetaTileEntity); + return addToMachineList(aTileEntity, aBaseCasingIndex); } } return false; @@ -123,8 +118,7 @@ public class GregtechMetaTileEntity_Adv_DistillationTower extends GregtechMeta_M } else { IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity(); if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Output){ - ((GT_MetaTileEntity_Hatch)aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mOutputHatches.add((GT_MetaTileEntity_Hatch_Output)aMetaTileEntity); + return addToMachineList(aTileEntity, aBaseCasingIndex); } } return false; @@ -136,11 +130,9 @@ public class GregtechMetaTileEntity_Adv_DistillationTower extends GregtechMeta_M } else { IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity(); if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Output){ - ((GT_MetaTileEntity_Hatch)aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mOutputHatches.add((GT_MetaTileEntity_Hatch_Output)aMetaTileEntity); + return addToMachineList(aTileEntity, aBaseCasingIndex); } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Muffler){ - ((GT_MetaTileEntity_Hatch)aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mMufflerHatches.add((GT_MetaTileEntity_Hatch_Muffler)aMetaTileEntity); + return addToMachineList(aTileEntity, aBaseCasingIndex); } } return false; diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/advanced/GregtechMetaTileEntity_Adv_EBF.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/advanced/GregtechMetaTileEntity_Adv_EBF.java index e6eb362b2b..1a77423fdb 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/advanced/GregtechMetaTileEntity_Adv_EBF.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/advanced/GregtechMetaTileEntity_Adv_EBF.java @@ -164,31 +164,23 @@ public class GregtechMetaTileEntity_Adv_EBF extends GregtechMeta_MultiBlockBase } else { IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity(); if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_CustomFluidBase && aMetaTileEntity.getBaseMetaTileEntity().getMetaTileID() == 968) { - ((GT_MetaTileEntity_Hatch) aMetaTileEntity).updateTexture(aBaseCasingIndex); mHaveHatch = true; - return this.mInputHatches.add((GT_MetaTileEntity_Hatch_Input) aMetaTileEntity); + return addToMachineList(aTileEntity, aBaseCasingIndex); } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_InputBus){ - ((GT_MetaTileEntity_Hatch)aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mInputBusses.add((GT_MetaTileEntity_Hatch_InputBus)aMetaTileEntity); + return addToMachineList(aTileEntity, aBaseCasingIndex); } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Maintenance){ - ((GT_MetaTileEntity_Hatch)aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mMaintenanceHatches.add((GT_MetaTileEntity_Hatch_Maintenance)aMetaTileEntity); + return addToMachineList(aTileEntity, aBaseCasingIndex); } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Energy){ - ((GT_MetaTileEntity_Hatch)aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mEnergyHatches.add((GT_MetaTileEntity_Hatch_Energy)aMetaTileEntity); + return addToMachineList(aTileEntity, aBaseCasingIndex); } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_OutputBus) { - ((GT_MetaTileEntity_Hatch) aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mOutputBusses.add((GT_MetaTileEntity_Hatch_OutputBus) aMetaTileEntity); + return addToMachineList(aTileEntity, aBaseCasingIndex); } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Muffler) { - ((GT_MetaTileEntity_Hatch) aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mMufflerHatches.add((GT_MetaTileEntity_Hatch_Muffler) aMetaTileEntity); + return addToMachineList(aTileEntity, aBaseCasingIndex); } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Input) { - ((GT_MetaTileEntity_Hatch) aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mInputHatches.add((GT_MetaTileEntity_Hatch_Input) aMetaTileEntity); + return addToMachineList(aTileEntity, aBaseCasingIndex); } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Output) { - ((GT_MetaTileEntity_Hatch) aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mOutputHatches.add((GT_MetaTileEntity_Hatch_Output) aMetaTileEntity); + return addToMachineList(aTileEntity, aBaseCasingIndex); } } return false; diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/advanced/GregtechMetaTileEntity_Adv_Implosion.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/advanced/GregtechMetaTileEntity_Adv_Implosion.java index 77369a0407..93d5d74dc4 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/advanced/GregtechMetaTileEntity_Adv_Implosion.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/advanced/GregtechMetaTileEntity_Adv_Implosion.java @@ -107,20 +107,15 @@ extends GregtechMeta_MultiBlockBase { } else { IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity(); if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_InputBus){ - ((GT_MetaTileEntity_Hatch)aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mInputBusses.add((GT_MetaTileEntity_Hatch_InputBus)aMetaTileEntity); + return addToMachineList(aTileEntity, aBaseCasingIndex); } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Maintenance){ - ((GT_MetaTileEntity_Hatch)aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mMaintenanceHatches.add((GT_MetaTileEntity_Hatch_Maintenance)aMetaTileEntity); + return addToMachineList(aTileEntity, aBaseCasingIndex); } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Energy){ - ((GT_MetaTileEntity_Hatch)aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mEnergyHatches.add((GT_MetaTileEntity_Hatch_Energy)aMetaTileEntity); + return addToMachineList(aTileEntity, aBaseCasingIndex); } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_OutputBus) { - ((GT_MetaTileEntity_Hatch) aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mOutputBusses.add((GT_MetaTileEntity_Hatch_OutputBus) aMetaTileEntity); + return addToMachineList(aTileEntity, aBaseCasingIndex); } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Muffler) { - ((GT_MetaTileEntity_Hatch) aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mMufflerHatches.add((GT_MetaTileEntity_Hatch_Muffler) aMetaTileEntity); + return addToMachineList(aTileEntity, aBaseCasingIndex); } } return false; diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/steam/GregtechMetaTileEntity_SteamMacerator.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/steam/GregtechMetaTileEntity_SteamMacerator.java index 114504e5da..3191f56889 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/steam/GregtechMetaTileEntity_SteamMacerator.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/steam/GregtechMetaTileEntity_SteamMacerator.java @@ -110,14 +110,11 @@ public class GregtechMetaTileEntity_SteamMacerator extends GregtechMeta_SteamMul } else { IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity(); if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_CustomFluidBase && aMetaTileEntity.getBaseMetaTileEntity().getMetaTileID() == 31040){ - ((GT_MetaTileEntity_Hatch)aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mSteamInputFluids.add((GT_MetaTileEntity_Hatch_CustomFluidBase)aMetaTileEntity); + return addToMachineList(aTileEntity, aBaseCasingIndex); } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Steam_BusInput){ - ((GT_MetaTileEntity_Hatch)aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mSteamInputs.add((GT_MetaTileEntity_Hatch_Steam_BusInput)aMetaTileEntity); + return addToMachineList(aTileEntity, aBaseCasingIndex); } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Steam_BusOutput){ - ((GT_MetaTileEntity_Hatch)aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mSteamOutputs.add((GT_MetaTileEntity_Hatch_Steam_BusOutput)aMetaTileEntity); + return addToMachineList(aTileEntity, aBaseCasingIndex); } } return false; diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GT4Entity_AutoCrafter.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GT4Entity_AutoCrafter.java index 57ea2db9fb..7700e496b4 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GT4Entity_AutoCrafter.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GT4Entity_AutoCrafter.java @@ -207,23 +207,17 @@ public class GT4Entity_AutoCrafter extends GregtechMeta_MultiBlockBase { } else { IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity(); if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_InputBus){ - ((GT_MetaTileEntity_Hatch)aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mInputBusses.add((GT_MetaTileEntity_Hatch_InputBus)aMetaTileEntity); + return addToMachineList(aTileEntity, aBaseCasingIndex); } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Maintenance){ - ((GT_MetaTileEntity_Hatch)aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mMaintenanceHatches.add((GT_MetaTileEntity_Hatch_Maintenance)aMetaTileEntity); + return addToMachineList(aTileEntity, aBaseCasingIndex); } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Energy){ - ((GT_MetaTileEntity_Hatch)aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mEnergyHatches.add((GT_MetaTileEntity_Hatch_Energy)aMetaTileEntity); + return addToMachineList(aTileEntity, aBaseCasingIndex); } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_OutputBus) { - ((GT_MetaTileEntity_Hatch) aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mOutputBusses.add((GT_MetaTileEntity_Hatch_OutputBus) aMetaTileEntity); + return addToMachineList(aTileEntity, aBaseCasingIndex); } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Muffler) { - ((GT_MetaTileEntity_Hatch) aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mMufflerHatches.add((GT_MetaTileEntity_Hatch_Muffler) aMetaTileEntity); + return addToMachineList(aTileEntity, aBaseCasingIndex); } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Input) { - ((GT_MetaTileEntity_Hatch) aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mInputHatches.add((GT_MetaTileEntity_Hatch_Input) aMetaTileEntity); + return addToMachineList(aTileEntity, aBaseCasingIndex); } } return false; diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GT4Entity_ThermalBoiler.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GT4Entity_ThermalBoiler.java index b486261b33..ef52dbaf13 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GT4Entity_ThermalBoiler.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GT4Entity_ThermalBoiler.java @@ -280,23 +280,17 @@ extends GregtechMeta_MultiBlockBase } else { IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity(); if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_InputBus){ - ((GT_MetaTileEntity_Hatch)aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mInputBusses.add((GT_MetaTileEntity_Hatch_InputBus)aMetaTileEntity); + return addToMachineList(aTileEntity, aBaseCasingIndex); } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Maintenance){ - ((GT_MetaTileEntity_Hatch)aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mMaintenanceHatches.add((GT_MetaTileEntity_Hatch_Maintenance)aMetaTileEntity); + return addToMachineList(aTileEntity, aBaseCasingIndex); } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_OutputBus) { - ((GT_MetaTileEntity_Hatch) aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mOutputBusses.add((GT_MetaTileEntity_Hatch_OutputBus) aMetaTileEntity); + return addToMachineList(aTileEntity, aBaseCasingIndex); } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Muffler) { - ((GT_MetaTileEntity_Hatch) aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mMufflerHatches.add((GT_MetaTileEntity_Hatch_Muffler) aMetaTileEntity); + return addToMachineList(aTileEntity, aBaseCasingIndex); } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Input) { - ((GT_MetaTileEntity_Hatch) aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mInputHatches.add((GT_MetaTileEntity_Hatch_Input) aMetaTileEntity); + return addToMachineList(aTileEntity, aBaseCasingIndex); } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Output) { - ((GT_MetaTileEntity_Hatch) aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mOutputHatches.add((GT_MetaTileEntity_Hatch_Output) aMetaTileEntity); + return addToMachineList(aTileEntity, aBaseCasingIndex); } } return false; diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMTE_ElementalDuplicator.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMTE_ElementalDuplicator.java index 6f8f082065..e4d8d2778e 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMTE_ElementalDuplicator.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMTE_ElementalDuplicator.java @@ -1,6 +1,9 @@ -/* package gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.production; +import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofChain; +import static com.gtnewhorizon.structurelib.structure.StructureUtility.onElementPass; +import static com.gtnewhorizon.structurelib.structure.StructureUtility.transpose; +import static gregtech.api.util.GT_StructureUtility.ofHatchAdder; import static gtPlusPlus.core.util.data.ArrayUtils.removeNulls; import java.util.ArrayList; @@ -9,6 +12,11 @@ import java.util.List; import org.apache.commons.lang3.ArrayUtils; +import com.gtnewhorizon.structurelib.StructureLibAPI; +import com.gtnewhorizon.structurelib.structure.IStructureDefinition; +import com.gtnewhorizon.structurelib.structure.IStructureElement; +import com.gtnewhorizon.structurelib.structure.StructureDefinition; + import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import gregtech.api.GregTech_API; @@ -16,15 +24,22 @@ import gregtech.api.enums.Textures; import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Energy; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Input; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_InputBus; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Maintenance; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Output; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_OutputBus; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_TieredMachineBlock; import gregtech.api.objects.GT_RenderedTexture; import gregtech.api.util.GTPP_Recipe; +import gregtech.api.util.GT_Multiblock_Tooltip_Builder; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; import gtPlusPlus.api.objects.Logger; import gtPlusPlus.api.objects.data.AutoMap; import gtPlusPlus.api.objects.data.Triplet; -import gtPlusPlus.core.block.ModBlocks; import gtPlusPlus.core.item.chemistry.general.ItemGenericChemBase; import gtPlusPlus.core.lib.CORE; import gtPlusPlus.core.recipe.common.CI; @@ -32,14 +47,11 @@ import gtPlusPlus.core.util.math.MathUtils; import gtPlusPlus.core.util.minecraft.ItemUtils; import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_ElementalDataOrbHolder; import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GregtechMeta_MultiBlockBase; -import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.nbthandlers.GT_MetaTileEntity_Hatch_Catalysts; -import gtPlusPlus.xmod.gregtech.common.Meta_GT_Proxy; -import gtPlusPlus.xmod.gregtech.common.StaticFields59; import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock; import net.minecraft.block.Block; -import net.minecraft.init.Blocks; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.world.World; import net.minecraftforge.common.util.ForgeDirection; import net.minecraftforge.fluids.FluidStack; @@ -48,12 +60,19 @@ public class GregtechMTE_ElementalDuplicator extends GregtechMeta_MultiBlockBase private int mSolidCasingTier = 0; private int mMachineCasingTier = 0; private int mPipeCasingTier = 0; - private int mCoilTier = 0; + private int mCoilTier = 0; + private int checkCoil; + private int[] checkCasing = new int[8]; + private int checkMachine; + private int checkPipe; + private int maxTierOfHatch; + private int mCasing; + private IStructureDefinition STRUCTURE_DEFINITION = null; + + private ArrayList mReplicatorDataOrbHatches = new ArrayList(); - private ArrayList mDataHolders = new ArrayList(); - private static final HashMap> mTieredBlockRegistry = new HashMap>(); - + public GregtechMTE_ElementalDuplicator(final int aID, final String aName, final String aNameRegional) { super(aID, aName, aNameRegional); } @@ -61,7 +80,7 @@ public class GregtechMTE_ElementalDuplicator extends GregtechMeta_MultiBlockBase public GregtechMTE_ElementalDuplicator(final String aName) { super(aName); } - + public static boolean registerMachineCasingForTier(int aTier, Block aBlock, int aMeta, int aCasingTextureID) { int aSize = mTieredBlockRegistry.size(); int aSize2 = aSize; @@ -73,21 +92,14 @@ public class GregtechMTE_ElementalDuplicator extends GregtechMeta_MultiBlockBase aSize = mTieredBlockRegistry.size(); return aSize > aSize2; } - - private static Block getBlockForTier(int aTier) { - if (!mTieredBlockRegistry.containsKey(aTier)) { - return Blocks.bedrock; - } - return mTieredBlockRegistry.get(aTier).getValue_1(); - } - private static int getMetaForTier(int aTier) { + + private static int getCasingTextureIdForTier(int aTier) { if (!mTieredBlockRegistry.containsKey(aTier)) { - return 32; + return 10; } - return mTieredBlockRegistry.get(aTier).getValue_2(); - } - private static int getCasingTextureIdForTier(int aTier) { - return 67; + int aCasingID = mTieredBlockRegistry.get(aTier).getValue_3(); + //Logger.INFO("Found casing texture ID "+aCasingID+" for tier "+aTier); + return aCasingID; } @Override @@ -97,19 +109,287 @@ public class GregtechMTE_ElementalDuplicator extends GregtechMeta_MultiBlockBase @Override public String getMachineType() { - return "Chemical Plant"; + return "Replicator"; + } + + @Override + protected GT_Multiblock_Tooltip_Builder createTooltip() { + GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); + tt.addMachineType(getMachineType()) + .addInfo("Controller Block for the Industrial Replication Machine") + .addInfo("Now replication is less painful") + .addInfo("Please read to user manual for more information on construction & usage") + .addSeparator() + .addController("Bottom Center") + .addStructureHint("Catalyst Housing", 1) + .addInputBus("Bottom Casing", 1) + .addOutputBus("Bottom Casing", 1) + .addInputHatch("Bottom Casing", 1) + .addOutputHatch("Bottom Casing", 1) + .addEnergyHatch("Bottom Casing", 1) + .addMaintenanceHatch("Bottom Casing", 1) + .toolTipFinisher(CORE.GT_Tooltip_Builder); + return tt; + } + + public void setMachineMeta(int meta) { + checkMachine = meta; + } + + public int getMachineMeta() { + return checkMachine; + } + + public void setPipeMeta(int meta) { + checkPipe = meta; + } + + public int getPipeMeta() { + return checkPipe; + } + + public void setCoilMeta(int meta) { + checkCoil = meta; + } + + public int getCoilMeta() { + return checkCoil; + } + + public int coilTier(int meta) { + switch (meta) { + case 0: return 1; + case 1: return 2; + case 2: return 3; + case 3: return 4; + case 4: return 5; + case 5: return 7; + case 6: return 8; + case 7: return 10; + case 8: return 11; + case 9: return 6; + case 10: return 9; + } + return 0; } @Override - public String[] getTooltip() { - return new String[] { - "Controller Block for the Industrial Replication Machine", - "Now replication is less painful", - "Please read to user manual for more information on construction & usage", - TAG_HIDE_MAINT + public IStructureDefinition getStructureDefinition() { + if (STRUCTURE_DEFINITION == null) { + STRUCTURE_DEFINITION = StructureDefinition.builder() + .addShape(mName, transpose(new String[][]{ + {"XXXXXXX", "XXXXXXX", "XXXXXXX", "XXXXXXX", "XXXXXXX", "XXXXXXX", "XXXXXXX"}, + {"X X", " MMMMM ", " MHHHM ", " MHHHM ", " MHHHM ", " MMMMM ", "X X"}, + {"X X", " ", " PPP ", " PPP ", " PPP ", " ", "X X"}, + {"X X", " ", " HHH ", " HHH ", " HHH ", " ", "X X"}, + {"X X", " ", " PPP ", " PPP ", " PPP ", " ", "X X"}, + {"X X", " MMMMM ", " MHHHM ", " MHHHM ", " MHHHM ", " MMMMM ", "X X"}, + {"CCC~CCC", "CMMMMMC", "CMMMMMC", "CMMMMMC", "CMMMMMC", "CMMMMMC", "CCCCCCC"}, + })) + .addElement( + 'C', + ofChain( + ofHatchAdder( + GregtechMTE_ElementalDuplicator::addChemicalPlantList, getCasingTextureID(), 1 + ), + onElementPass( + x -> {++x.checkCasing[0]; ++x.mCasing;}, + ofSolidCasing(0) + ), + onElementPass( + x -> {++x.checkCasing[1]; ++x.mCasing;}, + ofSolidCasing(1) + ), + onElementPass( + x -> {++x.checkCasing[2]; ++x.mCasing;}, + ofSolidCasing(2) + ), + onElementPass( + x -> {++x.checkCasing[3]; ++x.mCasing;}, + ofSolidCasing(3) + ), + onElementPass( + x -> {++x.checkCasing[4]; ++x.mCasing;}, + ofSolidCasing(4) + ), + onElementPass( + x -> {++x.checkCasing[5]; ++x.mCasing;}, + ofSolidCasing(5) + ), + onElementPass( + x -> {++x.checkCasing[6]; ++x.mCasing;}, + ofSolidCasing(6) + ), + onElementPass( + x -> {++x.checkCasing[7]; ++x.mCasing;}, + ofSolidCasing(7) + ) + ) + ) + .addElement( + 'X', + ofChain( + onElementPass( + x -> {++x.checkCasing[0]; ++x.mCasing;}, + ofSolidCasing(0) + ), + onElementPass( + x -> {++x.checkCasing[1]; ++x.mCasing;}, + ofSolidCasing(1) + ), + onElementPass( + x -> {++x.checkCasing[2]; ++x.mCasing;}, + ofSolidCasing(2) + ), + onElementPass( + x -> {++x.checkCasing[3]; ++x.mCasing;}, + ofSolidCasing(3) + ), + onElementPass( + x -> {++x.checkCasing[4]; ++x.mCasing;}, + ofSolidCasing(4) + ), + onElementPass( + x -> {++x.checkCasing[5]; ++x.mCasing;}, + ofSolidCasing(5) + ), + onElementPass( + x -> {++x.checkCasing[6]; ++x.mCasing;}, + ofSolidCasing(6) + ), + onElementPass( + x -> {++x.checkCasing[7]; ++x.mCasing;}, + ofSolidCasing(7) + ) + ) + ) + .addElement( + 'M', + addTieredBlock( + GregTech_API.sBlockCasings1, GregtechMTE_ElementalDuplicator::setMachineMeta, GregtechMTE_ElementalDuplicator::getMachineMeta, 10 + ) + ) + .addElement( + 'H', + addTieredBlock( + GregTech_API.sBlockCasings5, GregtechMTE_ElementalDuplicator::setCoilMeta, GregtechMTE_ElementalDuplicator::getCoilMeta, 11 + ) + ) + .addElement( + 'P', + addTieredBlock( + GregTech_API.sBlockCasings2, GregtechMTE_ElementalDuplicator::setPipeMeta, GregtechMTE_ElementalDuplicator::getPipeMeta, 12, 16 + ) + ) + .build(); + } + return STRUCTURE_DEFINITION; + } + + public static IStructureElement ofSolidCasing(int aIndex) { + return new IStructureElement() { + @Override + public boolean check(T t, World world, int x, int y, int z) { + Block block = world.getBlock(x, y, z); + int meta = world.getBlockMetadata(x, y, z); + Block target = mTieredBlockRegistry.get(aIndex).getValue_1(); + int targetMeta = mTieredBlockRegistry.get(aIndex).getValue_2(); + return target.equals(block) && meta == targetMeta; + } + + int getIndex(int size) { + if (size > 8) size = 8; + return size - 1; + } + + @Override + public boolean spawnHint(T t, World world, int x, int y, int z, ItemStack trigger) { + StructureLibAPI.hintParticle(world, x, y, z, mTieredBlockRegistry.get(getIndex(trigger.stackSize)).getValue_1(), mTieredBlockRegistry.get(getIndex(trigger.stackSize)).getValue_2()); + return true; + } + + @Override + public boolean placeBlock(T t, World world, int x, int y, int z, ItemStack trigger) { + return world.setBlock(x, y, z, mTieredBlockRegistry.get(getIndex(trigger.stackSize)).getValue_1(), mTieredBlockRegistry.get(getIndex(trigger.stackSize)).getValue_2(), 3); + } }; } + @Override + public void construct(ItemStack stackSize, boolean hintsOnly) { + buildPiece(mName , stackSize, hintsOnly, 3, 6, 0); + } + + @Override + public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) { + mCasing = 0; + for (int i = 0; i < 8; i++) { + checkCasing[i] = 0; + } + checkCoil = 0; + checkPipe = 0; + checkMachine = 0; + mSolidCasingTier = 0; + mMachineCasingTier = 0; + mPipeCasingTier = 0; + mCoilTier = 0; + mReplicatorDataOrbHatches.clear(); + if (checkPiece(mName, 3, 6, 0) && mCasing >= 80) { + for (int i = 0; i < 8; i++) { + if (checkCasing[i] == mCasing) { + mSolidCasingTier = i; + } + else if (checkCasing[i] > 0) + return false; + } + mMachineCasingTier = checkMachine - 1; + mPipeCasingTier = checkPipe - 12; + mCoilTier = coilTier(checkCoil - 1); + updateHatchTexture(); + return mMachineCasingTier >= maxTierOfHatch; + } + return false; + } + + public void updateHatchTexture() { + for (GT_MetaTileEntity_Hatch h : mReplicatorDataOrbHatches) h.updateTexture(getCasingTextureID()); + for (GT_MetaTileEntity_Hatch h : mInputBusses) h.updateTexture(getCasingTextureID()); + for (GT_MetaTileEntity_Hatch h : mMaintenanceHatches) h.updateTexture(getCasingTextureID()); + for (GT_MetaTileEntity_Hatch h : mEnergyHatches) h.updateTexture(getCasingTextureID()); + for (GT_MetaTileEntity_Hatch h : mOutputBusses) h.updateTexture(getCasingTextureID()); + for (GT_MetaTileEntity_Hatch h : mInputHatches) h.updateTexture(getCasingTextureID()); + for (GT_MetaTileEntity_Hatch h : mOutputHatches) h.updateTexture(getCasingTextureID()); + } + + public final boolean addChemicalPlantList(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) { + if (aTileEntity == null) { + return false; + } else { + IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity(); + if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_ElementalDataOrbHolder){ + return addToMachineList(aTileEntity, aBaseCasingIndex); + } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_InputBus){ + maxTierOfHatch = Math.max(maxTierOfHatch, ((GT_MetaTileEntity_Hatch_InputBus) aMetaTileEntity).mTier); + return addToMachineList(aTileEntity, aBaseCasingIndex); + } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Maintenance){ + return addToMachineList(aTileEntity, aBaseCasingIndex); + } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Energy){ + maxTierOfHatch = Math.max(maxTierOfHatch, ((GT_MetaTileEntity_Hatch_Energy) aMetaTileEntity).mTier); + return addToMachineList(aTileEntity, aBaseCasingIndex); + } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_OutputBus) { + maxTierOfHatch = Math.max(maxTierOfHatch, ((GT_MetaTileEntity_Hatch_OutputBus) aMetaTileEntity).mTier); + return addToMachineList(aTileEntity, aBaseCasingIndex); + } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Input) { + maxTierOfHatch = Math.max(maxTierOfHatch, ((GT_MetaTileEntity_Hatch_Input) aMetaTileEntity).mTier); + return addToMachineList(aTileEntity, aBaseCasingIndex); + } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Output) { + maxTierOfHatch = Math.max(maxTierOfHatch, ((GT_MetaTileEntity_Hatch_Output) aMetaTileEntity).mTier); + return addToMachineList(aTileEntity, aBaseCasingIndex); + } + } + return false; + } + @Override public String getSound() { return GregTech_API.sSoundList.get(Integer.valueOf(207)); @@ -140,20 +420,18 @@ public class GregtechMTE_ElementalDuplicator extends GregtechMeta_MultiBlockBase @Override public GT_Recipe.GT_Recipe_Map getRecipeMap() { + if (GTPP_Recipe.GTPP_Recipe_Map.sChemicalPlant_GT.mRecipeList.size() == 0) { + generateRecipes(); + } return GTPP_Recipe.GTPP_Recipe_Map.sChemicalPlant_GT; } public static void generateRecipes() { - for (GTPP_Recipe i : GTPP_Recipe.GTPP_Recipe_Map.sChemicalPlantRecipes.mRecipeList) { + for (GT_Recipe i : GTPP_Recipe.GTPP_Recipe_Map.sChemicalPlantRecipes.mRecipeList) { GTPP_Recipe.GTPP_Recipe_Map.sChemicalPlant_GT.add(i); } } - @Override - public boolean isFacingValid(final byte aFacing) { - return aFacing > 1; - } - @Override public int getMaxParallelRecipes() { return 2 * getPipeCasingTier(); @@ -171,12 +449,10 @@ public class GregtechMTE_ElementalDuplicator extends GregtechMeta_MultiBlockBase private int getMachineCasingTier() { return mMachineCasingTier; } + private int getPipeCasingTier() { return mPipeCasingTier; } - private int getCoilTier() { - return mCoilTier; - } private int getCasingTextureID() { // Check the Tier Client Side @@ -192,15 +468,15 @@ public class GregtechMTE_ElementalDuplicator extends GregtechMeta_MultiBlockBase GT_MetaTileEntity_TieredMachineBlock aMachineBlock = (GT_MetaTileEntity_TieredMachineBlock) aMetaTileEntity; int aTileTier = aMachineBlock.mTier; if (aTileTier > aMaxTier) { - Logger.INFO("Hatch tier too high."); + log("Hatch tier too high."); return false; } - else { + else { return addToMachineList(aTileEntity, getCasingTextureID()); } } else { - Logger.INFO("Bad Tile Entity being added to hatch map."); // Shouldn't ever happen, but.. ya know.. + log("Bad Tile Entity being added to hatch map."); // Shouldn't ever happen, but.. ya know.. return false; } } @@ -223,368 +499,6 @@ public class GregtechMTE_ElementalDuplicator extends GregtechMeta_MultiBlockBase mCoilTier = aNBT.getInteger("mCoilTier"); } - private static boolean isBlockSolidCasing(int aCurrentTier, Block aBlock, int aMeta) { - if (aBlock == null || (aMeta < 0 || aMeta > 16)) { - return false; - } - Block aTieredCasing = ModBlocks.blockCasings5Misc; - int aTieredMeta = 3; - if (aBlock == aTieredCasing && aMeta == aTieredMeta) { - return true; - } - return false; - } - private static boolean isBlockMachineCasing(Block aBlock, int aMeta) { - Block aCasingBlock1 = GregTech_API.sBlockCasings1; - if (aBlock == aCasingBlock1) { - if (aMeta > 9 || aMeta < 0) { - return false; - } - else { - return true; - } - } - else { - return false; - } - } - private static boolean isBlockPipeCasing(Block aBlock, int aMeta) { - Block aCasingBlock2 = GregTech_API.sBlockCasings2; - if (aBlock == aCasingBlock2) { - int aMetaBronzePipeCasing = 12; - //int aMetaSteelPipeCasing = 13; - //int aMetaTitaniumPipeCasing = 14; - int aMetaTungstenPipeCasing = 15; - if (aMeta > aMetaTungstenPipeCasing || aMeta < aMetaBronzePipeCasing) { - return false; - } - else { - return true; - } - } - else { - return false; - } - } - - private static AutoMap mValidCoilMetaCache; - - private static boolean isBlockCoil(Block aBlock, int aMeta) { - Block aCasingBlock; - if (CORE.MAIN_GREGTECH_5U_EXPERIMENTAL_FORK) { - aCasingBlock = StaticFields59.getBlockCasings5(); - } - else { - aCasingBlock = GregTech_API.sBlockCasings1; - } - // Cache the meta values for later - if (mValidCoilMetaCache == null || mValidCoilMetaCache.isEmpty()) { - AutoMap aValidCoilMeta = new AutoMap(); - // Only use the right meta values available. - if (CORE.MAIN_GREGTECH_5U_EXPERIMENTAL_FORK) { - aValidCoilMeta = Meta_GT_Proxy.GT_ValidHeatingCoilMetas; - } - else { - aValidCoilMeta.put(12); - aValidCoilMeta.put(13); - aValidCoilMeta.put(14); - } - mValidCoilMetaCache = aValidCoilMeta; - } - if (aBlock == aCasingBlock) { - for (int i: mValidCoilMetaCache.values()) { - if (i == aMeta) { - return true; - } - } - } - return false; - } - - - @Override - public boolean checkMultiblock(final IGregTechTileEntity aBaseMetaTileEntity, final ItemStack aStack) { - - int xDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX * 3; - int zDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetZ * 3; - - Logger.INFO("Checking ChemPlant Structure"); - - // Require Air above controller - boolean aAirCheck = aBaseMetaTileEntity.getAirOffset(0, 1, 0); - - if (!aAirCheck) { - Logger.INFO("No Air Above Controller"); - return false; - } else { - - //String aName = aInitStructureCheck != null ? ItemUtils.getLocalizedNameOfBlock(aInitStructureCheck, aInitStructureCheckMeta) : "Air"; - - mSolidCasingTier = getSolidCasingTierCheck(aBaseMetaTileEntity, xDir, zDir); - mMachineCasingTier = getMachineCasingTierCheck(aBaseMetaTileEntity, xDir, zDir); - - Logger.INFO("Initial Casing Check Complete, Solid Casing Tier: "+mSolidCasingTier+", Machine Casing Tier: "+mMachineCasingTier); - - int aSolidCasingCount = 0; - int aMachineCasingCount = 0; - int aPipeCount = 0; - int aCoilCount = 0; - - aSolidCasingCount = checkSolidCasings(aBaseMetaTileEntity, aStack, xDir, zDir); - aMachineCasingCount = checkMachineCasings(aBaseMetaTileEntity, aStack, xDir, zDir); - aPipeCount = checkPipes(aBaseMetaTileEntity, aStack, xDir, zDir); - aCoilCount = checkCoils(aBaseMetaTileEntity, aStack, xDir, zDir); - - Logger.INFO("Casing Counts: "); - Logger.INFO("Solid: "+aSolidCasingCount+", Machine: "+aMachineCasingCount); - Logger.INFO("Pipe: "+aPipeCount+", Coil: "+aCoilCount); - - - Logger.INFO("Casing Tiers: "); - Logger.INFO("Solid: "+getSolidCasingTier()+", Machine: "+getMachineCasingTier()); - Logger.INFO("Pipe: "+getPipeCasingTier()+", Coil: "+getCoilTier()); - - // Attempt to sync fields here, so that it updates client side values. - aBaseMetaTileEntity.getWorld().markBlockForUpdate(aBaseMetaTileEntity.getXCoord(), aBaseMetaTileEntity.getYCoord(), aBaseMetaTileEntity.getZCoord()); - - - - // Minimum 80/93 Solid Casings - if (aSolidCasingCount < 80) { - Logger.INFO("Not enough solid casings. Found "+aSolidCasingCount+", require: 80."); - return false; - } - if (aMachineCasingCount != 57) { - Logger.INFO("Not enough machine casings. Found "+aMachineCasingCount+", require: 57."); - return false; - } - if (aPipeCount != 18) { - Logger.INFO("Not enough pipe casings. Found "+aPipeCount+", require: 18."); - return false; - } - if (aCoilCount != 27) { - Logger.INFO("Not enough coils. Found "+aCoilCount+", require: 27."); - return false; - } - - Logger.INFO("Structure Check Complete!"); - - return true; - } - } - - - public int checkCoils(final IGregTechTileEntity aBaseMetaTileEntity, final ItemStack aStack, int aOffsetX, int aOffsetZ) { - int tAmount = 0; - int aCurrentCoilMeta = -1; - for (int i = -1; i < 2; i++) { - for (int j = -1; j < 2; j++) { - for (int h = 0; h < 8; h++) { - if (h == 1 || h == 3 || h == 5) { - Block aBlock = aBaseMetaTileEntity.getBlockOffset(aOffsetX + i, h, aOffsetZ + j); - int aMeta = aBaseMetaTileEntity.getMetaIDOffset(aOffsetX + i, h, aOffsetZ + j); - if (isBlockCoil(aBlock, aMeta)) { - if (aCurrentCoilMeta < 0) { - aCurrentCoilMeta = aMeta; - } - if (aCurrentCoilMeta != aMeta) { - return tAmount; - } - else { - tAmount++; - } - } - } - } - } - } - - if (CORE.MAIN_GREGTECH_5U_EXPERIMENTAL_FORK) { - this.mCoilTier = (aCurrentCoilMeta+1); - } - else { - if (aCurrentCoilMeta == 12) { - this.mCoilTier = 1; - } - else if (aCurrentCoilMeta == 13) { - this.mCoilTier = 2; - } - else if (aCurrentCoilMeta == 14) { - this.mCoilTier = 3; - } - else { - this.mCoilTier = 0; - } - } - - return tAmount; - } - - - public int checkPipes(final IGregTechTileEntity aBaseMetaTileEntity, final ItemStack aStack, int aOffsetX, int aOffsetZ) { - int tAmount = 0; - int aCurrentPipeMeta = -1; - for (int i = -1; i < 2; i++) { - for (int j = -1; j < 2; j++) { - for (int h = 0; h < 8; h++) { - if (h == 2 || h == 4) { - Block aBlock = aBaseMetaTileEntity.getBlockOffset(aOffsetX + i, h, aOffsetZ + j); - int aMeta = aBaseMetaTileEntity.getMetaIDOffset(aOffsetX + i, h, aOffsetZ + j); - if (isBlockPipeCasing(aBlock, aMeta)) { - if (aCurrentPipeMeta < 0) { - aCurrentPipeMeta = aMeta; - } - if (aCurrentPipeMeta != aMeta) { - return tAmount; - } - else { - tAmount++; - } - } - } - } - } - } - - if (aCurrentPipeMeta == 12) { - this.mPipeCasingTier = 1; - } - else if (aCurrentPipeMeta == 13) { - this.mPipeCasingTier = 2; - } - else if (aCurrentPipeMeta == 14) { - this.mPipeCasingTier = 3; - } - else if (aCurrentPipeMeta == 15) { - this.mPipeCasingTier = 4; - } - else { - this.mPipeCasingTier = 0; - } - - return tAmount; - } - - - public int checkSolidCasings(final IGregTechTileEntity aBaseMetaTileEntity, final ItemStack aStack, int aOffsetX, int aOffsetZ) { - - int tAmount = 0; - - // Only check a 7x7 - for (int i = -3; i < 4; i++) { - for (int j = -3; j < 4; j++) { - // If we are on the 7x7 ring, proceed - IGregTechTileEntity aTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(aOffsetX + i, 0, aOffsetZ + j); - Block aBlock = aBaseMetaTileEntity.getBlockOffset(aOffsetX + i, 0, aOffsetZ + j); - int aMeta = aBaseMetaTileEntity.getMetaIDOffset(aOffsetX + i, 0, aOffsetZ + j); - - if (aTileEntity != null) { - - if (this.addToMachineList(aTileEntity)) { - tAmount++; - } - else { - if (aTileEntity != null) { - Logger.INFO("Adding "+aTileEntity.getInventoryName()); - } - final IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity(); - if (aMetaTileEntity == null) { - Logger.INFO("Error counting Bottom Layer Casing Ring. Bad Tile Entity. Found "+aTileEntity.getInventoryName()); - return tAmount; - } - //Handle controller - if (aMetaTileEntity instanceof GregtechMTE_ElementalDuplicator) { - continue; - } - else { - Logger.INFO("Error counting Bottom Layer Casing Ring. Bad Tile Entity. Found "+aMetaTileEntity.getInventoryName()); - return tAmount; - } - } - } - else { - if (isBlockSolidCasing(mSolidCasingTier, aBlock, aMeta)) { - tAmount++; - } - else { - Logger.INFO("Error counting Bottom Layer Casing Ring. Found "+aBlock.getLocalizedName()+":"+aMeta); - return tAmount; - } - } - - } - } - - return tAmount; - } - - - public int checkMachineCasings(final IGregTechTileEntity aBaseMetaTileEntity, final ItemStack aStack, int aOffsetX, int aOffsetZ) { - int tAmount = 0; - int aHeight = 0; - // Iterate once for each layer - for (int aIteration=0;aIteration<3;aIteration++) { - // Dynamically set height - aHeight = (aIteration == 0 ? 0 : aIteration == 1 ? 1 : 5); - // Only check a 5x5 area - for (int i = -2; i < 3; i++) { - for (int j = -2; j < 3; j++) { - // If we are on the 5x5 ring, proceed - if (i == -2 || i == 2 || j == -2 || j == 2) { - // If the second axis is on the outer ring, continue - if (i < -2 || i > 2 || j < -2 || j > 2) { - continue; - } - Block aBlock = aBaseMetaTileEntity.getBlockOffset(aOffsetX + i, aHeight, aOffsetZ + j); - int aMeta = aBaseMetaTileEntity.getMetaIDOffset(aOffsetX + i, aHeight, aOffsetZ + j); - if (isBlockMachineCasing(aBlock, aMeta)) { - tAmount++; - } - else { - return tAmount; - } - } - } - } - } - - // Check bottom layer inner 3x3 - for (int i = -1; i < 2; i++) { - for (int j = -1; j < 2; j++) { - Block aBlock = aBaseMetaTileEntity.getBlockOffset(aOffsetX + i, 0, aOffsetZ + j); - int aMeta = aBaseMetaTileEntity.getMetaIDOffset(aOffsetX + i, 0, aOffsetZ + j); - if (isBlockMachineCasing(aBlock, aMeta)) { - tAmount++; - } - else { - return tAmount; - } - } - } - - return tAmount; - } - - public int getSolidCasingTierCheck(IGregTechTileEntity aBaseMetaTileEntity, int xDir, int zDir) { - Block aInitStructureCheck; - int aInitStructureCheckMeta; - if (xDir == 0) { - aInitStructureCheck = aBaseMetaTileEntity.getBlockOffset(zDir, 1, 0); - aInitStructureCheckMeta = aBaseMetaTileEntity.getMetaIDOffset(zDir, 1, 0); - } - else { - aInitStructureCheck = aBaseMetaTileEntity.getBlockOffset(0, 1, xDir); - aInitStructureCheckMeta = aBaseMetaTileEntity.getMetaIDOffset(0, 1, xDir); - } - for (int aTier : mTieredBlockRegistry.keySet()) { - Triplet aData = mTieredBlockRegistry.get(aTier); - if (aData.getValue_1() == aInitStructureCheck && aData.getValue_2() == aInitStructureCheckMeta) { - return aTier; - } - } - return 0; - } - @Override public boolean addToMachineList(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) { final IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity(); @@ -593,16 +507,12 @@ public class GregtechMTE_ElementalDuplicator extends GregtechMeta_MultiBlockBase } if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_ElementalDataOrbHolder) { log("Found GT_MetaTileEntity_Hatch_ElementalDataOrbHolder"); - return addToMachineListInternal(mDataHolders, aMetaTileEntity, aBaseCasingIndex); + ((GT_MetaTileEntity_Hatch_ElementalDataOrbHolder) aTileEntity).mRecipeMap = getRecipeMap(); + return addToMachineListInternal(mReplicatorDataOrbHatches, aMetaTileEntity, aBaseCasingIndex); } return super.addToMachineList(aTileEntity, aBaseCasingIndex); } - public int getMachineCasingTierCheck(IGregTechTileEntity aBaseMetaTileEntity, int xDir, int zDir) { - return 10; - } - - @Override public int getMaxEfficiency(final ItemStack aStack) { return 10000; @@ -610,7 +520,7 @@ public class GregtechMTE_ElementalDuplicator extends GregtechMeta_MultiBlockBase @Override public int getPollutionPerTick(final ItemStack aStack) { - return 0; + return 100; } @Override @@ -633,24 +543,13 @@ public class GregtechMTE_ElementalDuplicator extends GregtechMeta_MultiBlockBase return 50 * (this.mCoilTier - 2); } - public int getMaxCatalystDurability() { - return 50; - } - @Override public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { if (aBaseMetaTileEntity.isServerSide()) { if (this.mUpdate == 1 || this.mStartUpCheck == 1) { - this.mDataHolders.clear(); + this.mReplicatorDataOrbHatches.clear(); } } - // Silly Client Syncing - if (aBaseMetaTileEntity.isClientSide()) { - if (this != null && this.getBaseMetaTileEntity() != null && this.getBaseMetaTileEntity().getWorld() != null) { - this.mSolidCasingTier = getCasingTierOnClientSide(); - markDirty(); - } - } super.onPostTick(aBaseMetaTileEntity, aTick); } @@ -669,7 +568,7 @@ public class GregtechMTE_ElementalDuplicator extends GregtechMeta_MultiBlockBase public boolean checkRecipeGeneric( ItemStack[] aItemInputs, FluidStack[] aFluidInputs, int aMaxParallelRecipes, int aEUPercent, - int aSpeedBonusPercent, int aOutputChanceRoll, GT_Recipe aRecipe) { + int aSpeedBonusPercent, int aOutputChanceRoll, GT_Recipe aRecipe, boolean isOC) { // Based on the Processing Array. A bit overkill, but very flexible. @@ -684,34 +583,43 @@ public class GregtechMTE_ElementalDuplicator extends GregtechMeta_MultiBlockBase long tEnergy = getMaxInputEnergy(); log("Running checkRecipeGeneric(0)"); + //GT_Recipe tRecipe = findRecipe(getBaseMetaTileEntity(), mLastRecipe, false, gregtech.api.enums.GT_Values.V[tTier], aFluidInputs, aItemInputs); + GT_Recipe tRecipe = findRecipe(mLastRecipe, gregtech.api.enums.GT_Values.V[tTier], getSolidCasingTier(), aItemInputs, aFluidInputs); + + + + + if (tRecipe == null) { + log("BAD RETURN - 1"); + return false; + } + // checks if it has a catalyst with enough durability ItemStack tCatalystRecipe = findCatalyst(aItemInputs); - if (tCatalystRecipe == null) { - log("does not have catalyst"); - return false; + boolean aDoesRecipeNeedCatalyst = false; + for (ItemStack aInputItem : tRecipe.mInputs) { + if (ItemUtils.isCatalyst(aInputItem)) { + aDoesRecipeNeedCatalyst = true; + break; + } + } + if (aDoesRecipeNeedCatalyst) { + if (tCatalystRecipe == null) { + log("does not have catalyst"); + return false; + } } - - GT_Recipe tRecipe = findRecipe( - getBaseMetaTileEntity(), mLastRecipe, false, - gregtech.api.enums.GT_Values.V[tTier], aFluidInputs, aItemInputs); log("Running checkRecipeGeneric(1)"); // Remember last recipe - an optimization for findRecipe() this.mLastRecipe = tRecipe; - - if (tRecipe == null) { - log("BAD RETURN - 1"); - return false; - } - if (tRecipe.mSpecialValue > this.mSolidCasingTier) { log("solid tier is too low"); return false; } - aMaxParallelRecipes = this.canBufferOutputs(tRecipe, aMaxParallelRecipes); if (aMaxParallelRecipes == 0) { log("BAD RETURN - 2"); @@ -847,12 +755,6 @@ public class GregtechMTE_ElementalDuplicator extends GregtechMeta_MultiBlockBase } tOutputItems = tSList.toArray(new ItemStack[tSList.size()]); - // Damage catalyst once all is said and done. - if (tCatalystRecipe != null) { - log("damaging catalyst"); - damageCatalyst(tCatalystRecipe, parallelRecipes); - } - // Commit outputs this.mOutputItems = tOutputItems; this.mOutputFluids = tOutputFluids; @@ -865,129 +767,173 @@ public class GregtechMTE_ElementalDuplicator extends GregtechMeta_MultiBlockBase return true; } - private int getCatalysts(ItemStack[] aItemInputs, ItemStack aRecipeCatalyst, int aMaxParrallel, ArrayList aOutPut) { - int allowedParrallel = 0; - for (final ItemStack aInput : aItemInputs) { - if (aRecipeCatalyst.isItemEqual(aInput)) { - int aDurabilityRemaining = getMaxCatalystDurability() - getDamage(aInput); - return Math.min(aMaxParrallel, aDurabilityRemaining); + private static final HashMap> mTieredRecipeMap = new HashMap>(); + private static final AutoMap aTier0Recipes = new AutoMap(); + private static final AutoMap aTier1Recipes = new AutoMap(); + private static final AutoMap aTier2Recipes = new AutoMap(); + private static final AutoMap aTier3Recipes = new AutoMap(); + private static final AutoMap aTier4Recipes = new AutoMap(); + private static final AutoMap aTier5Recipes = new AutoMap(); + private static final AutoMap aTier6Recipes = new AutoMap(); + private static final AutoMap aTier7Recipes = new AutoMap(); + private static boolean mInitRecipeCache = false; + + private static void initRecipeCaches() { + if (!mInitRecipeCache) { + mTieredRecipeMap.put((long) 0, aTier0Recipes); + mTieredRecipeMap.put((long) 1, aTier1Recipes); + mTieredRecipeMap.put((long) 2, aTier2Recipes); + mTieredRecipeMap.put((long) 3, aTier3Recipes); + mTieredRecipeMap.put((long) 4, aTier4Recipes); + mTieredRecipeMap.put((long) 5, aTier5Recipes); + mTieredRecipeMap.put((long) 6, aTier6Recipes); + mTieredRecipeMap.put((long) 7, aTier7Recipes); + for (GT_Recipe aRecipe : GTPP_Recipe.GTPP_Recipe_Map.sChemicalPlant_GT.mRecipeList) { + if (aRecipe != null) { + switch (aRecipe.mSpecialValue) { + case 0: + aTier0Recipes.add(aRecipe); + continue; + case 1: + aTier1Recipes.add(aRecipe); + continue; + case 2: + aTier2Recipes.add(aRecipe); + continue; + case 3: + aTier3Recipes.add(aRecipe); + continue; + case 4: + aTier4Recipes.add(aRecipe); + continue; + case 5: + aTier5Recipes.add(aRecipe); + continue; + case 6: + aTier6Recipes.add(aRecipe); + continue; + case 7: + aTier7Recipes.add(aRecipe); + continue; + } + } } - } - return allowedParrallel; - } - - private ItemStack findCatalyst(ItemStack[] aItemInputs) { - if (aItemInputs != null) { - for (final ItemStack aInput : aItemInputs) { - if (aInput != null) { - if (ItemUtils.isCatalyst(aInput)) { - return aInput; + mInitRecipeCache = true; + } + } + + private static boolean areInputsEqual(GT_Recipe aComparator, ItemStack[] aInputs, FluidStack[] aFluids) { + int aInputCount = aComparator.mInputs.length; + if (aInputCount > 0) { + //Logger.INFO("Looking for recipe with "+aInputCount+" Items"); + int aMatchingInputs = 0; + recipe : for (ItemStack a : aComparator.mInputs) { + for (ItemStack b : aInputs) { + if (a.getItem() == b.getItem()) { + if (a.getItemDamage() == b.getItemDamage()) { + //Logger.INFO("Found matching Item Input - "+b.getUnlocalizedName()); + aMatchingInputs++; + continue recipe; + } } } } + if (aMatchingInputs != aInputCount) { + return false; + } } - return null; - } - - - private void damageCatalyst(ItemStack aStack, int parallelRecipes) { - for (int i=0; i= getMaxCatalystDurability()) { - log("consume catalyst"); - addOutput(CI.getEmptyCatalyst(1)); - aStack = null; - } - else { - log("damaging catalyst"); - setDamage(aStack, damage); + int aFluidInputCount = aComparator.mFluidInputs.length; + if (aFluidInputCount > 0) { + //Logger.INFO("Looking for recipe with "+aFluidInputCount+" Fluids"); + int aMatchingFluidInputs = 0; + recipe : for (FluidStack b : aComparator.mFluidInputs) { + //Logger.INFO("Checking for fluid "+b.getLocalizedName()); + for (FluidStack a : aFluids) { + if (GT_Utility.areFluidsEqual(a, b)) { + //Logger.INFO("Found matching Fluid Input - "+b.getLocalizedName()); + aMatchingFluidInputs++; + continue recipe; + } + else { + //Logger.INFO("Found fluid which did not match - "+a.getLocalizedName()); + } } - } - else { - log("not consuming catalyst"); + } + if (aMatchingFluidInputs != aFluidInputCount) { + return false; } } - - - - } - - private int getDamage(ItemStack aStack) { - return ItemGenericChemBase.getCatalystDamage(aStack); - } - - private void setDamage(ItemStack aStack,int aAmount) { - ItemGenericChemBase.setCatalystDamage(aStack, aAmount); + Logger.INFO("Recipes Match!"); + return true; } - - - @SideOnly(Side.CLIENT) - private final int getCasingTierOnClientSide() { - - if (this == null || this.getBaseMetaTileEntity().getWorld() == null) { - return 0; + public GT_Recipe findRecipe(final GT_Recipe aRecipe, final long aVoltage, final long aSpecialValue, ItemStack[] aInputs, final FluidStack[] aFluids) { + if (!mInitRecipeCache) { + initRecipeCaches(); + } + if (this.getRecipeMap().mRecipeList.isEmpty()) { + log("No Recipes in Map to search through."); + return null; } - try { - Block aInitStructureCheck; - int aInitStructureCheckMeta; - IGregTechTileEntity aBaseMetaTileEntity = this.getBaseMetaTileEntity(); - int xDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX * 3; - int zDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetZ * 3; - if (xDir == 0) { - aInitStructureCheck = aBaseMetaTileEntity.getBlockOffset(zDir, 1, 0); - aInitStructureCheckMeta = aBaseMetaTileEntity.getMetaIDOffset(zDir, 1, 0); + else { + log("Checking tier "+aSpecialValue+" recipes and below. Using Input Voltage of "+aVoltage+"V."); + log("We have "+aInputs.length+" Items and "+aFluids.length+" Fluids."); + // Try check the cached recipe first + if (aRecipe != null) { + if (areInputsEqual(aRecipe, aInputs, aFluids)) { + if (aRecipe.mEUt <= aVoltage) { + Logger.INFO("Using cached recipe."); + return aRecipe; + } + } } - else { - aInitStructureCheck = aBaseMetaTileEntity.getBlockOffset(0, 1, xDir); - aInitStructureCheckMeta = aBaseMetaTileEntity.getMetaIDOffset(0, 1, xDir); + + // Get all recipes for the tier + AutoMap> aMasterMap = new AutoMap>(); + for (long i=0;i<=aSpecialValue;i++) { + aMasterMap.add(mTieredRecipeMap.get(i)); } - for (int aTier : mTieredBlockRegistry.keySet()) { - Triplet aData = mTieredBlockRegistry.get(aTier); - if (aData.getValue_1() == aInitStructureCheck && aData.getValue_2() == aInitStructureCheckMeta) { - return aTier; - } + GT_Recipe aFoundRecipe = null; + + // Iterate the tiers recipes until we find the one with all inputs matching + master : for (AutoMap aTieredMap : aMasterMap) { + for (GT_Recipe aRecipeToCheck : aTieredMap) { + if (areInputsEqual(aRecipeToCheck, aInputs, aFluids)) { + log("Found recipe with matching inputs!"); + if (aRecipeToCheck.mSpecialValue <= aSpecialValue) { + if (aRecipeToCheck.mEUt <= aVoltage) { + aFoundRecipe = aRecipeToCheck; + break master; + } + } + } + } } - return 0; - } - catch (Throwable t) { - t.printStackTrace(); - return 0; - } + // If we found a recipe, return it + if (aFoundRecipe != null) { + log("Found valid recipe."); + return aFoundRecipe; + } + } + log("Did not find valid recipe."); + return null; } - - - */ -/* + /* * Catalyst Handling - *//* - - + */ - @Override - public ArrayList getStoredInputs() { + public ArrayList getStoredInputs() { ArrayList tItems = super.getStoredInputs(); - for (GT_MetaTileEntity_Hatch_ElementalDataOrbHolder tHatch : mDataHolders) { - tHatch.mRecipeMap = getRecipeMap(); - if (isValidMetaTileEntity(tHatch)) { - ArrayList aTempList = new ArrayList(); - for (ItemStack s : tHatch.mInventory) { - aTempList.add(s); - } - tItems.addAll(aTempList); - } - } + for (GT_MetaTileEntity_Hatch_ElementalDataOrbHolder tHatch : mReplicatorDataOrbHatches) { + tHatch.mRecipeMap = getRecipeMap(); + if (isValidMetaTileEntity(tHatch)) { + tItems.addAll(tHatch.getInventory()); + } + } return tItems; } - - - - } -*/ diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMTE_FrothFlotationCell.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMTE_FrothFlotationCell.java index 35502d1064..fb442d294f 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMTE_FrothFlotationCell.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMTE_FrothFlotationCell.java @@ -173,20 +173,15 @@ public class GregtechMTE_FrothFlotationCell extends GregtechMeta_MultiBlockBase } else { IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity(); if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_InputBus){ - ((GT_MetaTileEntity_Hatch)aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mInputBusses.add((GT_MetaTileEntity_Hatch_InputBus)aMetaTileEntity); + return addToMachineList(aTileEntity, aBaseCasingIndex); } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Maintenance){ - ((GT_MetaTileEntity_Hatch)aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mMaintenanceHatches.add((GT_MetaTileEntity_Hatch_Maintenance)aMetaTileEntity); + return addToMachineList(aTileEntity, aBaseCasingIndex); } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Energy){ - ((GT_MetaTileEntity_Hatch)aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mEnergyHatches.add((GT_MetaTileEntity_Hatch_Energy)aMetaTileEntity); + return addToMachineList(aTileEntity, aBaseCasingIndex); } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Input) { - ((GT_MetaTileEntity_Hatch) aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mInputHatches.add((GT_MetaTileEntity_Hatch_Input) aMetaTileEntity); + return addToMachineList(aTileEntity, aBaseCasingIndex); } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Output) { - ((GT_MetaTileEntity_Hatch) aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mOutputHatches.add((GT_MetaTileEntity_Hatch_Output) aMetaTileEntity); + return addToMachineList(aTileEntity, aBaseCasingIndex); } } return false; diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMTE_NuclearReactor.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMTE_NuclearReactor.java index 3b3b6998ef..7fa1b41efd 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMTE_NuclearReactor.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMTE_NuclearReactor.java @@ -169,17 +169,13 @@ public class GregtechMTE_NuclearReactor extends GregtechMeta_MultiBlockBase { } else { IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity(); if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Maintenance){ - ((GT_MetaTileEntity_Hatch)aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mMaintenanceHatches.add((GT_MetaTileEntity_Hatch_Maintenance)aMetaTileEntity); + return addToMachineList(aTileEntity, aBaseCasingIndex); } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Dynamo && (((GT_MetaTileEntity_Hatch_Dynamo) aMetaTileEntity).mTier >= 5 && ((GT_MetaTileEntity_Hatch_Dynamo) aMetaTileEntity).mTier <= 6)){ - ((GT_MetaTileEntity_Hatch)aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mDynamoHatches.add((GT_MetaTileEntity_Hatch_Dynamo)aMetaTileEntity); + return addToMachineList(aTileEntity, aBaseCasingIndex); } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Input && ((GT_MetaTileEntity_Hatch_Input) aMetaTileEntity).mTier >= 5) { - ((GT_MetaTileEntity_Hatch) aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mInputHatches.add((GT_MetaTileEntity_Hatch_Input) aMetaTileEntity); + return addToMachineList(aTileEntity, aBaseCasingIndex); } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Output && ((GT_MetaTileEntity_Hatch_Output) aMetaTileEntity).mTier >= 5) { - ((GT_MetaTileEntity_Hatch) aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mOutputHatches.add((GT_MetaTileEntity_Hatch_Output) aMetaTileEntity); + return addToMachineList(aTileEntity, aBaseCasingIndex); } } return false; @@ -191,8 +187,7 @@ public class GregtechMTE_NuclearReactor extends GregtechMeta_MultiBlockBase { } else { IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity(); if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Muffler && ((GT_MetaTileEntity_Hatch_Muffler) aMetaTileEntity).mTier >= 5) { - ((GT_MetaTileEntity_Hatch) aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mMufflerHatches.add((GT_MetaTileEntity_Hatch_Muffler) aMetaTileEntity); + return addToMachineList(aTileEntity, aBaseCasingIndex); } } return false; diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntityGeneratorArray.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntityGeneratorArray.java index e453689156..cccee84c99 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntityGeneratorArray.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntityGeneratorArray.java @@ -365,23 +365,17 @@ public class GregtechMetaTileEntityGeneratorArray extends GregtechMeta_MultiBloc } else { IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity(); if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_InputBus){ - ((GT_MetaTileEntity_Hatch)aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mInputBusses.add((GT_MetaTileEntity_Hatch_InputBus)aMetaTileEntity); + return addToMachineList(aTileEntity, aBaseCasingIndex); } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Maintenance){ - ((GT_MetaTileEntity_Hatch)aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mMaintenanceHatches.add((GT_MetaTileEntity_Hatch_Maintenance)aMetaTileEntity); + return addToMachineList(aTileEntity, aBaseCasingIndex); } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Dynamo){ - ((GT_MetaTileEntity_Hatch)aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mDynamoHatches.add((GT_MetaTileEntity_Hatch_Dynamo)aMetaTileEntity); + return addToMachineList(aTileEntity, aBaseCasingIndex); } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_OutputBus) { - ((GT_MetaTileEntity_Hatch) aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mOutputBusses.add((GT_MetaTileEntity_Hatch_OutputBus) aMetaTileEntity); + return addToMachineList(aTileEntity, aBaseCasingIndex); } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Input) { - ((GT_MetaTileEntity_Hatch) aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mInputHatches.add((GT_MetaTileEntity_Hatch_Input) aMetaTileEntity); + return addToMachineList(aTileEntity, aBaseCasingIndex); } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Output) { - ((GT_MetaTileEntity_Hatch) aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mOutputHatches.add((GT_MetaTileEntity_Hatch_Output) aMetaTileEntity); + return addToMachineList(aTileEntity, aBaseCasingIndex); } } return false; diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_AlloyBlastSmelter.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_AlloyBlastSmelter.java index ab736dc8c5..fb06d322fe 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_AlloyBlastSmelter.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_AlloyBlastSmelter.java @@ -137,23 +137,17 @@ extends GregtechMeta_MultiBlockBase { } else { IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity(); if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_InputBus){ - ((GT_MetaTileEntity_Hatch)aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mInputBusses.add((GT_MetaTileEntity_Hatch_InputBus)aMetaTileEntity); + return addToMachineList(aTileEntity, aBaseCasingIndex); } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Maintenance){ - ((GT_MetaTileEntity_Hatch)aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mMaintenanceHatches.add((GT_MetaTileEntity_Hatch_Maintenance)aMetaTileEntity); + return addToMachineList(aTileEntity, aBaseCasingIndex); } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Energy){ - ((GT_MetaTileEntity_Hatch)aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mEnergyHatches.add((GT_MetaTileEntity_Hatch_Energy)aMetaTileEntity); + return addToMachineList(aTileEntity, aBaseCasingIndex); } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Muffler) { - ((GT_MetaTileEntity_Hatch) aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mMufflerHatches.add((GT_MetaTileEntity_Hatch_Muffler) aMetaTileEntity); + return addToMachineList(aTileEntity, aBaseCasingIndex); } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Input) { - ((GT_MetaTileEntity_Hatch) aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mInputHatches.add((GT_MetaTileEntity_Hatch_Input) aMetaTileEntity); + return addToMachineList(aTileEntity, aBaseCasingIndex); } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Output) { - ((GT_MetaTileEntity_Hatch) aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mOutputHatches.add((GT_MetaTileEntity_Hatch_Output) aMetaTileEntity); + return addToMachineList(aTileEntity, aBaseCasingIndex); } } return false; diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_Cyclotron.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_Cyclotron.java index c916f7afa6..f1b2bf6221 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_Cyclotron.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_Cyclotron.java @@ -202,23 +202,17 @@ public class GregtechMetaTileEntity_Cyclotron extends GregtechMeta_MultiBlockBas } else { IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity(); if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_InputBus && ((GT_MetaTileEntity_Hatch_InputBus) aMetaTileEntity).mTier >= 5){ - ((GT_MetaTileEntity_Hatch)aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mInputBusses.add((GT_MetaTileEntity_Hatch_InputBus)aMetaTileEntity); + return addToMachineList(aTileEntity, aBaseCasingIndex); } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Maintenance){ - ((GT_MetaTileEntity_Hatch)aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mMaintenanceHatches.add((GT_MetaTileEntity_Hatch_Maintenance)aMetaTileEntity); + return addToMachineList(aTileEntity, aBaseCasingIndex); } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Energy && ((GT_MetaTileEntity_Hatch_Energy) aMetaTileEntity).mTier >= 5){ - ((GT_MetaTileEntity_Hatch)aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mEnergyHatches.add((GT_MetaTileEntity_Hatch_Energy)aMetaTileEntity); + return addToMachineList(aTileEntity, aBaseCasingIndex); } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_OutputBus && ((GT_MetaTileEntity_Hatch_OutputBus) aMetaTileEntity).mTier >= 5) { - ((GT_MetaTileEntity_Hatch) aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mOutputBusses.add((GT_MetaTileEntity_Hatch_OutputBus) aMetaTileEntity); + return addToMachineList(aTileEntity, aBaseCasingIndex); } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Muffler && ((GT_MetaTileEntity_Hatch_Muffler) aMetaTileEntity).mTier >= 5) { - ((GT_MetaTileEntity_Hatch) aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mMufflerHatches.add((GT_MetaTileEntity_Hatch_Muffler) aMetaTileEntity); + return addToMachineList(aTileEntity, aBaseCasingIndex); } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Input && ((GT_MetaTileEntity_Hatch_Input) aMetaTileEntity).mTier >= 5) { - ((GT_MetaTileEntity_Hatch) aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mInputHatches.add((GT_MetaTileEntity_Hatch_Input) aMetaTileEntity); + return addToMachineList(aTileEntity, aBaseCasingIndex); } } return false; diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_IndustrialFishingPond.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_IndustrialFishingPond.java index 5de1ec4247..6bec73aa20 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_IndustrialFishingPond.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_IndustrialFishingPond.java @@ -129,23 +129,17 @@ public class GregtechMetaTileEntity_IndustrialFishingPond extends GregtechMeta_M } else { IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity(); if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_InputBus){ - ((GT_MetaTileEntity_Hatch)aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mInputBusses.add((GT_MetaTileEntity_Hatch_InputBus)aMetaTileEntity); + return addToMachineList(aTileEntity, aBaseCasingIndex); } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Maintenance){ - ((GT_MetaTileEntity_Hatch)aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mMaintenanceHatches.add((GT_MetaTileEntity_Hatch_Maintenance)aMetaTileEntity); + return addToMachineList(aTileEntity, aBaseCasingIndex); } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Energy){ - ((GT_MetaTileEntity_Hatch)aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mEnergyHatches.add((GT_MetaTileEntity_Hatch_Energy)aMetaTileEntity); + return addToMachineList(aTileEntity, aBaseCasingIndex); } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_OutputBus) { - ((GT_MetaTileEntity_Hatch) aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mOutputBusses.add((GT_MetaTileEntity_Hatch_OutputBus) aMetaTileEntity); + return addToMachineList(aTileEntity, aBaseCasingIndex); } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Muffler) { - ((GT_MetaTileEntity_Hatch) aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mMufflerHatches.add((GT_MetaTileEntity_Hatch_Muffler) aMetaTileEntity); + return addToMachineList(aTileEntity, aBaseCasingIndex); } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Input) { - ((GT_MetaTileEntity_Hatch) aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mInputHatches.add((GT_MetaTileEntity_Hatch_Input) aMetaTileEntity); + return addToMachineList(aTileEntity, aBaseCasingIndex); } } return false; diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_LargeRocketEngine.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_LargeRocketEngine.java index e248c46c0e..d8c5eec439 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_LargeRocketEngine.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_LargeRocketEngine.java @@ -37,7 +37,7 @@ import static com.gtnewhorizon.structurelib.structure.StructureUtility.*; import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofBlock; import static gregtech.api.util.GT_StructureUtility.ofHatchAdder; -public class GregtechMetaTileEntity_LargeRocketEngine extends GregtechMeta_MultiBlockBase +public class GregtechMetaTileEntity_LargeRocketEngine extends GregtechMeta_MultiBlockBase { protected int fuelConsumption; protected int fuelValue; @@ -57,8 +57,6 @@ public class GregtechMetaTileEntity_LargeRocketEngine extends GregtechMeta_Multi private IStructureDefinition STRUCTURE_DEFINITION = null; private final static int CASING_ID = TAE.getIndexFromPage(3, 11); - - public ArrayList mAllDynamoHatches = new ArrayList(); public GregtechMetaTileEntity_LargeRocketEngine(final int aID, final String aName, final String aNameRegional) { super(aID, aName, aNameRegional); @@ -201,15 +199,12 @@ public class GregtechMetaTileEntity_LargeRocketEngine extends GregtechMeta_Multi } else { IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity(); if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Maintenance){ - ((GT_MetaTileEntity_Hatch)aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mMaintenanceHatches.add((GT_MetaTileEntity_Hatch_Maintenance)aMetaTileEntity); + return addToMachineList(aTileEntity, aBaseCasingIndex); } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Dynamo) { - ((GT_MetaTileEntity_Hatch) aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mAllDynamoHatches.add((GT_MetaTileEntity_Hatch_Dynamo) aMetaTileEntity); + return addToMachineList(aTileEntity, aBaseCasingIndex); } if (LoadedMods.TecTech) { if (isThisHatchMultiDynamo(aMetaTileEntity)) { - ((GT_MetaTileEntity_Hatch)aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mAllDynamoHatches.add((GT_MetaTileEntity_Hatch) aMetaTileEntity); + return addToMachineList(aTileEntity, aBaseCasingIndex); } } } @@ -222,17 +217,13 @@ public class GregtechMetaTileEntity_LargeRocketEngine extends GregtechMeta_Multi } else { IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity(); if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Maintenance){ - ((GT_MetaTileEntity_Hatch)aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mMaintenanceHatches.add((GT_MetaTileEntity_Hatch_Maintenance)aMetaTileEntity); + return addToMachineList(aTileEntity, aBaseCasingIndex); } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_AirIntake) { - ((GT_MetaTileEntity_Hatch) aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mAirIntakes.add(aMetaTileEntity) && this.mInputHatches.add((GT_MetaTileEntity_Hatch_Input) aMetaTileEntity); + return addToMachineList(aTileEntity, aBaseCasingIndex); } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Input) { - ((GT_MetaTileEntity_Hatch) aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mInputHatches.add((GT_MetaTileEntity_Hatch_Input) aMetaTileEntity); + return addToMachineList(aTileEntity, aBaseCasingIndex); } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_InputBus) { - ((GT_MetaTileEntity_Hatch) aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mInputBusses.add((GT_MetaTileEntity_Hatch_InputBus) aMetaTileEntity); + return addToMachineList(aTileEntity, aBaseCasingIndex); } } return false; @@ -244,8 +235,7 @@ public class GregtechMetaTileEntity_LargeRocketEngine extends GregtechMeta_Multi } else { IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity(); if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Muffler){ - ((GT_MetaTileEntity_Hatch)aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mMufflerHatches.add((GT_MetaTileEntity_Hatch_Muffler)aMetaTileEntity); + return addToMachineList(aTileEntity, aBaseCasingIndex); } } return false; @@ -276,8 +266,7 @@ public class GregtechMetaTileEntity_LargeRocketEngine extends GregtechMeta_Multi else { int totalAir = 0; FluidStack airstack = FluidUtils.getFluidStack("air", 1); - for (Object U : this.mAirIntakes) { - GT_MetaTileEntity_Hatch_AirIntake u = (GT_MetaTileEntity_Hatch_AirIntake) U; + for (GT_MetaTileEntity_Hatch_AirIntake u : this.mAirIntakes) { if (u != null && u.mFluid != null) { // had this trow errors cousing the machine to stop probebly fixed FluidStack f = u.mFluid; diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_LargeSemifluidGenerator.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_LargeSemifluidGenerator.java index 016c316b16..b85a67652e 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_LargeSemifluidGenerator.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_LargeSemifluidGenerator.java @@ -195,14 +195,11 @@ public class GregtechMetaTileEntity_LargeSemifluidGenerator extends GregtechMeta } else { IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity(); if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Maintenance){ - ((GT_MetaTileEntity_Hatch)aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mMaintenanceHatches.add((GT_MetaTileEntity_Hatch_Maintenance)aMetaTileEntity); + return addToMachineList(aTileEntity, aBaseCasingIndex); } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Muffler) { - ((GT_MetaTileEntity_Hatch) aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mMufflerHatches.add((GT_MetaTileEntity_Hatch_Muffler) aMetaTileEntity); + return addToMachineList(aTileEntity, aBaseCasingIndex); } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Input) { - ((GT_MetaTileEntity_Hatch) aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mInputHatches.add((GT_MetaTileEntity_Hatch_Input) aMetaTileEntity); + return addToMachineList(aTileEntity, aBaseCasingIndex); } } return false; @@ -213,9 +210,8 @@ public class GregtechMetaTileEntity_LargeSemifluidGenerator extends GregtechMeta return false; } else { IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity(); - if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Dynamo){ - ((GT_MetaTileEntity_Hatch)aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mDynamoHatches.add((GT_MetaTileEntity_Hatch_Dynamo)aMetaTileEntity); + if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Dynamo || this.isThisHatchMultiDynamo(aTileEntity)){ + return addToMachineList(aTileEntity, aBaseCasingIndex); } } return false; diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_MassFabricator.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_MassFabricator.java index ea22018080..dfc2a5b80f 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_MassFabricator.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_MassFabricator.java @@ -239,26 +239,19 @@ public class GregtechMetaTileEntity_MassFabricator extends GregtechMeta_MultiBlo } else { IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity(); if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_InputBus){ - ((GT_MetaTileEntity_Hatch)aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mInputBusses.add((GT_MetaTileEntity_Hatch_InputBus)aMetaTileEntity); + return addToMachineList(aTileEntity, aBaseCasingIndex); } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Maintenance){ - ((GT_MetaTileEntity_Hatch)aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mMaintenanceHatches.add((GT_MetaTileEntity_Hatch_Maintenance)aMetaTileEntity); + return addToMachineList(aTileEntity, aBaseCasingIndex); } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Energy){ - ((GT_MetaTileEntity_Hatch)aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mEnergyHatches.add((GT_MetaTileEntity_Hatch_Energy)aMetaTileEntity); + return addToMachineList(aTileEntity, aBaseCasingIndex); } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_OutputBus) { - ((GT_MetaTileEntity_Hatch) aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mOutputBusses.add((GT_MetaTileEntity_Hatch_OutputBus) aMetaTileEntity); + return addToMachineList(aTileEntity, aBaseCasingIndex); } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Muffler) { - ((GT_MetaTileEntity_Hatch) aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mMufflerHatches.add((GT_MetaTileEntity_Hatch_Muffler) aMetaTileEntity); + return addToMachineList(aTileEntity, aBaseCasingIndex); } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Input) { - ((GT_MetaTileEntity_Hatch) aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mInputHatches.add((GT_MetaTileEntity_Hatch_Input) aMetaTileEntity); + return addToMachineList(aTileEntity, aBaseCasingIndex); } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Output) { - ((GT_MetaTileEntity_Hatch) aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mOutputHatches.add((GT_MetaTileEntity_Hatch_Output) aMetaTileEntity); + return addToMachineList(aTileEntity, aBaseCasingIndex); } } return false; diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_Refinery.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_Refinery.java index 618696c22c..c195823900 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_Refinery.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_Refinery.java @@ -115,23 +115,17 @@ public class GregtechMetaTileEntity_Refinery extends GregtechMeta_MultiBlockBase } else { IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity(); if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Maintenance){ - ((GT_MetaTileEntity_Hatch)aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mMaintenanceHatches.add((GT_MetaTileEntity_Hatch_Maintenance)aMetaTileEntity); + return addToMachineList(aTileEntity, aBaseCasingIndex); } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Energy){ - ((GT_MetaTileEntity_Hatch)aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mEnergyHatches.add((GT_MetaTileEntity_Hatch_Energy)aMetaTileEntity); + return addToMachineList(aTileEntity, aBaseCasingIndex); } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_OutputBus) { - ((GT_MetaTileEntity_Hatch) aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mOutputBusses.add((GT_MetaTileEntity_Hatch_OutputBus) aMetaTileEntity); + return addToMachineList(aTileEntity, aBaseCasingIndex); } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Muffler && ((GT_MetaTileEntity_Hatch_Muffler) aMetaTileEntity).mTier >= 6) { - ((GT_MetaTileEntity_Hatch) aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mMufflerHatches.add((GT_MetaTileEntity_Hatch_Muffler) aMetaTileEntity); + return addToMachineList(aTileEntity, aBaseCasingIndex); } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Input) { - ((GT_MetaTileEntity_Hatch) aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mInputHatches.add((GT_MetaTileEntity_Hatch_Input) aMetaTileEntity); + return addToMachineList(aTileEntity, aBaseCasingIndex); } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Output) { - ((GT_MetaTileEntity_Hatch) aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mOutputHatches.add((GT_MetaTileEntity_Hatch_Output) aMetaTileEntity); + return addToMachineList(aTileEntity, aBaseCasingIndex); } } return false; diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/algae/GregtechMTE_AlgaePondBase.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/algae/GregtechMTE_AlgaePondBase.java index 8737a52c85..95d4806939 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/algae/GregtechMTE_AlgaePondBase.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/algae/GregtechMTE_AlgaePondBase.java @@ -154,14 +154,11 @@ public class GregtechMTE_AlgaePondBase extends GregtechMeta_MultiBlockBase { } else { IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity(); if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_InputBus){ - ((GT_MetaTileEntity_Hatch)aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mInputBusses.add((GT_MetaTileEntity_Hatch_InputBus)aMetaTileEntity); + return addToMachineList(aTileEntity, aBaseCasingIndex); } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_OutputBus) { - ((GT_MetaTileEntity_Hatch) aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mOutputBusses.add((GT_MetaTileEntity_Hatch_OutputBus) aMetaTileEntity); + return addToMachineList(aTileEntity, aBaseCasingIndex); }else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Input) { - ((GT_MetaTileEntity_Hatch) aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mInputHatches.add((GT_MetaTileEntity_Hatch_Input) aMetaTileEntity); + return addToMachineList(aTileEntity, aBaseCasingIndex); } } return false; diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/chemplant/GregtechMTE_ChemicalPlant.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/chemplant/GregtechMTE_ChemicalPlant.java index 66ccd72af3..7023211230 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/chemplant/GregtechMTE_ChemicalPlant.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/chemplant/GregtechMTE_ChemicalPlant.java @@ -367,24 +367,24 @@ public class GregtechMTE_ChemicalPlant extends GregtechMeta_MultiBlockBase { } else { IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity(); if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Catalysts){ - return addToMachineListInternal(mCatalystBuses, aMetaTileEntity, aBaseCasingIndex); + return addToMachineList(aTileEntity, aBaseCasingIndex); } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_InputBus){ maxTierOfHatch = Math.max(maxTierOfHatch, ((GT_MetaTileEntity_Hatch_InputBus) aMetaTileEntity).mTier); - return this.mInputBusses.add((GT_MetaTileEntity_Hatch_InputBus)aMetaTileEntity); + return addToMachineList(aTileEntity, aBaseCasingIndex); } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Maintenance){ - return this.mMaintenanceHatches.add((GT_MetaTileEntity_Hatch_Maintenance)aMetaTileEntity); + return addToMachineList(aTileEntity, aBaseCasingIndex); } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Energy){ maxTierOfHatch = Math.max(maxTierOfHatch, ((GT_MetaTileEntity_Hatch_Energy) aMetaTileEntity).mTier); - return this.mEnergyHatches.add((GT_MetaTileEntity_Hatch_Energy)aMetaTileEntity); + return addToMachineList(aTileEntity, aBaseCasingIndex); } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_OutputBus) { maxTierOfHatch = Math.max(maxTierOfHatch, ((GT_MetaTileEntity_Hatch_OutputBus) aMetaTileEntity).mTier); - return this.mOutputBusses.add((GT_MetaTileEntity_Hatch_OutputBus) aMetaTileEntity); + return addToMachineList(aTileEntity, aBaseCasingIndex); } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Input) { maxTierOfHatch = Math.max(maxTierOfHatch, ((GT_MetaTileEntity_Hatch_Input) aMetaTileEntity).mTier); - return this.mInputHatches.add((GT_MetaTileEntity_Hatch_Input) aMetaTileEntity); + return addToMachineList(aTileEntity, aBaseCasingIndex); } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Output) { maxTierOfHatch = Math.max(maxTierOfHatch, ((GT_MetaTileEntity_Hatch_Output) aMetaTileEntity).mTier); - return this.mOutputHatches.add((GT_MetaTileEntity_Hatch_Output) aMetaTileEntity); + return addToMachineList(aTileEntity, aBaseCasingIndex); } } return false; diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/storage/GregtechMetaTileEntity_PowerSubStationController.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/storage/GregtechMetaTileEntity_PowerSubStationController.java index 1acb785e8c..a90c962cae 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/storage/GregtechMetaTileEntity_PowerSubStationController.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/storage/GregtechMetaTileEntity_PowerSubStationController.java @@ -1,18 +1,25 @@ package gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.storage; -import java.util.ArrayList; +import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofBlock; +import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofChain; +import static com.gtnewhorizon.structurelib.structure.StructureUtility.onElementPass; +import static com.gtnewhorizon.structurelib.structure.StructureUtility.transpose; +import static gregtech.api.util.GT_StructureUtility.ofHatchAdder; import com.gtnewhorizon.structurelib.StructureLibAPI; import com.gtnewhorizon.structurelib.structure.IStructureDefinition; import com.gtnewhorizon.structurelib.structure.IStructureElement; import com.gtnewhorizon.structurelib.structure.StructureDefinition; + import gregtech.api.enums.TAE; import gregtech.api.enums.Textures; import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.MetaTileEntity; -import gregtech.api.metatileentity.implementations.*; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Dynamo; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Energy; import gregtech.api.objects.GT_RenderedTexture; import gregtech.api.util.GT_Multiblock_Tooltip_Builder; import gregtech.api.util.GT_Utility; @@ -37,11 +44,7 @@ import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.EnumChatFormatting; import net.minecraft.world.World; -import static com.gtnewhorizon.structurelib.structure.StructureUtility.*; -import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofBlock; -import static gregtech.api.util.GT_StructureUtility.ofHatchAdder; - -public class GregtechMetaTileEntity_PowerSubStationController extends GregtechMeta_MultiBlockBase { +public class GregtechMetaTileEntity_PowerSubStationController extends GregtechMeta_MultiBlockBase { protected long mAverageEuUsage = 0; protected long mTotalEnergyAdded = 0; @@ -56,10 +59,6 @@ public class GregtechMetaTileEntity_PowerSubStationController extends GregtechMe private int[] cellCount = new int[6]; private IStructureDefinition STRUCTURE_DEFINITION = null; - //TecTech Support - public ArrayList mAllEnergyHatches = new ArrayList(); - public ArrayList mAllDynamoHatches = new ArrayList(); - public GregtechMetaTileEntity_PowerSubStationController(final int aID, final String aName, final String aNameRegional) { super(aID, aName, aNameRegional); } @@ -345,18 +344,14 @@ public class GregtechMetaTileEntity_PowerSubStationController extends GregtechMe } else { IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity(); if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Energy) { - ((GT_MetaTileEntity_Hatch)aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mAllEnergyHatches.add((GT_MetaTileEntity_Hatch_Energy)aMetaTileEntity); + return addToMachineList(aTileEntity, aBaseCasingIndex); } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Dynamo) { - ((GT_MetaTileEntity_Hatch)aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mAllDynamoHatches.add((GT_MetaTileEntity_Hatch_Dynamo)aMetaTileEntity); + return addToMachineList(aTileEntity, aBaseCasingIndex); } if (LoadedMods.TecTech) { if (isThisHatchMultiDynamo(aMetaTileEntity)) { - ((GT_MetaTileEntity_Hatch)aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mAllDynamoHatches.add((GT_MetaTileEntity_Hatch) aMetaTileEntity); + return addToMachineList(aTileEntity, aBaseCasingIndex); } else if (isThisHatchMultiEnergy(aMetaTileEntity)) { - ((GT_MetaTileEntity_Hatch)aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mAllEnergyHatches.add((GT_MetaTileEntity_Hatch) aMetaTileEntity); + return addToMachineList(aTileEntity, aBaseCasingIndex); } } } diff --git a/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialElementDuplicator.java b/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialElementDuplicator.java index 59b6d78a4f..9e940dff26 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialElementDuplicator.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialElementDuplicator.java @@ -1,10 +1,8 @@ -/* package gtPlusPlus.xmod.gregtech.registration.gregtech; import gtPlusPlus.api.objects.Logger; import gtPlusPlus.xmod.gregtech.api.enums.GregtechItemList; import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_ElementalDataOrbHolder; -import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Steam_BusInput; import gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.production.GregtechMTE_ElementalDuplicator; public class GregtechIndustrialElementDuplicator { @@ -19,4 +17,4 @@ public class GregtechIndustrialElementDuplicator { } } -*/ + -- cgit From cdaa19e700a862766e1af69528c42af43cf1a1fc Mon Sep 17 00:00:00 2001 From: Alkalus <3060479+draknyte1@users.noreply.github.com> Date: Sun, 12 Dec 2021 12:34:49 +0000 Subject: Fixed cells being consumed in nuclear reprocessing. Removed some debug logging. Removed ClassTransformer_CC_GuiContainerManager. Improved handling in GT_NEI_LFTR_Sparging. Added Erbium. Added HeLiCoPtEr. --- src/Java/gtPlusPlus/core/item/ModItems.java | 2 + src/Java/gtPlusPlus/core/material/ALLOY.java | 18 +++ src/Java/gtPlusPlus/core/material/ORES.java | 3 + src/Java/gtPlusPlus/nei/GT_NEI_LFTR.java | 1 - src/Java/gtPlusPlus/nei/GT_NEI_LFTR_Sparging.java | 178 ++++++++++----------- .../Preloader_Transformer_Handler.java | 4 +- .../recipe/RecipeLoader_NuclearFuelProcessing.java | 3 +- 7 files changed, 110 insertions(+), 99 deletions(-) (limited to 'src/Java/gtPlusPlus/core/item') diff --git a/src/Java/gtPlusPlus/core/item/ModItems.java b/src/Java/gtPlusPlus/core/item/ModItems.java index fa09eb03f7..819babb1ba 100644 --- a/src/Java/gtPlusPlus/core/item/ModItems.java +++ b/src/Java/gtPlusPlus/core/item/ModItems.java @@ -472,6 +472,7 @@ public final class ModItems { MaterialGenerator.generate(ELEMENT.getInstance().IODINE); //LFTR byproduct MaterialGenerator.generate(ELEMENT.getInstance().HAFNIUM); MaterialGenerator.generate(ELEMENT.getInstance().DYSPROSIUM); + MaterialGenerator.generate(ELEMENT.getInstance().ERBIUM); MaterialGenerator.generate(ELEMENT.getInstance().TELLURIUM); //LFTR byproduct MaterialGenerator.generate(ELEMENT.getInstance().RHODIUM); MaterialGenerator.generate(ELEMENT.getInstance().RHENIUM); @@ -641,6 +642,7 @@ public final class ModItems { MaterialGenerator.generate(ALLOY.TRINIUM_REINFORCED_STEEL); //Top Tier Alloys + MaterialGenerator.generate(ALLOY.HELICOPTER); MaterialGenerator.generate(ALLOY.LAFIUM); MaterialGenerator.generate(ALLOY.CINOBITE); MaterialGenerator.generate(ALLOY.PIKYONIUM); diff --git a/src/Java/gtPlusPlus/core/material/ALLOY.java b/src/Java/gtPlusPlus/core/material/ALLOY.java index f51dbf920d..fd7547970c 100644 --- a/src/Java/gtPlusPlus/core/material/ALLOY.java +++ b/src/Java/gtPlusPlus/core/material/ALLOY.java @@ -745,6 +745,24 @@ public final class ALLOY { /* * Top Tier Alloys */ + + public static final Material HELICOPTER = new Material( + "HeLiCoPtEr", //Material Name + MaterialState.SOLID, //State + null, //Material Colour + 5763, + 8192, + -1, + -1, + true, //Uses Blast furnace? + //Material Stacks with Percentage of required elements. + new MaterialStack[]{ + new MaterialStack(ELEMENT.getInstance().HELIUM, 20), + new MaterialStack(ELEMENT.getInstance().LITHIUM, 20), + new MaterialStack(ELEMENT.getInstance().COBALT, 20), + new MaterialStack(ELEMENT.getInstance().PLATINUM, 20), + new MaterialStack(ELEMENT.getInstance().ERBIUM, 20) + }); //0lafe Compound public static final Material LAFIUM = new Material( diff --git a/src/Java/gtPlusPlus/core/material/ORES.java b/src/Java/gtPlusPlus/core/material/ORES.java index 262852eec7..0186c23a07 100644 --- a/src/Java/gtPlusPlus/core/material/ORES.java +++ b/src/Java/gtPlusPlus/core/material/ORES.java @@ -245,6 +245,7 @@ public final class ORES { -1, //Radiation new MaterialStack[]{ new MaterialStack(ELEMENT.getInstance().CERIUM, 4), + new MaterialStack(ELEMENT.getInstance().ERBIUM, 2), new MaterialStack(ELEMENT.getInstance().LANTHANUM, 2), new MaterialStack(ELEMENT.getInstance().NEODYMIUM, 2), new MaterialStack(ELEMENT.getInstance().YTTRIUM, 2), @@ -267,6 +268,7 @@ public final class ORES { -1, //Radiation new MaterialStack[]{ new MaterialStack(ELEMENT.getInstance().CERIUM, 2), + new MaterialStack(ELEMENT.getInstance().ERBIUM, 2), new MaterialStack(ELEMENT.getInstance().LANTHANUM, 2), new MaterialStack(ELEMENT.getInstance().NEODYMIUM, 2), new MaterialStack(ELEMENT.getInstance().YTTRIUM, 4), @@ -661,6 +663,7 @@ public final class ORES { new MaterialStack[]{ new MaterialStack(ELEMENT.getInstance().YTTRIUM, 2), new MaterialStack(ELEMENT.getInstance().YTTERBIUM, 2), + new MaterialStack(ELEMENT.getInstance().ERBIUM, 2), new MaterialStack(ELEMENT.getInstance().EUROPIUM, 1), new MaterialStack(ELEMENT.getInstance().PHOSPHORUS, 2), new MaterialStack(ELEMENT.getInstance().OXYGEN, 8) diff --git a/src/Java/gtPlusPlus/nei/GT_NEI_LFTR.java b/src/Java/gtPlusPlus/nei/GT_NEI_LFTR.java index a88df530ab..9fbc689ac3 100644 --- a/src/Java/gtPlusPlus/nei/GT_NEI_LFTR.java +++ b/src/Java/gtPlusPlus/nei/GT_NEI_LFTR.java @@ -101,7 +101,6 @@ public class GT_NEI_LFTR extends GTPP_NEI_DefaultHandler { if ((mRecipe.mFluidOutputs.length > 8) && (mRecipe.mFluidOutputs[8] != null) && (mRecipe.mFluidOutputs[8].getFluid() != null)) { this.mOutputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(mRecipe.mFluidOutputs[8], true), 138, 41, mRecipe.getOutputChance(tStartIndex++))); } - Logger.INFO("Outputs: "+mRecipe.mFluidOutputs.length); } } diff --git a/src/Java/gtPlusPlus/nei/GT_NEI_LFTR_Sparging.java b/src/Java/gtPlusPlus/nei/GT_NEI_LFTR_Sparging.java index acaea3fa4b..b293ac7c6f 100644 --- a/src/Java/gtPlusPlus/nei/GT_NEI_LFTR_Sparging.java +++ b/src/Java/gtPlusPlus/nei/GT_NEI_LFTR_Sparging.java @@ -1,10 +1,11 @@ package gtPlusPlus.nei; import java.awt.Rectangle; +import java.lang.ref.SoftReference; import java.util.ArrayList; -import java.util.Collections; import java.util.Iterator; import java.util.List; +import java.util.stream.Collectors; import org.lwjgl.opengl.GL11; @@ -19,19 +20,18 @@ import gregtech.api.util.GT_OreDictUnificator; import gregtech.api.util.GT_Utility; import gregtech.api.util.GasSpargingRecipe; import gregtech.api.util.GasSpargingRecipeMap; -import gtPlusPlus.api.objects.Logger; import gtPlusPlus.core.gui.machine.GUI_DecayablesChest; import gtPlusPlus.core.util.math.MathUtils; import gtPlusPlus.core.util.minecraft.ItemUtils; import net.minecraft.client.gui.inventory.GuiContainer; import net.minecraft.init.Blocks; import net.minecraft.item.ItemStack; -import net.minecraftforge.fluids.FluidContainerRegistry; import net.minecraftforge.fluids.FluidStack; public class GT_NEI_LFTR_Sparging extends TemplateRecipeHandler { public static final String mNEIName = GasSpargingRecipeMap.mNEIDisplayName; + private SoftReference> mCachedRecipes = null; public String getRecipeName() { return mNEIName; @@ -63,97 +63,86 @@ public class GT_NEI_LFTR_Sparging extends TemplateRecipeHandler { public void loadTransferRects() { this.transferRects.add(new RecipeTransferRect(new Rectangle(72, 14, 22, 16), getRecipeName(), new Object[0])); } - - public List getSortedRecipes() { - List result = new ArrayList(GasSpargingRecipeMap.mRecipes); - Collections.sort(result); - return result; - } - - @Override - public void loadCraftingRecipes(final String outputId, final Object... results) { - if (outputId.equals(getRecipeName())) { - for (GasSpargingRecipe tRecipe : getSortedRecipes()) { - this.arecipes.add(new GasSpargingRecipeNEI(tRecipe)); - } - } else { - super.loadCraftingRecipes(outputId, results); - } - } - - @Override - public void loadCraftingRecipes(final ItemStack aResult) { - ItemData tPrefixMaterial = GT_OreDictUnificator.getAssociation(aResult); - - ArrayList tResults = new ArrayList(); - tResults.add(aResult); - tResults.add(GT_OreDictUnificator.get(true, aResult)); - if ((tPrefixMaterial != null) && (!tPrefixMaterial.mBlackListed) && (!tPrefixMaterial.mPrefix.mFamiliarPrefixes.isEmpty())) { - for (OrePrefixes tPrefix : tPrefixMaterial.mPrefix.mFamiliarPrefixes) { - tResults.add(GT_OreDictUnificator.get(tPrefix, tPrefixMaterial.mMaterial.mMaterial, 1L)); - } - } - FluidStack tFluid = GT_Utility.getFluidForFilledItem(aResult, true); - if (tFluid != null) { - tResults.add(GT_Utility.getFluidDisplayStack(tFluid, false)); - for (FluidContainerRegistry.FluidContainerData tData : FluidContainerRegistry.getRegisteredFluidContainerData()) { - if (tData.fluid.isFluidEqual(tFluid)) { - tResults.add(GT_Utility.copy(new Object[]{tData.filledContainer})); - } - } - } - for (GasSpargingRecipe tRecipe : getSortedRecipes()) { - GasSpargingRecipeNEI tNEIRecipe = new GasSpargingRecipeNEI(tRecipe); - for (ItemStack tStack : tResults) { - if (tNEIRecipe.contains(tNEIRecipe.mOutputs, tStack)) { - this.arecipes.add(tNEIRecipe); - break; - } - } - } - //CachedDefaultRecipe tNEIRecipe; - } - - public void loadUsageRecipes(ItemStack aInput) { - ItemData tPrefixMaterial = GT_OreDictUnificator.getAssociation(aInput); - - ArrayList tInputs = new ArrayList(); - tInputs.add(aInput); - tInputs.add(GT_OreDictUnificator.get(false, aInput)); - if ((tPrefixMaterial != null) && (!tPrefixMaterial.mPrefix.mFamiliarPrefixes.isEmpty())) { - for (OrePrefixes tPrefix : tPrefixMaterial.mPrefix.mFamiliarPrefixes) { - tInputs.add(GT_OreDictUnificator.get(tPrefix, tPrefixMaterial.mMaterial.mMaterial, 1L)); - } - } - FluidStack tFluid = GT_Utility.getFluidForFilledItem(aInput, true); - if (tFluid != null) { - tInputs.add(GT_Utility.getFluidDisplayStack(tFluid, false)); - for (FluidContainerRegistry.FluidContainerData tData : FluidContainerRegistry.getRegisteredFluidContainerData()) { - if (tData.fluid.isFluidEqual(tFluid)) { - tInputs.add(GT_Utility.copy(new Object[]{tData.filledContainer})); - } - } - } - for (GasSpargingRecipe tRecipe : getSortedRecipes()) { - GasSpargingRecipeNEI tNEIRecipe = new GasSpargingRecipeNEI(tRecipe); - for (ItemStack tStack : tInputs) { - if (tNEIRecipe.contains(tNEIRecipe.mInputs, tStack)) { - this.arecipes.add(tNEIRecipe); - break; - } - } - } - } - - private final void sort() { - List g = new ArrayList(); - for (CachedRecipe u : arecipes) { - g.add((GasSpargingRecipeNEI) u); - } - if (g != null && !g.isEmpty()) { - Collections.sort(g); - } - } + + public List getCache() { + List cache; + if (mCachedRecipes == null || (cache = mCachedRecipes.get()) == null) { + cache = GasSpargingRecipeMap.mRecipes.stream() // do not use parallel stream. This is already parallelized by NEI + .sorted() + .map(temp -> {return createCachedRecipe(temp);}) + .collect(Collectors.toList()); + // while the NEI parallelize handlers, for each individual handler it still uses sequential execution model + // so we do not need any synchronization here + mCachedRecipes = new SoftReference<>(cache); + } + return cache; + } + + public GasSpargingRecipeNEI createCachedRecipe(GasSpargingRecipe aRecipe) { + return new GasSpargingRecipeNEI(aRecipe); + } + + public void loadCraftingRecipes(String outputId, Object... results) { + if (outputId.equals(getOverlayIdentifier())) { + arecipes.addAll(getCache()); + } else { + super.loadCraftingRecipes(outputId, results); + } + } + + public void loadCraftingRecipes(ItemStack aResult) { + ItemData tPrefixMaterial = GT_OreDictUnificator.getAssociation(aResult); + + ArrayList tResults = new ArrayList<>(); + tResults.add(aResult); + tResults.add(GT_OreDictUnificator.get(true, aResult)); + if ((tPrefixMaterial != null) && (!tPrefixMaterial.mBlackListed) && (!tPrefixMaterial.mPrefix.mFamiliarPrefixes.isEmpty())) { + for (OrePrefixes tPrefix : tPrefixMaterial.mPrefix.mFamiliarPrefixes) { + tResults.add(GT_OreDictUnificator.get(tPrefix, tPrefixMaterial.mMaterial.mMaterial, 1L)); + } + } + FluidStack tFluid = GT_Utility.getFluidForFilledItem(aResult, true); + FluidStack tFluidStack; + if (tFluid != null) { + tFluidStack = tFluid; + tResults.add(GT_Utility.getFluidDisplayStack(tFluid, false)); + } + else tFluidStack = GT_Utility.getFluidFromDisplayStack(aResult); + if (tFluidStack != null) { + tResults.addAll(GT_Utility.getContainersFromFluid(tFluidStack)); + } + for (GasSpargingRecipeNEI recipe : getCache()) { + if (tResults.stream().anyMatch(stack -> recipe.contains(recipe.mOutputs, stack))) + arecipes.add(recipe); + } + } + + public void loadUsageRecipes(ItemStack aInput) { + ItemData tPrefixMaterial = GT_OreDictUnificator.getAssociation(aInput); + + ArrayList tInputs = new ArrayList<>(); + tInputs.add(aInput); + tInputs.add(GT_OreDictUnificator.get(false, aInput)); + if ((tPrefixMaterial != null) && (!tPrefixMaterial.mPrefix.mFamiliarPrefixes.isEmpty())) { + for (OrePrefixes tPrefix : tPrefixMaterial.mPrefix.mFamiliarPrefixes) { + tInputs.add(GT_OreDictUnificator.get(tPrefix, tPrefixMaterial.mMaterial.mMaterial, 1L)); + } + } + FluidStack tFluid = GT_Utility.getFluidForFilledItem(aInput, true); + FluidStack tFluidStack; + if (tFluid != null) { + tFluidStack = tFluid; + tInputs.add(GT_Utility.getFluidDisplayStack(tFluid, false)); + } + else tFluidStack = GT_Utility.getFluidFromDisplayStack(aInput); + if (tFluidStack != null) { + tInputs.addAll(GT_Utility.getContainersFromFluid(tFluidStack)); + } + for (GasSpargingRecipeNEI recipe : getCache()) { + if (tInputs.stream().anyMatch(stack -> recipe.contains(recipe.mInputs, stack))) + arecipes.add(recipe); + } + } public void drawExtras(int aRecipeIndex) { final long tEUt = ((GasSpargingRecipeNEI) this.arecipes.get(aRecipeIndex)).mRecipe.mEUt; @@ -320,7 +309,6 @@ public class GT_NEI_LFTR_Sparging extends TemplateRecipeHandler { if ((tRecipe.mFluidOutputs.length > 8) && (tRecipe.mFluidOutputs[8] != null) && (tRecipe.mFluidOutputs[8].getFluid() != null)) { this.mOutputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(tRecipe.mFluidOutputs[8], false), 138, 41, tRecipe.getMaxOutput(tStartIndex++))); } - Logger.INFO("Outputs: "+tRecipe.mFluidOutputs.length); } } diff --git a/src/Java/gtPlusPlus/preloader/asm/transformers/Preloader_Transformer_Handler.java b/src/Java/gtPlusPlus/preloader/asm/transformers/Preloader_Transformer_Handler.java index 1795d74262..5cb2eef066 100644 --- a/src/Java/gtPlusPlus/preloader/asm/transformers/Preloader_Transformer_Handler.java +++ b/src/Java/gtPlusPlus/preloader/asm/transformers/Preloader_Transformer_Handler.java @@ -122,8 +122,8 @@ public class Preloader_Transformer_Handler implements IClassTransformer { // Log Handling of CodeChicken if (transformedName.equals("codechicken.nei.guihook.GuiContainerManager")) { - Preloader_Logger.INFO("CodeChicken GuiContainerManager Patch", "Transforming "+transformedName); - return new ClassTransformer_CC_GuiContainerManager(basicClass).getWriter().toByteArray(); + //Preloader_Logger.INFO("CodeChicken GuiContainerManager Patch", "Transforming "+transformedName); + //return new ClassTransformer_CC_GuiContainerManager(basicClass).getWriter().toByteArray(); } // Fix the OreDictionary COFH if (transformedName.equals(COFH_ORE_DICTIONARY_ARBITER) && (AsmConfig.enableCofhPatch || !obfuscated)) { diff --git a/src/Java/gtPlusPlus/xmod/gregtech/loaders/recipe/RecipeLoader_NuclearFuelProcessing.java b/src/Java/gtPlusPlus/xmod/gregtech/loaders/recipe/RecipeLoader_NuclearFuelProcessing.java index 646b99d924..8ec192b573 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/loaders/recipe/RecipeLoader_NuclearFuelProcessing.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/loaders/recipe/RecipeLoader_NuclearFuelProcessing.java @@ -97,7 +97,7 @@ public class RecipeLoader_NuclearFuelProcessing { ELEMENT.getInstance().FLUORINE.getCell(6), NUCLIDE.LiFBeF2ThF4.getFluidStack(10000), new ItemStack[] { - CI.emptyCells(3), + CI.emptyCells(4), FLUORIDES.LITHIUM_FLUORIDE.getCell(1), FLUORIDES.BERYLLIUM_FLUORIDE.getCell(1), ItemUtils.getSimpleStack(ModItems.dustProtactinium233), @@ -210,6 +210,7 @@ public class RecipeLoader_NuclearFuelProcessing { ELEMENT.getInstance().FLUORINE.getCell(3), NUCLIDE.Sparged_LiFBeF2UF4FP.getFluidStack(1000), new ItemStack[] { + CI.emptyCells(1), NUCLIDE.UF6F2FP.getCell(2) }, new int[] {10000}, -- cgit From e2168151e5510e9c7d2d21879b4b16e71bb37e3e Mon Sep 17 00:00:00 2001 From: Alkalus <3060479+draknyte1@users.noreply.github.com> Date: Sun, 12 Dec 2021 13:28:58 +0000 Subject: Add recipes for Sparging Multiblock. Add some localization. Migrate material recipes out of item classes. --- .../core/item/base/ingots/BaseItemIngot.java | 17 ------ .../core/item/base/nugget/BaseItemNugget.java | 1 + .../core/item/base/plates/BaseItemPlate.java | 2 - .../core/item/base/plates/BaseItemPlateDouble.java | 1 + .../core/item/base/rings/BaseItemRing.java | 1 + .../core/item/base/rods/BaseItemRod.java | 37 ------------- .../core/item/base/rods/BaseItemRodLong.java | 30 +---------- .../core/item/base/screws/BaseItemScrew.java | 20 ------- .../core/item/crafting/ItemDummyResearch.java | 3 +- .../core/material/MaterialGenerator.java | 3 ++ .../gtPlusPlus/core/recipe/RECIPES_Machines.java | 63 ++++++++++++++++++++++ src/resources/assets/miscutils/lang/en_US.lang | 31 +++++++++++ 12 files changed, 103 insertions(+), 106 deletions(-) (limited to 'src/Java/gtPlusPlus/core/item') diff --git a/src/Java/gtPlusPlus/core/item/base/ingots/BaseItemIngot.java b/src/Java/gtPlusPlus/core/item/base/ingots/BaseItemIngot.java index 5f0254bc51..ea96e2914c 100644 --- a/src/Java/gtPlusPlus/core/item/base/ingots/BaseItemIngot.java +++ b/src/Java/gtPlusPlus/core/item/base/ingots/BaseItemIngot.java @@ -1,12 +1,7 @@ package gtPlusPlus.core.item.base.ingots; -import net.minecraft.item.ItemStack; - -import gregtech.api.util.GT_ModHandler; - import gtPlusPlus.core.item.base.BaseItemComponent; import gtPlusPlus.core.material.Material; -import gtPlusPlus.core.util.minecraft.ItemUtils; public class BaseItemIngot extends BaseItemComponent{ @@ -21,18 +16,6 @@ public class BaseItemIngot extends BaseItemComponent{ super(material, type); this.materialName = material.getLocalizedName(); this.unlocalName = material.getUnlocalizedName(); - if (type != ComponentTypes.HOTINGOT) { - this.generateCompressorRecipe(); - } } - private void generateCompressorRecipe(){ - final ItemStack tempStack = componentMaterial.getIngot(9); - final ItemStack tempOutput = componentMaterial.getBlock(1); - if (ItemUtils.checkForInvalidItems(new ItemStack[] {tempStack, tempOutput})){ - GT_ModHandler.addCompressionRecipe(tempStack, tempOutput); - } - } - - } diff --git a/src/Java/gtPlusPlus/core/item/base/nugget/BaseItemNugget.java b/src/Java/gtPlusPlus/core/item/base/nugget/BaseItemNugget.java index a6eb598622..1644856bf8 100644 --- a/src/Java/gtPlusPlus/core/item/base/nugget/BaseItemNugget.java +++ b/src/Java/gtPlusPlus/core/item/base/nugget/BaseItemNugget.java @@ -8,4 +8,5 @@ public class BaseItemNugget extends BaseItemComponent{ public BaseItemNugget(final Material material) { super(material, BaseItemComponent.ComponentTypes.NUGGET); } + } diff --git a/src/Java/gtPlusPlus/core/item/base/plates/BaseItemPlate.java b/src/Java/gtPlusPlus/core/item/base/plates/BaseItemPlate.java index 34d44cd43e..a810b22c70 100644 --- a/src/Java/gtPlusPlus/core/item/base/plates/BaseItemPlate.java +++ b/src/Java/gtPlusPlus/core/item/base/plates/BaseItemPlate.java @@ -15,6 +15,4 @@ public class BaseItemPlate extends BaseItemComponent{ this(MaterialUtils.generateQuickMaterial(materialName, state, new short[]{colour[0], colour[1], colour[2], 0}, sRadioactivity)); } - - } diff --git a/src/Java/gtPlusPlus/core/item/base/plates/BaseItemPlateDouble.java b/src/Java/gtPlusPlus/core/item/base/plates/BaseItemPlateDouble.java index 373f84b7c5..31f86e8ffa 100644 --- a/src/Java/gtPlusPlus/core/item/base/plates/BaseItemPlateDouble.java +++ b/src/Java/gtPlusPlus/core/item/base/plates/BaseItemPlateDouble.java @@ -16,4 +16,5 @@ public class BaseItemPlateDouble extends BaseItemComponent{ public String getItemStackDisplayName(final ItemStack p_77653_1_) { return ("Double "+this.materialName+ " Plate"); } + } diff --git a/src/Java/gtPlusPlus/core/item/base/rings/BaseItemRing.java b/src/Java/gtPlusPlus/core/item/base/rings/BaseItemRing.java index 62777cc9f5..c83ae94af1 100644 --- a/src/Java/gtPlusPlus/core/item/base/rings/BaseItemRing.java +++ b/src/Java/gtPlusPlus/core/item/base/rings/BaseItemRing.java @@ -8,4 +8,5 @@ public class BaseItemRing extends BaseItemComponent{ public BaseItemRing(final Material material) { super(material, BaseItemComponent.ComponentTypes.RING); } + } diff --git a/src/Java/gtPlusPlus/core/item/base/rods/BaseItemRod.java b/src/Java/gtPlusPlus/core/item/base/rods/BaseItemRod.java index ef3266fe75..f77f846d34 100644 --- a/src/Java/gtPlusPlus/core/item/base/rods/BaseItemRod.java +++ b/src/Java/gtPlusPlus/core/item/base/rods/BaseItemRod.java @@ -1,49 +1,12 @@ package gtPlusPlus.core.item.base.rods; -import net.minecraft.item.ItemStack; - -import gregtech.api.enums.GT_Values; - -import gtPlusPlus.api.objects.Logger; import gtPlusPlus.core.item.base.BaseItemComponent; import gtPlusPlus.core.material.Material; -import gtPlusPlus.core.util.minecraft.ItemUtils; public class BaseItemRod extends BaseItemComponent{ public BaseItemRod(final Material material) { super(material, BaseItemComponent.ComponentTypes.ROD); - this.addCutterRecipe(material); - this.addLatheRecipe(material); - } - - - private void addCutterRecipe(Material material){ - Logger.WARNING("Adding cutter recipe for "+this.materialName+" Rods"); - final ItemStack stackStick = this.componentMaterial.getRod(1); - final ItemStack stackBolt = this.componentMaterial.getBolt(4); - - if (ItemUtils.checkForInvalidItems(new ItemStack[] {stackStick, stackBolt})) - GT_Values.RA.addCutterRecipe( - stackStick, - stackBolt, - null, - (int) Math.max(this.componentMaterial.getMass() * 2L, 1L), - material.vVoltageMultiplier); - } - - - private void addLatheRecipe(Material material){ - Logger.WARNING("Adding recipe for "+this.materialName+" Rod"); - ItemStack boltStack = this.componentMaterial.getIngot(1); - if (ItemUtils.checkForInvalidItems(boltStack)){ - GT_Values.RA.addLatheRecipe( - boltStack, - ItemUtils.getSimpleStack(this), - material.getSmallDust(2), - (int) Math.max(this.componentMaterial.getMass() / 8L, 1L), - material.vVoltageMultiplier); - } } } diff --git a/src/Java/gtPlusPlus/core/item/base/rods/BaseItemRodLong.java b/src/Java/gtPlusPlus/core/item/base/rods/BaseItemRodLong.java index 9b232f95c5..215012817d 100644 --- a/src/Java/gtPlusPlus/core/item/base/rods/BaseItemRodLong.java +++ b/src/Java/gtPlusPlus/core/item/base/rods/BaseItemRodLong.java @@ -1,19 +1,13 @@ package gtPlusPlus.core.item.base.rods; -import net.minecraft.item.ItemStack; - -import gregtech.api.enums.GT_Values; - -import gtPlusPlus.api.objects.Logger; import gtPlusPlus.core.item.base.BaseItemComponent; import gtPlusPlus.core.material.Material; -import gtPlusPlus.core.util.minecraft.ItemUtils; +import net.minecraft.item.ItemStack; public class BaseItemRodLong extends BaseItemComponent{ public BaseItemRodLong(final Material material) { super(material, BaseItemComponent.ComponentTypes.RODLONG); - this.addExtruderRecipe(); } @Override @@ -21,26 +15,4 @@ public class BaseItemRodLong extends BaseItemComponent{ return ("Long "+this.materialName+ " Rod"); } - private void addExtruderRecipe(){ - Logger.WARNING("Adding recipe for Long "+this.materialName+" Rods"); - - final ItemStack stackStick = this.componentMaterial.getRod(2); - final ItemStack stackLong = this.componentMaterial.getLongRod(1); - - if (ItemUtils.checkForInvalidItems(new ItemStack[] {stackStick, stackLong})) - GT_Values.RA.addForgeHammerRecipe( - stackStick, - stackLong, - (int) Math.max(this.componentMaterial.getMass(), 1L), - 16); - - if (ItemUtils.checkForInvalidItems(new ItemStack[] {stackStick, stackLong})) - GT_Values.RA.addCutterRecipe( - stackLong, - stackStick, - null, - (int) Math.max(this.componentMaterial.getMass(), 1L), - 4); - } - } diff --git a/src/Java/gtPlusPlus/core/item/base/screws/BaseItemScrew.java b/src/Java/gtPlusPlus/core/item/base/screws/BaseItemScrew.java index 29e525ed10..dbd817215a 100644 --- a/src/Java/gtPlusPlus/core/item/base/screws/BaseItemScrew.java +++ b/src/Java/gtPlusPlus/core/item/base/screws/BaseItemScrew.java @@ -1,32 +1,12 @@ package gtPlusPlus.core.item.base.screws; -import net.minecraft.item.ItemStack; - -import gregtech.api.enums.GT_Values; - -import gtPlusPlus.api.objects.Logger; import gtPlusPlus.core.item.base.BaseItemComponent; import gtPlusPlus.core.material.Material; -import gtPlusPlus.core.util.minecraft.ItemUtils; public class BaseItemScrew extends BaseItemComponent{ public BaseItemScrew(final Material material) { super(material, BaseItemComponent.ComponentTypes.SCREW); - this.addLatheRecipe(); - } - - private void addLatheRecipe(){ - Logger.WARNING("Adding recipe for "+this.materialName+" Screws"); - ItemStack boltStack = this.componentMaterial.getBolt(1); - if (ItemUtils.checkForInvalidItems(boltStack)){ - GT_Values.RA.addLatheRecipe( - boltStack, - ItemUtils.getSimpleStack(this), - null, - (int) Math.max(this.componentMaterial.getMass() / 8L, 1L), - 4); - } } } diff --git a/src/Java/gtPlusPlus/core/item/crafting/ItemDummyResearch.java b/src/Java/gtPlusPlus/core/item/crafting/ItemDummyResearch.java index 3f8e31d8d2..d8ddb26675 100644 --- a/src/Java/gtPlusPlus/core/item/crafting/ItemDummyResearch.java +++ b/src/Java/gtPlusPlus/core/item/crafting/ItemDummyResearch.java @@ -28,7 +28,8 @@ public class ItemDummyResearch extends ItemGenericToken { RESEARCH_6_BASIC_METALLURGY("Basic Metallurgy", "Information about material smelting"), RESEARCH_7_ADV_METALLURGY("Advanced Metallurgy", "Advanced Material Sciences!"), RESEARCH_8_TURBINE_AUTOMATION("Turbine Automation", "You really don't want to share this with anyone!"), - RESEARCH_9_CLOAKING("Cloaking Technologies", "Sneaking around like a mouse"); + RESEARCH_9_CLOAKING("Cloaking Technologies", "Sneaking around like a mouse"), + RESEARCH_10_SPARGING("Gas Sparging", "Blowing gas for results"); diff --git a/src/Java/gtPlusPlus/core/material/MaterialGenerator.java b/src/Java/gtPlusPlus/core/material/MaterialGenerator.java index f48ed9f5cb..8425ed89be 100644 --- a/src/Java/gtPlusPlus/core/material/MaterialGenerator.java +++ b/src/Java/gtPlusPlus/core/material/MaterialGenerator.java @@ -47,6 +47,7 @@ import gtPlusPlus.xmod.gregtech.loaders.RecipeGen_Extruder; import gtPlusPlus.xmod.gregtech.loaders.RecipeGen_FluidCanning; import gtPlusPlus.xmod.gregtech.loaders.RecipeGen_Fluids; import gtPlusPlus.xmod.gregtech.loaders.RecipeGen_MaterialProcessing; +import gtPlusPlus.xmod.gregtech.loaders.RecipeGen_MetalRecipe; import gtPlusPlus.xmod.gregtech.loaders.RecipeGen_Ore; import gtPlusPlus.xmod.gregtech.loaders.RecipeGen_Plasma; import gtPlusPlus.xmod.gregtech.loaders.RecipeGen_Plates; @@ -213,6 +214,7 @@ public class MaterialGenerator { if (generateBlastSmelterRecipes){ new RecipeGen_BlastSmelter(matInfo); } + new RecipeGen_MetalRecipe(matInfo); new RecipeGen_Extruder(matInfo); new RecipeGen_Fluids(matInfo); new RecipeGen_Plates(matInfo); @@ -331,6 +333,7 @@ public class MaterialGenerator { new RecipeGen_Recycling(matInfo); } + new RecipeGen_MetalRecipe(matInfo); new RecipeGen_DustGeneration(matInfo, disableOptionalRecipes); new RecipeGen_Plasma(matInfo); diff --git a/src/Java/gtPlusPlus/core/recipe/RECIPES_Machines.java b/src/Java/gtPlusPlus/core/recipe/RECIPES_Machines.java index 4998d4bdbd..af244818b9 100644 --- a/src/Java/gtPlusPlus/core/recipe/RECIPES_Machines.java +++ b/src/Java/gtPlusPlus/core/recipe/RECIPES_Machines.java @@ -10,6 +10,8 @@ import gtPlusPlus.api.objects.Logger; import gtPlusPlus.core.block.ModBlocks; import gtPlusPlus.core.item.ModItems; import gtPlusPlus.core.item.chemistry.AgriculturalChem; +import gtPlusPlus.core.item.crafting.ItemDummyResearch; +import gtPlusPlus.core.item.crafting.ItemDummyResearch.ASSEMBLY_LINE_RESEARCH; import gtPlusPlus.core.lib.CORE; import gtPlusPlus.core.lib.LoadedMods; import gtPlusPlus.core.material.ALLOY; @@ -251,6 +253,7 @@ public class RECIPES_Machines { chemPlant(); zyngen(); milling(); + sparging(); } @@ -2550,6 +2553,66 @@ public class RECIPES_Machines { MaterialUtils.getVoltageForTier(5)); } + + private static void sparging() { + + // Sparge Tower Research + CORE.RA.addSixSlotAssemblingRecipe( + new ItemStack[] { + CI.getNumberedAdvancedCircuit(8), + ELEMENT.getInstance().HELIUM.getCell(8), + ELEMENT.getInstance().FLUORINE.getCell(8), + ALLOY.HS188A.getIngot(8), + }, + null, + ItemDummyResearch.getResearchStack(ASSEMBLY_LINE_RESEARCH.RESEARCH_10_SPARGING, 1), + 60 * 20 * 5, + MaterialUtils.getVoltageForTier(5)); + + // Sparge Tower Controller + CORE.RA.addAssemblylineRecipe( + ItemDummyResearch.getResearchStack(ASSEMBLY_LINE_RESEARCH.RESEARCH_10_SPARGING, 1), + 20 * 60 * 20, + new ItemStack[] { + GregtechItemList.Casing_Sparge_Tower_Exterior.get(4), + CI.getTieredGTPPMachineCasing(4, 4), + ItemList.Machine_IV_Distillery.get(1), + ItemUtils.getItemStackOfAmountFromOreDict(CI.getTieredCircuitOreDictName(5), 8), + ALLOY.HS188A.getGear(8), + ALLOY.HS188A.getPlate(32), + ALLOY.HASTELLOY_N.getPlateDouble(8), + ALLOY.HASTELLOY_N.getPlateDouble(8), + ALLOY.HASTELLOY_N.getScrew(64), + CI.getTieredComponentOfMaterial(Materials.YttriumBariumCuprate, OrePrefixes.wireFine, 64), + CI.getTieredComponentOfMaterial(Materials.YttriumBariumCuprate, OrePrefixes.wireFine, 64), + CI.getTieredComponentOfMaterial(Materials.Platinum, OrePrefixes.foil, 32), + CI.getTieredComponentOfMaterial(Materials.Platinum, OrePrefixes.foil, 32), + + }, + new FluidStack[] { + CI.getTieredFluid(4, 16 * 144), + CI.getAlternativeTieredFluid(3, 32 * 144), + CI.getTertiaryTieredFluid(3, 32 * 144) + }, + GregtechItemList.Controller_Sparge_Tower.get(1), + 20 * 60 * 10, + MaterialUtils.getVoltageForTier(6)); + + // Sparge Tower Casing + CORE.RA.addSixSlotAssemblingRecipe( + new ItemStack[] { + CI.getNumberedAdvancedCircuit(8), + CI.getTieredGTPPMachineCasing(3, 1), + ALLOY.HS188A.getPlate(8), + ALLOY.HASTELLOY_N.getRing(4), + CI.getTieredComponentOfMaterial(Materials.TungstenSteel, OrePrefixes.plateDouble, 4), + ALLOY.HASTELLOY_N.getScrew(4), + }, + ALLOY.STAINLESS_STEEL.getFluidStack(8 * 144), + GregtechItemList.Casing_Sparge_Tower_Exterior.get(1), + 60 * 20 * 2, + MaterialUtils.getVoltageForTier(5)); + } private static void fakeMachineCasingCovers() { GregtechItemList[] mMachineCasingCovers = new GregtechItemList[] { diff --git a/src/resources/assets/miscutils/lang/en_US.lang b/src/resources/assets/miscutils/lang/en_US.lang index 14637b95e6..acd98829a0 100644 --- a/src/resources/assets/miscutils/lang/en_US.lang +++ b/src/resources/assets/miscutils/lang/en_US.lang @@ -3312,3 +3312,34 @@ item.itemScrewHS188A.name=HS-188A Screw item.itemRotorHS188A.name=HS-188A Rotor item.itemGearHS188A.name=HS-188A Gear +//Added 12/12/21 +item.itemIngotErbium.name=Erbium Ingot +item.itemHotIngotErbium.name=Hot Erbium Ingot +item.itemDustErbium.name=Erbium Dust +item.itemDustTinyErbium.name=Tiny Pile of Erbium Dust +item.itemDustSmallErbium.name=Small Pile of Erbium Dust +item.itemNuggetErbium.name=Erbium Nugget +item.itemPlateErbium.name=Erbium Plate +item.itemPlateDoubleErbium.name=Double Erbium Plate +item.itemBoltErbium.name=Erbium Bolt +item.itemRodErbium.name=Erbium Rod +item.itemRodLongErbium.name=Long Erbium Rod +item.itemRingErbium.name=Erbium Ring +item.itemScrewErbium.name=Erbium Screw +item.itemRotorErbium.name=Erbium Rotor +item.itemGearErbium.name=Erbium Gear +item.itemIngotHeLiCoPtEr.name=HeLiCoPtEr Ingot +item.itemHotIngotHeLiCoPtEr.name=Hot HeLiCoPtEr Ingot +item.itemDustHeLiCoPtEr.name=HeLiCoPtEr Dust +item.itemDustTinyHeLiCoPtEr.name=Tiny Pile of HeLiCoPtEr Dust +item.itemDustSmallHeLiCoPtEr.name=Small Pile of HeLiCoPtEr Dust +item.itemNuggetHeLiCoPtEr.name=HeLiCoPtEr Nugget +item.itemPlateHeLiCoPtEr.name=HeLiCoPtEr Plate +item.itemPlateDoubleHeLiCoPtEr.name=Double HeLiCoPtEr Plate +item.itemBoltHeLiCoPtEr.name=HeLiCoPtEr Bolt +item.itemRodHeLiCoPtEr.name=HeLiCoPtEr Rod +item.itemRodLongHeLiCoPtEr.name=Long HeLiCoPtEr Rod +item.itemRingHeLiCoPtEr.name=HeLiCoPtEr Ring +item.itemScrewHeLiCoPtEr.name=HeLiCoPtEr Screw +item.itemRotorHeLiCoPtEr.name=HeLiCoPtEr Rotor +item.itemGearHeLiCoPtEr.name=HeLiCoPtEr Gear \ No newline at end of file -- cgit From 9b7e098f24322ab9ef39349cb0284a19f1cb7214 Mon Sep 17 00:00:00 2001 From: Alkalus <3060479+draknyte1@users.noreply.github.com> Date: Sun, 12 Dec 2021 14:07:42 +0000 Subject: Add one final milling recipe for Monazite. --- build.properties | 2 +- src/Java/gtPlusPlus/core/item/ModItems.java | 1 + .../core/item/chemistry/MilledOreProcessing.java | 46 +++++++++++++++++++++- src/resources/assets/miscutils/lang/en_US.lang | 18 ++++++++- 4 files changed, 64 insertions(+), 3 deletions(-) (limited to 'src/Java/gtPlusPlus/core/item') diff --git a/build.properties b/build.properties index dc028128c1..7156634547 100644 --- a/build.properties +++ b/build.properties @@ -3,6 +3,6 @@ forge.version=10.13.4.1614-1.7.10 ic2.version=2.2.817-experimental gt.version=5.09.37 ae2.version=rv3-beta-22 -gtpp.version=1.7.17 +gtpp.version=1.7.18 commit.hash=aa9f04218e5298414f900b9fe61131f7ed26b8f1 structurelib.version=1.0.6 diff --git a/src/Java/gtPlusPlus/core/item/ModItems.java b/src/Java/gtPlusPlus/core/item/ModItems.java index 819babb1ba..4c6f0dc712 100644 --- a/src/Java/gtPlusPlus/core/item/ModItems.java +++ b/src/Java/gtPlusPlus/core/item/ModItems.java @@ -473,6 +473,7 @@ public final class ModItems { MaterialGenerator.generate(ELEMENT.getInstance().HAFNIUM); MaterialGenerator.generate(ELEMENT.getInstance().DYSPROSIUM); MaterialGenerator.generate(ELEMENT.getInstance().ERBIUM); + MaterialGenerator.generate(ELEMENT.getInstance().PRASEODYMIUM); MaterialGenerator.generate(ELEMENT.getInstance().TELLURIUM); //LFTR byproduct MaterialGenerator.generate(ELEMENT.getInstance().RHODIUM); MaterialGenerator.generate(ELEMENT.getInstance().RHENIUM); diff --git a/src/Java/gtPlusPlus/core/item/chemistry/MilledOreProcessing.java b/src/Java/gtPlusPlus/core/item/chemistry/MilledOreProcessing.java index 8c6e66fcb8..dfc85c533b 100644 --- a/src/Java/gtPlusPlus/core/item/chemistry/MilledOreProcessing.java +++ b/src/Java/gtPlusPlus/core/item/chemistry/MilledOreProcessing.java @@ -42,6 +42,7 @@ public class MilledOreProcessing extends ItemPackage { public static Fluid GrossularFlotationFroth; public static Fluid AlmandineFlotationFroth; public static Fluid PyropeFlotationFroth; + public static Fluid MonaziteFlotationFroth; public static Fluid PineOil; @@ -81,7 +82,10 @@ public class MilledOreProcessing extends ItemPackage { public static Item milledAlmandine; // Magnesium, Manganese, Borax, Rhenium - public static Item milledPyrope; + public static Item milledPyrope; + + // Erbium, Lanthanum, Praseodymium, Europium + public static Item milledMonazite; @Override @@ -98,6 +102,7 @@ public class MilledOreProcessing extends ItemPackage { milledGrossular = BaseItemMilledOre.generate(Materials.Grossular, MaterialUtils.getVoltageForTier(6)); milledAlmandine = BaseItemMilledOre.generate(Materials.Almandine, MaterialUtils.getVoltageForTier(6)); milledPyrope = BaseItemMilledOre.generate(Materials.Pyrope, MaterialUtils.getVoltageForTier(4)); + milledMonazite = BaseItemMilledOre.generate(Materials.Monazite, MaterialUtils.getVoltageForTier(7)); } @@ -130,6 +135,8 @@ public class MilledOreProcessing extends ItemPackage { AlmandineFlotationFroth = FluidUtils.generateFluidNoPrefix("froth.almandineflotation", "Almandine Froth", 32 + 175, new short[] { aAlmandineFrothRGB[0], aAlmandineFrothRGB[1], aAlmandineFrothRGB[2], 100 }, true); short[] aPyropeFrothRGB = Materials.Pyrope.mRGBa; PyropeFlotationFroth = FluidUtils.generateFluidNoPrefix("froth.pyropeflotation", "Pyrope Froth", 32 + 175, new short[] { aPyropeFrothRGB[0], aPyropeFrothRGB[1], aPyropeFrothRGB[2], 100 }, true); + short[] aMonaziteFrothRGB = Materials.Monazite.mRGBa; + MonaziteFlotationFroth = FluidUtils.generateFluidNoPrefix("froth.Monaziteflotation", "Monazite Froth", 32 + 175, new short[] { aMonaziteFrothRGB[0], aMonaziteFrothRGB[1], aMonaziteFrothRGB[2], 100 }, true); PineOil = FluidUtils.generateFluidNoPrefix("pineoil", "Pine Oil", 32 + 175, new short[] { 250, 200, 60, 100 }, true); @@ -233,6 +240,14 @@ public class MilledOreProcessing extends ItemPackage { MaterialUtils.generateMaterialFromGtENUM(Materials.Borax), 60, ELEMENT.getInstance().RHENIUM, 20 ); + //milledMonazite TODO + registerOreDataForMilledType( + MonaziteFlotationFroth, + ELEMENT.getInstance().ERBIUM, 96, + ELEMENT.getInstance().LANTHANUM, 96, + ELEMENT.getInstance().PRASEODYMIUM, 96, + ELEMENT.getInstance().EUROPIUM, 32 + ); } @@ -409,6 +424,21 @@ public class MilledOreProcessing extends ItemPackage { 20 * 120, MaterialUtils.getVoltageForTier(4), 3500); + CORE.RA.addVacuumFurnaceRecipe( + new ItemStack[] { + CI.getNumberedCircuit(aCircuitID++) + }, + new FluidStack[] { + FluidUtils.getFluidStack(MonaziteFlotationFroth, 4000) + }, + getOutputsFromMap(MonaziteFlotationFroth), + new FluidStack[] { + FluidUtils.getFluidStack(AgriculturalChem.RedMud, 2000), + FluidUtils.getWater(2000) + }, + 20 * 120, + MaterialUtils.getVoltageForTier(7), + 7500); } @@ -559,6 +589,20 @@ public class MilledOreProcessing extends ItemPackage { MaterialUtils.getVoltageForTier(4) ); + // Monazite + CORE.RA.addFlotationRecipe( + Materials.Monazite, + ItemUtils.getSimpleStack(GenericChem.mPotassiumEthylXanthate, 1), + new FluidStack[] { + FluidUtils.getFluidStack(PineOil, 30000), + }, + new FluidStack[] { + FluidUtils.getFluidStack(MonaziteFlotationFroth, 1000) + }, + 20 * 1200, + MaterialUtils.getVoltageForTier(6) + ); + } private void addPineOilExtraction() { diff --git a/src/resources/assets/miscutils/lang/en_US.lang b/src/resources/assets/miscutils/lang/en_US.lang index acd98829a0..ee365985e5 100644 --- a/src/resources/assets/miscutils/lang/en_US.lang +++ b/src/resources/assets/miscutils/lang/en_US.lang @@ -3342,4 +3342,20 @@ item.itemRodLongHeLiCoPtEr.name=Long HeLiCoPtEr Rod item.itemRingHeLiCoPtEr.name=HeLiCoPtEr Ring item.itemScrewHeLiCoPtEr.name=HeLiCoPtEr Screw item.itemRotorHeLiCoPtEr.name=HeLiCoPtEr Rotor -item.itemGearHeLiCoPtEr.name=HeLiCoPtEr Gear \ No newline at end of file +item.itemGearHeLiCoPtEr.name=HeLiCoPtEr Gear +item.milledMonazite.name=Milled Monazite +item.itemIngotPraseodymium.name=Praseodymium Ingot +item.itemHotIngotPraseodymium.name=Hot Praseodymium Ingot +item.itemDustPraseodymium.name=Praseodymium Dust +item.itemDustTinyPraseodymium.name=Tiny Pile of Praseodymium Dust +item.itemDustSmallPraseodymium.name=Small Pile of Praseodymium Dust +item.itemNuggetPraseodymium.name=Praseodymium Nugget +item.itemPlatePraseodymium.name=Praseodymium Plate +item.itemPlateDoublePraseodymium.name=Double Praseodymium Plate +item.itemBoltPraseodymium.name=Praseodymium Bolt +item.itemRodPraseodymium.name=Praseodymium Rod +item.itemRodLongPraseodymium.name=Long Praseodymium Rod +item.itemRingPraseodymium.name=Praseodymium Ring +item.itemScrewPraseodymium.name=Praseodymium Screw +item.itemRotorPraseodymium.name=Praseodymium Rotor +item.itemGearPraseodymium.name=Praseodymium Gear -- cgit