diff options
author | miozune <miozune@gmail.com> | 2022-08-05 12:59:51 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-08-05 10:59:51 +0700 |
commit | 970ddeba130cc8abe29800023447536d7f79de8c (patch) | |
tree | c128f9a6af2cdcc3aed5f4e27579902b560b477f | |
parent | 82e73b6119996490d23801ee1fc930eb50589ed7 (diff) | |
download | GT5-Unofficial-970ddeba130cc8abe29800023447536d7f79de8c.tar.gz GT5-Unofficial-970ddeba130cc8abe29800023447536d7f79de8c.tar.bz2 GT5-Unofficial-970ddeba130cc8abe29800023447536d7f79de8c.zip |
NEI Cleanup (#251)
* NEI Cleanup
* adjustments
19 files changed, 306 insertions, 2256 deletions
diff --git a/src/main/java/gregtech/api/util/GTPP_Recipe.java b/src/main/java/gregtech/api/util/GTPP_Recipe.java index 93144aed83..dba084d26d 100644 --- a/src/main/java/gregtech/api/util/GTPP_Recipe.java +++ b/src/main/java/gregtech/api/util/GTPP_Recipe.java @@ -8,9 +8,11 @@ import codechicken.nei.PositionedStack; import gregtech.api.GregTech_API; import gregtech.api.interfaces.tileentity.*; import gregtech.api.objects.GT_ItemStack; +import gregtech.nei.GT_NEI_DefaultHandler.FixedPositionedStack; import gtPlusPlus.api.interfaces.IComparableRecipe; import gtPlusPlus.api.objects.Logger; import gtPlusPlus.api.objects.data.AutoMap; +import gtPlusPlus.api.objects.data.Pair; import gtPlusPlus.core.lib.CORE; import gtPlusPlus.core.util.minecraft.RecipeUtils; import net.minecraft.item.ItemStack; @@ -21,7 +23,7 @@ import net.minecraftforge.fluids.*; * @author Alkalus * */ -public class GTPP_Recipe extends GT_Recipe implements IComparableRecipe { +public class GTPP_Recipe extends GT_Recipe implements IComparableRecipe { private final String mRecipeHash; private final AutoMap<Integer> mHashMap = new AutoMap<Integer>(); @@ -142,32 +144,8 @@ public class GTPP_Recipe extends GT_Recipe implements IComparableRecipe { } } - //Custom Recipe Handlers - public GTPP_Recipe(final ItemStack aInput, final FluidStack aFluid, final ItemStack[] aOutput, final int aDuration, final int aEUt) { - this(true, new ItemStack[]{aInput}, aOutput.clone(), null, null, new FluidStack[]{aFluid}, null, aDuration, aEUt, 0); - if ((this.mInputs.length > 0) && (this.mOutputs[0] != null)) { - GTPP_Recipe_Map.sChemicalDehydratorRecipes.addRecipe(this); - } - } - - /*public GregtechRecipe(ItemStack aInput, FluidStack aFluid, ItemStack[] aOutput, int aDuration, int aEUt) { - this(true, new ItemStack[]{aInput}, aOutput.clone(), null, null, new FluidStack[]{aFluid}, null, aDuration, aEUt, 0); - if (mInputs.length > 0 && mOutputs[0] != null) { - Gregtech_Recipe_Map.sChemicalDehydratorRecipes.addRecipe(this); - } - }*/ - - public static void reInit() { GT_Log.out.println("GT_Mod: Re-Unificating Recipes."); - for (final GTPP_Recipe_Map tMapEntry : GTPP_Recipe_Map.sMappings) { - //tMapEntry.reInit(); - if (tMapEntry != null && tMapEntry.mRecipeList != null && !tMapEntry.mRecipeList.isEmpty()) { - for (GT_Recipe aRecipe : tMapEntry.mRecipeList) { - checkRecipeOwnership(aRecipe); - } - } - } for (final GTPP_Recipe_Map_Internal tMapEntry : GTPP_Recipe_Map_Internal.sMappingsEx) { //tMapEntry.reInit(); if (tMapEntry != null && tMapEntry.mRecipeList != null && !tMapEntry.mRecipeList.isEmpty()) { @@ -194,46 +172,6 @@ public class GTPP_Recipe extends GT_Recipe implements IComparableRecipe { } } - @Override - public ItemStack getRepresentativeInput(final int aIndex) { - if ((aIndex < 0) || (aIndex >= this.mInputs.length)) { - return null; - } - return GT_Utility.copy(this.mInputs[aIndex]); - } - - @Override - public ItemStack getOutput(final int aIndex) { - if ((aIndex < 0) || (aIndex >= this.mOutputs.length)) { - return null; - } - return GT_Utility.copy(this.mOutputs[aIndex]); - } - - @Override - public int getOutputChance(final int aIndex) { - if ((aIndex < 0) || (aIndex >= this.mChances.length)) { - return 10000; - } - return this.mChances[aIndex]; - } - - @Override - public FluidStack getRepresentativeFluidInput(final int aIndex) { - if ((aIndex < 0) || (aIndex >= this.mFluidInputs.length) || (this.mFluidInputs[aIndex] == null)) { - return null; - } - return this.mFluidInputs[aIndex].copy(); - } - - @Override - public FluidStack getFluidOutput(final int aIndex) { - if ((aIndex < 0) || (aIndex >= this.mFluidOutputs.length) || (this.mFluidOutputs[aIndex] == null)) { - return null; - } - return this.mFluidOutputs[aIndex].copy(); - } - public static class GTPP_Recipe_Map_Internal extends GT_Recipe_Map { public static final Collection<GTPP_Recipe_Map_Internal> sMappingsEx = new ArrayList<>(); @@ -244,35 +182,30 @@ public class GTPP_Recipe extends GT_Recipe implements IComparableRecipe { GT_Recipe_Map.sMappings.remove(this); GTPP_Recipe_Map_Internal.sMappingsEx.add(this); } - } public static class GTPP_Recipe_Map { - /** - * Contains all Recipe Maps - */ - public static final Collection<GTPP_Recipe_Map> sMappings = new ArrayList<>(); //public static final GT_Recipe_Map sChemicalBathRecipes = new GT_Recipe_Map(new HashSet<GT_Recipe>(200), "gtpp.recipe.chemicalbath", "Chemical Bath", null, RES_PATH_GUI + "basicmachines/ChemicalBath", 1, 3, 1, 1, 1, E, 1, E, true, true); public static final GTPP_Recipe_Map_Internal sCokeOvenRecipes = new GTPP_Recipe_Map_Internal(new HashSet<GT_Recipe>(200), "gtpp.recipe.cokeoven", "Coke Oven", null, RES_PATH_GUI + "basicmachines/Dehydrator", 2, 9, 1, 0, 1, E, 1, E, true, true); - public static final GTPP_Recipe_Map_Internal sMatterFab2Recipes = new GTPP_Recipe_Map_Internal(new HashSet<GT_Recipe>(200), "gtpp.recipe.matterfab2", "Matter Fabricator", null, RES_PATH_GUI + "basicmachines/Default", 9, 9, 0, 0, 1, E, 1, E, true, true); + public static final GTPP_Recipe_Map_Internal sMatterFab2Recipes = new GTPP_Recipe_Map_Internal(new HashSet<GT_Recipe>(200), "gtpp.recipe.matterfab2", "Matter Fabricator", null, RES_PATH_GUI + "basicmachines/Default", 6, 6, 0, 0, 1, E, 1, E, true, true); //public static final Gregtech_Recipe_Map sMatterFabRecipes = new Gregtech_Recipe_Map(new HashSet<GregtechRecipe>(200), "gtpp.recipe.matterfab", "Matter Fabricator", null, RES_PATH_GUI + "basicmachines/Massfabricator", 1, 3, 1, 1, 1, E, 1, E, true, true); public static final GT_Recipe_Map_Fuel sRocketFuels = new GT_Recipe_Map_Fuel(new HashSet<GT_Recipe>(10), "gtpp.recipe.rocketenginefuel", "Rocket Engine Fuel", null, RES_PATH_GUI + "basicmachines/Default", 1, 1, 0, 0, 1, "Fuel Value: ", 3000, " EU", true, true); public static final GTPP_Recipe_Map_Internal sGeoThermalFuels = new GTPP_Recipe_Map_Internal(new HashSet<GT_Recipe>(10), "gtpp.recipe.geothermalfuel", "GeoThermal Fuel", null, RES_PATH_GUI + "basicmachines/Default", 1, 1, 0, 0, 1, "Fuel Value: ", 1000, " EU", true, true); public static final GTPP_Recipe_Map_Internal sChemicalDehydratorRecipes = new GTPP_Recipe_Map_Internal(new HashSet<GT_Recipe>(200), "gtpp.recipe.chemicaldehydrator", "Dehydrator", null, RES_PATH_GUI + "basicmachines/Dehydrator", 2, 9, 0, 0, 1, E, 1, E, true, true); - public static final GTPP_Recipe_Map_Internal sVacuumFurnaceRecipes = new GTPP_Recipe_Map_Internal(new HashSet<GT_Recipe>(500), "gtpp.recipe.vacfurnace", "Vacuum Furnace", null, "gregtech:textures/gui/basicmachines/Default", 6, 6, 1, 0, 1, "Heat Capacity: ", 1, " K", false, true); - public static final GTPP_Recipe_Map_Internal sAlloyBlastSmelterRecipes = new GTPP_Recipe_Map_Internal(new HashSet<GT_Recipe>(200), "gtpp.recipe.alloyblastsmelter", "Alloy Blast Smelter", null, RES_PATH_GUI + "basicmachines/BlastSmelter", 9, 9, 1, 0, 1, E, 1, E, true, true); + public static final GTPP_Recipe_Map_Internal sVacuumFurnaceRecipes = new GTPP_Recipe_Map_MultiNoCell(new HashSet<GT_Recipe>(500), "gtpp.recipe.vacfurnace", "Vacuum Furnace", null, RES_PATH_GUI + "basicmachines/FissionFuel", 6, 6, 1, 0, 1, "Heat Capacity: ", 1, " K", false, true); + public static final GTPP_Recipe_Map_Internal sAlloyBlastSmelterRecipes = new GTPP_Recipe_Map_MultiNoCell(new HashSet<GT_Recipe>(200), "gtpp.recipe.alloyblastsmelter", "Alloy Blast Smelter", null, RES_PATH_GUI + "basicmachines/FissionFuel", 9, 9, 1, 0, 1, E, 1, E, true, true); public static final GTPP_Recipe_Map_Internal sSteamTurbineFuels = new GTPP_Recipe_Map_Internal(new HashSet<GT_Recipe>(10), "gtpp.recipe.steamturbinefuel", "GeoThermal Fuel", null, RES_PATH_GUI + "basicmachines/Default", 1, 1, 0, 0, 1, "Fuel Value: ", 1000, " EU", true, false); //LFTR recipes - public static final GTPP_Recipe_Map_Internal sLiquidFluorineThoriumReactorRecipes = new GTPP_Recipe_Map_Internal(new HashSet<GT_Recipe>(50), "gtpp.recipe.lftr", "Liquid Fluoride Thorium Reactor", null, RES_PATH_GUI + "basicmachines/FissionFuel", 0, 0, 0, 2, 0, "Power: ", 1, " EU/t per Dynamo", true, true); + public static final GTPP_Recipe_Map_Internal sLiquidFluorineThoriumReactorRecipes = new GTPP_Recipe_Map_MultiNoCell(new HashSet<GT_Recipe>(50), "gtpp.recipe.lftr", "Liquid Fluoride Thorium Reactor", null, RES_PATH_GUI + "basicmachines/FissionFuel", 0, 0, 0, 2, 0, "Power: ", 1, " EU/t per Dynamo", true, true); // Ore Milling Map - public static final GTPP_Recipe_Map_Internal sOreMillRecipes = new GTPP_Recipe_Map_Internal(new HashSet<GT_Recipe>(10000), "gtpp.recipe.oremill", "Milling", null, RES_PATH_GUI + "basicmachines/LFTR", 3, 4, 1, 0, 1, E, 1, E, true, false); + public static final GTPP_Recipe_Map_Internal sOreMillRecipes = new GTPP_Recipe_Map_Internal(new HashSet<GT_Recipe>(10000), "gtpp.recipe.oremill", "Milling", null, RES_PATH_GUI + "basicmachines/LFTR", 3, 4, 1, 0, 1, E, 1, E, true, true); //Fission Fuel Plant Recipes - public static final GTPP_Recipe_Map_Internal sFissionFuelProcessing = new GTPP_Recipe_Map_Internal(new HashSet<GT_Recipe>(50), "gtpp.recipe.fissionfuel", "Nuclear Fuel Processing", null, RES_PATH_GUI + "basicmachines/FissionFuel", 0, 0, 0, 0, 1, E, 1, E, true, false); + public static final GTPP_Recipe_Map_Internal sFissionFuelProcessing = new GTPP_Recipe_Map_MultiNoCell(new HashSet<GT_Recipe>(50), "gtpp.recipe.fissionfuel", "Nuclear Fuel Processing", null, RES_PATH_GUI + "basicmachines/FissionFuel", 0, 0, 0, 0, 1, E, 1, E, true, true); //Cold Trap public static final GTPP_Recipe_Map_Internal sColdTrapRecipes = new GTPP_Recipe_Map_Internal(new HashSet<GT_Recipe>(10000), "gtpp.recipe.coldtrap", "Cold Trap", null, RES_PATH_GUI + "basicmachines/Dehydrator", 2, 9, 0, 0, 1, E, 1, E, true, true); @@ -292,12 +225,12 @@ public class GTPP_Recipe extends GT_Recipe implements IComparableRecipe { //public static final GT_Recipe_Map sSimpleWasherRecipes_FakeFuckBW = new GT_Recipe_Map(new HashSet<GT_Recipe>(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_Internal sChemicalPlantRecipes = new GTPP_Recipe_Map_Internal( + public static final GTPP_Recipe_Map_Internal sChemicalPlantRecipes = new GTPP_Recipe_Map_ChemicalPlant( new HashSet<GT_Recipe>(100), "gtpp.recipe.fluidchemicaleactor", "Chemical Plant", null, - CORE.MODID+":textures/gui/FluidReactor", + CORE.MODID + ":textures/gui/FluidReactor", 0, 0, 0, @@ -307,7 +240,7 @@ public class GTPP_Recipe extends GT_Recipe implements IComparableRecipe { 1, E, true, - false); + true); //RTG Fuel Map @@ -316,14 +249,14 @@ public class GTPP_Recipe extends GT_Recipe implements IComparableRecipe { "gregtech:textures/gui/basicmachines/Default", 1, 1, 0, 0, 1, "Fuel Value: ", 365, " Minecraft Days", true, true); //Thermal Boiler map - public static final GT_Recipe.GT_Recipe_Map_Fuel sThermalFuels = new GT_Recipe_Map_Fuel(new HashSet<GT_Recipe>(10), "gtpp.recipe.thermalgeneratorfuel", - "Thermal Generator Fuel", null, "gregtech:textures/gui/basicmachines/Default", 1, 1, 0, 0, 1, - null, 1000, null, true, false); + public static final GTPP_Recipe_Map_Internal sThermalFuels = new GTPP_Recipe_Map_MultiNoCell(new HashSet<GT_Recipe>(10), "gtpp.recipe.thermalgeneratorfuel", + "Thermal Generator Fuel", null, RES_PATH_GUI + "basicmachines/FissionFuel", 1, 1, 0, 0, 1, + null, 1000, null, true, true); //Solar Tower map - public static final GT_Recipe.GT_Recipe_Map_Fuel sSolarTowerRecipes = new GT_Recipe_Map_Fuel(new HashSet<GT_Recipe>(10), "gtpp.recipe.solartower", - "Solar Tower", null, "gregtech:textures/gui/basicmachines/Default", 1, 1, 0, 0, 1, - null, 1000, null, true, false); + public static final GTPP_Recipe_Map_Internal sSolarTowerRecipes = new GTPP_Recipe_Map_MultiNoCell(new HashSet<GT_Recipe>(10), "gtpp.recipe.solartower", + "Solar Tower", null, RES_PATH_GUI + "basicmachines/FissionFuel", 1, 1, 0, 0, 1, + null, 1000, null, true, true); //Cyclotron recipe map public static final GTPP_Recipe_Map_Internal sCyclotronRecipes = new GTPP_Recipe_Map_Internal(new HashSet<GT_Recipe>(200), "gtpp.recipe.cyclotron", "COMET - Compact Cyclotron", null, RES_PATH_GUI + "basicmachines/BlastSmelter", 2, 16, 0, 0, 1, E, 1, E, true, true); @@ -350,609 +283,284 @@ public class GTPP_Recipe extends GT_Recipe implements IComparableRecipe { //public static final GTPP_Recipe_Map sMultiblockElectrolyzerRecipes = new GT_Recipe_Map_LargeElectrolyzer(); //public static final GTPP_Recipe_Map sAdvFreezerRecipes = new GT_Recipe_Map_AdvancedVacuumFreezer(); - public static final GTPP_Recipe_Map_Internal sAdvFreezerRecipes_GT = new GTPP_Recipe_Map_Internal(new HashSet<GT_Recipe>(2000), "gtpp.recipe.cryogenicfreezer", "Cryogenic Freezer", null, RES_PATH_GUI + "basicmachines/FissionFuel", 9, 9, 0, 0, 1, "", 0, "", false, true); - public static final GTPP_Recipe_Map_Internal sMultiblockCentrifugeRecipes_GT = new GTPP_Recipe_Map_Internal(new HashSet<GT_Recipe>(2000), "gtpp.recipe.multicentrifuge", "Multiblock Centrifuge", null, RES_PATH_GUI + "basicmachines/FissionFuel", 9, 9, 0, 0, 1, "", 0, "", false, true); - public static final GTPP_Recipe_Map_Internal sMultiblockElectrolyzerRecipes_GT = new GTPP_Recipe_Map_Internal(new HashSet<GT_Recipe>(2000), "gtpp.recipe.multielectro", "Multiblock Electrolyzer", null, RES_PATH_GUI + "basicmachines/FissionFuel", 9, 9, 0, 0, 1, "", 0, "", false, true); + public static final GTPP_Recipe_Map_Internal sAdvFreezerRecipes_GT = new GTPP_Recipe_Map_MultiNoCell(new HashSet<GT_Recipe>(2000), "gtpp.recipe.cryogenicfreezer", "Cryogenic Freezer", null, RES_PATH_GUI + "basicmachines/FissionFuel", 9, 9, 0, 0, 1, "", 0, "", false, true); + public static final GTPP_Recipe_Map_Internal sMultiblockCentrifugeRecipes_GT = new GTPP_Recipe_Map_MultiNoCell(new HashSet<GT_Recipe>(2000), "gtpp.recipe.multicentrifuge", "Multiblock Centrifuge", null, RES_PATH_GUI + "basicmachines/FissionFuel", 9, 9, 0, 0, 1, "", 0, "", false, true); + public static final GTPP_Recipe_Map_Internal sMultiblockElectrolyzerRecipes_GT = new GTPP_Recipe_Map_MultiNoCell(new HashSet<GT_Recipe>(2000), "gtpp.recipe.multielectro", "Multiblock Electrolyzer", null, RES_PATH_GUI + "basicmachines/FissionFuel", 9, 9, 0, 0, 1, "", 0, "", false, true); + // internal copy of sChemicalPlantRecipes public static final GTPP_Recipe_Map_Internal sChemicalPlant_GT = new GTPP_Recipe_Map_Internal(new HashSet<GT_Recipe>(2000), "gtpp.recipe.temp4", "temp4", null, RES_PATH_GUI + "basicmachines/PotionBrewer", 0, 0, 0, 0, 0, "", 0, "", false, false); - public static final GTPP_Recipe_Map_Internal sMultiblockMixerRecipes_GT = new GTPP_Recipe_Map_Internal(new HashSet<GT_Recipe>(2000), "gtpp.recipe.multimixer", "Multiblock Mixer", null, RES_PATH_GUI + "basicmachines/FissionFuel", 12, 9, 0, 0, 1, "", 0, "", false, true); + public static final GTPP_Recipe_Map_Internal sMultiblockMixerRecipes_GT = new GTPP_Recipe_Map_MultiNoCell(new HashSet<GT_Recipe>(2000), "gtpp.recipe.multimixer", "Multiblock Mixer", null, RES_PATH_GUI + "basicmachines/FissionFuel", 12, 9, 0, 0, 1, "", 0, "", false, true); //Semi-Fluid Fuel Map public static final GT_Recipe_Map_Fuel sSemiFluidLiquidFuels = new GT_Recipe_Map_Fuel(new HashSet<GT_Recipe>(10), "gtpp.recipe.semifluidgeneratorfuels", "Semifluid Generator Fuels", null, RES_PATH_GUI + "basicmachines/Default", 1, 1, 0, 0, 1, "Fuel Value: ", 1000, " EU", true, true); // Flotation Cell - public static final GTPP_Recipe_Map_Internal sFlotationCellRecipes = new GTPP_Recipe_Map_Internal(new HashSet<GT_Recipe>(10000), "gtpp.recipe.flotationcell", "Flotation Cell", null, RES_PATH_GUI + "basicmachines/LFTR", 6, 4, 1, 1, 1, "Ore Key: ", 1, E, true, false); + public static final GTPP_Recipe_Map_Internal sFlotationCellRecipes = new GTPP_Recipe_Map_Internal(new HashSet<GT_Recipe>(10000), "gtpp.recipe.flotationcell", "Flotation Cell", null, RES_PATH_GUI + "basicmachines/LFTR", 6, 4, 1, 1, 1, "Ore Key: ", 1, E, true, true); // Tree Growth Simulator - public static final GTPP_Recipe_Map_Internal sTreeSimFakeRecipes = new GTPP_Recipe_Map_Internal(new HashSet<GT_Recipe>(100), "gtpp.recipe.treefarm", "Tree Growth Simulator", null, RES_PATH_GUI + "basicmachines/FissionFuel", 9, 9, 1, 0, 1, "", 1, "", false, true); - - - /** - * HashMap of Recipes based on their Items - */ - public final Map<GT_ItemStack, Collection<GTPP_Recipe>> mRecipeItemMap = new HashMap<>(); - /** - * HashMap of Recipes based on their Fluids - */ - public final Map<Fluid, Collection<GTPP_Recipe>> mRecipeFluidMap = new HashMap<>(); - /** - * The List of all Recipes - */ - public final Collection<GTPP_Recipe> mRecipeList; - /** - * String used as an unlocalised Name. - */ - public final String mUnlocalizedName; - /** - * String used in NEI for the Recipe Lists. If null it will use the unlocalised Name instead - */ - public final String mNEIName; - /** - * GUI used for NEI Display. Usually the GUI of the Machine itself - */ - public final String mNEIGUIPath; - public final String mNEISpecialValuePre, mNEISpecialValuePost; - public final int mUsualInputCount, mUsualOutputCount, mNEISpecialValueMultiplier, mMinimalInputItems, mMinimalInputFluids, mAmperage; - public final boolean mNEIAllowed, mShowVoltageAmperageInNEI; - - /** - * Initialises a new type of Recipe Handler. - * - * @param aRecipeList a List you specify as Recipe List. Usually just an ArrayList with a pre-initialised Size. - * @param aUnlocalizedName the unlocalised Name of this Recipe Handler, used mainly for NEI. - * @param aLocalName the displayed Name inside the NEI Recipe GUI. - * @param aNEIGUIPath the displayed GUI Texture, usually just a Machine GUI. Auto-Attaches ".png" if forgotten. - * @param aUsualInputCount the usual amount of Input Slots this Recipe Class has. - * @param aUsualOutputCount the usual amount of Output Slots this Recipe Class has. - * @param aNEISpecialValuePre the String in front of the Special Value in NEI. - * @param aNEISpecialValueMultiplier the Value the Special Value is getting Multiplied with before displaying - * @param aNEISpecialValuePost the String after the Special Value. Usually for a Unit or something. - * @param aNEIAllowed if NEI is allowed to display this Recipe Handler in general. - */ - public GTPP_Recipe_Map(final Collection<GTPP_Recipe> aRecipeList, - final String aUnlocalizedName, final String aLocalName, final String aNEIName, - final String aNEIGUIPath, final int aUsualInputCount, - final int aUsualOutputCount, final int aMinimalInputItems, - final int aMinimalInputFluids, final int aAmperage, - final String aNEISpecialValuePre, final int aNEISpecialValueMultiplier, - final String aNEISpecialValuePost, final boolean aShowVoltageAmperageInNEI, - final boolean aNEIAllowed) { - sMappings.add(this); - this.mNEIAllowed = aNEIAllowed; - this.mShowVoltageAmperageInNEI = aShowVoltageAmperageInNEI; - this.mRecipeList = aRecipeList; - this.mNEIName = aNEIName == null ? aUnlocalizedName : aNEIName; - this.mNEIGUIPath = aNEIGUIPath.endsWith(".png") ? aNEIGUIPath : aNEIGUIPath + ".png"; - this.mNEISpecialValuePre = aNEISpecialValuePre; - this.mNEISpecialValueMultiplier = aNEISpecialValueMultiplier; - this.mNEISpecialValuePost = aNEISpecialValuePost; - this.mAmperage = aAmperage; - this.mUsualInputCount = aUsualInputCount; - this.mUsualOutputCount = aUsualOutputCount; - this.mMinimalInputItems = aMinimalInputItems; - this.mMinimalInputFluids = aMinimalInputFluids; - GregTech_API.sFluidMappings.add(this.mRecipeFluidMap); - GregTech_API.sItemStackMappings.add(this.mRecipeItemMap); - GT_LanguageManager.addStringLocalization(this.mUnlocalizedName = aUnlocalizedName, aLocalName); - } - - public GTPP_Recipe addRecipe(final boolean aOptimize, final ItemStack[] aInputs, final ItemStack[] aOutputs, final Object aSpecial, final int[] aOutputChances, final FluidStack[] aFluidInputs, final FluidStack[] aFluidOutputs, final int aDuration, final int aEUt, final int aSpecialValue) { - return this.addRecipe(new GTPP_Recipe(aOptimize, aInputs, aOutputs, aSpecial, aOutputChances, aFluidInputs, aFluidOutputs, aDuration, aEUt, aSpecialValue)); - } - - public GTPP_Recipe addRecipe(final int[] aOutputChances, final FluidStack[] aFluidInputs, final FluidStack[] aFluidOutputs, final int aDuration, final int aEUt, final int aSpecialValue) { - return this.addRecipe(new GTPP_Recipe(false, null, null, null, aOutputChances, aFluidInputs, aFluidOutputs, aDuration, aEUt, aSpecialValue), false, false, false); - } + public static final GTPP_Recipe_Map_Internal sTreeSimFakeRecipes = new GTPP_Recipe_Map_MultiNoCell(new HashSet<GT_Recipe>(100), "gtpp.recipe.treefarm", "Tree Growth Simulator", null, RES_PATH_GUI + "basicmachines/FissionFuel", 9, 9, 1, 0, 1, "", 1, "", false, true); - public GTPP_Recipe addRecipe(final boolean aOptimize, final ItemStack[] aInputs, final ItemStack[] aOutputs, final Object aSpecial, final FluidStack[] aFluidInputs, final FluidStack[] aFluidOutputs, final int aDuration, final int aEUt, final int aSpecialValue) { - return this.addRecipe(new GTPP_Recipe(aOptimize, aInputs, aOutputs, aSpecial, null, aFluidInputs, aFluidOutputs, aDuration, aEUt, aSpecialValue)); - } - - public GTPP_Recipe addRecipe(final boolean aOptimize, final FluidStack[] aFluidInputs, final FluidStack[] aFluidOutputs, final int aDuration, final int aEUt, final int aSpecialValue) { - return this.addRecipe(new GTPP_Recipe(aOptimize, null, null, null, null, aFluidInputs, aFluidOutputs, aDuration, aEUt, aSpecialValue)); - } - - /*public GregtechRecipe addRecipe(boolean aOptimize, FluidStack aInput1, FluidStack aOutput1, ItemStack[] bInput1, ItemStack[] bOutput1, int aDuration, int aEUt, int aSpecialValue) { - return addRecipe(new GregtechRecipe(aOptimize, aInput1, aOutput1, bInput1,bOutput1, aDuration, aEUt, aSpecialValue)); + } - }*/ + public static class GTPP_Recipe_Map_MultiNoCell extends GTPP_Recipe_Map_Internal { - public GTPP_Recipe addRecipe(final GTPP_Recipe aRecipe) { - Logger.WARNING("Adding Recipe Method 1"); - return this.addRecipe(aRecipe, true, false, false); - } + // region NEI stuff + private static final HashMap<Integer, Pair<Integer, Integer>> mInputSlotMap = new HashMap<>(); + private static final HashMap<Integer, Pair<Integer, Integer>> mOutputSlotMap = new HashMap<>(); - protected GTPP_Recipe addRecipe(final GTPP_Recipe aRecipe, final boolean aCheckForCollisions, final boolean aFakeRecipe, final boolean aHidden) { - Logger.WARNING("Adding Recipe Method 2 - This Checks if hidden, fake or if duplicate recipes exists, I think."); - aRecipe.mHidden = aHidden; - aRecipe.mFakeRecipe = aFakeRecipe; - Logger.WARNING("Logging some data about this method: GregtechRecipe["+aRecipe.toString()+"] | aCheckForCollisions["+aCheckForCollisions+"] | aFakeRecipe["+aFakeRecipe+"] | aHidden["+aHidden+"]"); - Logger.WARNING("Logging some data about this method: mMinimalInputFluids["+this.mMinimalInputFluids+"] | mMinimalInputItems["+this.mMinimalInputItems+"] | aRecipe.mFluidInputs.length["+aRecipe.mFluidInputs.length+"] | aRecipe.mInputs.length["+aRecipe.mInputs.length+"]"); - if ((aRecipe.mFluidInputs.length < this.mMinimalInputFluids) && (aRecipe.mInputs.length < this.mMinimalInputItems)){ - Logger.WARNING("Step 2 failed"); - return null;} - - Logger.WARNING("Logging some data about this method: aCheckForCollisions["+aCheckForCollisions+"] | findRecipe != null ["+(this.findRecipe(null, false, Long.MAX_VALUE, aRecipe.mFluidInputs, aRecipe.mInputs) != null)+"]"); - if (aCheckForCollisions && (this.findRecipe(null, false, Long.MAX_VALUE, aRecipe.mFluidInputs, aRecipe.mInputs) != null)){ - Logger.WARNING("Step 2 failed - 2"); - return null; + static { + int[] slotsX = new int[] {12, 30, 48}; + int[] slotsY = new int[] {5, 23, 41, 64}; + // Input slots + int aIndex = 0; + for (int slotY : slotsY) { + for (int slotX : slotsX) { + mInputSlotMap.put(aIndex++, new Pair<>(slotX, slotY)); + } + } + // Output slots + slotsX = new int[] {102, 120, 138}; + aIndex = 0; + for (int slotY : slotsY) { + for (int slotX : slotsX) { + mOutputSlotMap.put(aIndex++, new Pair<>(slotX, slotY)); + } } - return this.add(aRecipe); - } - - - - /** - * Only used for fake Recipe Handlers to show something in NEI, do not use this for adding actual Recipes! findRecipe wont find fake Recipes, containsInput WILL find fake Recipes - */ - public GTPP_Recipe addFakeRecipe(final boolean aCheckForCollisions, final ItemStack[] aInputs, final ItemStack[] aOutputs, final Object aSpecial, final int[] aOutputChances, final FluidStack[] aFluidInputs, final FluidStack[] aFluidOutputs, final int aDuration, final int aEUt, final int aSpecialValue) { - return this.addFakeRecipe(aCheckForCollisions, new GTPP_Recipe(false, aInputs, aOutputs, aSpecial, aOutputChances, aFluidInputs, aFluidOutputs, aDuration, aEUt, aSpecialValue)); } - /** - * Only used for fake Recipe Handlers to show something in NEI, do not use this for adding actual Recipes! findRecipe wont find fake Recipes, containsInput WILL find fake Recipes - */ - public GTPP_Recipe addFakeRecipe(final boolean aCheckForCollisions, final ItemStack[] aInputs, final ItemStack[] aOutputs, final Object aSpecial, final FluidStack[] aFluidInputs, final FluidStack[] aFluidOutputs, final int aDuration, final int aEUt, final int aSpecialValue) { - return this.addFakeRecipe(aCheckForCollisions, new GTPP_Recipe(false, aInputs, aOutputs, aSpecial, null, aFluidInputs, aFluidOutputs, aDuration, aEUt, aSpecialValue)); - } + // endregion NEI stuff - /** - * Only used for fake Recipe Handlers to show something in NEI, do not use this for adding actual Recipes! findRecipe wont find fake Recipes, containsInput WILL find fake Recipes - */ - public GTPP_Recipe addFakeRecipe(final boolean aCheckForCollisions, final GTPP_Recipe aRecipe) { - return this.addRecipe(aRecipe, aCheckForCollisions, true, false); + public GTPP_Recipe_Map_MultiNoCell(Collection<GT_Recipe> aRecipeList, String aUnlocalizedName, String aLocalName, String aNEIName, String aNEIGUIPath, int aUsualInputCount, int aUsualOutputCount, int aMinimalInputItems, int aMinimalInputFluids, int aAmperage, String aNEISpecialValuePre, int aNEISpecialValueMultiplier, String aNEISpecialValuePost, boolean aShowVoltageAmperageInNEI, boolean aNEIAllowed) { + super(aRecipeList, aUnlocalizedName, aLocalName, aNEIName, aNEIGUIPath, aUsualInputCount, aUsualOutputCount, aMinimalInputItems, aMinimalInputFluids, aAmperage, aNEISpecialValuePre, aNEISpecialValueMultiplier, aNEISpecialValuePost, aShowVoltageAmperageInNEI, aNEIAllowed); } - public GTPP_Recipe add(final GTPP_Recipe aRecipe) { - Logger.WARNING("Adding Recipe Method 3"); - this.mRecipeList.add(aRecipe); - for (final FluidStack aFluid : aRecipe.mFluidInputs) { - if (aFluid != null) { - Logger.WARNING("Fluid is valid - getting some kind of fluid instance to add to the recipe hashmap."); - Collection<GTPP_Recipe> tList = this.mRecipeFluidMap.get(aFluid.getFluid()); - if (tList == null) { - this.mRecipeFluidMap.put(aFluid.getFluid(), tList = new HashSet<>(1)); - } - tList.add(aRecipe); - } - } - return this.addToItemMap(aRecipe); + @Override + public GT_Recipe addRecipe(boolean aOptimize, ItemStack[] aInputs, ItemStack[] aOutputs, Object aSpecial, int[] aOutputChances, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aSpecialValue) { + return addRecipe(new GTPP_Recipe_MultiNoCell(aOptimize, aInputs, aOutputs, aSpecial, aOutputChances, aFluidInputs, aFluidOutputs, aDuration, aEUt, aSpecialValue)); } - public void reInit() { - final Map<GT_ItemStack, Collection<GTPP_Recipe>> tMap = this.mRecipeItemMap; - if (tMap != null) { - tMap.clear(); - } - for (final GTPP_Recipe tRecipe : this.mRecipeList) { - GT_OreDictUnificator.setStackArray(true, tRecipe.mInputs); - GT_OreDictUnificator.setStackArray(true, tRecipe.mOutputs); - if (tMap != null) { - this.addToItemMap(tRecipe); - } - } + @Override + public GT_Recipe addRecipe(int[] aOutputChances, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aSpecialValue) { + return addRecipe(new GTPP_Recipe_MultiNoCell(false, null, null, null, aOutputChances, aFluidInputs, aFluidOutputs, aDuration, aEUt, aSpecialValue), false, false, false); } - /** - * @return if this Item is a valid Input for any for the Recipes - */ - public boolean containsInput(final ItemStack aStack) { - return (aStack != null) && (this.mRecipeItemMap.containsKey(new GT_ItemStack(aStack)) || this.mRecipeItemMap.containsKey(new GT_ItemStack(GT_Utility.copyMetaData(W, aStack)))); + @Override + public GT_Recipe addRecipe(boolean aOptimize, ItemStack[] aInputs, ItemStack[] aOutputs, Object aSpecial, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aSpecialValue) { + return addRecipe(new GTPP_Recipe_MultiNoCell(aOptimize, aInputs, aOutputs, aSpecial, null, aFluidInputs, aFluidOutputs, aDuration, aEUt, aSpecialValue)); } - /** - * @return if this Fluid is a valid Input for any for the Recipes - */ - public boolean containsInput(final FluidStack aFluid) { - return (aFluid != null) && this.containsInput(aFluid.getFluid()); + @Override + public GT_Recipe addFakeRecipe(boolean aCheckForCollisions, ItemStack[] aInputs, ItemStack[] aOutputs, Object aSpecial, int[] aOutputChances, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aSpecialValue) { + return addFakeRecipe(aCheckForCollisions, new GTPP_Recipe_MultiNoCell(false, aInputs, aOutputs, aSpecial, aOutputChances, aFluidInputs, aFluidOutputs, aDuration, aEUt, aSpecialValue)); } - /** - * @return if this Fluid is a valid Input for any for the Recipes - */ - public boolean containsInput(final Fluid aFluid) { - return (aFluid != null) && this.mRecipeFluidMap.containsKey(aFluid); + @Override + public GT_Recipe addFakeRecipe(boolean aCheckForCollisions, ItemStack[] aInputs, ItemStack[] aOutputs, Object aSpecial, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aSpecialValue) { + return addFakeRecipe(aCheckForCollisions, new GTPP_Recipe_MultiNoCell(false, aInputs, aOutputs, aSpecial, null, aFluidInputs, aFluidOutputs, aDuration, aEUt, aSpecialValue)); } - public GTPP_Recipe findRecipe(final IHasWorldObjectAndCoords aTileEntity, final boolean aNotUnificated, final long aVoltage, final FluidStack[] aFluids, final ItemStack... aInputs) { - return this.findRecipe(aTileEntity, null, aNotUnificated, aVoltage, aFluids, null, aInputs); + @Override + public GT_Recipe addFakeRecipe(boolean aCheckForCollisions, ItemStack[] aInputs, ItemStack[] aOutputs, Object aSpecial, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aSpecialValue,boolean hidden) { + return addFakeRecipe(aCheckForCollisions, new GTPP_Recipe_MultiNoCell(false, aInputs, aOutputs, aSpecial, null, aFluidInputs, aFluidOutputs, aDuration, aEUt, aSpecialValue),hidden); } - public GTPP_Recipe findRecipe(final IHasWorldObjectAndCoords aTileEntity, final GTPP_Recipe aRecipe, final boolean aNotUnificated, final long aVoltage, final FluidStack[] aFluids, final ItemStack... aInputs) { - return this.findRecipe(aTileEntity, aRecipe, aNotUnificated, aVoltage, aFluids, null, aInputs); - } + public static class GTPP_Recipe_MultiNoCell extends GT_Recipe { - /** - * finds a Recipe matching the aFluid and ItemStack Inputs. - * - * @param aTileEntity an Object representing the current coordinates of the executing Block/Entity/Whatever. This may be null, especially during Startup. - * @param aRecipe in case this is != null it will try to use this Recipe first when looking things up. - * @param aNotUnificated if this is T the Recipe searcher will unificate the ItemStack Inputs - * @param aVoltage Voltage of the Machine or Long.MAX_VALUE if it has no Voltage - * @param aFluids the Fluid Inputs - * @param aSpecialSlot the content of the Special Slot, the regular Manager doesn't do anything with this, but some custom ones do. - * @param aInputs the Item Inputs - * @return the Recipe it has found or null for no matching Recipe - */ - public GTPP_Recipe findRecipe(final IHasWorldObjectAndCoords aTileEntity, final GTPP_Recipe aRecipe, final boolean aNotUnificated, final long aVoltage, final FluidStack[] aFluids, final ItemStack aSpecialSlot, ItemStack... aInputs) { - // No Recipes? Well, nothing to be found then. - if (this.mRecipeList.isEmpty()) { - return null; + public GTPP_Recipe_MultiNoCell(boolean aOptimize, ItemStack[] aInputs, ItemStack[] aOutputs, Object aSpecialItems, int[] aChances, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aSpecialValue) { + super(aOptimize, aInputs, aOutputs, aSpecialItems, aChances, aFluidInputs, aFluidOutputs, aDuration, aEUt, aSpecialValue); } - // Some Recipe Classes require a certain amount of Inputs of certain kinds. Like "at least 1 Fluid + 1 Stack" or "at least 2 Stacks" before they start searching for Recipes. - // This improves Performance massively, especially if people leave things like Circuits, Molds or Shapes in their Machines to select Sub Recipes. - if (GregTech_API.sPostloadFinished) { - if (this.mMinimalInputFluids > 0) { - if (aFluids == null) { - return null; - } - int tAmount = 0; - for (final FluidStack aFluid : aFluids) { - if (aFluid != null) { - tAmount++; - } - } - if (tAmount < this.mMinimalInputFluids) { - return null; - } - } - if (this.mMinimalInputItems > 0) { - if (aInputs == null) { - return null; - } - int tAmount = 0; - for (final ItemStack aInput : aInputs) { - if (aInput != null) { - tAmount++; - } - } - if (tAmount < this.mMinimalInputItems) { - return null; - } - } - } + @Override + public ArrayList<PositionedStack> getInputPositionedStacks() { + int aInputItemsCount = mInputs.length; + int aInputFluidsCount = mFluidInputs.length; + int aInputSlotsUsed = 0; + int aSlotToCheck = 0; - // Unification happens here in case the Input isn't already unificated. - if (aNotUnificated) { - aInputs = GT_OreDictUnificator.getStackArray(true, (Object[]) aInputs); - } + ArrayList<PositionedStack> inputStacks = new ArrayList<>(aInputItemsCount + aInputFluidsCount); - // Check the Recipe which has been used last time in order to not have to search for it again, if possible. - if (aRecipe != null) { - if (!aRecipe.mFakeRecipe && aRecipe.mCanBeBuffered && aRecipe.isRecipeInputEqual(false, true, aFluids, aInputs)) { - return aRecipe.mEnabled && ((aVoltage * this.mAmperage) >= aRecipe.mEUt) ? aRecipe : null; + // Special Slot + if (mSpecialItems != null) { + inputStacks.add(new FixedPositionedStack(mSpecialItems, 120, 52)); } - } - - // Now look for the Recipes inside the Item HashMaps, but only when the Recipes usually have Items. - if ((this.mUsualInputCount > 0) && (aInputs != null)) { - for (final ItemStack tStack : aInputs) { - if (tStack != null) { - Collection<GTPP_Recipe> - tRecipes = this.mRecipeItemMap.get(new GT_ItemStack(tStack)); - if (tRecipes != null) { - for (final GTPP_Recipe tRecipe : tRecipes) { - if (!tRecipe.mFakeRecipe && tRecipe.isRecipeInputEqual(false, true, aFluids, aInputs)) { - return tRecipe.mEnabled && ((aVoltage * this.mAmperage) >= tRecipe.mEUt) ? tRecipe : null; - } - } - } - tRecipes = this.mRecipeItemMap.get(new GT_ItemStack(GT_Utility.copyMetaData(W, tStack))); - if (tRecipes != null) { - for (final GTPP_Recipe tRecipe : tRecipes) { - if (!tRecipe.mFakeRecipe && tRecipe.isRecipeInputEqual(false, true, aFluids, aInputs)) { - return tRecipe.mEnabled && ((aVoltage * this.mAmperage) >= tRecipe.mEUt) ? tRecipe : null; - } - } - } + // Up to 9 Inputs Slots + if (aInputItemsCount > 0) { + if (aInputItemsCount > 9) { + aInputItemsCount = 9; } - } - } - - // If the minimal Amount of Items for the Recipe is 0, then it could be a Fluid-Only Recipe, so check that Map too. - if ((this.mMinimalInputItems == 0) && (aFluids != null)) { - for (final FluidStack aFluid : aFluids) { - if (aFluid != null) { - final Collection<GTPP_Recipe> - tRecipes = this.mRecipeFluidMap.get(aFluid.getFluid()); - if (tRecipes != null) { - for (final GTPP_Recipe tRecipe : tRecipes) { - if (!tRecipe.mFakeRecipe && tRecipe.isRecipeInputEqual(false, true, aFluids, aInputs)) { - return tRecipe.mEnabled && ((aVoltage * this.mAmperage) >= tRecipe.mEUt) ? tRecipe : null; - } - } + for (int i=0;i<aInputItemsCount;i++) { + int x = mInputSlotMap.get(aInputSlotsUsed).getKey(); + int y = mInputSlotMap.get(aInputSlotsUsed).getValue(); + ItemStack aRepStack = getRepresentativeInput(aSlotToCheck++); + if (aRepStack != null) { + inputStacks.add(new FixedPositionedStack(aRepStack, x, y)); + aInputSlotsUsed++; } } } - } - - // And nothing has been found. - return null; - } - - protected GTPP_Recipe addToItemMap(final GTPP_Recipe aRecipe) { - Logger.WARNING("Adding Recipe Method 4"); - for (final ItemStack aStack : aRecipe.mInputs) { - if (aStack != null) { - Logger.WARNING("Method 4 - Manipulating "+aStack.getDisplayName()); - final GT_ItemStack tStack = new GT_ItemStack(aStack); - Logger.WARNING("Method 4 - Made gt stack of item "+tStack.toStack().getDisplayName()); - Collection<GTPP_Recipe> tList = this.mRecipeItemMap.get(tStack); - if (tList != null){ - Logger.WARNING("Method 4 - Gt Recipe Hashmap: "+tList.toString()); - } - if (tList == null){ - Logger.WARNING("Method 4 - brrr list was NUll"); - this.mRecipeItemMap.put(tStack, tList = new HashSet<>(1)); - Logger.WARNING("Method 4 - Attemping backup method for Gt Recipe Hashmap:"); - - while (tList.iterator().hasNext()){ - Logger.WARNING(tList.iterator().next().toString()); - } - + // Up to 9 Fluid Inputs Slots + aSlotToCheck = aInputSlotsUsed; + if (aInputFluidsCount > 0) { + for (int i=0;i<aInputFluidsCount;i++) { + int x = mInputSlotMap.get(aSlotToCheck).getKey(); + int y = mInputSlotMap.get(aSlotToCheck).getValue(); + inputStacks.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(mFluidInputs[i], true), x, y)); + aSlotToCheck++; + aInputSlotsUsed++; } - tList.add(aRecipe); - Logger.WARNING("Method 4 - Added recipe to map? I think."); } + + return inputStacks; } - return aRecipe; - } - public GTPP_Recipe findRecipe(final IGregTechTileEntity baseMetaTileEntity, final GTPP_Recipe aRecipe, final boolean aNotUnificated, - final long aVoltage, final FluidStack[] aFluids, final FluidStack[] fluidStacks) { + @Override + public ArrayList<PositionedStack> getOutputPositionedStacks() { + int aOutputItemsCount = mOutputs.length; + int aOutputFluidsCount = mFluidOutputs.length; + int aOutputSlotsUsed = 0; + int aSlotToCheck = 0; - ItemStack aInputs[] = null; - // No Recipes? Well, nothing to be found then. - if (this.mRecipeList.isEmpty()) { - return null; - } + ArrayList<PositionedStack> outputStacks = new ArrayList<>(aOutputItemsCount + aOutputFluidsCount); - // Some Recipe Classes require a certain amount of Inputs of certain kinds. Like "at least 1 Fluid + 1 Stack" or "at least 2 Stacks" before they start searching for Recipes. - // This improves Performance massively, especially if people leave things like Circuits, Molds or Shapes in their Machines to select Sub Recipes. - if (GregTech_API.sPostloadFinished) { - if (this.mMinimalInputFluids > 0) { - if (aFluids == null) { - return null; + // Up to 9 Output Slots + if (aOutputItemsCount > 0) { + if (aOutputItemsCount > 9) { + aOutputItemsCount = 9; } - int tAmount = 0; - for (final FluidStack aFluid : aFluids) { - if (aFluid != null) { - tAmount++; + for (int i=0;i<aOutputItemsCount;i++) { + int x = mOutputSlotMap.get(aOutputSlotsUsed).getKey(); + int y = mOutputSlotMap.get(aOutputSlotsUsed).getValue(); + ItemStack aRepStack = getOutput(aSlotToCheck); + if (aRepStack != null) { + outputStacks.add(new FixedPositionedStack(aRepStack, x, y, getOutputChance(aSlotToCheck))); + aOutputSlotsUsed++; } - } - if (tAmount < this.mMinimalInputFluids) { - return null; + aSlotToCheck++; } } - if (this.mMinimalInputItems > 0) { - if (aInputs == null) { - return null; - } - int tAmount = 0; - for (final ItemStack aInput : aInputs) { - if (aInput != null) { - tAmount++; - } + // Up to 9 Fluid Outputs Slots + aSlotToCheck = aOutputSlotsUsed; + if (aOutputFluidsCount > 0) { + for (int i=0;i<aOutputFluidsCount;i++) { + int x = mOutputSlotMap.get(aSlotToCheck).getKey(); + int y = mOutputSlotMap.get(aSlotToCheck).getValue(); + outputStacks.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(mFluidOutputs[i], true), x, y)); + aSlotToCheck++; + aOutputSlotsUsed++; } - if (tAmount < this.mMinimalInputItems) { - return null; - } - } - } - - // Unification happens here in case the Input isn't already unificated. - if (aNotUnificated) { - aInputs = GT_OreDictUnificator.getStackArray(true, (Object[]) aInputs); - } - - // Check the Recipe which has been used last time in order to not have to search for it again, if possible. - if (aRecipe != null) { - if (!aRecipe.mFakeRecipe && aRecipe.mCanBeBuffered && aRecipe.isRecipeInputEqual(false, true, aFluids, aInputs)) { - return aRecipe.mEnabled && ((aVoltage * this.mAmperage) >= aRecipe.mEUt) ? aRecipe : null; } - } - // Now look for the Recipes inside the Item HashMaps, but only when the Recipes usually have Items. - if ((this.mUsualInputCount > 0) && (aInputs != null)) { - for (final ItemStack tStack : aInputs) { - if (tStack != null) { - Collection<GTPP_Recipe> - tRecipes = this.mRecipeItemMap.get(new GT_ItemStack(tStack)); - if (tRecipes != null) { - for (final GTPP_Recipe tRecipe : tRecipes) { - if (!tRecipe.mFakeRecipe && tRecipe.isRecipeInputEqual(false, true, aFluids, aInputs)) { - return tRecipe.mEnabled && ((aVoltage * this.mAmperage) >= tRecipe.mEUt) ? tRecipe : null; - } - } - } - tRecipes = this.mRecipeItemMap.get(new GT_ItemStack(GT_Utility.copyMetaData(W, tStack))); - if (tRecipes != null) { - for (final GTPP_Recipe tRecipe : tRecipes) { - if (!tRecipe.mFakeRecipe && tRecipe.isRecipeInputEqual(false, true, aFluids, aInputs)) { - return tRecipe.mEnabled && ((aVoltage * this.mAmperage) >= tRecipe.mEUt) ? tRecipe : null; - } - } - } - } - } + return outputStacks; } - - // If the minimal Amount of Items for the Recipe is 0, then it could be a Fluid-Only Recipe, so check that Map too. - if ((this.mMinimalInputItems == 0) && (aFluids != null)) { - for (final FluidStack aFluid : aFluids) { - if (aFluid != null) { - final Collection<GTPP_Recipe> - tRecipes = this.mRecipeFluidMap.get(aFluid.getFluid()); - if (tRecipes != null) { - for (final GTPP_Recipe tRecipe : tRecipes) { - if (!tRecipe.mFakeRecipe && tRecipe.isRecipeInputEqual(false, true, aFluids, aInputs)) { - return tRecipe.mEnabled && ((aVoltage * this.mAmperage) >= tRecipe.mEUt) ? tRecipe : null; - } - } - } - } - } - } - - // And nothing has been found. - return null; } } - // ----------------------------------------------------------------------------------------------------------------- - // Here are a few Classes I use for Special Cases in some Machines without having to write a separate Machine Class. - // ----------------------------------------------------------------------------------------------------------------- + public static class GTPP_Recipe_Map_ChemicalPlant extends GTPP_Recipe_Map_Internal { - /** - * Abstract Class for general Recipe Handling of non GT Recipes - */ - public static abstract class GT_Recipe_Map_NonGTRecipes extends GTPP_Recipe_Map { - public GT_Recipe_Map_NonGTRecipes(final Collection<GTPP_Recipe> aRecipeList, final String aUnlocalizedName, final String aLocalName, final String aNEIName, final String aNEIGUIPath, final int aUsualInputCount, final int aUsualOutputCount, final int aMinimalInputItems, final int aMinimalInputFluids, final int aAmperage, final String aNEISpecialValuePre, final int aNEISpecialValueMultiplier, final String aNEISpecialValuePost, final boolean aShowVoltageAmperageInNEI, final boolean aNEIAllowed) { + public GTPP_Recipe_Map_ChemicalPlant(Collection<GT_Recipe> aRecipeList, String aUnlocalizedName, String aLocalName, String aNEIName, String aNEIGUIPath, int aUsualInputCount, int aUsualOutputCount, int aMinimalInputItems, int aMinimalInputFluids, int aAmperage, String aNEISpecialValuePre, int aNEISpecialValueMultiplier, String aNEISpecialValuePost, boolean aShowVoltageAmperageInNEI, boolean aNEIAllowed) { super(aRecipeList, aUnlocalizedName, aLocalName, aNEIName, aNEIGUIPath, aUsualInputCount, aUsualOutputCount, aMinimalInputItems, aMinimalInputFluids, aAmperage, aNEISpecialValuePre, aNEISpecialValueMultiplier, aNEISpecialValuePost, aShowVoltageAmperageInNEI, aNEIAllowed); } @Override - public boolean containsInput(final ItemStack aStack) { - return false; + public GT_Recipe addRecipe(boolean aOptimize, ItemStack[] aInputs, ItemStack[] aOutputs, Object aSpecial, int[] aOutputChances, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aSpecialValue) { + return addRecipe(new GTPP_Recipe_ChemicalPlant(aOptimize, aInputs, aOutputs, aSpecial, aOutputChances, aFluidInputs, aFluidOutputs, aDuration, aEUt, aSpecialValue)); } @Override - public boolean containsInput(final FluidStack aFluid) { - return false; + public GT_Recipe addRecipe(int[] aOutputChances, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aSpecialValue) { + return addRecipe(new GTPP_Recipe_ChemicalPlant(false, null, null, null, aOutputChances, aFluidInputs, aFluidOutputs, aDuration, aEUt, aSpecialValue), false, false, false); } @Override - public boolean containsInput(final Fluid aFluid) { - return false; + public GT_Recipe addRecipe(boolean aOptimize, ItemStack[] aInputs, ItemStack[] aOutputs, Object aSpecial, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aSpecialValue) { + return addRecipe(new GTPP_Recipe_ChemicalPlant(aOptimize, aInputs, aOutputs, aSpecial, null, aFluidInputs, aFluidOutputs, aDuration, aEUt, aSpecialValue)); } - @Override - public GTPP_Recipe addRecipe(final boolean aOptimize, final ItemStack[] aInputs, final ItemStack[] aOutputs, final Object aSpecial, final int[] aOutputChances, final FluidStack[] aFluidInputs, final FluidStack[] aFluidOutputs, final int aDuration, final int aEUt, final int aSpecialValue) { - return null; - } - - @Override - public GTPP_Recipe addRecipe(final boolean aOptimize, final ItemStack[] aInputs, final ItemStack[] aOutputs, final Object aSpecial, final FluidStack[] aFluidInputs, final FluidStack[] aFluidOutputs, final int aDuration, final int aEUt, final int aSpecialValue) { - return null; - } - - @Override - public GTPP_Recipe addRecipe(final GTPP_Recipe aRecipe) { - return null; - } - - @Override - public GTPP_Recipe addFakeRecipe(final boolean aCheckForCollisions, final ItemStack[] aInputs, final ItemStack[] aOutputs, final Object aSpecial, final int[] aOutputChances, final FluidStack[] aFluidInputs, final FluidStack[] aFluidOutputs, final int aDuration, final int aEUt, final int aSpecialValue) { - return null; - } - - @Override - public GTPP_Recipe addFakeRecipe(final boolean aCheckForCollisions, final ItemStack[] aInputs, final ItemStack[] aOutputs, final Object aSpecial, final FluidStack[] aFluidInputs, final FluidStack[] aFluidOutputs, final int aDuration, final int aEUt, final int aSpecialValue) { - return null; - } - - @Override - public GTPP_Recipe addFakeRecipe(final boolean aCheckForCollisions, final GTPP_Recipe aRecipe) { - return null; - } + public static class GTPP_Recipe_ChemicalPlant extends GT_Recipe { - @Override - public GTPP_Recipe add(final GTPP_Recipe aRecipe) { - return null; - } - - @Override - public void reInit() {/**/} - - @Override - protected GTPP_Recipe addToItemMap(final GTPP_Recipe aRecipe) { - return null; - } - } - - /** - * Just a Recipe Map with Utility specifically for Fuels. - */ - public static class Gregtech_Recipe_Map_Fuel extends GTPP_Recipe_Map { - public Gregtech_Recipe_Map_Fuel(final Collection<GTPP_Recipe> aRecipeList, final String aUnlocalizedName, final String aLocalName, final String aNEIName, final String aNEIGUIPath, final int aUsualInputCount, final int aUsualOutputCount, final int aMinimalInputItems, final int aMinimalInputFluids, final int aAmperage, final String aNEISpecialValuePre, final int aNEISpecialValueMultiplier, final String aNEISpecialValuePost, final boolean aShowVoltageAmperageInNEI, final boolean aNEIAllowed) { - super(aRecipeList, aUnlocalizedName, aLocalName, aNEIName, aNEIGUIPath, aUsualInputCount, aUsualOutputCount, aMinimalInputItems, aMinimalInputFluids, aAmperage, aNEISpecialValuePre, aNEISpecialValueMultiplier, aNEISpecialValuePost, aShowVoltageAmperageInNEI, aNEIAllowed); - } + public GTPP_Recipe_ChemicalPlant(boolean aOptimize, ItemStack[] aInputs, ItemStack[] aOutputs, Object aSpecialItems, int[] aChances, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aSpecialValue) { + super(aOptimize, aInputs, aOutputs, aSpecialItems, aChances, aFluidInputs, aFluidOutputs, aDuration, aEUt, aSpecialValue); + } - public GTPP_Recipe addFuel(final ItemStack aInput, final ItemStack aOutput, final int aFuelValueInEU) { - Logger.WARNING("Adding Fuel using method 1"); - return this.addFuel(aInput, aOutput, null, null, 10000, aFuelValueInEU); - } + @Override + public ArrayList<PositionedStack> getInputPositionedStacks() { + int tStartIndex = 0; + ArrayList<PositionedStack> inputStacks = new ArrayList<>(mInputs.length + mFluidInputs.length); - public GTPP_Recipe addFuel(final ItemStack aInput, final ItemStack aOutput, final int aChance, final int aFuelValueInEU) { - Logger.WARNING("Adding Fuel using method 2"); - return this.addFuel(aInput, aOutput, null, null, aChance, aFuelValueInEU); - } + // Four Input Slots + if (getRepresentativeInput(tStartIndex) != null) { + inputStacks.add(new FixedPositionedStack(getRepresentativeInput(tStartIndex), 3, -4)); + } + tStartIndex++; + if (getRepresentativeInput(tStartIndex) != null) { + inputStacks.add(new FixedPositionedStack(getRepresentativeInput(tStartIndex), 21, -4)); + } + tStartIndex++; + if (getRepresentativeInput(tStartIndex) != null) { + inputStacks.add(new FixedPositionedStack(getRepresentativeInput(tStartIndex), 39, -4)); + } + tStartIndex++; + if (getRepresentativeInput(tStartIndex) != null) { + inputStacks.add(new FixedPositionedStack(getRepresentativeInput(tStartIndex), 57, -4)); + } + tStartIndex++; - public GTPP_Recipe addFuel(final FluidStack aFluidInput, final FluidStack aFluidOutput, final int aFuelValueInEU) { - Logger.WARNING("Adding Fuel using method 3"); - return this.addFuel(null, null, aFluidInput, aFluidOutput, 10000, aFuelValueInEU); - } + if (mSpecialItems != null) { + inputStacks.add(new FixedPositionedStack(mSpecialItems, 120, 52)); + } - public GTPP_Recipe addFuel(final ItemStack aInput, final ItemStack aOutput, final FluidStack aFluidInput, final FluidStack aFluidOutput, final int aFuelValueInEU) { - Logger.WARNING("Adding Fuel using method 4"); - return this.addFuel(aInput, aOutput, aFluidInput, aFluidOutput, 10000, aFuelValueInEU); - } + //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 (mFluidInputs.length >= 1) { + if ((mFluidInputs[0] != null) && (mFluidInputs[0].getFluid() != null)) { + inputStacks.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(mFluidInputs[0], true), 3, 31)); + } + if ((mFluidInputs.length > 1) && (mFluidInputs[1] != null) && (mFluidInputs[1].getFluid() != null)) { + inputStacks.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(mFluidInputs[1], true), 21, 31)); + } + if ((mFluidInputs.length > 2) && (mFluidInputs[2] != null) && (mFluidInputs[2].getFluid() != null)) { + inputStacks.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(mFluidInputs[2], true), 39, 31)); + } + if ((mFluidInputs.length > 3) && (mFluidInputs[3] != null) && (mFluidInputs[3].getFluid() != null)) { + inputStacks.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(mFluidInputs[3], true), 57, 31)); + } + } - public GTPP_Recipe addFuel(final ItemStack aInput, final ItemStack aOutput, final FluidStack aFluidInput, final FluidStack aFluidOutput, final int aChance, final int aFuelValueInEU) { - Logger.WARNING("Adding Fuel using method 5"); - return this.addRecipe(true, new ItemStack[]{aInput}, new ItemStack[]{aOutput}, null, new int[]{aChance}, new FluidStack[]{aFluidInput}, new FluidStack[]{aFluidOutput}, 0, 0, aFuelValueInEU); - } - } + return inputStacks; + } - @Override - public ArrayList<PositionedStack> getInputPositionedStacks() { - return null; - } + @Override + public ArrayList<PositionedStack> getOutputPositionedStacks() { + int tStartIndex = 0; + ArrayList<PositionedStack> outputStacks = new ArrayList<>(mOutputs.length + mFluidOutputs.length); - @Override - public ArrayList<PositionedStack> getOutputPositionedStacks() { - return null; - } + //Four Output Slots + if (getOutput(tStartIndex) != null) { + outputStacks.add(new FixedPositionedStack(getOutput(tStartIndex), 102, 5, getOutputChance(tStartIndex))); + } + tStartIndex++; + if (getOutput(tStartIndex) != null) { + outputStacks.add(new FixedPositionedStack(getOutput(tStartIndex), 120, 5, getOutputChance(tStartIndex))); + } + tStartIndex++; + if (getOutput(tStartIndex) != null) { + outputStacks.add(new FixedPositionedStack(getOutput(tStartIndex), 102, 23, getOutputChance(tStartIndex))); + } + tStartIndex++; + if (getOutput(tStartIndex) != null) { + outputStacks.add(new FixedPositionedStack(getOutput(tStartIndex), 120, 23, getOutputChance(tStartIndex))); + } + tStartIndex++; - public int compareTo(GTPP_Recipe recipe) { - // first lowest tier recipes - // then fastest - // then with lowest special value - // then dry recipes - // then with fewer inputs - if (this.mEUt != recipe.mEUt) { - return this.mEUt - recipe.mEUt; - } else if (this.mDuration != recipe.mDuration) { - return this.mDuration - recipe.mDuration; - } else if (this.mSpecialValue != recipe.mSpecialValue) { - return this.mSpecialValue - recipe.mSpecialValue; - } else if (this.mFluidInputs.length != recipe.mFluidInputs.length) { - return this.mFluidInputs.length - recipe.mFluidInputs.length; - } else if (this.mInputs.length != recipe.mInputs.length) { - return this.mInputs.length - recipe.mInputs.length; - } - return 0; - } + if (mFluidOutputs.length > 0) { + if ((mFluidOutputs[0] != null) && (mFluidOutputs[0].getFluid() != null)) { + outputStacks.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(mFluidOutputs[0], true), 138, 5)); + } + if ((mFluidOutputs.length > 1) && (mFluidOutputs[1] != null) && (mFluidOutputs[1].getFluid() != null)) { + outputStacks.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(mFluidOutputs[1], true), 138, 23)); + } + } - @Override - public int compareTo(GT_Recipe recipe) { - // first lowest tier recipes - // then fastest - // then with lowest special value - // then dry recipes - // then with fewer inputs - if (this.mEUt != recipe.mEUt) { - return this.mEUt - recipe.mEUt; - } else if (this.mDuration != recipe.mDuration) { - return this.mDuration - recipe.mDuration; - } else if (this.mSpecialValue != recipe.mSpecialValue) { - return this.mSpecialValue - recipe.mSpecialValue; - } else if (this.mFluidInputs.length != recipe.mFluidInputs.length) { - return this.mFluidInputs.length - recipe.mFluidInputs.length; - } else if (this.mInputs.length != recipe.mInputs.length) { - return this.mInputs.length - recipe.mInputs.length; + return outputStacks; + } } - return 0; } - } diff --git a/src/main/java/gregtech/api/util/HotFuel.java b/src/main/java/gregtech/api/util/HotFuel.java index e709926f83..511361f8ae 100644 --- a/src/main/java/gregtech/api/util/HotFuel.java +++ b/src/main/java/gregtech/api/util/HotFuel.java @@ -7,7 +7,7 @@ import net.minecraftforge.fluids.FluidStack; public class HotFuel { public static void addNewHotFuel(FluidStack aInput1, FluidStack aOutput1, ItemStack[] outputItems, int[] chances, int aSpecialValue) { - GTPP_Recipe x = new GTPP_Recipe( + GTPP_Recipe.GTPP_Recipe_Map.sThermalFuels.addRecipe( true, null, outputItems, @@ -19,11 +19,10 @@ public class HotFuel { 0, //No Eu produced aSpecialValue //Magic Number ); - GTPP_Recipe.GTPP_Recipe_Map.sThermalFuels.addRecipe(x); } public static void addNewHotFuel(FluidStack aInput1, FluidStack aOutput1, FluidStack aOutput2, int aSpecialValue) { - GTPP_Recipe x = new GTPP_Recipe( + GTPP_Recipe.GTPP_Recipe_Map.sThermalFuels.addRecipe( false, null, null, @@ -35,7 +34,6 @@ public class HotFuel { 0, //No Eu produced aSpecialValue //Magic Number ); - GTPP_Recipe.GTPP_Recipe_Map.sThermalFuels.addRecipe(x); } diff --git a/src/main/java/gtPlusPlus/nei/GTPP_NEI_DefaultHandler.java b/src/main/java/gtPlusPlus/nei/GTPP_NEI_DefaultHandler.java index d714e9ba53..27dce789ae 100644 --- a/src/main/java/gtPlusPlus/nei/GTPP_NEI_DefaultHandler.java +++ b/src/main/java/gtPlusPlus/nei/GTPP_NEI_DefaultHandler.java @@ -1,65 +1,21 @@ package gtPlusPlus.nei; -import java.awt.Rectangle; -import java.lang.ref.SoftReference; import java.util.*; -import java.util.stream.Collectors; -import org.lwjgl.opengl.GL11; - -import codechicken.lib.gui.GuiDraw; +import gregtech.nei.GT_NEI_DefaultHandler; +import gtPlusPlus.core.util.minecraft.ItemUtils; import codechicken.nei.PositionedStack; -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.objects.ItemData; import gregtech.api.util.*; import gregtech.api.util.GT_Recipe.GT_Recipe_Map; -import gtPlusPlus.api.objects.data.Pair; -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<List<CachedDefaultRecipe>> mCachedRecipes = null; - - private static final HashMap<Integer, Pair<Integer, Integer>> mInputSlotMap = new HashMap<Integer, Pair<Integer, Integer>>(); - private static final HashMap<Integer, Pair<Integer, Integer>> mOutputSlotMap = new HashMap<Integer, Pair<Integer, Integer>>(); - - static { - 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<aSlotY.length;y++) { - for (int x=0; x<aSlotX.length;x++) { - mInputSlotMap.put(aIndex++, new Pair<Integer, Integer>(aSlotX[x], aSlotY[y])); - } - } - // Output slots - aSlotX = new int[] {102, 120, 138}; - aIndex = 0; - for (int y=0; y<aSlotY.length;y++) { - for (int x=0; x<aSlotX.length;x++) { - mOutputSlotMap.put(aIndex++, new Pair<Integer, Integer>(aSlotX[x], aSlotY[y])); - } - } - } - protected final GT_Recipe_Map mRecipeMap; +public class GTPP_NEI_DefaultHandler extends GT_NEI_DefaultHandler { public GTPP_NEI_DefaultHandler(final GT_Recipe_Map tMap) { - this.mRecipeMap = tMap; - this.transferRects.add(new TemplateRecipeHandler.RecipeTransferRect(new Rectangle(65, 13, 36, 18), this.getOverlayIdentifier(), new Object[0])); + super(tMap); if (!NEI_GT_Config.sIsAdded) { FMLInterModComms.sendRuntimeMessage(GT_Values.GT, "NEIPlugins", "register-crafting-handler", "gregtechplusplus@" + this.getRecipeName() + "@" + this.getOverlayIdentifier()); GuiCraftingRecipe.craftinghandlers.add(this); @@ -67,855 +23,35 @@ public class GTPP_NEI_DefaultHandler extends TemplateRecipeHandler { } } - 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 GTPP_NEI_DefaultHandler(this.mRecipeMap); } - - - public List<GT_Recipe> getSortedRecipes() { - List<GT_Recipe> result = new ArrayList<>(this.mRecipeMap.mRecipeList); - Collections.sort(result); - return result; - } - - public List<CachedDefaultRecipe> getCache() { - List<CachedDefaultRecipe> 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())) { - arecipes.addAll(getCache()); - } else { - super.loadCraftingRecipes(outputId, results); - } - } - - public void loadCraftingRecipes(ItemStack aResult) { - ItemData tPrefixMaterial = GT_OreDictUnificator.getAssociation(aResult); - - ArrayList<ItemStack> 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 (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<ItemStack> 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 (CachedDefaultRecipe recipe : getCache()) { - if (tInputs.stream().anyMatch(stack -> recipe.contains(recipe.mInputs, stack))) - arecipes.add(recipe); - } - } - - @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<String> handleItemTooltip(final GuiRecipe<?> gui, final ItemStack aStack, final List<String> 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; - } + public List<String> handleItemTooltip(GuiRecipe<?> gui, ItemStack aStack, List<String> currenttip, int aRecipeIndex) { + super.handleItemTooltip(gui, aStack, currenttip, aRecipeIndex); + CachedRecipe tObject = this.arecipes.get(aRecipeIndex); + if (tObject instanceof CachedDefaultRecipe) { + CachedDefaultRecipe tRecipe = (CachedDefaultRecipe) tObject; + for (PositionedStack tStack : tRecipe.mOutputs) { + // no-op } - for (final PositionedStack tStack : tRecipe.mInputs) { + for (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; + if (ItemUtils.isMillingBall(aStack)) { + currenttip.remove(GT_Utility.trans("151", "Does not get consumed in the process")); + currenttip.add("Does not always get consumed in the process"); } - 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 long tDuration = ((CachedDefaultRecipe) this.arecipes.get(aRecipeIndex)).mRecipe.mDuration; - if (tEUt != 0) { - 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: " + MathUtils.formatNumbers(tEUt / this.mRecipeMap.mAmperage) + " EU", -16777216); - drawText(10, 103, "Amperage: " + this.mRecipeMap.mAmperage, -16777216); - } else { - drawText(10, 93, "Voltage: unspecified", -16777216); - drawText(10, 103, "Amperage: unspecified", -16777216); - } - } - if (tDuration > 0) { - drawText(10, 113, "Time: " + (tDuration < 20 ? "< 1" : MathUtils.formatNumbers(0.05d * tDuration)) + " 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); - } - } - - @Deprecated - public static class GT_RectHandler - implements IContainerInputHandler, IContainerTooltipHandler { - @Override - public boolean mouseClicked(final GuiContainer gui, final int mousex, final int mousey, final int button) { - return false; - } - - @Override - public boolean lastKeyTyped(final GuiContainer gui, final char keyChar, final int keyCode) { - return false; - } - - public boolean canHandle(final GuiContainer gui) { - return false; - } - - @Override - public List<String> handleTooltip(final GuiContainer gui, final int mousex, final int mousey, final List<String> currenttip) { - return currenttip; - } - - private boolean transferRect(final GuiContainer gui, final boolean usage) { - return false; - } - - @Override - public List<String> handleItemDisplayName(final GuiContainer gui, final ItemStack itemstack, final List<String> currenttip) { - return currenttip; - } - - @Override - public List<String> handleItemTooltip(final GuiContainer gui, final ItemStack itemstack, final int mousex, final int mousey, final List<String> 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, true); - } - - public FixedPositionedStack(final Object object, final int x, final int y, boolean aUnificate) { - this(object, x, y, 0, aUnificate); - } - - public FixedPositionedStack(final Object object, final int x, final int y, final int aChance) { - this(object, x, y, aChance, true); - } - - public FixedPositionedStack(final Object object, final int x, final int y, final int aChance, boolean aUnificate) { - super(aUnificate ? GT_OreDictUnificator.getNonUnifiedStacks(object) : object, x, y, true); - this.mChance = aChance; - } - - @Override - public void generatePermutations() { - if (this.permutated) { - return; - } - final ArrayList<ItemStack> tDisplayStacks = new ArrayList<ItemStack>(); - for (final ItemStack tStack : this.items) { - if (GT_Utility.isStackValid(tStack)) { - if (tStack.getItemDamage() == 32767) { - final List<ItemStack> permutations = codechicken.nei.ItemList.itemMap.get(tStack.getItem()); - if (!permutations.isEmpty()) { - ItemStack stack; - for (final Iterator<ItemStack> 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})); + if (ItemUtils.isCatalyst(aStack)) { + currenttip.remove(GT_Utility.trans("151", "Does not get consumed in the process")); + currenttip.add("Does not always get consumed in the process"); + currenttip.add("Higher tier pipe casings allow this item to last longer"); } } } - 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<PositionedStack> mOutputs = new ArrayList<PositionedStack>(); - public final List<PositionedStack> mInputs = new ArrayList<PositionedStack>(); - - 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 (mRecipe.getRepresentativeInput(tStartIndex) != null) { - this.mInputs.add(new FixedPositionedStack(mRecipe.getRepresentativeInput(tStartIndex), 48, 14)); - } - tStartIndex++; - break; - case 2: - if (mRecipe.getRepresentativeInput(tStartIndex) != null) { - this.mInputs.add(new FixedPositionedStack(mRecipe.getRepresentativeInput(tStartIndex), 30, 14)); - } - tStartIndex++; - if (mRecipe.getRepresentativeInput(tStartIndex) != null) { - this.mInputs.add(new FixedPositionedStack(mRecipe.getRepresentativeInput(tStartIndex), 48, 14)); - } - tStartIndex++; - break; - case 3: - if (mRecipe.getRepresentativeInput(tStartIndex) != null) { - this.mInputs.add(new FixedPositionedStack(mRecipe.getRepresentativeInput(tStartIndex), 12, 14)); - } - tStartIndex++; - if (mRecipe.getRepresentativeInput(tStartIndex) != null) { - this.mInputs.add(new FixedPositionedStack(mRecipe.getRepresentativeInput(tStartIndex), 30, 14)); - } - tStartIndex++; - if (mRecipe.getRepresentativeInput(tStartIndex) != null) { - this.mInputs.add(new FixedPositionedStack(mRecipe.getRepresentativeInput(tStartIndex), 48, 14)); - } - tStartIndex++; - break; - case 4: - 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), 30, 23)); - } - tStartIndex++; - if (mRecipe.getRepresentativeInput(tStartIndex) != null) { - this.mInputs.add(new FixedPositionedStack(mRecipe.getRepresentativeInput(tStartIndex), 48, 23)); - } - tStartIndex++; - break; - case 5: - 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), 30, 23)); - } - tStartIndex++; - if (mRecipe.getRepresentativeInput(tStartIndex) != null) { - this.mInputs.add(new FixedPositionedStack(mRecipe.getRepresentativeInput(tStartIndex), 48, 23)); - } - tStartIndex++; - break; - case 6: - 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++; - break; - case 7: - if (mRecipe.getRepresentativeInput(tStartIndex) != null) { - this.mInputs.add(new FixedPositionedStack(mRecipe.getRepresentativeInput(tStartIndex), 12, -4)); - } - tStartIndex++; - if (mRecipe.getRepresentativeInput(tStartIndex) != null) { - this.mInputs.add(new FixedPositionedStack(mRecipe.getRepresentativeInput(tStartIndex), 30, -4)); - } - tStartIndex++; - if (mRecipe.getRepresentativeInput(tStartIndex) != null) { - this.mInputs.add(new FixedPositionedStack(mRecipe.getRepresentativeInput(tStartIndex), 48, -4)); - } - tStartIndex++; - if (mRecipe.getRepresentativeInput(tStartIndex) != null) { - this.mInputs.add(new FixedPositionedStack(mRecipe.getRepresentativeInput(tStartIndex), 12, 14)); - } - tStartIndex++; - if (mRecipe.getRepresentativeInput(tStartIndex) != null) { - this.mInputs.add(new FixedPositionedStack(mRecipe.getRepresentativeInput(tStartIndex), 30, 14)); - } - tStartIndex++; - if (mRecipe.getRepresentativeInput(tStartIndex) != null) { - this.mInputs.add(new FixedPositionedStack(mRecipe.getRepresentativeInput(tStartIndex), 48, 14)); - } - tStartIndex++; - if (mRecipe.getRepresentativeInput(tStartIndex) != null) { - this.mInputs.add(new FixedPositionedStack(mRecipe.getRepresentativeInput(tStartIndex), 12, 32)); - } - tStartIndex++; - break; - case 8: - if (mRecipe.getRepresentativeInput(tStartIndex) != null) { - this.mInputs.add(new FixedPositionedStack(mRecipe.getRepresentativeInput(tStartIndex), 12, -4)); - } - tStartIndex++; - if (mRecipe.getRepresentativeInput(tStartIndex) != null) { - this.mInputs.add(new FixedPositionedStack(mRecipe.getRepresentativeInput(tStartIndex), 30, -4)); - } - tStartIndex++; - if (mRecipe.getRepresentativeInput(tStartIndex) != null) { - this.mInputs.add(new FixedPositionedStack(mRecipe.getRepresentativeInput(tStartIndex), 48, -4)); - } - tStartIndex++; - if (mRecipe.getRepresentativeInput(tStartIndex) != null) { - this.mInputs.add(new FixedPositionedStack(mRecipe.getRepresentativeInput(tStartIndex), 12, 14)); - } - tStartIndex++; - if (mRecipe.getRepresentativeInput(tStartIndex) != null) { - this.mInputs.add(new FixedPositionedStack(mRecipe.getRepresentativeInput(tStartIndex), 30, 14)); - } - tStartIndex++; - if (mRecipe.getRepresentativeInput(tStartIndex) != null) { - this.mInputs.add(new FixedPositionedStack(mRecipe.getRepresentativeInput(tStartIndex), 48, 14)); - } - tStartIndex++; - if (mRecipe.getRepresentativeInput(tStartIndex) != null) { - this.mInputs.add(new FixedPositionedStack(mRecipe.getRepresentativeInput(tStartIndex), 12, 32)); - } - tStartIndex++; - if (mRecipe.getRepresentativeInput(tStartIndex) != null) { - this.mInputs.add(new FixedPositionedStack(mRecipe.getRepresentativeInput(tStartIndex), 30, 32)); - } - tStartIndex++; - break; - default: - if (mRecipe.getRepresentativeInput(tStartIndex) != null) { - this.mInputs.add(new FixedPositionedStack(mRecipe.getRepresentativeInput(tStartIndex), 12, -4)); - } - tStartIndex++; - if (mRecipe.getRepresentativeInput(tStartIndex) != null) { - this.mInputs.add(new FixedPositionedStack(mRecipe.getRepresentativeInput(tStartIndex), 30, -4)); - } - tStartIndex++; - if (mRecipe.getRepresentativeInput(tStartIndex) != null) { - this.mInputs.add(new FixedPositionedStack(mRecipe.getRepresentativeInput(tStartIndex), 48, -4)); - } - tStartIndex++; - if (mRecipe.getRepresentativeInput(tStartIndex) != null) { - this.mInputs.add(new FixedPositionedStack(mRecipe.getRepresentativeInput(tStartIndex), 12, 14)); - } - tStartIndex++; - if (mRecipe.getRepresentativeInput(tStartIndex) != null) { - this.mInputs.add(new FixedPositionedStack(mRecipe.getRepresentativeInput(tStartIndex), 30, 14)); - } - tStartIndex++; - if (mRecipe.getRepresentativeInput(tStartIndex) != null) { - this.mInputs.add(new FixedPositionedStack(mRecipe.getRepresentativeInput(tStartIndex), 48, 14)); - } - tStartIndex++; - if (mRecipe.getRepresentativeInput(tStartIndex) != null) { - this.mInputs.add(new FixedPositionedStack(mRecipe.getRepresentativeInput(tStartIndex), 12, 32)); - } - tStartIndex++; - if (mRecipe.getRepresentativeInput(tStartIndex) != null) { - this.mInputs.add(new FixedPositionedStack(mRecipe.getRepresentativeInput(tStartIndex), 30, 32)); - } - tStartIndex++; - if (mRecipe.getRepresentativeInput(tStartIndex) != null) { - this.mInputs.add(new FixedPositionedStack(mRecipe.getRepresentativeInput(tStartIndex), 48, 32)); - } - tStartIndex++; - } - if (mRecipe.mSpecialItems != null) { - this.mInputs.add(new FixedPositionedStack(mRecipe.mSpecialItems, 120, 52)); - } - tStartIndex = 0; - boolean tUnificate = mRecipeMap.mNEIUnificateOutput; - switch (GTPP_NEI_DefaultHandler.this.mRecipeMap.mUsualOutputCount) { - case 0: - break; - case 1: - if (mRecipe.getOutput(tStartIndex) != null) { - this.mOutputs.add(new FixedPositionedStack(mRecipe.getOutput(tStartIndex), 102, 14, mRecipe.getOutputChance(tStartIndex), tUnificate)); - } - tStartIndex++; - break; - case 2: - if (mRecipe.getOutput(tStartIndex) != null) { - this.mOutputs.add(new FixedPositionedStack(mRecipe.getOutput(tStartIndex), 102, 14, mRecipe.getOutputChance(tStartIndex), tUnificate)); - } - tStartIndex++; - if (mRecipe.getOutput(tStartIndex) != null) { - this.mOutputs.add(new FixedPositionedStack(mRecipe.getOutput(tStartIndex), 120, 14, mRecipe.getOutputChance(tStartIndex), tUnificate)); - } - tStartIndex++; - break; - case 3: - if (mRecipe.getOutput(tStartIndex) != null) { - this.mOutputs.add(new FixedPositionedStack(mRecipe.getOutput(tStartIndex), 102, 14, mRecipe.getOutputChance(tStartIndex), tUnificate)); - } - tStartIndex++; - if (mRecipe.getOutput(tStartIndex) != null) { - this.mOutputs.add(new FixedPositionedStack(mRecipe.getOutput(tStartIndex), 120, 14, mRecipe.getOutputChance(tStartIndex), tUnificate)); - } - tStartIndex++; - if (mRecipe.getOutput(tStartIndex) != null) { - this.mOutputs.add(new FixedPositionedStack(mRecipe.getOutput(tStartIndex), 138, 14, mRecipe.getOutputChance(tStartIndex), tUnificate)); - } - tStartIndex++; - break; - case 4: - if (mRecipe.getOutput(tStartIndex) != null) { - this.mOutputs.add(new FixedPositionedStack(mRecipe.getOutput(tStartIndex), 102, 5, mRecipe.getOutputChance(tStartIndex), tUnificate)); - } - tStartIndex++; - if (mRecipe.getOutput(tStartIndex) != null) { - this.mOutputs.add(new FixedPositionedStack(mRecipe.getOutput(tStartIndex), 120, 5, mRecipe.getOutputChance(tStartIndex), tUnificate)); - } - tStartIndex++; - if (mRecipe.getOutput(tStartIndex) != null) { - this.mOutputs.add(new FixedPositionedStack(mRecipe.getOutput(tStartIndex), 102, 23, mRecipe.getOutputChance(tStartIndex), tUnificate)); - } - tStartIndex++; - if (mRecipe.getOutput(tStartIndex) != null) { - this.mOutputs.add(new FixedPositionedStack(mRecipe.getOutput(tStartIndex), 120, 23, mRecipe.getOutputChance(tStartIndex), tUnificate)); - } - tStartIndex++; - break; - case 5: - if (mRecipe.getOutput(tStartIndex) != null) { - this.mOutputs.add(new FixedPositionedStack(mRecipe.getOutput(tStartIndex), 102, 5, mRecipe.getOutputChance(tStartIndex), tUnificate)); - } - tStartIndex++; - if (mRecipe.getOutput(tStartIndex) != null) { - this.mOutputs.add(new FixedPositionedStack(mRecipe.getOutput(tStartIndex), 120, 5, mRecipe.getOutputChance(tStartIndex), tUnificate)); - } - tStartIndex++; - if (mRecipe.getOutput(tStartIndex) != null) { - this.mOutputs.add(new FixedPositionedStack(mRecipe.getOutput(tStartIndex), 138, 5, mRecipe.getOutputChance(tStartIndex), tUnificate)); - } - tStartIndex++; - if (mRecipe.getOutput(tStartIndex) != null) { - this.mOutputs.add(new FixedPositionedStack(mRecipe.getOutput(tStartIndex), 102, 23, mRecipe.getOutputChance(tStartIndex), tUnificate)); - } - tStartIndex++; - if (mRecipe.getOutput(tStartIndex) != null) { - this.mOutputs.add(new FixedPositionedStack(mRecipe.getOutput(tStartIndex), 120, 23, mRecipe.getOutputChance(tStartIndex), tUnificate)); - } - tStartIndex++; - break; - case 6: - if (mRecipe.getOutput(tStartIndex) != null) { - this.mOutputs.add(new FixedPositionedStack(mRecipe.getOutput(tStartIndex), 102, 5, mRecipe.getOutputChance(tStartIndex), tUnificate)); - } - tStartIndex++; - if (mRecipe.getOutput(tStartIndex) != null) { - this.mOutputs.add(new FixedPositionedStack(mRecipe.getOutput(tStartIndex), 120, 5, mRecipe.getOutputChance(tStartIndex), tUnificate)); - } - tStartIndex++; - if (mRecipe.getOutput(tStartIndex) != null) { - this.mOutputs.add(new FixedPositionedStack(mRecipe.getOutput(tStartIndex), 138, 5, mRecipe.getOutputChance(tStartIndex), tUnificate)); - } - tStartIndex++; - if (mRecipe.getOutput(tStartIndex) != null) { - this.mOutputs.add(new FixedPositionedStack(mRecipe.getOutput(tStartIndex), 102, 23, mRecipe.getOutputChance(tStartIndex), tUnificate)); - } - tStartIndex++; - if (mRecipe.getOutput(tStartIndex) != null) { - this.mOutputs.add(new FixedPositionedStack(mRecipe.getOutput(tStartIndex), 120, 23, mRecipe.getOutputChance(tStartIndex), tUnificate)); - } - tStartIndex++; - if (mRecipe.getOutput(tStartIndex) != null) { - this.mOutputs.add(new FixedPositionedStack(mRecipe.getOutput(tStartIndex), 138, 23, mRecipe.getOutputChance(tStartIndex), tUnificate)); - } - tStartIndex++; - break; - case 7: - if (mRecipe.getOutput(tStartIndex) != null) { - this.mOutputs.add(new FixedPositionedStack(mRecipe.getOutput(tStartIndex), 102, -4, mRecipe.getOutputChance(tStartIndex), tUnificate)); - } - tStartIndex++; - if (mRecipe.getOutput(tStartIndex) != null) { - this.mOutputs.add(new FixedPositionedStack(mRecipe.getOutput(tStartIndex), 120, -4, mRecipe.getOutputChance(tStartIndex), tUnificate)); - } - tStartIndex++; - if (mRecipe.getOutput(tStartIndex) != null) { - this.mOutputs.add(new FixedPositionedStack(mRecipe.getOutput(tStartIndex), 138, -4, mRecipe.getOutputChance(tStartIndex), tUnificate)); - } - tStartIndex++; - if (mRecipe.getOutput(tStartIndex) != null) { - this.mOutputs.add(new FixedPositionedStack(mRecipe.getOutput(tStartIndex), 102, 14, mRecipe.getOutputChance(tStartIndex), tUnificate)); - } - tStartIndex++; - if (mRecipe.getOutput(tStartIndex) != null) { - this.mOutputs.add(new FixedPositionedStack(mRecipe.getOutput(tStartIndex), 120, 14, mRecipe.getOutputChance(tStartIndex), tUnificate)); - } - tStartIndex++; - if (mRecipe.getOutput(tStartIndex) != null) { - this.mOutputs.add(new FixedPositionedStack(mRecipe.getOutput(tStartIndex), 138, 14, mRecipe.getOutputChance(tStartIndex), tUnificate)); - } - tStartIndex++; - if (mRecipe.getOutput(tStartIndex) != null) { - this.mOutputs.add(new FixedPositionedStack(mRecipe.getOutput(tStartIndex), 102, 32, mRecipe.getOutputChance(tStartIndex), tUnificate)); - } - tStartIndex++; - break; - case 8: - if (mRecipe.getOutput(tStartIndex) != null) { - this.mOutputs.add(new FixedPositionedStack(mRecipe.getOutput(tStartIndex), 102, -4, mRecipe.getOutputChance(tStartIndex), tUnificate)); - } - tStartIndex++; - if (mRecipe.getOutput(tStartIndex) != null) { - this.mOutputs.add(new FixedPositionedStack(mRecipe.getOutput(tStartIndex), 120, -4, mRecipe.getOutputChance(tStartIndex), tUnificate)); - } - tStartIndex++; - if (mRecipe.getOutput(tStartIndex) != null) { - this.mOutputs.add(new FixedPositionedStack(mRecipe.getOutput(tStartIndex), 138, -4, mRecipe.getOutputChance(tStartIndex), tUnificate)); - } - tStartIndex++; - if (mRecipe.getOutput(tStartIndex) != null) { - this.mOutputs.add(new FixedPositionedStack(mRecipe.getOutput(tStartIndex), 102, 14, mRecipe.getOutputChance(tStartIndex), tUnificate)); - } - tStartIndex++; - if (mRecipe.getOutput(tStartIndex) != null) { - this.mOutputs.add(new FixedPositionedStack(mRecipe.getOutput(tStartIndex), 120, 14, mRecipe.getOutputChance(tStartIndex), tUnificate)); - } - tStartIndex++; - if (mRecipe.getOutput(tStartIndex) != null) { - this.mOutputs.add(new FixedPositionedStack(mRecipe.getOutput(tStartIndex), 138, 14, mRecipe.getOutputChance(tStartIndex), tUnificate)); - } - tStartIndex++; - if (mRecipe.getOutput(tStartIndex) != null) { - this.mOutputs.add(new FixedPositionedStack(mRecipe.getOutput(tStartIndex), 102, 32, mRecipe.getOutputChance(tStartIndex), tUnificate)); - } - tStartIndex++; - if (mRecipe.getOutput(tStartIndex) != null) { - this.mOutputs.add(new FixedPositionedStack(mRecipe.getOutput(tStartIndex), 120, 32, mRecipe.getOutputChance(tStartIndex), tUnificate)); - } - tStartIndex++; - break; - default: - if (mRecipe.getOutput(tStartIndex) != null) { - this.mOutputs.add(new FixedPositionedStack(mRecipe.getOutput(tStartIndex), 102, -4, mRecipe.getOutputChance(tStartIndex), tUnificate)); - } - tStartIndex++; - if (mRecipe.getOutput(tStartIndex) != null) { - this.mOutputs.add(new FixedPositionedStack(mRecipe.getOutput(tStartIndex), 120, -4, mRecipe.getOutputChance(tStartIndex), tUnificate)); - } - tStartIndex++; - if (mRecipe.getOutput(tStartIndex) != null) { - this.mOutputs.add(new FixedPositionedStack(mRecipe.getOutput(tStartIndex), 138, -4, mRecipe.getOutputChance(tStartIndex), tUnificate)); - } - tStartIndex++; - if (mRecipe.getOutput(tStartIndex) != null) { - this.mOutputs.add(new FixedPositionedStack(mRecipe.getOutput(tStartIndex), 102, 14, mRecipe.getOutputChance(tStartIndex), tUnificate)); - } - tStartIndex++; - if (mRecipe.getOutput(tStartIndex) != null) { - this.mOutputs.add(new FixedPositionedStack(mRecipe.getOutput(tStartIndex), 120, 14, mRecipe.getOutputChance(tStartIndex), tUnificate)); - } - tStartIndex++; - if (mRecipe.getOutput(tStartIndex) != null) { - this.mOutputs.add(new FixedPositionedStack(mRecipe.getOutput(tStartIndex), 138, 14, mRecipe.getOutputChance(tStartIndex), tUnificate)); - } - tStartIndex++; - if (mRecipe.getOutput(tStartIndex) != null) { - this.mOutputs.add(new FixedPositionedStack(mRecipe.getOutput(tStartIndex), 102, 32, mRecipe.getOutputChance(tStartIndex), tUnificate)); - } - tStartIndex++; - if (mRecipe.getOutput(tStartIndex) != null) { - this.mOutputs.add(new FixedPositionedStack(mRecipe.getOutput(tStartIndex), 120, 32, mRecipe.getOutputChance(tStartIndex), tUnificate)); - } - tStartIndex++; - if (mRecipe.getOutput(tStartIndex) != null) { - this.mOutputs.add(new FixedPositionedStack(mRecipe.getOutput(tStartIndex), 138, 32, mRecipe.getOutputChance(tStartIndex), tUnificate)); - } - 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), 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 (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, tUnificate)); - } - if (mRecipe.mFluidOutputs[1] != null && (mRecipe.mFluidOutputs[1].getFluid() != null)) { - this.mOutputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(mRecipe.mFluidOutputs[1], true), 138, 5, tUnificate)); - } - 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, tUnificate)); - } - 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, tUnificate)); - } - 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, tUnificate)); - } - } 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, tUnificate)); - } - } - - @Override - public List<PositionedStack> getIngredients() { - return this.getCycledIngredients(GTPP_NEI_DefaultHandler.this.cycleticks / 10, this.mInputs); - } - - @Override - public PositionedStack getResult() { - return null; - } - - @Override - public List<PositionedStack> getOtherStacks() { - 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<aInputItemsCount;i++) { - int x = mInputSlotMap.get(aInputSlotsUsed).getKey(); - int y = mInputSlotMap.get(aInputSlotsUsed).getValue(); - ItemStack aRepStack = mRecipe.getRepresentativeInput(aSlotToCheck++); - if (aRepStack != null) { - this.mInputs.add(new FixedPositionedStack(aRepStack, x, y)); - aInputSlotsUsed++; - } - } - } - aSlotToCheck = 0; - // Upto 9 Output Slots - if (aOutputItemsCount > 0) { - if (aOutputItemsCount > 9) { - aOutputItemsCount = 9; - } - for (int i=0;i<aOutputItemsCount;i++) { - int x = mOutputSlotMap.get(aOutputSlotsUsed).getKey(); - int y = mOutputSlotMap.get(aOutputSlotsUsed).getValue(); - ItemStack aRepStack = mRecipe.getOutput(aSlotToCheck); - if (aRepStack != null) { - this.mOutputs.add(new FixedPositionedStack(aRepStack, x, y, mRecipe.getOutputChance(aSlotToCheck), mRecipeMap.mNEIUnificateOutput)); - aOutputSlotsUsed++; - } - aSlotToCheck++; - } - } - - /* - * Fluids - */ - - // Upto 9 Fluid Inputs Slots - aSlotToCheck = aInputSlotsUsed; - if (aInputFluidsCount > 0) { - for (int i=0;i<aInputFluidsCount;i++) { - int x = mInputSlotMap.get(aSlotToCheck).getKey(); - int y = mInputSlotMap.get(aSlotToCheck).getValue(); - this.mInputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(mRecipe.mFluidInputs[i], true), x, y)); - aSlotToCheck++; - aInputSlotsUsed++; - } - } - // Upto 9 Fluid Outputs Slots - aSlotToCheck = aOutputSlotsUsed; - if (aOutputFluidsCount > 0) { - for (int i=0;i<aOutputFluidsCount;i++) { - int x = mOutputSlotMap.get(aSlotToCheck).getKey(); - int y = mOutputSlotMap.get(aSlotToCheck).getValue(); - this.mOutputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(mRecipe.mFluidOutputs[i], true), x, y, mRecipeMap.mNEIUnificateOutput)); - aSlotToCheck++; - aOutputSlotsUsed++; - } - } - } + return currenttip; } } diff --git a/src/main/java/gtPlusPlus/nei/GT_NEI_FlotationCell.java b/src/main/java/gtPlusPlus/nei/GT_NEI_FlotationCell.java deleted file mode 100644 index 0578a96a97..0000000000 --- a/src/main/java/gtPlusPlus/nei/GT_NEI_FlotationCell.java +++ /dev/null @@ -1,101 +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_FlotationCell extends GTPP_NEI_DefaultHandler { - - public GT_NEI_FlotationCell() { - super(GTPP_Recipe_Map.sFlotationCellRecipes); - } - - @Override - public TemplateRecipeHandler newInstance() { - return new GT_NEI_FlotationCell(); - } - - @Override - public CachedDefaultRecipe createCachedRecipe(GT_Recipe aRecipe) { - return new FlotationCellDefaultRecipe(aRecipe); - } - - public class FlotationCellDefaultRecipe extends CachedDefaultRecipe { - - public FlotationCellDefaultRecipe(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 - boolean tUnificate = mRecipeMap.mNEIUnificateOutput; - if (mRecipe.getOutput(tStartIndex) != null) { - this.mOutputs.add(new FixedPositionedStack(mRecipe.getOutput(tStartIndex), 102, 5, mRecipe.getOutputChance(tStartIndex), tUnificate)); - } - tStartIndex++; - if (mRecipe.getOutput(tStartIndex) != null) { - this.mOutputs.add(new FixedPositionedStack(mRecipe.getOutput(tStartIndex), 120, 5, mRecipe.getOutputChance(tStartIndex), tUnificate)); - } - tStartIndex++; - if (mRecipe.getOutput(tStartIndex) != null) { - this.mOutputs.add(new FixedPositionedStack(mRecipe.getOutput(tStartIndex), 102, 23, mRecipe.getOutputChance(tStartIndex), tUnificate)); - } - tStartIndex++; - if (mRecipe.getOutput(tStartIndex) != null) { - this.mOutputs.add(new FixedPositionedStack(mRecipe.getOutput(tStartIndex), 120, 23, mRecipe.getOutputChance(tStartIndex), tUnificate)); - } - 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), 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 (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, tUnificate)); - } - 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, tUnificate)); - } - } - } - - } -} diff --git a/src/main/java/gtPlusPlus/nei/GT_NEI_FluidReactor.java b/src/main/java/gtPlusPlus/nei/GT_NEI_FluidReactor.java index 29d28a9213..2ea0121ed9 100644 --- a/src/main/java/gtPlusPlus/nei/GT_NEI_FluidReactor.java +++ b/src/main/java/gtPlusPlus/nei/GT_NEI_FluidReactor.java @@ -1,16 +1,7 @@ package gtPlusPlus.nei; -import java.util.List; - -import codechicken.nei.PositionedStack; -import codechicken.nei.recipe.GuiRecipe; 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 gtPlusPlus.core.util.math.MathUtils; -import gtPlusPlus.core.util.minecraft.ItemUtils; -import net.minecraft.item.ItemStack; public class GT_NEI_FluidReactor extends GTPP_NEI_DefaultHandler { @@ -24,173 +15,32 @@ public class GT_NEI_FluidReactor extends GTPP_NEI_DefaultHandler { } @Override - public CachedDefaultRecipe createCachedRecipe(GT_Recipe aRecipe) { - return new ChemPlantDefaultRecipe(aRecipe); - } - - @Override - public List<String> handleItemTooltip(final GuiRecipe<?> gui, final ItemStack aStack, final List<String> currenttip, final int aRecipeIndex) { - final TemplateRecipeHandler.CachedRecipe tObject = this.arecipes.get(aRecipeIndex); - 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)) { - 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.isCatalyst(aStack)) { - currenttip.add("Does not always get consumed in the process"); - currenttip.add("Higher tier pipe casings allow this item to last longer"); - } - else if (ItemUtils.isControlCircuit(aStack)) { - currenttip.add("Does not get consumed in the process"); - } - break; - } - } + protected String getSpecialInfo(int specialValue) { + String aTierMaterial = " - "; + if (specialValue <= 0) { + aTierMaterial += "Bronze"; } - return currenttip; - } - - @Override - public void drawExtras(final int aRecipeIndex) { - 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: " + MathUtils.formatNumbers((long) (tDuration * tEUt)) + " EU", -16777216); - //drawText(10, 83, "Usage: " + tEUt + " EU/t", -16777216); - if (this.mRecipeMap.mShowVoltageAmperageInNEI) { - 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); - drawText(10, 103, "Amperage: unspecified", -16777216); - } + else if (specialValue == 1) { + aTierMaterial += "Steel"; } - if (tDuration > 0) { - drawText(10, 103, "Time: " + (tDuration < 20 ? "< 1" : MathUtils.formatNumbers(0.05d * tDuration)) + " secs", -16777216); + else if (specialValue == 2) { + aTierMaterial += "Aluminium"; } - if ((GT_Utility.isStringValid(this.mRecipeMap.mNEISpecialValuePre)) || (GT_Utility.isStringValid(this.mRecipeMap.mNEISpecialValuePost))) { - int aTier = (((ChemPlantDefaultRecipe) this.arecipes.get(aRecipeIndex)).mRecipe.mSpecialValue); - String aTierMaterial = " - "; - if (aTier <= 0) { - aTierMaterial += "Bronze"; - } - else if (aTier == 1) { - aTierMaterial += "Steel"; - } - else if (aTier == 2) { - aTierMaterial += "Aluminium"; - } - else if (aTier == 3) { - aTierMaterial += "Stainless Steel"; - } - else if (aTier == 4) { - aTierMaterial += "Titanium"; - } - else if (aTier == 5) { - aTierMaterial += "Tungsten Steel"; - } - else if (aTier == 6) { - aTierMaterial += "Laurenium"; - } - else if (aTier == 7) { - aTierMaterial += "Botmium"; - } - - drawText(10, 113, this.mRecipeMap.mNEISpecialValuePre + (((ChemPlantDefaultRecipe) this.arecipes.get(aRecipeIndex)).mRecipe.mSpecialValue * this.mRecipeMap.mNEISpecialValueMultiplier) + aTierMaterial, -16777216); + else if (specialValue == 3) { + aTierMaterial += "Stainless Steel"; } - } - - public class ChemPlantDefaultRecipe extends CachedDefaultRecipe { - - public ChemPlantDefaultRecipe(final GT_Recipe aRecipe) { - super(aRecipe); + else if (specialValue == 4) { + aTierMaterial += "Titanium"; } - - @Override - public void handleSlots() { - int tStartIndex = 0; - - // Four Input Slots - if (mRecipe.getRepresentativeInput(tStartIndex) != null) { - this.mInputs.add(new FixedPositionedStack(mRecipe.getRepresentativeInput(tStartIndex), 3, -4)); - } - tStartIndex++; - if (mRecipe.getRepresentativeInput(tStartIndex) != null) { - this.mInputs.add(new FixedPositionedStack(mRecipe.getRepresentativeInput(tStartIndex), 21, -4)); - } - tStartIndex++; - if (mRecipe.getRepresentativeInput(tStartIndex) != null) { - this.mInputs.add(new FixedPositionedStack(mRecipe.getRepresentativeInput(tStartIndex), 39, -4)); - } - tStartIndex++; - if (mRecipe.getRepresentativeInput(tStartIndex) != null) { - this.mInputs.add(new FixedPositionedStack(mRecipe.getRepresentativeInput(tStartIndex), 57, -4)); - } - tStartIndex++; - - - if (mRecipe.mSpecialItems != null) { - this.mInputs.add(new FixedPositionedStack(mRecipe.mSpecialItems, 120, 52)); - } - tStartIndex = 0; - - //Four Output Slots - boolean tUnificate = mRecipeMap.mNEIUnificateOutput; - if (mRecipe.getOutput(tStartIndex) != null) { - this.mOutputs.add(new FixedPositionedStack(mRecipe.getOutput(tStartIndex), 102, 5, mRecipe.getOutputChance(tStartIndex), tUnificate)); - } - tStartIndex++; - if (mRecipe.getOutput(tStartIndex) != null) { - this.mOutputs.add(new FixedPositionedStack(mRecipe.getOutput(tStartIndex), 120, 5, mRecipe.getOutputChance(tStartIndex), tUnificate)); - } - tStartIndex++; - if (mRecipe.getOutput(tStartIndex) != null) { - this.mOutputs.add(new FixedPositionedStack(mRecipe.getOutput(tStartIndex), 102, 23, mRecipe.getOutputChance(tStartIndex), tUnificate)); - } - tStartIndex++; - if (mRecipe.getOutput(tStartIndex) != null) { - this.mOutputs.add(new FixedPositionedStack(mRecipe.getOutput(tStartIndex), 120, 23, mRecipe.getOutputChance(tStartIndex), tUnificate)); - } - 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 >= 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 ((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 ((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 ((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 (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, tUnificate)); - } - 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, tUnificate)); - } - } - + else if (specialValue == 5) { + aTierMaterial += "Tungsten Steel"; + } + else if (specialValue == 6) { + aTierMaterial += "Laurenium"; + } + else if (specialValue == 7) { + aTierMaterial += "Botmium"; } + return this.mRecipeMap.mNEISpecialValuePre + (specialValue * this.mRecipeMap.mNEISpecialValueMultiplier) + aTierMaterial; } } diff --git a/src/main/java/gtPlusPlus/nei/GT_NEI_LFTR.java b/src/main/java/gtPlusPlus/nei/GT_NEI_LFTR.java index 02db84664d..82f6299bbb 100644 --- a/src/main/java/gtPlusPlus/nei/GT_NEI_LFTR.java +++ b/src/main/java/gtPlusPlus/nei/GT_NEI_LFTR.java @@ -1,15 +1,10 @@ package gtPlusPlus.nei; -import org.lwjgl.opengl.GL11; - -import codechicken.lib.gui.GuiDraw; 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 gtPlusPlus.core.util.math.MathUtils; -public class GT_NEI_LFTR extends GTPP_NEI_DefaultHandler { +public class GT_NEI_LFTR extends GT_NEI_MultiNoCell { public GT_NEI_LFTR() { super(GTPP_Recipe_Map.sLiquidFluorineThoriumReactorRecipes); @@ -21,18 +16,6 @@ public class GT_NEI_LFTR extends GTPP_NEI_DefaultHandler { } @Override - public CachedDefaultRecipe createCachedRecipe(GT_Recipe aRecipe) { - return new LFTRDefaultRecipe(aRecipe); - } - - @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, 89); - } - - @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; @@ -41,79 +24,4 @@ public class GT_NEI_LFTR extends GTPP_NEI_DefaultHandler { drawText(10, 103, "Dynamo: " + MathUtils.formatNumbers((long) (tDuration * tEUt)) + " EU", -16777216); drawText(10, 113, "Total: " + MathUtils.formatNumbers((long) (tDuration * tEUt * 4)) + " EU", -16777216); } - - public class LFTRDefaultRecipe extends CachedDefaultRecipe { - - public LFTRDefaultRecipe(final GT_Recipe aRecipe) { - super(aRecipe); - } - - @Override - public void handleSlots() { - int tStartIndex = 0; - 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 ((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 ((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)); - } - } - - tStartIndex = 0; - boolean tUnificate = mRecipeMap.mNEIUnificateOutput; - 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++), tUnificate)); - } - 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++), tUnificate)); - } - 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++), tUnificate)); - } - 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++), tUnificate)); - } - 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++), tUnificate)); - } - 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++), tUnificate)); - } - 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++), tUnificate)); - } - 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++), tUnificate)); - } - 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++), tUnificate)); - } - } - - } - - } } diff --git a/src/main/java/gtPlusPlus/nei/GT_NEI_MillingMachine.java b/src/main/java/gtPlusPlus/nei/GT_NEI_MillingMachine.java deleted file mode 100644 index febca9e77f..0000000000 --- a/src/main/java/gtPlusPlus/nei/GT_NEI_MillingMachine.java +++ /dev/null @@ -1,137 +0,0 @@ -package gtPlusPlus.nei; - -import java.util.List; - -import codechicken.nei.PositionedStack; -import codechicken.nei.recipe.GuiRecipe; -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 gtPlusPlus.core.util.minecraft.ItemUtils; -import net.minecraft.item.ItemStack; - -public class GT_NEI_MillingMachine extends GTPP_NEI_DefaultHandler { - - public GT_NEI_MillingMachine() { - super(GTPP_Recipe_Map.sOreMillRecipes); - } - - @Override - public TemplateRecipeHandler newInstance() { - return new GT_NEI_MillingMachine(); - } - - @Override - public CachedDefaultRecipe createCachedRecipe(GT_Recipe aRecipe) { - return new MillingDefaultRecipe(aRecipe); - } - - @Override - public List<String> handleItemTooltip(final GuiRecipe<?> gui, final ItemStack aStack, final List<String> 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.isMillingBall(aStack)) { - currenttip.add("Does not always get consumed in the process"); - } - else if (ItemUtils.isControlCircuit(aStack)) { - currenttip.add("Does not get consumed in the process"); - } - break; - } - } - } - return currenttip; - } - - public class MillingDefaultRecipe extends CachedDefaultRecipe { - - public MillingDefaultRecipe(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, 14)); - } - tStartIndex++; - if (mRecipe.getRepresentativeInput(tStartIndex) != null) { - this.mInputs.add(new FixedPositionedStack(mRecipe.getRepresentativeInput(tStartIndex), 30, 14)); - } - tStartIndex++; - if (mRecipe.getRepresentativeInput(tStartIndex) != null) { - this.mInputs.add(new FixedPositionedStack(mRecipe.getRepresentativeInput(tStartIndex), 48, 14)); - } - tStartIndex++; - - if (mRecipe.mSpecialItems != null) { - this.mInputs.add(new FixedPositionedStack(mRecipe.mSpecialItems, 120, 52)); - } - tStartIndex = 0; - - //Four Output Slots - boolean tUnificate = mRecipeMap.mNEIUnificateOutput; - if (mRecipe.getOutput(tStartIndex) != null) { - this.mOutputs.add(new FixedPositionedStack(mRecipe.getOutput(tStartIndex), 102, 5, mRecipe.getOutputChance(tStartIndex), tUnificate)); - } - tStartIndex++; - if (mRecipe.getOutput(tStartIndex) != null) { - this.mOutputs.add(new FixedPositionedStack(mRecipe.getOutput(tStartIndex), 120, 5, mRecipe.getOutputChance(tStartIndex), tUnificate)); - } - tStartIndex++; - if (mRecipe.getOutput(tStartIndex) != null) { - this.mOutputs.add(new FixedPositionedStack(mRecipe.getOutput(tStartIndex), 102, 23, mRecipe.getOutputChance(tStartIndex), tUnificate)); - } - tStartIndex++; - if (mRecipe.getOutput(tStartIndex) != null) { - this.mOutputs.add(new FixedPositionedStack(mRecipe.getOutput(tStartIndex), 120, 23, mRecipe.getOutputChance(tStartIndex), tUnificate)); - } - 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 >= 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 ((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 ((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 ((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 (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, tUnificate)); - } - 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, tUnificate)); - } - } - } - } -} diff --git a/src/main/java/gtPlusPlus/nei/GT_NEI_MolecularTransformer.java b/src/main/java/gtPlusPlus/nei/GT_NEI_MolecularTransformer.java deleted file mode 100644 index 65e4c651c1..0000000000 --- a/src/main/java/gtPlusPlus/nei/GT_NEI_MolecularTransformer.java +++ /dev/null @@ -1,33 +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 gtPlusPlus.core.util.math.MathUtils; - -public class GT_NEI_MolecularTransformer extends GTPP_NEI_DefaultHandler { - - public GT_NEI_MolecularTransformer() { - super(GTPP_Recipe_Map.sMolecularTransformerRecipes); - } - - @Override - public TemplateRecipeHandler newInstance() { - return new GT_NEI_MolecularTransformer(); - } - - @Override - public void drawExtras(final int aRecipeIndex) { - GT_Recipe aRecipe = ((CachedDefaultRecipe) this.arecipes.get(aRecipeIndex)).mRecipe; - final long tEUt = aRecipe.mEUt; - final long tDuration = aRecipe.mDuration; - if (tEUt != 0) { - drawText(10, 73, "Total: " + MathUtils.formatNumbers((long) (tDuration * tEUt)) + " EU", -16777216); - drawText(10, 83, "Voltage: " + MathUtils.formatNumbers(tEUt) + " EU", -16777216); - } - if (tDuration > 0) { - drawText(10, 93, "Time: " + (tDuration < 20 ? "< 1" : MathUtils.formatNumbers(0.05d * tDuration)) + " secs", -16777216); - } - } - -} diff --git a/src/main/java/gtPlusPlus/nei/GT_NEI_MultiNoCell.java b/src/main/java/gtPlusPlus/nei/GT_NEI_MultiNoCell.java index 5fd6cc5b64..26d11e1803 100644 --- a/src/main/java/gtPlusPlus/nei/GT_NEI_MultiNoCell.java +++ b/src/main/java/gtPlusPlus/nei/GT_NEI_MultiNoCell.java @@ -1,16 +1,14 @@ package gtPlusPlus.nei; -import static gregtech.api.enums.GT_Values.RES_PATH_GUI; - import org.lwjgl.opengl.GL11; import codechicken.lib.gui.GuiDraw; 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.core.util.math.MathUtils; +/** + * Used for larger GUI ("basicmachines/FissionFuel") + */ public class GT_NEI_MultiNoCell extends GTPP_NEI_DefaultHandler { public GT_NEI_MultiNoCell(GT_Recipe_Map aMap) { @@ -23,36 +21,14 @@ public class GT_NEI_MultiNoCell extends GTPP_NEI_DefaultHandler { } @Override - public CachedDefaultRecipe createCachedRecipe(GT_Recipe aRecipe) { - return new NoCellMultiDefaultRecipe(aRecipe); - } - - @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, 89); } - - @Override - public String getGuiTexture() { - return RES_PATH_GUI + "basicmachines/FissionFuel.png"; - } @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, 90, "Total: " + MathUtils.formatNumbers((long) (tDuration * tEUt)) + " EU", -16777216); - drawText(10, 100, "Usage: " + MathUtils.formatNumbers(tEUt) + " EU/t", -16777216); - } - if (tDuration > 0) { - drawText(10, 110, "Time: " + (tDuration < 20 ? "< 1" : MathUtils.formatNumbers(0.05d * tDuration)) + " 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); - } + protected int getDescriptionYOffset() { + return 85; } - } diff --git a/src/main/java/gtPlusPlus/nei/GT_NEI_MultiSolarTower.java b/src/main/java/gtPlusPlus/nei/GT_NEI_MultiSolarTower.java index fd611cbabe..8ea1dec802 100644 --- a/src/main/java/gtPlusPlus/nei/GT_NEI_MultiSolarTower.java +++ b/src/main/java/gtPlusPlus/nei/GT_NEI_MultiSolarTower.java @@ -1,7 +1,5 @@ package gtPlusPlus.nei; -import static gregtech.api.enums.GT_Values.RES_PATH_GUI; - import codechicken.nei.recipe.TemplateRecipeHandler; import gregtech.api.util.GT_Recipe.GT_Recipe_Map; import gtPlusPlus.core.util.math.MathUtils; @@ -16,11 +14,6 @@ public class GT_NEI_MultiSolarTower extends GT_NEI_MultiNoCell { public TemplateRecipeHandler newInstance() { return new GT_NEI_MultiSolarTower(mRecipeMap); } - - @Override - public String getGuiTexture() { - return RES_PATH_GUI + "basicmachines/FissionFuel.png"; - } @Override public void drawExtras(final int aRecipeIndex) { @@ -30,7 +23,7 @@ public class GT_NEI_MultiSolarTower extends GT_NEI_MultiNoCell { } drawText(5, 100, "Solar Heater rings boost tier", -16777216); drawText(5, 110, "R1:T1, R2:T2, R3:T4, R4:T8, R5:T16", -16777216); - drawText(5, 120, "Input Amount = 1000 x T", -16777216); + drawText(5, 120, "Input Amount = 1000 x T", -16777216); } } diff --git a/src/main/java/gtPlusPlus/nei/GT_NEI_MultiTreeGrowthSimulator.java b/src/main/java/gtPlusPlus/nei/GT_NEI_MultiTreeGrowthSimulator.java index 81755a1714..ea175f4ddb 100644 --- a/src/main/java/gtPlusPlus/nei/GT_NEI_MultiTreeGrowthSimulator.java +++ b/src/main/java/gtPlusPlus/nei/GT_NEI_MultiTreeGrowthSimulator.java @@ -1,47 +1,15 @@ package gtPlusPlus.nei; -import static gregtech.api.enums.GT_Values.RES_PATH_GUI; - -import java.util.HashMap; import java.util.List; -import org.lwjgl.opengl.GL11; - -import codechicken.lib.gui.GuiDraw; import codechicken.nei.PositionedStack; import codechicken.nei.recipe.GuiRecipe; 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 gtPlusPlus.api.objects.data.Pair; import gtPlusPlus.core.item.ModItems; import net.minecraft.item.ItemStack; -public class GT_NEI_MultiTreeGrowthSimulator extends GTPP_NEI_DefaultHandler { - - private static final HashMap<Integer, Pair<Integer, Integer>> mInputSlotMap = new HashMap<Integer, Pair<Integer, Integer>>(); - private static final HashMap<Integer, Pair<Integer, Integer>> mOutputSlotMap = new HashMap<Integer, Pair<Integer, Integer>>(); - - static { - 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<aSlotY.length;y++) { - for (int x=0; x<aSlotX.length;x++) { - mInputSlotMap.put(aIndex++, new Pair<Integer, Integer>(aSlotX[x], aSlotY[y])); - } - } - // Output slots - aSlotX = new int[] {102, 120, 138}; - aIndex = 0; - for (int y=0; y<aSlotY.length;y++) { - for (int x=0; x<aSlotX.length;x++) { - mOutputSlotMap.put(aIndex++, new Pair<Integer, Integer>(aSlotX[x], aSlotY[y])); - } - } - } +public class GT_NEI_MultiTreeGrowthSimulator extends GT_NEI_MultiNoCell { public GT_NEI_MultiTreeGrowthSimulator() { super(GTPP_Recipe_Map.sTreeSimFakeRecipes); @@ -50,23 +18,6 @@ public class GT_NEI_MultiTreeGrowthSimulator extends GTPP_NEI_DefaultHandler { @Override public TemplateRecipeHandler newInstance() { return new GT_NEI_MultiTreeGrowthSimulator(); - } - - @Override - public CachedDefaultRecipe createCachedRecipe(GT_Recipe aRecipe) { - return new TreeSimDefaultRecipe(aRecipe); - } - - @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, 89); - } - - @Override - public String getGuiTexture() { - return RES_PATH_GUI + "basicmachines/FissionFuel.png"; } @Override @@ -81,7 +32,7 @@ public class GT_NEI_MultiTreeGrowthSimulator extends GTPP_NEI_DefaultHandler { @Override public List<String> handleItemTooltip(final GuiRecipe<?> gui, final ItemStack aStack, final List<String> currenttip, final int aRecipeIndex) { final TemplateRecipeHandler.CachedRecipe tObject = this.arecipes.get(aRecipeIndex); - if ((tObject instanceof CachedDefaultRecipe)) { + if (tObject instanceof CachedDefaultRecipe) { final CachedDefaultRecipe tRecipe = (CachedDefaultRecipe) tObject; for (final PositionedStack tStack : tRecipe.mOutputs) { if (aStack == tStack.item) { @@ -89,7 +40,7 @@ public class GT_NEI_MultiTreeGrowthSimulator extends GTPP_NEI_DefaultHandler { break; } if (ModItems.fluidFertBasic != null) { - currenttip.add("Chance output if "+ModItems.fluidFertBasic.getLocalizedName()+" is provided."); + currenttip.add("Chance output if "+ModItems.fluidFertBasic.getLocalizedName()+" is provided."); } break; } @@ -97,82 +48,4 @@ public class GT_NEI_MultiTreeGrowthSimulator extends GTPP_NEI_DefaultHandler { } return currenttip; } - - public class TreeSimDefaultRecipe extends CachedDefaultRecipe { - - public TreeSimDefaultRecipe(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 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<aInputItemsCount;i++) { - int x = mInputSlotMap.get(aInputSlotsUsed).getKey(); - int y = mInputSlotMap.get(aInputSlotsUsed).getValue(); - ItemStack aRepStack = mRecipe.getRepresentativeInput(aSlotToCheck++); - if (aRepStack != null) { - this.mInputs.add(new FixedPositionedStack(aRepStack, x, y)); - aInputSlotsUsed++; - } - } - } - aSlotToCheck = 0; - // Upto 9 Output Slots - if (aOutputItemsCount > 0) { - if (aOutputItemsCount > 9) { - aOutputItemsCount = 9; - } - boolean tUnificate = mRecipeMap.mNEIUnificateOutput; - for (int i=0;i<aOutputItemsCount;i++) { - int x = mOutputSlotMap.get(aOutputSlotsUsed).getKey(); - int y = mOutputSlotMap.get(aOutputSlotsUsed).getValue(); - ItemStack aRepStack = mRecipe.getOutput(aSlotToCheck); - if (aRepStack != null) { - this.mOutputs.add(new FixedPositionedStack(aRepStack, x, y, mRecipe.getOutputChance(aSlotToCheck), tUnificate)); - aOutputSlotsUsed++; - } - aSlotToCheck++; - } - } - - /* - * Fluids - */ - aInputSlotsUsed = 9; - aSlotToCheck = aInputSlotsUsed; - if (aInputFluidsCount > 0) { - for (int i=0;i<aInputFluidsCount;i++) { - int x = mInputSlotMap.get(aSlotToCheck).getKey(); - int y = mInputSlotMap.get(aSlotToCheck).getValue(); - this.mInputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(mRecipe.mFluidInputs[i], true), x, y)); - aSlotToCheck++; - aInputSlotsUsed++; - } - } - } - } - } diff --git a/src/main/java/gtPlusPlus/nei/NEI_GT_Config.java b/src/main/java/gtPlusPlus/nei/NEI_GT_Config.java index e7f769b0b3..053eec139b 100644 --- a/src/main/java/gtPlusPlus/nei/NEI_GT_Config.java +++ b/src/main/java/gtPlusPlus/nei/NEI_GT_Config.java @@ -24,10 +24,7 @@ implements IConfigureNEI { mUniqueRecipeMapHandling.add(GTPP_Recipe_Map.sFissionFuelProcessing.mUnlocalizedName); mUniqueRecipeMapHandling.add(GTPP_Recipe_Map.sLiquidFluorineThoriumReactorRecipes.mUnlocalizedName); mUniqueRecipeMapHandling.add(GTPP_Recipe_Map.sChemicalPlantRecipes.mUnlocalizedName); - mUniqueRecipeMapHandling.add(GTPP_Recipe_Map.sOreMillRecipes.mUnlocalizedName); - mUniqueRecipeMapHandling.add(GTPP_Recipe_Map.sFlotationCellRecipes.mUnlocalizedName); - mUniqueRecipeMapHandling.add(GTPP_Recipe_Map.sVacuumFurnaceRecipes.mUnlocalizedName); - mUniqueRecipeMapHandling.add(GTPP_Recipe_Map.sMolecularTransformerRecipes.mUnlocalizedName); + mUniqueRecipeMapHandling.add(GTPP_Recipe_Map.sVacuumFurnaceRecipes.mUnlocalizedName); mUniqueRecipeMapHandling.add(GTPP_Recipe_Map.sAdvFreezerRecipes_GT.mUnlocalizedName); mUniqueRecipeMapHandling.add(GTPP_Recipe_Map.sMultiblockCentrifugeRecipes_GT.mUnlocalizedName); @@ -44,7 +41,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 GTPP_NEI_DefaultHandler(tMap); } else { Logger.INFO("NEI Registration: Not allowed to register NEI handler for "+tMap.mNEIName); @@ -57,12 +54,6 @@ implements IConfigureNEI { Logger.INFO("NEI Registration: Registering NEI handler for "+GTPP_Recipe_Map.sChemicalPlantRecipes.mNEIName); new GT_NEI_FluidReactor(); - Logger.INFO("NEI Registration: Registering NEI handler for "+GTPP_Recipe_Map.sMolecularTransformerRecipes.mNEIName); - new GT_NEI_MolecularTransformer(); - Logger.INFO("NEI Registration: Registering NEI handler for "+GTPP_Recipe_Map.sOreMillRecipes.mNEIName); - new GT_NEI_MillingMachine(); - Logger.INFO("NEI Registration: Registering NEI handler for "+GTPP_Recipe_Map.sFlotationCellRecipes.mNEIName); - new GT_NEI_FlotationCell(); Logger.INFO("NEI Registration: Registering NEI handler for "+GTPP_Recipe_Map.sLiquidFluorineThoriumReactorRecipes.mNEIName); new GT_NEI_LFTR(); Logger.INFO("NEI Registration: Registering NEI handler for "+GTPP_Recipe_Map.sFissionFuelProcessing.mNEIName); @@ -89,7 +80,7 @@ implements IConfigureNEI { Logger.INFO("NEI Registration: Registering NEI handler for "+DecayableRecipeHandler.mNEIName); API.registerRecipeHandler(new DecayableRecipeHandler()); API.registerUsageHandler(new DecayableRecipeHandler()); - + Logger.INFO("NEI Registration: Registering NEI handler for "+GT_NEI_LFTR_Sparging.mNEIName); new GT_NEI_LFTR_Sparging(); diff --git a/src/main/java/gtPlusPlus/nei/NEI_IMC_Sender.java b/src/main/java/gtPlusPlus/nei/NEI_IMC_Sender.java index 4e5c3e53ce..80589c6811 100644 --- a/src/main/java/gtPlusPlus/nei/NEI_IMC_Sender.java +++ b/src/main/java/gtPlusPlus/nei/NEI_IMC_Sender.java @@ -28,6 +28,8 @@ public class NEI_IMC_Sender { sendHandler("gtpp.recipe.fissionfuel", "gregtech:gt.blockmachines:835", 1); sendHandler("gtpp.recipe.lftr", "gregtech:gt.blockmachines:751", 1); sendHandler("gtpp.recipe.lftr.sparging", "gregtech:gt.blockmachines:31035", 1); + sendHandler("gtpp.recipe.oremill", "gregtech:gt.blockmachines:31027", 1); + sendHandler("gtpp.recipe.flotationcell", "gregtech:gt.blockmachines:31028", 1); sendCatalyst("GTPP_Decayables", "miscutils:blockDecayablesChest"); diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntityTreeFarm.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntityTreeFarm.java index 57ee99ee2e..283d520a54 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntityTreeFarm.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntityTreeFarm.java @@ -486,7 +486,9 @@ public class GregtechMetaTileEntityTreeFarm extends GregtechMeta_MultiBlockBase< int aRecipes = GTPP_Recipe_Map.sTreeSimFakeRecipes.mRecipeList.size(); Logger.INFO("Adding Tree Growth Simulation for " + aSapling.getDisplayName() + " -> " + (aLog == null ? "NULL" : aLog.getDisplayName())); ItemStack[] aOutput = new ItemStack[]{aLog, aSapling}; - GT_Recipe aRecipe = new GT_Recipe( + String aOutputs = ItemUtils.getArrayStackNames(aOutput); + Logger.INFO("" + aOutputs); + GTPP_Recipe_Map.sTreeSimFakeRecipes.addFakeRecipe( false, new ItemStack[]{aSapling.copy()}, aOutput, @@ -497,10 +499,6 @@ public class GregtechMetaTileEntityTreeFarm extends GregtechMeta_MultiBlockBase< 1, sRecipeID++, 0); - aRecipe.mOutputs = aOutput; - String aOutputs = ItemUtils.getArrayStackNames(aRecipe.mOutputs); - Logger.INFO("" + aOutputs); - GTPP_Recipe_Map.sTreeSimFakeRecipes.addFakeRecipe(false, aRecipe); return GTPP_Recipe_Map.sTreeSimFakeRecipes.mRecipeList.size() > aRecipes; } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_MultisUsingFluidInsteadOfCells.java b/src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_MultisUsingFluidInsteadOfCells.java index a76322e4f4..1b6e623e91 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_MultisUsingFluidInsteadOfCells.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_MultisUsingFluidInsteadOfCells.java @@ -12,6 +12,8 @@ import gtPlusPlus.core.util.minecraft.ItemUtils; import net.minecraft.item.ItemStack; import net.minecraftforge.fluids.FluidStack; +import java.util.ArrayList; + public class RecipeGen_MultisUsingFluidInsteadOfCells { @@ -158,7 +160,7 @@ public class RecipeGen_MultisUsingFluidInsteadOfCells { } // Add Recipe to map - GT_Recipe aNewRecipe = new GTPP_Recipe( + GT_Recipe aNewRecipe = new GTPP_Recipe.GTPP_Recipe_Map_MultiNoCell.GTPP_Recipe_MultiNoCell( false, aNewItemInputs, aNewItemOutputs, @@ -168,7 +170,8 @@ public class RecipeGen_MultisUsingFluidInsteadOfCells { aNewFluidOutputs, x.mDuration, x.mEUt, - x.mSpecialValue); + x.mSpecialValue); + aNewRecipe.owners = new ArrayList<>(x.owners); aOutputs.add(aNewRecipe); aRecipesHandled++; } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/loaders/recipe/RecipeLoader_LFTR.java b/src/main/java/gtPlusPlus/xmod/gregtech/loaders/recipe/RecipeLoader_LFTR.java index a09cbcce0d..de4f7fa49a 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/loaders/recipe/RecipeLoader_LFTR.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/loaders/recipe/RecipeLoader_LFTR.java @@ -56,7 +56,7 @@ public class RecipeLoader_LFTR { FluidStack Li2BeF4 = NUCLIDE.Li2BeF4.getFluidStack(200); //LiFBeF2ThF4UF4 - T3 - GT_Recipe LFTR1 = new GTPP_Recipe( + GTPP_Recipe.GTPP_Recipe_Map.sLiquidFluorineThoriumReactorRecipes.addRecipe( false, new ItemStack[] {}, new ItemStack[] {}, @@ -77,7 +77,7 @@ public class RecipeLoader_LFTR { ); //LiFBeF2ZrF4UF4 - T2 - GT_Recipe LFTR2 = new GTPP_Recipe( + GTPP_Recipe.GTPP_Recipe_Map.sLiquidFluorineThoriumReactorRecipes.addRecipe( false, new ItemStack[] {}, new ItemStack[] {}, @@ -98,7 +98,7 @@ public class RecipeLoader_LFTR { ); //LiFBeF2ZrF4U235 - T1 - GT_Recipe LFTR3 = new GTPP_Recipe( + GTPP_Recipe.GTPP_Recipe_Map.sLiquidFluorineThoriumReactorRecipes.addRecipe( false, new ItemStack[] {}, new ItemStack[] {}, @@ -163,10 +163,6 @@ public class RecipeLoader_LFTR { new int[] { 1000, 1000, 1000, 1000, 1000 }); - - GTPP_Recipe.GTPP_Recipe_Map.sLiquidFluorineThoriumReactorRecipes.add(LFTR1); - GTPP_Recipe.GTPP_Recipe_Map.sLiquidFluorineThoriumReactorRecipes.add(LFTR2); - GTPP_Recipe.GTPP_Recipe_Map.sLiquidFluorineThoriumReactorRecipes.add(LFTR3); } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/recipes/GregtechRecipeAdder.java b/src/main/java/gtPlusPlus/xmod/gregtech/recipes/GregtechRecipeAdder.java index 75e48a0c00..9574dbb42e 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/recipes/GregtechRecipeAdder.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/recipes/GregtechRecipeAdder.java @@ -518,8 +518,11 @@ public class GregtechRecipeAdder implements IGregtech_RecipeAdder { ArrayUtils.removeNulls(aInput); if (aInput.length <= 1) { return false; - } - GTPP_Recipe aSpecialRecipe = new GTPP_Recipe( + } + + int aSize = GTPP_Recipe.GTPP_Recipe_Map.sAlloyBlastSmelterRecipes.mRecipeList.size(); + int aSize2 = aSize; + GTPP_Recipe.GTPP_Recipe_Map.sAlloyBlastSmelterRecipes.addRecipe( true, aInput, aOutputStack, @@ -528,12 +531,8 @@ public class GregtechRecipeAdder implements IGregtech_RecipeAdder { new FluidStack[] { aInputFluid }, new FluidStack[] { aOutput }, Math.max(1, aDuration), - Math.max(1, aEUt), - aSpecialValue); - - int aSize = GTPP_Recipe.GTPP_Recipe_Map.sAlloyBlastSmelterRecipes.mRecipeList.size(); - int aSize2 = aSize; - GTPP_Recipe.GTPP_Recipe_Map.sAlloyBlastSmelterRecipes.add(aSpecialRecipe); + Math.max(1, aEUt), + aSpecialValue); aSize = GTPP_Recipe.GTPP_Recipe_Map.sAlloyBlastSmelterRecipes.mRecipeList.size(); @@ -588,7 +587,9 @@ public class GregtechRecipeAdder implements IGregtech_RecipeAdder { final FluidStack inputs[] = { aInput1, aInput2, aInput3, aInput4, aInput5, aInput6, aInput7, aInput8, aInput9 }; final FluidStack outputs[] = { aOutput1, aOutput2 }; - GTPP_Recipe aSpecialRecipe = new GTPP_Recipe( + int aSize = GTPP_Recipe.GTPP_Recipe_Map.sFissionFuelProcessing.mRecipeList.size(); + int aSize2 = aSize; + GTPP_Recipe.GTPP_Recipe_Map.sFissionFuelProcessing.addRecipe( aOptimise, new ItemStack[] {}, new ItemStack[] {}, @@ -597,12 +598,8 @@ public class GregtechRecipeAdder implements IGregtech_RecipeAdder { inputs, outputs, Math.max(1, aDuration), - Math.max(1, aEUt), - 0); - - int aSize = GTPP_Recipe.GTPP_Recipe_Map.sFissionFuelProcessing.mRecipeList.size(); - int aSize2 = aSize; - GTPP_Recipe.GTPP_Recipe_Map.sFissionFuelProcessing.add(aSpecialRecipe); + Math.max(1, aEUt), + 0); aSize = GTPP_Recipe.GTPP_Recipe_Map.sFissionFuelProcessing.mRecipeList.size(); if (aSize > aSize2) { @@ -1438,7 +1435,9 @@ public class GregtechRecipeAdder implements IGregtech_RecipeAdder { @Override public boolean addVacuumFurnaceRecipe(ItemStack[] aInputs, FluidStack[] aFluidInputs, ItemStack[] aOutputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aLevel) { if (aInputs != null && aOutputs != null) { - GTPP_Recipe aSpecialRecipe = new GTPP_Recipe( + int aSize = GTPP_Recipe.GTPP_Recipe_Map.sVacuumFurnaceRecipes.mRecipeList.size(); + int aSize2 = aSize; + GTPP_Recipe.GTPP_Recipe_Map.sVacuumFurnaceRecipes.addRecipe( false, aInputs, aOutputs, @@ -1448,11 +1447,7 @@ public class GregtechRecipeAdder implements IGregtech_RecipeAdder { aFluidOutputs, aDuration, aEUt, - aLevel); - - int aSize = GTPP_Recipe.GTPP_Recipe_Map.sVacuumFurnaceRecipes.mRecipeList.size(); - int aSize2 = aSize; - GTPP_Recipe.GTPP_Recipe_Map.sVacuumFurnaceRecipes.addRecipe(aSpecialRecipe); + aLevel); aSize = GTPP_Recipe.GTPP_Recipe_Map.sVacuumFurnaceRecipes.mRecipeList.size(); return aSize > aSize2; } else { @@ -1506,8 +1501,9 @@ public class GregtechRecipeAdder implements IGregtech_RecipeAdder { CORE.crash(); } - - GTPP_Recipe aSpecialRecipe = new GTPP_Recipe( + int aSize = GTPP_Recipe.GTPP_Recipe_Map.sChemicalPlantRecipes.mRecipeList.size(); + int aSize2 = aSize; + GTPP_Recipe.GTPP_Recipe_Map.sChemicalPlantRecipes.addRecipe( false, aInputs, aOutputs, @@ -1517,11 +1513,7 @@ public class GregtechRecipeAdder implements IGregtech_RecipeAdder { aFluidOutputs, time, (int) eu, - aTier); - - int aSize = GTPP_Recipe.GTPP_Recipe_Map.sChemicalPlantRecipes.mRecipeList.size(); - int aSize2 = aSize; - GTPP_Recipe.GTPP_Recipe_Map.sChemicalPlantRecipes.add(aSpecialRecipe); + aTier); aSize = GTPP_Recipe.GTPP_Recipe_Map.sChemicalPlantRecipes.mRecipeList.size(); return aSize > aSize2; } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechSolarTower.java b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechSolarTower.java index b4cdf581ae..aeb937e78b 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechSolarTower.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechSolarTower.java @@ -31,7 +31,7 @@ public class GregtechSolarTower { 0).getStackForm(1L)); // NEI recipe - GTPP_Recipe aRecipe = new GTPP_Recipe( + GTPP_Recipe.GTPP_Recipe_Map.sSolarTowerRecipes.addRecipe( false, null, null, @@ -42,8 +42,5 @@ public class GregtechSolarTower { 0, 0, 0); - GTPP_Recipe.GTPP_Recipe_Map.sSolarTowerRecipes.add(aRecipe); - - } } diff --git a/src/main/resources/assets/gregtech/textures/gui/basicmachines/BlastSmelter.png b/src/main/resources/assets/gregtech/textures/gui/basicmachines/BlastSmelter.png Binary files differindex f21ebc1026..5e6b8d10ed 100644 --- a/src/main/resources/assets/gregtech/textures/gui/basicmachines/BlastSmelter.png +++ b/src/main/resources/assets/gregtech/textures/gui/basicmachines/BlastSmelter.png |