From e42c71394ca8e9b82a47ca8b35aad2d19ff16ac3 Mon Sep 17 00:00:00 2001 From: Alkalus Date: Tue, 14 Apr 2020 18:46:45 +0100 Subject: $ Fixed GTPP recipe maps being mapped to to the GT_Recipe_Map.sMappings list. Prevents BartWorks from touching my recipes. --- src/Java/gregtech/api/util/Recipe_GT.java | 60 +++++++++++++++++++------------ 1 file changed, 38 insertions(+), 22 deletions(-) (limited to 'src/Java/gregtech/api/util') diff --git a/src/Java/gregtech/api/util/Recipe_GT.java b/src/Java/gregtech/api/util/Recipe_GT.java index d8cbb6525e..7bed2ee4ec 100644 --- a/src/Java/gregtech/api/util/Recipe_GT.java +++ b/src/Java/gregtech/api/util/Recipe_GT.java @@ -119,6 +119,10 @@ public class Recipe_GT extends GT_Recipe implements IComparableRecipe{ for (final Gregtech_Recipe_Map tMapEntry : Gregtech_Recipe_Map.sMappings) { tMapEntry.reInit(); } + for (final GTPP_Recipe_Map tMapEntry : GTPP_Recipe_Map.sMappingsEx) { + tMapEntry.reInit(); + } + } @Override @@ -235,6 +239,18 @@ public class Recipe_GT extends GT_Recipe implements IComparableRecipe{ return true; } + + public static class GTPP_Recipe_Map extends GT_Recipe_Map { + + public static final Collection sMappingsEx = new ArrayList<>(); + + public GTPP_Recipe_Map(Collection 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); + GT_Recipe_Map.sMappings.remove(this); + GTPP_Recipe_Map.sMappingsEx.add(this); + } + + } public static class Gregtech_Recipe_Map { /** @@ -242,30 +258,30 @@ public class Recipe_GT extends GT_Recipe implements IComparableRecipe{ */ public static final Collection sMappings = new ArrayList<>(); //public static final GT_Recipe_Map sChemicalBathRecipes = new GT_Recipe_Map(new HashSet(200), "gt.recipe.chemicalbath", "Chemical Bath", null, RES_PATH_GUI + "basicmachines/ChemicalBath", 1, 3, 1, 1, 1, E, 1, E, true, true); - public static final GT_Recipe_Map sCokeOvenRecipes = new GT_Recipe_Map(new HashSet(200), "gt.recipe.cokeoven", "Coke Oven", null, RES_PATH_GUI + "basicmachines/Dehydrator", 2, 2, 1, 0, 1, E, 1, E, true, true); - public static final GT_Recipe_Map sMatterFab2Recipes = new GT_Recipe_Map(new HashSet(200), "gt.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 sCokeOvenRecipes = new GTPP_Recipe_Map(new HashSet(200), "gt.recipe.cokeoven", "Coke Oven", null, RES_PATH_GUI + "basicmachines/Dehydrator", 2, 2, 1, 0, 1, E, 1, E, true, true); + public static final GTPP_Recipe_Map sMatterFab2Recipes = new GTPP_Recipe_Map(new HashSet(200), "gt.recipe.matterfab2", "Matter Fabricator", null, RES_PATH_GUI + "basicmachines/Default", 9, 9, 0, 0, 1, E, 1, E, true, true); //public static final Gregtech_Recipe_Map sMatterFabRecipes = new Gregtech_Recipe_Map(new HashSet(200), "gt.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(10), "gt.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 GT_Recipe_Map sGeoThermalFuels = new GT_Recipe_Map(new HashSet(10), "gt.recipe.geothermalfuel", "GeoThermal Fuel", null, RES_PATH_GUI + "basicmachines/Default", 1, 1, 0, 0, 1, "Fuel Value: ", 1000, " EU", true, true); - public static final GT_Recipe_Map sChemicalDehydratorRecipes = new GT_Recipe_Map(new HashSet(200), "gt.recipe.chemicaldehydrator", "Dehydrator", null, RES_PATH_GUI + "basicmachines/Dehydrator", 2, 9, 0, 0, 1, E, 1, E, true, true); - public static final GT_Recipe_Map sVacuumFurnaceRecipes = new GT_Recipe_Map(new HashSet(500), "gt.recipe.vacfurnace", "Vacuum Furnace", null, "gregtech:textures/gui/basicmachines/Default", 6, 6, 1, 0, 1, "Heat Capacity: ", 1, " K", false, true); - public static final GT_Recipe_Map sAlloyBlastSmelterRecipes = new GT_Recipe_Map(new HashSet(200), "gt.recipe.alloyblastsmelter", "Alloy Blast Smelter", null, RES_PATH_GUI + "basicmachines/BlastSmelter", 9, 9, 1, 0, 1, E, 1, E, true, true); - public static final GT_Recipe_Map sSteamTurbineFuels = new GT_Recipe_Map(new HashSet(10), "gt.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 sGeoThermalFuels = new GTPP_Recipe_Map(new HashSet(10), "gt.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 sChemicalDehydratorRecipes = new GTPP_Recipe_Map(new HashSet(200), "gt.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 sVacuumFurnaceRecipes = new GTPP_Recipe_Map(new HashSet(500), "gt.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 sAlloyBlastSmelterRecipes = new GTPP_Recipe_Map(new HashSet(200), "gt.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 sSteamTurbineFuels = new GTPP_Recipe_Map(new HashSet(10), "gt.recipe.geothermalfuel", "GeoThermal Fuel", null, RES_PATH_GUI + "basicmachines/Default", 1, 1, 0, 0, 1, "Fuel Value: ", 1000, " EU", true, true); //LFTR recipes - public static final GT_Recipe_Map sLiquidFluorineThoriumReactorRecipes = new GT_Recipe_Map(new HashSet(50), "gt.recipe.lftr", "Liquid Fluoride Thorium Reactor", null, RES_PATH_GUI + "basicmachines/LFTR", 0, 0, 0, 2, 1, "Start: ", 1, " EU", true, true); - public static final GT_Recipe_Map sLiquidFluorineThoriumReactorRecipesEx = new GT_Recipe_Map(new NoConflictGTRecipeMap(), "gt.recipe.lftr.2", "Liquid Fluoride Thorium Reactor", null, RES_PATH_GUI + "basicmachines/LFTR", 0, 0, 0, 2, 1, "Start: ", 1, " EU", true, true); + public static final GTPP_Recipe_Map sLiquidFluorineThoriumReactorRecipes = new GTPP_Recipe_Map(new HashSet(50), "gt.recipe.lftr", "Liquid Fluoride Thorium Reactor", null, RES_PATH_GUI + "basicmachines/LFTR", 0, 0, 0, 2, 1, "Start: ", 1, " EU", true, true); + public static final GTPP_Recipe_Map sLiquidFluorineThoriumReactorRecipesEx = new GTPP_Recipe_Map(new NoConflictGTRecipeMap(), "gt.recipe.lftr.2", "Liquid Fluoride Thorium Reactor", null, RES_PATH_GUI + "basicmachines/LFTR", 0, 0, 0, 2, 1, "Start: ", 1, " EU", true, true); // Ore Milling Map - public static final GT_Recipe_Map sOreMillRecipes = new GT_Recipe_Map(new HashSet(10000), "gt.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 sOreMillRecipes = new GTPP_Recipe_Map(new HashSet(10000), "gt.recipe.oremill", "Milling", null, RES_PATH_GUI + "basicmachines/LFTR", 3, 4, 1, 0, 1, E, 1, E, true, false); //Fission Fuel Plant Recipes - //public static final GT_Recipe_Map sFissionFuelProcessing = new GT_Recipe_Map(new HashSet(50), "gt.recipe.fissionfuel", "Fission Fuel Processing", null, RES_PATH_GUI + "basicmachines/LFTR", 0, 0, 0, 9, 1, E, 1, E, true, true); + //public static final GTPP_Recipe_Map sFissionFuelProcessing = new GTPP_Recipe_Map(new HashSet(50), "gt.recipe.fissionfuel", "Fission Fuel Processing", null, RES_PATH_GUI + "basicmachines/LFTR", 0, 0, 0, 9, 1, E, 1, E, true, true); //Basic Washer Map - public static final GT_Recipe_Map sSimpleWasherRecipes = new GT_Recipe_Map(new HashSet(3), "gt.recipe.simplewasher", "Simple Dust Washer", null, RES_PATH_GUI + "basicmachines/PotionBrewer", 1, 1, 0, 0, 1, E, 1, E, true, true); + public static final GTPP_Recipe_Map sSimpleWasherRecipes = new GTPP_Recipe_Map(new HashSet(3), "gt.recipe.simplewasher", "Simple Dust Washer", null, RES_PATH_GUI + "basicmachines/PotionBrewer", 1, 1, 0, 0, 1, E, 1, E, true, true); public static final Gregtech_Recipe_Map sChemicalPlantRecipes = new Gregtech_Recipe_Map( new HashSet(100), @@ -282,7 +298,7 @@ public class Recipe_GT extends GT_Recipe implements IComparableRecipe{ 1, E, true, - true); + false); //RTG Fuel Map @@ -296,15 +312,15 @@ public class Recipe_GT extends GT_Recipe implements IComparableRecipe{ "Fuel Value: ", 1000, " EU", true, false); //Cyclotron recipe map - public static final GT_Recipe_Map sCyclotronRecipes = new GT_Recipe_Map(new HashSet(200), "gt.recipe.cyclotron", "COMET - Compact Cyclotron", null, RES_PATH_GUI + "basicmachines/BlastSmelter", 2, 16, 0, 0, 1, E, 1, E, true, true); + public static final GTPP_Recipe_Map sCyclotronRecipes = new GTPP_Recipe_Map(new HashSet(200), "gt.recipe.cyclotron", "COMET - Compact Cyclotron", null, RES_PATH_GUI + "basicmachines/BlastSmelter", 2, 16, 0, 0, 1, E, 1, E, true, true); //Advanced Mixer - public static final GT_Recipe_Map sAdvancedMixerRecipes = new GT_Recipe_Map(new HashSet(1000), "gt.recipe.advanced.mixer", + public static final GTPP_Recipe_Map sAdvancedMixerRecipes = new GTPP_Recipe_Map(new HashSet(1000), "gt.recipe.advanced.mixer", "Advanced Material Combiner", null, "gregtech:textures/gui/basicmachines/MixerAdvanced", 4, 4, 1, 0, 2, "", 1, "", true, true); //Mini Fusion - public static final GT_Recipe_Map sSlowFusionRecipes = new GT_Recipe_Map(new HashSet(50), "gt.recipe.slowfusionreactor", + public static final GTPP_Recipe_Map sSlowFusionRecipes = new GTPP_Recipe_Map(new HashSet(50), "gt.recipe.slowfusionreactor", "Mimir - Slow Fusion", null, "gregtech:textures/gui/basicmachines/LFTR", 0, 0, 0, 2, 1, "Start: ", 1, " EU", true, true); @@ -313,20 +329,20 @@ public class Recipe_GT extends GT_Recipe implements IComparableRecipe{ public static final GT_Recipe_Map sComponentAssemblerRecipes = new GT_Recipe_Map_Assembler(new HashSet(300), "gt.recipe.componentassembler", "Component Assembler", null, RES_PATH_GUI + "basicmachines/Assembler", 6, 1, 1, 0, 1, E, 1, E, true, true); //Special Maps for Multis - public static final GT_Recipe_Map sFishPondRecipes = new GT_Recipe_Map(new HashSet(3), "gt.recipe.fishpond", "Zhuhai - Fishing Port", null, RES_PATH_GUI + "basicmachines/PotionBrewer", 0, 1, 0, 0, 1, "Requires Circuit: ", 1, ".", true, true); + public static final GTPP_Recipe_Map sFishPondRecipes = new GTPP_Recipe_Map(new HashSet(3), "gt.recipe.fishpond", "Zhuhai - Fishing Port", null, RES_PATH_GUI + "basicmachines/PotionBrewer", 0, 1, 0, 0, 1, "Requires Circuit: ", 1, ".", true, true); public static final Gregtech_Recipe_Map sMultiblockCentrifugeRecipes = new GT_Recipe_Map_LargeCentrifuge(); public static final Gregtech_Recipe_Map sMultiblockElectrolyzerRecipes = new GT_Recipe_Map_LargeElectrolyzer(); public static final Gregtech_Recipe_Map sAdvFreezerRecipes = new GT_Recipe_Map_AdvancedVacuumFreezer(); - public static final GT_Recipe_Map sAdvFreezerRecipes_GT = new GT_Recipe_Map(new HashSet(2000), "gt.recipe.temp", "temp", null, RES_PATH_GUI + "basicmachines/PotionBrewer", 0, 0, 0, 0, 0, "", 0, "", false, false); - public static final GT_Recipe_Map sMultiblockCentrifugeRecipes_GT = new GT_Recipe_Map(new HashSet(2000), "gt.recipe.temp2", "temp2", null, RES_PATH_GUI + "basicmachines/PotionBrewer", 0, 0, 0, 0, 0, "", 0, "", false, false); - public static final GT_Recipe_Map sMultiblockElectrolyzerRecipes_GT = new GT_Recipe_Map(new HashSet(2000), "gt.recipe.temp3", "temp3", null, RES_PATH_GUI + "basicmachines/PotionBrewer", 0, 0, 0, 0, 0, "", 0, "", false, false); - public static final GT_Recipe_Map sChemicalPlant_GT = new GT_Recipe_Map(new HashSet(2000), "gt.recipe.temp4", "temp4", null, RES_PATH_GUI + "basicmachines/PotionBrewer", 0, 0, 0, 0, 0, "", 0, "", false, false); + public static final GTPP_Recipe_Map sAdvFreezerRecipes_GT = new GTPP_Recipe_Map(new HashSet(2000), "gt.recipe.temp", "temp", null, RES_PATH_GUI + "basicmachines/PotionBrewer", 0, 0, 0, 0, 0, "", 0, "", false, false); + public static final GTPP_Recipe_Map sMultiblockCentrifugeRecipes_GT = new GTPP_Recipe_Map(new HashSet(2000), "gt.recipe.temp2", "temp2", null, RES_PATH_GUI + "basicmachines/PotionBrewer", 0, 0, 0, 0, 0, "", 0, "", false, false); + public static final GTPP_Recipe_Map sMultiblockElectrolyzerRecipes_GT = new GTPP_Recipe_Map(new HashSet(2000), "gt.recipe.temp3", "temp3", null, RES_PATH_GUI + "basicmachines/PotionBrewer", 0, 0, 0, 0, 0, "", 0, "", false, false); + public static final GTPP_Recipe_Map sChemicalPlant_GT = new GTPP_Recipe_Map(new HashSet(2000), "gt.recipe.temp4", "temp4", null, RES_PATH_GUI + "basicmachines/PotionBrewer", 0, 0, 0, 0, 0, "", 0, "", false, false); //Semi-Fluid Fuel Map public static final GT_Recipe_Map_Fuel sSemiFluidLiquidFuels = new GT_Recipe_Map_Fuel(new HashSet(10), "gt.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 GT_Recipe_Map sFlotationCellRecipes = new GT_Recipe_Map(new HashSet(10000), "gt.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 sFlotationCellRecipes = new GTPP_Recipe_Map(new HashSet(10000), "gt.recipe.flotationcell", "Flotation Cell", null, RES_PATH_GUI + "basicmachines/LFTR", 6, 4, 1, 1, 1, "Ore Key: ", 1, E, true, false); -- cgit From 45ca80fa77d081c500cc6df0799a2e824912fd62 Mon Sep 17 00:00:00 2001 From: Alkalus Date: Tue, 14 Apr 2020 19:35:14 +0100 Subject: $ Added recipe hashing to prevent unwanted recipe changes. $ Made certain TileEntities blacklisted against the World accelerator in both GT++ & GTNH. --- src/Java/gregtech/api/util/CustomRecipeMap.java | 76 +- src/Java/gregtech/api/util/FishPondFakeRecipe.java | 4 +- src/Java/gregtech/api/util/GTPP_Recipe.java | 1465 ++++++++++++++++++++ src/Java/gregtech/api/util/HotFuel.java | 4 +- .../api/util/MultiblockRecipeMapHandler.java | 4 +- src/Java/gregtech/api/util/Recipe_GT.java | 1423 ------------------- .../gregtech/api/util/SemiFluidFuelHandler.java | 6 +- src/Java/gregtech/api/util/ThermalFuel.java | 8 +- src/Java/gtPlusPlus/GTplusplus.java | 21 +- .../api/interfaces/IComparableRecipe.java | 2 +- .../core/item/chemistry/RocketFuels.java | 20 +- .../core/slots/SlotChemicalPlantInput.java | 8 +- .../core/tileentities/ModTileEntities.java | 7 + .../gtPlusPlus/nei/GTPP_NEI_DefaultHandler.java | 6 +- .../gtPlusPlus/nei/GTPP_NEI_DefaultHandlerEx.java | 6 +- src/Java/gtPlusPlus/nei/GT_NEI_FlotationCell.java | 14 +- src/Java/gtPlusPlus/nei/GT_NEI_FluidReactor.java | 18 +- src/Java/gtPlusPlus/nei/GT_NEI_MillingMachine.java | 16 +- .../gtPlusPlus/nei/GT_NEI_MultiBlockHandler.java | 20 +- src/Java/gtPlusPlus/nei/GT_NEI_VacFurnace.java | 14 +- src/Java/gtPlusPlus/nei/NEI_GT_Config.java | 16 +- .../xmod/gregtech/common/Meta_GT_Proxy.java | 56 +- .../common/items/MetaGeneratedGregtechItems.java | 10 +- .../GT_MetaTileEntity_SemiFluidGenerator.java | 4 +- .../GregtechMetaTileEntityRocketFuelGenerator.java | 4 +- .../generators/GregtechMetaTileEntity_RTG.java | 4 +- .../basic/GregtechMetaTileEntity_BasicWasher.java | 4 +- .../GregtechMetaTileEntity_ChemicalReactor.java | 2 +- ...regtechMetaTileEntity_CompactFusionReactor.java | 4 +- .../basic/GregtechMetaTileEntity_PocketFusion.java | 4 +- ...regtechMetaTileEntity_IndustrialCentrifuge.java | 4 +- .../GregtechMetaTileEntity_IndustrialCokeOven.java | 4 +- ...regtechMetaTileEntity_IndustrialDehydrator.java | 4 +- ...gtechMetaTileEntity_IndustrialElectrolyzer.java | 2 +- ...techMetaTileEntity_IndustrialVacuumFreezer.java | 8 +- .../processing/GregtechMetaTileEntity_IsaMill.java | 4 +- .../multi/production/GT4Entity_ThermalBoiler.java | 4 +- .../production/GregtechMTE_FrothFlotationCell.java | 4 +- .../production/GregtechMTE_MiniFusionPlant.java | 4 +- .../production/GregtechMTE_NuclearReactor.java | 4 +- .../GregtechMetaTileEntityGeneratorArray.java | 10 +- .../GregtechMetaTileEntity_AlloyBlastSmelter.java | 6 +- .../GregtechMetaTileEntity_Cyclotron.java | 4 +- ...egtechMetaTileEntity_IndustrialFishingPond.java | 4 +- .../GregtechMetaTileEntity_LargeRocketEngine.java | 4 +- ...techMetaTileEntity_LargeSemifluidGenerator.java | 4 +- .../GregtechMetaTileEntity_MassFabricator.java | 6 +- .../chemplant/GregtechMTE_ChemicalPlant.java | 8 +- .../gregtech/loaders/RecipeGen_FluidCanning.java | 4 +- .../xmod/gregtech/loaders/RecipeGen_Plates.java | 13 +- .../loaders/misc/AddCustomMachineToPA.java | 6 +- .../loaders/recipe/RecipeLoader_AlgaeFarm.java | 4 +- .../gregtech/loaders/recipe/RecipeLoader_LFTR.java | 14 +- .../xmod/gregtech/recipes/GregtechRecipeAdder.java | 78 +- .../xmod/gregtech/recipes/RecipesToRemove.java | 6 +- .../gregtech/GregtechAdvancedMixer.java | 10 +- .../gregtech/GregtechComponentAssembler.java | 18 +- .../registration/gregtech/GregtechDehydrator.java | 14 +- .../gregtech/GregtechIndustrialMassFabricator.java | 60 +- .../gregtech/GregtechMiniRaFusion.java | 6 +- .../gregtech/GregtechSimpleWasher.java | 12 +- 61 files changed, 1829 insertions(+), 1754 deletions(-) create mode 100644 src/Java/gregtech/api/util/GTPP_Recipe.java delete mode 100644 src/Java/gregtech/api/util/Recipe_GT.java (limited to 'src/Java/gregtech/api/util') diff --git a/src/Java/gregtech/api/util/CustomRecipeMap.java b/src/Java/gregtech/api/util/CustomRecipeMap.java index ba0ab3dd29..dd137aa527 100644 --- a/src/Java/gregtech/api/util/CustomRecipeMap.java +++ b/src/Java/gregtech/api/util/CustomRecipeMap.java @@ -14,36 +14,36 @@ import gtPlusPlus.api.objects.Logger; import net.minecraftforge.fluids.Fluid; import net.minecraftforge.fluids.FluidStack; -public class CustomRecipeMap/* extends GT_Recipe_Map*/{ +public class CustomRecipeMap/* extends GTPP_Recipe_Map*/{ /** * Contains all Recipe Maps */ public static final Collection sMappings = new ArrayList<>(); - //public static final CustomRecipeMap sOreWasherRecipes = new GT_Recipe_Map_OreWasher(new HashSet(0), "ic.recipe.orewasher", "Ore Washer", "ic2.blockOreWashingPlant", RES_PATH_GUI + "basicmachines/OreWasher", 1, 3, 1, 1, 1, E, 1, E, true, false); + //public static final CustomRecipeMap sOreWasherRecipes = new GTPP_Recipe_Map_OreWasher(new HashSet(0), "ic.recipe.orewasher", "Ore Washer", "ic2.blockOreWashingPlant", RES_PATH_GUI + "basicmachines/OreWasher", 1, 3, 1, 1, 1, E, 1, E, true, false); //Fission Fuel Plant Recipes - public static final CustomRecipeMap sFissionFuelProcessing = new CustomRecipeMap(new HashSet(50), "gt.recipe.fissionfuel", "Nuclear Fuel Processing", null, RES_PATH_GUI + "basicmachines/FissionFuel", 0, 0, 0, 4, 1, E, 1, E, true, true); + public static final CustomRecipeMap sFissionFuelProcessing = new CustomRecipeMap(new HashSet(50), "gt.recipe.fissionfuel", "Nuclear Fuel Processing", null, RES_PATH_GUI + "basicmachines/FissionFuel", 0, 0, 0, 4, 1, E, 1, E, true, true); - public static final CustomRecipeMap mMultiWireMill = new CustomRecipeMap(new HashSet(500), "gt.recipe.multi.wiremill", "Multiblock Wiremill", null, RES_PATH_GUI + "basicmachines/FissionFuel", 1, 1, 0, 0, 1, E, 1, E, true, true); - public static final CustomRecipeMap mMultiMacerator = new CustomRecipeMap(new HashSet(500), "gt.recipe.multi.macerator", "Maceration Stack", null, RES_PATH_GUI + "basicmachines/FissionFuel", 1, 3, 0, 0, 1, E, 1, E, true, true); - public static final CustomRecipeMap mMultiCentrifuge = new CustomRecipeMap(new HashSet(500), "gt.recipe.multi.centrifuge", "Multiblock Centrifuge", null, RES_PATH_GUI + "basicmachines/FissionFuel", 2, 6, 0, 0, 1, E, 1, E, true, true); - public static final CustomRecipeMap mMultiElectrolyzer = new CustomRecipeMap(new HashSet(500), "gt.recipe.multi.electrolyzer", "Multiblock Electrolyzer", null, RES_PATH_GUI + "basicmachines/FissionFuel", 2, 6, 0, 0, 1, E, 1, E, true, true); + public static final CustomRecipeMap mMultiWireMill = new CustomRecipeMap(new HashSet(500), "gt.recipe.multi.wiremill", "Multiblock Wiremill", null, RES_PATH_GUI + "basicmachines/FissionFuel", 1, 1, 0, 0, 1, E, 1, E, true, true); + public static final CustomRecipeMap mMultiMacerator = new CustomRecipeMap(new HashSet(500), "gt.recipe.multi.macerator", "Maceration Stack", null, RES_PATH_GUI + "basicmachines/FissionFuel", 1, 3, 0, 0, 1, E, 1, E, true, true); + public static final CustomRecipeMap mMultiCentrifuge = new CustomRecipeMap(new HashSet(500), "gt.recipe.multi.centrifuge", "Multiblock Centrifuge", null, RES_PATH_GUI + "basicmachines/FissionFuel", 2, 6, 0, 0, 1, E, 1, E, true, true); + public static final CustomRecipeMap mMultiElectrolyzer = new CustomRecipeMap(new HashSet(500), "gt.recipe.multi.electrolyzer", "Multiblock Electrolyzer", null, RES_PATH_GUI + "basicmachines/FissionFuel", 2, 6, 0, 0, 1, E, 1, E, true, true); /** * HashMap of Recipes based on their Items */ - public final Map> mRecipeItemMap = new HashMap<>(); + public final Map> mRecipeItemMap = new HashMap<>(); /** * HashMap of Recipes based on their Fluids */ - public final Map> mRecipeFluidMap = new HashMap<>(); + public final Map> mRecipeFluidMap = new HashMap<>(); /** * The List of all Recipes */ - public final Collection mRecipeList; + public final Collection mRecipeList; /** * String used as an unlocalised Name. */ @@ -74,7 +74,7 @@ public class CustomRecipeMap/* extends GT_Recipe_Map*/{ * @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 CustomRecipeMap(final Collection 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 CustomRecipeMap(final Collection 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); sMappings.add(this); this.mNEIAllowed = aNEIAllowed; @@ -95,23 +95,23 @@ public class CustomRecipeMap/* extends GT_Recipe_Map*/{ GT_LanguageManager.addStringLocalization(this.mUnlocalizedName = aUnlocalizedName, aLocalName); } - public GT_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 GT_Recipe(aOptimize, aInputs, aOutputs, aSpecial, aOutputChances, aFluidInputs, aFluidOutputs, aDuration, aEUt, aSpecialValue)); + 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 GT_Recipe addRecipe(final int[] aOutputChances, final FluidStack[] aFluidInputs, final FluidStack[] aFluidOutputs, final int aDuration, final int aEUt, final int aSpecialValue) { - return this.addRecipe(new GT_Recipe(false, null, null, null, aOutputChances, aFluidInputs, aFluidOutputs, aDuration, aEUt, aSpecialValue), false, false, false); + 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 GT_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 GT_Recipe(aOptimize, aInputs, aOutputs, aSpecial, null, aFluidInputs, aFluidOutputs, aDuration, aEUt, aSpecialValue)); + 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 GT_Recipe addRecipe(final GT_Recipe aRecipe) { + public GTPP_Recipe addRecipe(final GTPP_Recipe aRecipe) { return this.addRecipe(aRecipe, true, false, false); } - public GT_Recipe addRecipe(final GT_Recipe aRecipe, final boolean aCheckForCollisions, final boolean aFakeRecipe, final boolean aHidden) { + public GTPP_Recipe addRecipe(final GTPP_Recipe aRecipe, final boolean aCheckForCollisions, final boolean aFakeRecipe, final boolean aHidden) { aRecipe.mHidden = aHidden; aRecipe.mFakeRecipe = aFakeRecipe; if ((aRecipe.mFluidInputs.length < this.mMinimalInputFluids) && (aRecipe.mInputs.length < this.mMinimalInputItems)) { @@ -126,29 +126,29 @@ public class CustomRecipeMap/* extends GT_Recipe_Map*/{ /** * 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 GT_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 GT_Recipe(false, aInputs, aOutputs, aSpecial, aOutputChances, aFluidInputs, aFluidOutputs, aDuration, aEUt, aSpecialValue)); + 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 GT_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 GT_Recipe(false, aInputs, aOutputs, aSpecial, null, aFluidInputs, aFluidOutputs, aDuration, aEUt, aSpecialValue)); + 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)); } /** * 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 GT_Recipe addFakeRecipe(final boolean aCheckForCollisions, final GT_Recipe aRecipe) { + public GTPP_Recipe addFakeRecipe(final boolean aCheckForCollisions, final GTPP_Recipe aRecipe) { return this.addRecipe(aRecipe, aCheckForCollisions, true, false); } - public GT_Recipe add(final GT_Recipe aRecipe) { + public GTPP_Recipe add(final GTPP_Recipe aRecipe) { this.mRecipeList.add(aRecipe); for (final FluidStack aFluid : aRecipe.mFluidInputs) { if (aFluid != null) { - Collection tList = this.mRecipeFluidMap.get(aFluid.getFluid()); + Collection tList = this.mRecipeFluidMap.get(aFluid.getFluid()); if (tList == null) { this.mRecipeFluidMap.put(aFluid.getFluid(), tList = new HashSet<>(1)); } @@ -159,11 +159,11 @@ public class CustomRecipeMap/* extends GT_Recipe_Map*/{ } public void reInit() { - final Map> tMap = this.mRecipeItemMap; + final Map> tMap = this.mRecipeItemMap; if (tMap != null) { tMap.clear(); } - for (final GT_Recipe tRecipe : this.mRecipeList) { + for (final GTPP_Recipe tRecipe : this.mRecipeList) { GT_OreDictUnificator.setStackArray(true, tRecipe.mInputs); GT_OreDictUnificator.setStackArray(true, tRecipe.mOutputs); if (tMap != null) { @@ -193,11 +193,11 @@ public class CustomRecipeMap/* extends GT_Recipe_Map*/{ return (aFluid != null) && this.mRecipeFluidMap.containsKey(aFluid); } - public GT_Recipe findRecipe(final IHasWorldObjectAndCoords aTileEntity, final boolean aNotUnificated, final long aVoltage, final FluidStack[] aFluids, final ItemStack... aInputs) { + 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); } - public GT_Recipe findRecipe(final IHasWorldObjectAndCoords aTileEntity, final GT_Recipe aRecipe, final boolean aNotUnificated, final long aVoltage, final FluidStack[] aFluids, final ItemStack... aInputs) { + 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); } @@ -213,7 +213,7 @@ public class CustomRecipeMap/* extends GT_Recipe_Map*/{ * @param aInputs the Item Inputs * @return the Recipe it has found or null for no matching Recipe */ - public GT_Recipe findRecipe(final IHasWorldObjectAndCoords aTileEntity, final GT_Recipe aRecipe, final boolean aNotUnificated, final long aVoltage, final FluidStack[] aFluids, final ItemStack aSpecialSlot, ItemStack... aInputs) { + 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()) { Logger.WARNING("BAD RECIPE"); @@ -277,11 +277,11 @@ public class CustomRecipeMap/* extends GT_Recipe_Map*/{ Logger.WARNING("BAD RECIPE [b1]"); if (tStack != null) { Logger.WARNING("BAD RECIPE [b2] | "+tStack.getDisplayName()); - Collection + Collection tRecipes = this.mRecipeItemMap.get(new GT_ItemStack(tStack)); if (tRecipes != null) { Logger.WARNING("BAD RECIPE [b3]"); - for (final GT_Recipe tRecipe : tRecipes) { + for (final GTPP_Recipe tRecipe : tRecipes) { Logger.WARNING("BAD RECIPE [b4]"); if (!tRecipe.mFakeRecipe && tRecipe.isRecipeInputEqual(false, true, aFluids, aInputs)) { Logger.WARNING("BAD RECIPE [b5]"); @@ -293,7 +293,7 @@ public class CustomRecipeMap/* extends GT_Recipe_Map*/{ tRecipes = this.mRecipeItemMap.get(new GT_ItemStack(GT_Utility.copyMetaData(W, tStack))); if (tRecipes != null) { Logger.WARNING("BAD RECIPE [b7]"); - for (final GT_Recipe tRecipe : tRecipes) { + for (final GTPP_Recipe tRecipe : tRecipes) { Logger.WARNING("BAD RECIPE [b8]"); if (!tRecipe.mFakeRecipe && tRecipe.isRecipeInputEqual(false, true, aFluids, aInputs)) { Logger.WARNING("BAD RECIPE [b9]"); @@ -312,11 +312,11 @@ public class CustomRecipeMap/* extends GT_Recipe_Map*/{ Logger.WARNING("BAD RECIPE [c1]"); if (aFluid != null) { Logger.WARNING("BAD RECIPE [c2]"); - final Collection + final Collection tRecipes = this.mRecipeFluidMap.get(aFluid.getFluid()); if (tRecipes != null) { Logger.WARNING("BAD RECIPE [c3]"); - for (final GT_Recipe tRecipe : tRecipes) { + for (final GTPP_Recipe tRecipe : tRecipes) { Logger.WARNING("BAD RECIPE [c4]"); if (!tRecipe.mFakeRecipe && tRecipe.isRecipeInputEqual(false, true, aFluids, aInputs)) { Logger.WARNING("BAD RECIPE [c5]"); @@ -333,11 +333,11 @@ public class CustomRecipeMap/* extends GT_Recipe_Map*/{ return null; } - protected GT_Recipe addToItemMap(final GT_Recipe aRecipe) { + protected GTPP_Recipe addToItemMap(final GTPP_Recipe aRecipe) { for (final ItemStack aStack : aRecipe.mInputs) { if (aStack != null) { final GT_ItemStack tStack = new GT_ItemStack(aStack); - Collection tList = this.mRecipeItemMap.get(tStack); + Collection tList = this.mRecipeItemMap.get(tStack); if (tList == null) { this.mRecipeItemMap.put(tStack, tList = new HashSet<>(1)); } diff --git a/src/Java/gregtech/api/util/FishPondFakeRecipe.java b/src/Java/gregtech/api/util/FishPondFakeRecipe.java index 5d74329135..bc7cdb4701 100644 --- a/src/Java/gregtech/api/util/FishPondFakeRecipe.java +++ b/src/Java/gregtech/api/util/FishPondFakeRecipe.java @@ -59,7 +59,7 @@ public class FishPondFakeRecipe { } public static void addNewFishPondLoot(int circuit, ItemStack[] outputItems, int[] chances) { - GT_Recipe x = new GT_Recipe( + GTPP_Recipe x = new GTPP_Recipe( true, new ItemStack[]{CI.getNumberedCircuit(circuit)}, outputItems, @@ -73,7 +73,7 @@ public class FishPondFakeRecipe { ); if (x != null) { Logger.INFO("Fishing ["+circuit+"]: "+ItemUtils.getArrayStackNames(outputItems)); - Recipe_GT.Gregtech_Recipe_Map.sFishPondRecipes.addRecipe(x); + GTPP_Recipe.GTPP_Recipe_Map.sFishPondRecipes.addRecipe(x); } } diff --git a/src/Java/gregtech/api/util/GTPP_Recipe.java b/src/Java/gregtech/api/util/GTPP_Recipe.java new file mode 100644 index 0000000000..107fa89510 --- /dev/null +++ b/src/Java/gregtech/api/util/GTPP_Recipe.java @@ -0,0 +1,1465 @@ +package gregtech.api.util; + +import static gregtech.api.enums.GT_Values.E; +import static gregtech.api.enums.GT_Values.RES_PATH_GUI; +import static gregtech.api.enums.GT_Values.W; + +import java.util.*; + +import codechicken.nei.PositionedStack; +import gregtech.api.GregTech_API; +import gregtech.api.enums.Materials; +import gregtech.api.enums.OrePrefixes; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.interfaces.tileentity.IHasWorldObjectAndCoords; +import gregtech.api.objects.GT_ItemStack; +import gregtech.api.objects.ItemData; +import gtPlusPlus.api.interfaces.IComparableRecipe; +import gtPlusPlus.api.objects.Logger; +import gtPlusPlus.api.objects.data.AutoMap; +import gtPlusPlus.api.objects.minecraft.NoConflictGTRecipeMap; +import gtPlusPlus.core.lib.CORE; +import gtPlusPlus.core.util.minecraft.ItemUtils; +import gtPlusPlus.core.util.minecraft.RecipeUtils; +import gtPlusPlus.nei.GT_NEI_MultiBlockHandler; +import net.minecraft.item.ItemStack; +import net.minecraftforge.fluids.Fluid; +import net.minecraftforge.fluids.FluidContainerRegistry; +import net.minecraftforge.fluids.FluidStack; + +/** + * Custom GT Recipe Class + * @author Alkalus + * + */ +public class GTPP_Recipe extends GT_Recipe implements IComparableRecipe { + + private final int mRecipeHash; + + public GTPP_Recipe(final boolean aOptimize, final ItemStack[] aInputs, final ItemStack[] aOutputs, final Object aSpecialItems, final int[] aChances, final FluidStack[] aFluidInputs, final FluidStack[] aFluidOutputs, final int aDuration, final int aEUt, final int aSpecialValue) { + super(aOptimize, aInputs, aOutputs, aSpecialItems, aChances, aFluidInputs, aFluidOutputs, aDuration, aEUt, aSpecialValue); + //Logger.SPECIFIC_WARNING(this.getClass().getName()+" | [GregtechRecipe]", "Created new recipe instance for "+ItemUtils.getArrayStackNames(aInputs), 167); + mRecipeHash = getRecipeHash(this); + } + + public GTPP_Recipe(final ItemStack aInput1, final ItemStack aOutput1, final int aFuelValue, final int aType) { + this(aInput1, aOutput1, null, null, null, aFuelValue, aType); + } + + public static int getRecipeHash(GT_Recipe aRecipe) { + return aRecipe.hashCode(); + } + + public final void checkModified() { + if (hasBeenModified()) { + CORE.crash("Someone has edited an internal GT++ recipe, which is no longer allowed. Please complain to whoever has done this, not Alkalus."); + } + } + + private final boolean hasBeenModified() { + return mRecipeHash != this.hashCode(); + } + + // aSpecialValue = EU per Liter! If there is no Liquid for this Object, then it gets multiplied with 1000! + public GTPP_Recipe(final ItemStack aInput1, final ItemStack aOutput1, final ItemStack aOutput2, final ItemStack aOutput3, final ItemStack aOutput4, final int aSpecialValue, final int aType) { + this(true, new ItemStack[]{aInput1}, new ItemStack[]{aOutput1, aOutput2, aOutput3, aOutput4}, null, null, null, null, 0, 0, Math.max(1, aSpecialValue)); + + Logger.WARNING("Switch case method for adding fuels"); + if ((this.mInputs.length > 0) && (aSpecialValue > 0)) { + switch (aType) { + // Diesel Generator + case 0: + Logger.WARNING("Added fuel "+aInput1.getDisplayName()+" is ROCKET FUEL - continuing"); + GTPP_Recipe_Map.sRocketFuels.addRecipe(this); + break; + // Gas Turbine + case 1: + GTPP_Recipe_Map.sGeoThermalFuels.addRecipe(this); + break; + // Thermal Generator + case 2: + GTPP_Recipe_Map.sRTGFuels.addRecipe(this); + break; + // Plasma Generator + case 4: + //Gregtech_Recipe_Map.sPlasmaFuels.addRecipe(this); + break; + // Magic Generator + case 5: + //Gregtech_Recipe_Map.sMagicFuels.addRecipe(this); + break; + // Fluid Generator. Usually 3. Every wrong Type ends up in the Semifluid Generator + default: + //Gregtech_Recipe_Map.sDenseLiquidFuels.addRecipe(this); + break; + } + } + } + + //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 GTPP_Recipe(final FluidStack aInput1, final FluidStack aInput2, final FluidStack aOutput1, final int aDuration, final int aEUt, final int aSpecialValue) { + this(true, null, null, null, null, new FluidStack[]{aInput1, aInput2}, new FluidStack[]{aOutput1}, Math.max(aDuration, 1), aEUt, Math.max(Math.min(aSpecialValue, 160000000), 0)); + if (this.mInputs.length > 1) { + GTPP_Recipe_Map.sLiquidFluorineThoriumReactorRecipes.addRecipe(this); + } + } + + public GTPP_Recipe( + final FluidStack aInput1, final FluidStack aInput2, final FluidStack aInput3, + final FluidStack aInput4, final FluidStack aInput5, final FluidStack aInput6, + final FluidStack aInput7, final FluidStack aInput8, final FluidStack aInput9, + final FluidStack aOutput1, final FluidStack aOutput2, + final int aDuration, final int aEUt) { + this(true, null, null, null, null, new FluidStack[]{aInput1, aInput2, aInput3, aInput4, aInput5, aInput6, aInput7, aInput8, aInput9}, new FluidStack[]{aOutput1, aOutput2}, Math.max(aDuration, 1), aEUt, 0); + if (this.mInputs.length > 1) { + CustomRecipeMap.sFissionFuelProcessing.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()) { + for (GT_Recipe aRecipe : tMapEntry.mRecipeList) { + checkRecipeOwnership(aRecipe); + } + } + } + } + + private final static boolean checkRecipeOwnership(GT_Recipe aRecipe) { + if (aRecipe != null && aRecipe instanceof GTPP_Recipe) { + GTPP_Recipe nRecipe = (GTPP_Recipe) aRecipe; + GTPP_Recipe_Map_Internal.mHashedRecipes.put(nRecipe.hashCode(), nRecipe); + return true; + } + return false; + } + + public final static void checkRecipeModifications() { + for (GTPP_Recipe aRecipe : GTPP_Recipe_Map_Internal.mHashedRecipes.values()) { + aRecipe.checkModified(); + } + } + + @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(); + } + + @Override + public boolean isRecipeInputEqual(final boolean aDecreaseStacksizeBySuccess, final FluidStack[] aFluidInputs, final ItemStack... aInputs) { + return this.isRecipeInputEqual(aDecreaseStacksizeBySuccess, false, aFluidInputs, aInputs); + } + + @Override + public boolean isRecipeInputEqual(final boolean aDecreaseStacksizeBySuccess, final boolean aDontCheckStackSizes, final FluidStack[] aFluidInputs, final ItemStack... aInputs) { + if ((this.mFluidInputs.length > 0) && (aFluidInputs == null)) { + return false; + } + for (final FluidStack tFluid : this.mFluidInputs) { + if (tFluid != null) { + boolean temp = true; + for (final FluidStack aFluid : aFluidInputs) { + if ((aFluid != null) && aFluid.isFluidEqual(tFluid) && (aDontCheckStackSizes || (aFluid.amount >= tFluid.amount))) { + temp = false; + break; + } + } + if (temp) { + return false; + } + } + } + + if ((this.mInputs.length > 0) && (aInputs == null)) { + return false; + } + + for (final ItemStack tStack : this.mInputs) { + if (tStack != null) { + boolean temp = true; + for (final ItemStack aStack : aInputs) { + if ((GT_Utility.areUnificationsEqual(aStack, tStack, true) || GT_Utility.areUnificationsEqual(GT_OreDictUnificator.get(false, aStack), tStack, true)) && (aDontCheckStackSizes || (aStack.stackSize >= tStack.stackSize))) { + temp = false; + break; + } + } + if (temp) { + return false; + } + } + } + + if (aDecreaseStacksizeBySuccess) { + if (aFluidInputs != null) { + for (final FluidStack tFluid : this.mFluidInputs) { + if (tFluid != null) { + for (final FluidStack aFluid : aFluidInputs) { + if ((aFluid != null) && aFluid.isFluidEqual(tFluid) && (aDontCheckStackSizes || (aFluid.amount >= tFluid.amount))) { + aFluid.amount -= tFluid.amount; + break; + } + } + } + } + } + + if (aInputs != null) { + for (final ItemStack tStack : this.mInputs) { + if (tStack != null) { + for (final ItemStack aStack : aInputs) { + if ((GT_Utility.areUnificationsEqual(aStack, tStack, true) || GT_Utility.areUnificationsEqual(GT_OreDictUnificator.get(false, aStack), tStack, true)) && (aDontCheckStackSizes || (aStack.stackSize >= tStack.stackSize))) { + aStack.stackSize -= tStack.stackSize; + break; + } + } + } + } + } + } + + return true; + } + + public static class GTPP_Recipe_Map_Internal extends GT_Recipe_Map { + + public static final Collection sMappingsEx = new ArrayList<>(); + private static final HashMap mHashedRecipes = new HashMap(); + + public GTPP_Recipe_Map_Internal(Collection 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); + 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 sMappings = new ArrayList<>(); + //public static final GT_Recipe_Map sChemicalBathRecipes = new GT_Recipe_Map(new HashSet(200), "gt.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(200), "gt.recipe.cokeoven", "Coke Oven", null, RES_PATH_GUI + "basicmachines/Dehydrator", 2, 2, 1, 0, 1, E, 1, E, true, true); + public static final GTPP_Recipe_Map_Internal sMatterFab2Recipes = new GTPP_Recipe_Map_Internal(new HashSet(200), "gt.recipe.matterfab2", "Matter Fabricator", null, RES_PATH_GUI + "basicmachines/Default", 9, 9, 0, 0, 1, E, 1, E, true, true); + //public static final Gregtech_Recipe_Map sMatterFabRecipes = new Gregtech_Recipe_Map(new HashSet(200), "gt.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(10), "gt.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(10), "gt.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(200), "gt.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(500), "gt.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(200), "gt.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 sSteamTurbineFuels = new GTPP_Recipe_Map_Internal(new HashSet(10), "gt.recipe.geothermalfuel", "GeoThermal Fuel", null, RES_PATH_GUI + "basicmachines/Default", 1, 1, 0, 0, 1, "Fuel Value: ", 1000, " EU", true, true); + + //LFTR recipes + public static final GTPP_Recipe_Map_Internal sLiquidFluorineThoriumReactorRecipes = new GTPP_Recipe_Map_Internal(new HashSet(50), "gt.recipe.lftr", "Liquid Fluoride Thorium Reactor", null, RES_PATH_GUI + "basicmachines/LFTR", 0, 0, 0, 2, 1, "Start: ", 1, " EU", true, true); + public static final GTPP_Recipe_Map_Internal sLiquidFluorineThoriumReactorRecipesEx = new GTPP_Recipe_Map_Internal(new NoConflictGTRecipeMap(), "gt.recipe.lftr.2", "Liquid Fluoride Thorium Reactor", null, RES_PATH_GUI + "basicmachines/LFTR", 0, 0, 0, 2, 1, "Start: ", 1, " EU", true, true); + + // Ore Milling Map + public static final GTPP_Recipe_Map_Internal sOreMillRecipes = new GTPP_Recipe_Map_Internal(new HashSet(10000), "gt.recipe.oremill", "Milling", null, RES_PATH_GUI + "basicmachines/LFTR", 3, 4, 1, 0, 1, E, 1, E, true, false); + + //Fission Fuel Plant Recipes + //public static final GTPP_Recipe_Map sFissionFuelProcessing = new GTPP_Recipe_Map(new HashSet(50), "gt.recipe.fissionfuel", "Fission Fuel Processing", null, RES_PATH_GUI + "basicmachines/LFTR", 0, 0, 0, 9, 1, E, 1, E, true, true); + + //Basic Washer Map + public static final GTPP_Recipe_Map_Internal sSimpleWasherRecipes = new GTPP_Recipe_Map_Internal(new HashSet(3), "gt.recipe.simplewasher", "Simple Dust Washer", null, RES_PATH_GUI + "basicmachines/PotionBrewer", 1, 1, 0, 0, 1, E, 1, E, true, true); + + public static final GTPP_Recipe_Map sChemicalPlantRecipes = new GTPP_Recipe_Map( + new HashSet(100), + "gt.recipe.fluidchemicaleactor", + "Chemical Plant", + null, + CORE.MODID+":textures/gui/FluidReactor", + 0, + 0, + 0, + 2, + 1, + "Tier: ", + 1, + E, + true, + false); + + + //RTG Fuel Map + public static final GT_Recipe.GT_Recipe_Map_Fuel sRTGFuels = new GTPP_Recipe.GT_Recipe_Map_Fuel( + new HashSet(10), "gt.recipe.RTGgenerators", "RTG", null, + "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(10), "gt.recipe.thermalgeneratorfuel", + "Thermal Generator Fuel", null, "gregtech:textures/gui/basicmachines/Default", 1, 1, 0, 0, 1, + "Fuel Value: ", 1000, " EU", true, false); + + //Cyclotron recipe map + public static final GTPP_Recipe_Map_Internal sCyclotronRecipes = new GTPP_Recipe_Map_Internal(new HashSet(200), "gt.recipe.cyclotron", "COMET - Compact Cyclotron", null, RES_PATH_GUI + "basicmachines/BlastSmelter", 2, 16, 0, 0, 1, E, 1, E, true, true); + + //Advanced Mixer + public static final GTPP_Recipe_Map_Internal sAdvancedMixerRecipes = new GTPP_Recipe_Map_Internal(new HashSet(1000), "gt.recipe.advanced.mixer", + "Advanced Material Combiner", null, "gregtech:textures/gui/basicmachines/MixerAdvanced", 4, 4, 1, 0, 2, "", 1, "", true, true); + + + //Mini Fusion + public static final GTPP_Recipe_Map_Internal sSlowFusionRecipes = new GTPP_Recipe_Map_Internal(new HashSet(50), "gt.recipe.slowfusionreactor", + "Mimir - Slow Fusion", null, "gregtech:textures/gui/basicmachines/LFTR", 0, 0, 0, 2, 1, "Start: ", 1, + " EU", true, true); + + + //Component Assembler + public static final GT_Recipe_Map sComponentAssemblerRecipes = new GT_Recipe_Map_Assembler(new HashSet(300), "gt.recipe.componentassembler", "Component Assembler", null, RES_PATH_GUI + "basicmachines/Assembler", 6, 1, 1, 0, 1, E, 1, E, true, true); + + //Special Maps for Multis + public static final GTPP_Recipe_Map_Internal sFishPondRecipes = new GTPP_Recipe_Map_Internal(new HashSet(3), "gt.recipe.fishpond", "Zhuhai - Fishing Port", null, RES_PATH_GUI + "basicmachines/PotionBrewer", 0, 1, 0, 0, 1, "Requires Circuit: ", 1, ".", true, true); + public static final GTPP_Recipe_Map sMultiblockCentrifugeRecipes = new GT_Recipe_Map_LargeCentrifuge(); + 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(2000), "gt.recipe.temp", "temp", null, RES_PATH_GUI + "basicmachines/PotionBrewer", 0, 0, 0, 0, 0, "", 0, "", false, false); + public static final GTPP_Recipe_Map_Internal sMultiblockCentrifugeRecipes_GT = new GTPP_Recipe_Map_Internal(new HashSet(2000), "gt.recipe.temp2", "temp2", null, RES_PATH_GUI + "basicmachines/PotionBrewer", 0, 0, 0, 0, 0, "", 0, "", false, false); + public static final GTPP_Recipe_Map_Internal sMultiblockElectrolyzerRecipes_GT = new GTPP_Recipe_Map_Internal(new HashSet(2000), "gt.recipe.temp3", "temp3", null, RES_PATH_GUI + "basicmachines/PotionBrewer", 0, 0, 0, 0, 0, "", 0, "", false, false); + public static final GTPP_Recipe_Map_Internal sChemicalPlant_GT = new GTPP_Recipe_Map_Internal(new HashSet(2000), "gt.recipe.temp4", "temp4", null, RES_PATH_GUI + "basicmachines/PotionBrewer", 0, 0, 0, 0, 0, "", 0, "", false, false); + + //Semi-Fluid Fuel Map + public static final GT_Recipe_Map_Fuel sSemiFluidLiquidFuels = new GT_Recipe_Map_Fuel(new HashSet(10), "gt.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(10000), "gt.recipe.flotationcell", "Flotation Cell", null, RES_PATH_GUI + "basicmachines/LFTR", 6, 4, 1, 1, 1, "Ore Key: ", 1, E, true, false); + + + + + /** + * HashMap of Recipes based on their Items + */ + public final Map> mRecipeItemMap = new HashMap<>(); + /** + * HashMap of Recipes based on their Fluids + */ + public final Map> mRecipeFluidMap = new HashMap<>(); + /** + * The List of all Recipes + */ + public final Collection 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 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 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 GTPP_Recipe addRecipe(final GTPP_Recipe aRecipe) { + Logger.WARNING("Adding Recipe Method 1"); + return this.addRecipe(aRecipe, true, false, false); + } + + 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; + } + 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)); + } + + /** + * 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 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 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); + } + + public void reInit() { + final Map> 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); + } + } + } + + /** + * @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)))); + } + + /** + * @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()); + } + + /** + * @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); + } + + 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); + } + + 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); + } + + /** + * 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; + } + + // 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; + } + } + } + + // 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 + 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; + } + } + } + } + } + } + + // 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 + 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; + } + + 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 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()); + } + + } + tList.add(aRecipe); + Logger.WARNING("Method 4 - Added recipe to map? I think."); + } + } + 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) { + + ItemStack aInputs[] = null; + // No Recipes? Well, nothing to be found then. + if (this.mRecipeList.isEmpty()) { + return null; + } + + // 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; + } + } + } + + // 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 + 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; + } + } + } + } + } + } + + // 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 + 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. + // ----------------------------------------------------------------------------------------------------------------- + + /** + * 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 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); + } + + @Override + public boolean containsInput(final ItemStack aStack) { + return false; + } + + @Override + public boolean containsInput(final FluidStack aFluid) { + return false; + } + + @Override + public boolean containsInput(final Fluid aFluid) { + return false; + } + + @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; + } + + @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 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 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); + } + + 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); + } + + 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); + } + + 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); + } + + 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); + } + } + + public static class GT_Recipe_Map_LargeCentrifuge extends GTPP_Recipe_Map { + private static int INPUT_COUNT; + private static int OUTPUT_COUNT; + private static int FLUID_INPUT_COUNT; + private static int FLUID_OUTPUT_COUNT; + + public GT_Recipe_Map_LargeCentrifuge() { + super(new HashSet(2000), "gt.recipe.largecentrifuge", "Large Centrifuge", null, + RES_PATH_GUI + "basicmachines/FissionFuel", GT_Recipe_Map_LargeCentrifuge.INPUT_COUNT, + GT_Recipe_Map_LargeCentrifuge.OUTPUT_COUNT, 0, 0, 1, "", 1, "", true, true); + } + + @Override + public GTPP_Recipe addRecipe(final boolean aOptimize, ItemStack[] aInputs, ItemStack[] aOutputs, + final Object aSpecial, final int[] aOutputChances, FluidStack[] aFluidInputs, + FluidStack[] aFluidOutputs, final int aDuration, final int aEUt, final int aSpecialValue) { + final ArrayList adjustedInputs = new ArrayList(); + final ArrayList adjustedOutputs = new ArrayList(); + final ArrayList adjustedFluidInputs = new ArrayList(); + final ArrayList adjustedFluidOutputs = new ArrayList(); + if (aInputs == null) { + aInputs = new ItemStack[0]; + } + for (final ItemStack input : aInputs) { + FluidStack inputFluidContent = FluidContainerRegistry.getFluidForFilledItem(input); + if (inputFluidContent != null) { + final FluidStack fluidStack = inputFluidContent; + fluidStack.amount *= input.stackSize; + if (inputFluidContent.getFluid().getName().equals("ic2steam")) { + inputFluidContent = GT_ModHandler.getSteam((long) inputFluidContent.amount); + } + adjustedFluidInputs.add(inputFluidContent); + } else { + final ItemData itemData = GT_OreDictUnificator.getItemData(input); + if (itemData == null || !itemData.hasValidPrefixMaterialData() + || itemData.mMaterial.mMaterial != Materials.Empty) { + if (itemData != null && itemData.hasValidPrefixMaterialData() + && itemData.mPrefix == OrePrefixes.cell) { + //final ItemStack dustStack = itemData.mMaterial.mMaterial.getDust(input.stackSize); + final ItemStack dustStack = ItemUtils.getGregtechOreStack(OrePrefixes.dust, itemData.mMaterial.mMaterial, input.stackSize); + if (dustStack != null) { + adjustedInputs.add(dustStack); + } else { + adjustedInputs.add(input); + } + } else { + adjustedInputs.add(input); + } + } + } + } + if (aFluidInputs == null) { + aFluidInputs = new FluidStack[0]; + } + for (final FluidStack fluidInput : aFluidInputs) { + adjustedFluidInputs.add(fluidInput); + } + aInputs = adjustedInputs.toArray(new ItemStack[adjustedInputs.size()]); + aFluidInputs = adjustedFluidInputs.toArray(new FluidStack[adjustedFluidInputs.size()]); + if (aOutputs == null) { + aOutputs = new ItemStack[0]; + } + for (final ItemStack output : aOutputs) { + FluidStack outputFluidContent = FluidContainerRegistry.getFluidForFilledItem(output); + if (outputFluidContent != null) { + final FluidStack fluidStack2 = outputFluidContent; + fluidStack2.amount *= output.stackSize; + if (outputFluidContent.getFluid().getName().equals("ic2steam")) { + outputFluidContent = GT_ModHandler.getSteam((long) outputFluidContent.amount); + } + adjustedFluidOutputs.add(outputFluidContent); + } else { + final ItemData itemData = GT_OreDictUnificator.getItemData(output); + if (itemData == null || !itemData.hasValidPrefixMaterialData() + || itemData.mMaterial.mMaterial != Materials.Empty) { + adjustedOutputs.add(output); + } + } + } + if (aFluidOutputs == null) { + aFluidOutputs = new FluidStack[0]; + } + for (final FluidStack fluidOutput : aFluidOutputs) { + adjustedFluidOutputs.add(fluidOutput); + } + aOutputs = adjustedOutputs.toArray(new ItemStack[adjustedOutputs.size()]); + aFluidOutputs = adjustedFluidOutputs.toArray(new FluidStack[adjustedFluidOutputs.size()]); + GTPP_Recipe mNew = new GT_Recipe_LargeCentrifuge(aOptimize, aInputs, aOutputs, aSpecial, aOutputChances, aFluidInputs, aFluidOutputs, aDuration, aEUt, aSpecialValue); + if (RecipeUtils.doesGregtechRecipeHaveEqualCells(mNew)) { + return this.addRecipe(mNew); + } + else { + return null; + } + } + + static { + GT_Recipe_Map_LargeCentrifuge.INPUT_COUNT = 2; + GT_Recipe_Map_LargeCentrifuge.OUTPUT_COUNT = 2; + GT_Recipe_Map_LargeCentrifuge.FLUID_INPUT_COUNT = 4; + GT_Recipe_Map_LargeCentrifuge.FLUID_OUTPUT_COUNT = 4; + } + + private static class GT_Recipe_LargeCentrifuge extends GTPP_Recipe { + protected GT_Recipe_LargeCentrifuge(final boolean aOptimize, final ItemStack[] aInputs, + final ItemStack[] aOutputs, final Object aSpecialItems, final int[] aChances, + final FluidStack[] aFluidInputs, final FluidStack[] aFluidOutputs, final int aDuration, + final int aEUt, final int aSpecialValue) { + super(aOptimize, aInputs, aOutputs, aSpecialItems, aChances, aFluidInputs, aFluidOutputs, aDuration, + aEUt, aSpecialValue); + } + + public ArrayList getInputPositionedStacks() { + final int itemLimit = Math.min(this.mInputs.length, GT_Recipe_Map_LargeCentrifuge.INPUT_COUNT); + final int fluidLimit = Math.min(this.mFluidInputs.length, + GT_Recipe_Map_LargeCentrifuge.FLUID_INPUT_COUNT); + final ArrayList inputStacks = new ArrayList(itemLimit + fluidLimit); + for (int i = 0; i < itemLimit; ++i) { + inputStacks.add((PositionedStack) new GT_NEI_MultiBlockHandler.FixedPositionedStack( + (Object) this.mInputs[i].copy(), 48 - i * 18, 5)); + } + for (int i = 0; i < fluidLimit; ++i) { + if (i < 3) { + inputStacks.add((PositionedStack) new GT_NEI_MultiBlockHandler.FixedPositionedStack( + (Object) GT_Utility.getFluidDisplayStack(this.mFluidInputs[i], true), 48 - i * 18, 23)); + } else { + inputStacks.add((PositionedStack) new GT_NEI_MultiBlockHandler.FixedPositionedStack( + (Object) GT_Utility.getFluidDisplayStack(this.mFluidInputs[i], true), 12, 5)); + } + } + return inputStacks; + } + + public ArrayList getOutputPositionedStacks() { + final int itemLimit = Math.max(this.mOutputs.length, 0); + final int fluidLimit = Math.max(this.mFluidOutputs.length, 0); + final ArrayList outputStacks = new ArrayList(itemLimit + fluidLimit); + AutoMap mNEIMap = new AutoMap(); + for (int i = 0; i < itemLimit; ++i) { + if (this.mOutputs[i] != null) + mNEIMap.put((Object) this.mOutputs[i].copy()); + } + for (int i = 0; i < fluidLimit; ++i) { + if (this.mFluidOutputs[i] != null) + mNEIMap.put((Object) GT_Utility.getFluidDisplayStack(this.mFluidOutputs[i], true)); + } + int xPos[] = new int[] {102, 120, 138}; + int yPos[] = new int[] {5, 23, 41, 59}; + int mRow = 0; + int mColumn = 0; + for (int i = 0; i < Math.min(mNEIMap.size(), 16); ++i) { + if (mColumn >= 3) { + mColumn = 0; + mRow++; + } + if (mColumn <= 2 && mRow <= 3) + outputStacks.add( + (PositionedStack) new GT_NEI_MultiBlockHandler.FixedPositionedStack( + (Object) mNEIMap.get(i), xPos[mColumn++], yPos[mRow], this.getOutputChance(i))); + } + return outputStacks; + } + } + } + + public static class GT_Recipe_Map_LargeElectrolyzer extends GTPP_Recipe_Map { + private static int INPUT_COUNT; + private static int OUTPUT_COUNT; + private static int FLUID_INPUT_COUNT; + private static int FLUID_OUTPUT_COUNT; + + public GT_Recipe_Map_LargeElectrolyzer() { + super(new HashSet(2000), "gt.recipe.largeelectrolyzer", "Large Electrolyzer", null, + RES_PATH_GUI + "basicmachines/FissionFuel", GT_Recipe_Map_LargeElectrolyzer.INPUT_COUNT, + GT_Recipe_Map_LargeElectrolyzer.OUTPUT_COUNT, 0, 0, 1, "", 1, "", true, true); + } + + @Override + public GTPP_Recipe addRecipe(final boolean aOptimize, ItemStack[] aInputs, ItemStack[] aOutputs, + final Object aSpecial, final int[] aOutputChances, FluidStack[] aFluidInputs, + FluidStack[] aFluidOutputs, final int aDuration, final int aEUt, final int aSpecialValue) { + final ArrayList adjustedInputs = new ArrayList(); + final ArrayList adjustedOutputs = new ArrayList(); + final ArrayList adjustedFluidInputs = new ArrayList(); + final ArrayList adjustedFluidOutputs = new ArrayList(); + if (aInputs == null) { + aInputs = new ItemStack[0]; + } + for (final ItemStack input : aInputs) { + FluidStack inputFluidContent = FluidContainerRegistry.getFluidForFilledItem(input); + if (inputFluidContent != null) { + final FluidStack fluidStack = inputFluidContent; + fluidStack.amount *= input.stackSize; + if (inputFluidContent.getFluid().getName().equals("ic2steam")) { + inputFluidContent = GT_ModHandler.getSteam((long) inputFluidContent.amount); + } + adjustedFluidInputs.add(inputFluidContent); + } else { + final ItemData itemData = GT_OreDictUnificator.getItemData(input); + if (itemData == null || !itemData.hasValidPrefixMaterialData() + || itemData.mMaterial.mMaterial != Materials.Empty) { + if (itemData != null && itemData.hasValidPrefixMaterialData() + && itemData.mPrefix == OrePrefixes.cell) { + //final ItemStack dustStack = itemData.mMaterial.mMaterial.getDust(input.stackSize); + final ItemStack dustStack = ItemUtils.getGregtechOreStack(OrePrefixes.dust, itemData.mMaterial.mMaterial, input.stackSize); + if (dustStack != null) { + adjustedInputs.add(dustStack); + } else { + adjustedInputs.add(input); + } + } else { + adjustedInputs.add(input); + } + } + } + } + if (aFluidInputs == null) { + aFluidInputs = new FluidStack[0]; + } + for (final FluidStack fluidInput : aFluidInputs) { + adjustedFluidInputs.add(fluidInput); + } + aInputs = adjustedInputs.toArray(new ItemStack[adjustedInputs.size()]); + aFluidInputs = adjustedFluidInputs.toArray(new FluidStack[adjustedFluidInputs.size()]); + if (aOutputs == null) { + aOutputs = new ItemStack[0]; + } + for (final ItemStack output : aOutputs) { + FluidStack outputFluidContent = FluidContainerRegistry.getFluidForFilledItem(output); + if (outputFluidContent != null) { + final FluidStack fluidStack2 = outputFluidContent; + fluidStack2.amount *= output.stackSize; + if (outputFluidContent.getFluid().getName().equals("ic2steam")) { + outputFluidContent = GT_ModHandler.getSteam((long) outputFluidContent.amount); + } + adjustedFluidOutputs.add(outputFluidContent); + } else { + final ItemData itemData = GT_OreDictUnificator.getItemData(output); + if (itemData == null || !itemData.hasValidPrefixMaterialData() + || itemData.mMaterial.mMaterial != Materials.Empty) { + adjustedOutputs.add(output); + } + } + } + if (aFluidOutputs == null) { + aFluidOutputs = new FluidStack[0]; + } + for (final FluidStack fluidOutput : aFluidOutputs) { + adjustedFluidOutputs.add(fluidOutput); + } + aOutputs = adjustedOutputs.toArray(new ItemStack[adjustedOutputs.size()]); + aFluidOutputs = adjustedFluidOutputs.toArray(new FluidStack[adjustedFluidOutputs.size()]); + GTPP_Recipe mNew = new GT_Recipe_LargeElectrolyzer(aOptimize, aInputs, aOutputs, aSpecial, aOutputChances, aFluidInputs, aFluidOutputs, aDuration, aEUt, aSpecialValue); + if (RecipeUtils.doesGregtechRecipeHaveEqualCells(mNew)) { + return this.addRecipe(mNew); + } + else { + return null; + } + } + + static { + GT_Recipe_Map_LargeElectrolyzer.INPUT_COUNT = 2; + GT_Recipe_Map_LargeElectrolyzer.OUTPUT_COUNT = 2; + GT_Recipe_Map_LargeElectrolyzer.FLUID_INPUT_COUNT = 4; + GT_Recipe_Map_LargeElectrolyzer.FLUID_OUTPUT_COUNT = 4; + } + + private static class GT_Recipe_LargeElectrolyzer extends GTPP_Recipe { + protected GT_Recipe_LargeElectrolyzer(final boolean aOptimize, final ItemStack[] aInputs, + final ItemStack[] aOutputs, final Object aSpecialItems, final int[] aChances, + final FluidStack[] aFluidInputs, final FluidStack[] aFluidOutputs, final int aDuration, + final int aEUt, final int aSpecialValue) { + super(aOptimize, aInputs, aOutputs, aSpecialItems, aChances, aFluidInputs, aFluidOutputs, aDuration, + aEUt, aSpecialValue); + } + + @Override + public ArrayList getInputPositionedStacks() { + final int itemLimit = Math.min(this.mInputs.length, GT_Recipe_Map_LargeElectrolyzer.INPUT_COUNT); + final int fluidLimit = Math.min(this.mFluidInputs.length, + GT_Recipe_Map_LargeElectrolyzer.FLUID_INPUT_COUNT); + final ArrayList inputStacks = new ArrayList(itemLimit + fluidLimit); + for (int i = 0; i < itemLimit; ++i) { + inputStacks.add((PositionedStack) new GT_NEI_MultiBlockHandler.FixedPositionedStack( + (Object) this.mInputs[i].copy(), 48 - i * 18, 5)); + } + for (int i = 0; i < fluidLimit; ++i) { + if (i < 3) { + inputStacks.add((PositionedStack) new GT_NEI_MultiBlockHandler.FixedPositionedStack( + (Object) GT_Utility.getFluidDisplayStack(this.mFluidInputs[i], true), 48 - i * 18, 23)); + } else { + inputStacks.add((PositionedStack) new GT_NEI_MultiBlockHandler.FixedPositionedStack( + (Object) GT_Utility.getFluidDisplayStack(this.mFluidInputs[i], true), 12, 5)); + } + } + return inputStacks; + } + + @Override + public ArrayList getOutputPositionedStacks() { + final int itemLimit = Math.max(this.mOutputs.length, 0); + final int fluidLimit = Math.max(this.mFluidOutputs.length, 0); + final ArrayList outputStacks = new ArrayList(itemLimit + fluidLimit); + AutoMap mNEIMap = new AutoMap(); + for (int i = 0; i < itemLimit; ++i) { + if (this.mOutputs[i] != null) + mNEIMap.put((Object) this.mOutputs[i].copy()); + } + for (int i = 0; i < fluidLimit; ++i) { + if (this.mFluidOutputs[i] != null) + mNEIMap.put((Object) GT_Utility.getFluidDisplayStack(this.mFluidOutputs[i], true)); + } + int xPos[] = new int[] {102, 120, 138}; + int yPos[] = new int[] {5, 23, 41, 59}; + int mRow = 0; + int mColumn = 0; + for (int i = 0; i < Math.min(mNEIMap.size(), 16); ++i) { + if (mColumn >= 3) { + mColumn = 0; + mRow++; + } + if (mColumn <= 2 && mRow <= 3) + outputStacks.add( + (PositionedStack) new GT_NEI_MultiBlockHandler.FixedPositionedStack( + (Object) mNEIMap.get(i), xPos[mColumn++], yPos[mRow], this.getOutputChance(i))); + } + return outputStacks; + } + } + } + + public static class GT_Recipe_Map_AdvancedVacuumFreezer extends GTPP_Recipe_Map { + private static int INPUT_COUNT; + private static int OUTPUT_COUNT; + private static int FLUID_INPUT_COUNT; + private static int FLUID_OUTPUT_COUNT; + + public GT_Recipe_Map_AdvancedVacuumFreezer() { + super(new HashSet(2000), "gt.recipe.advfreezer", "Adv. Cryogenic Freezer", null, + RES_PATH_GUI + "basicmachines/FissionFuel", GT_Recipe_Map_AdvancedVacuumFreezer.INPUT_COUNT, + GT_Recipe_Map_AdvancedVacuumFreezer.OUTPUT_COUNT, 0, 0, 1, "", 1, "", true, true); + } + + @Override + public GTPP_Recipe addRecipe(final boolean aOptimize, ItemStack[] aInputs, ItemStack[] aOutputs, + final Object aSpecial, final int[] aOutputChances, FluidStack[] aFluidInputs, + FluidStack[] aFluidOutputs, final int aDuration, final int aEUt, final int aSpecialValue) { + final ArrayList adjustedInputs = new ArrayList(); + final ArrayList adjustedOutputs = new ArrayList(); + final ArrayList adjustedFluidInputs = new ArrayList(); + final ArrayList adjustedFluidOutputs = new ArrayList(); + if (aInputs == null) { + aInputs = new ItemStack[0]; + } + for (final ItemStack input : aInputs) { + FluidStack inputFluidContent = FluidContainerRegistry.getFluidForFilledItem(input); + if (inputFluidContent != null) { + final FluidStack fluidStack = inputFluidContent; + fluidStack.amount *= input.stackSize; + if (inputFluidContent.getFluid().getName().equals("ic2steam")) { + inputFluidContent = GT_ModHandler.getSteam((long) inputFluidContent.amount); + } + adjustedFluidInputs.add(inputFluidContent); + } else { + final ItemData itemData = GT_OreDictUnificator.getItemData(input); + if (itemData == null || !itemData.hasValidPrefixMaterialData() + || itemData.mMaterial.mMaterial != Materials.Empty) { + if (itemData != null && itemData.hasValidPrefixMaterialData() + && itemData.mPrefix == OrePrefixes.cell) { + //final ItemStack dustStack = itemData.mMaterial.mMaterial.getDust(input.stackSize); + final ItemStack dustStack = ItemUtils.getGregtechOreStack(OrePrefixes.dust, itemData.mMaterial.mMaterial, input.stackSize); + if (dustStack != null) { + adjustedInputs.add(dustStack); + } else { + adjustedInputs.add(input); + } + } else { + adjustedInputs.add(input); + } + } + } + } + if (aFluidInputs == null) { + aFluidInputs = new FluidStack[0]; + } + for (final FluidStack fluidInput : aFluidInputs) { + adjustedFluidInputs.add(fluidInput); + } + aInputs = adjustedInputs.toArray(new ItemStack[adjustedInputs.size()]); + aFluidInputs = adjustedFluidInputs.toArray(new FluidStack[adjustedFluidInputs.size()]); + if (aOutputs == null) { + aOutputs = new ItemStack[0]; + } + for (final ItemStack output : aOutputs) { + FluidStack outputFluidContent = FluidContainerRegistry.getFluidForFilledItem(output); + if (outputFluidContent != null) { + final FluidStack fluidStack2 = outputFluidContent; + fluidStack2.amount *= output.stackSize; + if (outputFluidContent.getFluid().getName().equals("ic2steam")) { + outputFluidContent = GT_ModHandler.getSteam((long) outputFluidContent.amount); + } + adjustedFluidOutputs.add(outputFluidContent); + } else { + final ItemData itemData = GT_OreDictUnificator.getItemData(output); + if (itemData == null || !itemData.hasValidPrefixMaterialData() + || itemData.mMaterial.mMaterial != Materials.Empty) { + adjustedOutputs.add(output); + } + } + } + if (aFluidOutputs == null) { + aFluidOutputs = new FluidStack[0]; + } + for (final FluidStack fluidOutput : aFluidOutputs) { + adjustedFluidOutputs.add(fluidOutput); + } + aOutputs = adjustedOutputs.toArray(new ItemStack[adjustedOutputs.size()]); + aFluidOutputs = adjustedFluidOutputs.toArray(new FluidStack[adjustedFluidOutputs.size()]); + + GTPP_Recipe mNew = new GT_Recipe_AdvFreezer(aOptimize, aInputs, aOutputs, aSpecial, aOutputChances, aFluidInputs, aFluidOutputs, aDuration, aEUt, aSpecialValue); + if (RecipeUtils.doesGregtechRecipeHaveEqualCells(mNew)) { + return this.addRecipe(mNew); + } + else { + return null; + } + } + + static { + GT_Recipe_Map_AdvancedVacuumFreezer.INPUT_COUNT = 2; + GT_Recipe_Map_AdvancedVacuumFreezer.OUTPUT_COUNT = 2; + GT_Recipe_Map_AdvancedVacuumFreezer.FLUID_INPUT_COUNT = 4; + GT_Recipe_Map_AdvancedVacuumFreezer.FLUID_OUTPUT_COUNT = 4; + } + + private static class GT_Recipe_AdvFreezer extends GTPP_Recipe { + protected GT_Recipe_AdvFreezer(final boolean aOptimize, final ItemStack[] aInputs, + final ItemStack[] aOutputs, final Object aSpecialItems, final int[] aChances, + final FluidStack[] aFluidInputs, final FluidStack[] aFluidOutputs, final int aDuration, + final int aEUt, final int aSpecialValue) { + super(aOptimize, aInputs, aOutputs, aSpecialItems, aChances, aFluidInputs, aFluidOutputs, aDuration, + aEUt, aSpecialValue); + } + + public ArrayList getInputPositionedStacks() { + final int itemLimit = Math.min(this.mInputs.length, GT_Recipe_Map_AdvancedVacuumFreezer.INPUT_COUNT); + final int fluidLimit = Math.min(this.mFluidInputs.length, + GT_Recipe_Map_AdvancedVacuumFreezer.FLUID_INPUT_COUNT); + final ArrayList inputStacks = new ArrayList(itemLimit + fluidLimit); + for (int i = 0; i < itemLimit; ++i) { + inputStacks.add((PositionedStack) new GT_NEI_MultiBlockHandler.FixedPositionedStack( + (Object) this.mInputs[i].copy(), 48 - i * 18, 5)); + } + for (int i = 0; i < fluidLimit; ++i) { + if (i < 3) { + inputStacks.add((PositionedStack) new GT_NEI_MultiBlockHandler.FixedPositionedStack( + (Object) GT_Utility.getFluidDisplayStack(this.mFluidInputs[i], true), 48 - i * 18, 23)); + } else { + inputStacks.add((PositionedStack) new GT_NEI_MultiBlockHandler.FixedPositionedStack( + (Object) GT_Utility.getFluidDisplayStack(this.mFluidInputs[i], true), 12, 5)); + } + } + return inputStacks; + } + + + public ArrayList getOutputPositionedStacks() { + final int itemLimit = Math.min(this.mOutputs.length, GT_Recipe_Map_AdvancedVacuumFreezer.OUTPUT_COUNT); + final int fluidLimit = Math.min(this.mFluidOutputs.length, + GT_Recipe_Map_AdvancedVacuumFreezer.FLUID_OUTPUT_COUNT); + final ArrayList outputStacks = new ArrayList(itemLimit + fluidLimit); + for (int i = 0; i < itemLimit; ++i) { + if (this.mOutputs[i] != null) + outputStacks.add((PositionedStack) new GT_NEI_MultiBlockHandler.FixedPositionedStack( + (Object) this.mOutputs[i].copy(), 102 + i * 18, 5, this.getOutputChance(i))); + } + for (int i = 0; i < fluidLimit; ++i) { + if (this.mFluidOutputs[i] != null) + outputStacks.add((PositionedStack) new GT_NEI_MultiBlockHandler.FixedPositionedStack( + (Object) GT_Utility.getFluidDisplayStack(this.mFluidOutputs[i], true), 102 + i * 18, 23, this.getOutputChance(i))); + } + return outputStacks; + } + } + } + + public ArrayList getInputPositionedStacks() { + return null; + } + + public ArrayList getOutputPositionedStacks() { + return null; + } + + 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; + } + + 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 0; + } + +} diff --git a/src/Java/gregtech/api/util/HotFuel.java b/src/Java/gregtech/api/util/HotFuel.java index 746ff68382..c9a6dcf7c5 100644 --- a/src/Java/gregtech/api/util/HotFuel.java +++ b/src/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) { - GT_Recipe x = new GT_Recipe( + GTPP_Recipe x = new GTPP_Recipe( true, null, outputItems, @@ -19,7 +19,7 @@ public class HotFuel { 0, //No Eu produced aSpecialValue //Magic Number ); - Recipe_GT.Gregtech_Recipe_Map.sThermalFuels.addRecipe(x); + GTPP_Recipe.GTPP_Recipe_Map.sThermalFuels.addRecipe(x); } diff --git a/src/Java/gregtech/api/util/MultiblockRecipeMapHandler.java b/src/Java/gregtech/api/util/MultiblockRecipeMapHandler.java index 7f241b1178..8b79705fe6 100644 --- a/src/Java/gregtech/api/util/MultiblockRecipeMapHandler.java +++ b/src/Java/gregtech/api/util/MultiblockRecipeMapHandler.java @@ -139,7 +139,7 @@ public class MultiblockRecipeMapHandler{ final Collection x = r.mRecipeList; for (final GT_Recipe newBo : x) { int duration = MathUtils.findPercentageOfInt(newBo.mDuration, 80); - if (newMap.addRecipe(new GT_Recipe(true, newBo.mInputs, newBo.mOutputs, newBo.mSpecialItems, newBo.mChances, newBo.mFluidInputs, newBo.mFluidOutputs, duration, newBo.mEUt, newBo.mSpecialValue), false, true, true) != null){ + if (newMap.addRecipe(new GTPP_Recipe(true, newBo.mInputs, newBo.mOutputs, newBo.mSpecialItems, newBo.mChances, newBo.mFluidInputs, newBo.mFluidOutputs, duration, newBo.mEUt, newBo.mSpecialValue), false, true, true) != null){ Logger.INFO("Successfully added a simple recipe to the "+newMap.mNEIName+" map."); } else { @@ -181,7 +181,7 @@ public class MultiblockRecipeMapHandler{ } } } - if (newMap.addRecipe(new GT_Recipe(true, mInputs, mOutputs, newBo.mSpecialItems, outputChances, mFluidInputs, mFluidOutputs, duration, newBo.mEUt, newBo.mSpecialValue), false, true, true) != null){ + if (newMap.addRecipe(new GTPP_Recipe(true, mInputs, mOutputs, newBo.mSpecialItems, outputChances, mFluidInputs, mFluidOutputs, duration, newBo.mEUt, newBo.mSpecialValue), false, true, true) != null){ Logger.INFO("Successfully added a recipe to the "+newMap.mNEIName+" map."); } else { diff --git a/src/Java/gregtech/api/util/Recipe_GT.java b/src/Java/gregtech/api/util/Recipe_GT.java deleted file mode 100644 index 7bed2ee4ec..0000000000 --- a/src/Java/gregtech/api/util/Recipe_GT.java +++ /dev/null @@ -1,1423 +0,0 @@ -package gregtech.api.util; - -import static gregtech.api.enums.GT_Values.E; -import static gregtech.api.enums.GT_Values.RES_PATH_GUI; -import static gregtech.api.enums.GT_Values.W; - -import java.util.*; - -import codechicken.nei.PositionedStack; -import gregtech.api.GregTech_API; -import gregtech.api.enums.Materials; -import gregtech.api.enums.OrePrefixes; -import gregtech.api.interfaces.tileentity.IGregTechTileEntity; -import gregtech.api.interfaces.tileentity.IHasWorldObjectAndCoords; -import gregtech.api.objects.GT_ItemStack; -import gregtech.api.objects.ItemData; -import gtPlusPlus.api.interfaces.IComparableRecipe; -import gtPlusPlus.api.objects.Logger; -import gtPlusPlus.api.objects.data.AutoMap; -import gtPlusPlus.api.objects.minecraft.NoConflictGTRecipeMap; -import gtPlusPlus.core.lib.CORE; -import gtPlusPlus.core.util.minecraft.ItemUtils; -import gtPlusPlus.core.util.minecraft.RecipeUtils; -import gtPlusPlus.nei.GT_NEI_MultiBlockHandler; -import net.minecraft.item.ItemStack; -import net.minecraftforge.fluids.Fluid; -import net.minecraftforge.fluids.FluidContainerRegistry; -import net.minecraftforge.fluids.FluidStack; - -/** - * Custom GT Recipe Class - * @author Alkalus - * - */ -public class Recipe_GT extends GT_Recipe implements IComparableRecipe{ - - public Recipe_GT(final boolean aOptimize, final ItemStack[] aInputs, final ItemStack[] aOutputs, final Object aSpecialItems, final int[] aChances, final FluidStack[] aFluidInputs, final FluidStack[] aFluidOutputs, final int aDuration, final int aEUt, final int aSpecialValue) { - super(aOptimize, aInputs, aOutputs, aSpecialItems, aChances, aFluidInputs, aFluidOutputs, aDuration, aEUt, aSpecialValue); - //Logger.SPECIFIC_WARNING(this.getClass().getName()+" | [GregtechRecipe]", "Created new recipe instance for "+ItemUtils.getArrayStackNames(aInputs), 167); - } - - public Recipe_GT(final ItemStack aInput1, final ItemStack aOutput1, final int aFuelValue, final int aType) { - this(aInput1, aOutput1, null, null, null, aFuelValue, aType); - } - - // aSpecialValue = EU per Liter! If there is no Liquid for this Object, then it gets multiplied with 1000! - public Recipe_GT(final ItemStack aInput1, final ItemStack aOutput1, final ItemStack aOutput2, final ItemStack aOutput3, final ItemStack aOutput4, final int aSpecialValue, final int aType) { - this(true, new ItemStack[]{aInput1}, new ItemStack[]{aOutput1, aOutput2, aOutput3, aOutput4}, null, null, null, null, 0, 0, Math.max(1, aSpecialValue)); - - Logger.WARNING("Switch case method for adding fuels"); - if ((this.mInputs.length > 0) && (aSpecialValue > 0)) { - switch (aType) { - // Diesel Generator - case 0: - Logger.WARNING("Added fuel "+aInput1.getDisplayName()+" is ROCKET FUEL - continuing"); - Gregtech_Recipe_Map.sRocketFuels.addRecipe(this); - break; - // Gas Turbine - case 1: - Gregtech_Recipe_Map.sGeoThermalFuels.addRecipe(this); - break; - // Thermal Generator - case 2: - Gregtech_Recipe_Map.sRTGFuels.addRecipe(this); - break; - // Plasma Generator - case 4: - //Gregtech_Recipe_Map.sPlasmaFuels.addRecipe(this); - break; - // Magic Generator - case 5: - //Gregtech_Recipe_Map.sMagicFuels.addRecipe(this); - break; - // Fluid Generator. Usually 3. Every wrong Type ends up in the Semifluid Generator - default: - //Gregtech_Recipe_Map.sDenseLiquidFuels.addRecipe(this); - break; - } - } - } - - //Custom Recipe Handlers - public Recipe_GT(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)) { - Gregtech_Recipe_Map.sChemicalDehydratorRecipes.addRecipe(this); - } - } - - public Recipe_GT(final FluidStack aInput1, final FluidStack aInput2, final FluidStack aOutput1, final int aDuration, final int aEUt, final int aSpecialValue) { - this(true, null, null, null, null, new FluidStack[]{aInput1, aInput2}, new FluidStack[]{aOutput1}, Math.max(aDuration, 1), aEUt, Math.max(Math.min(aSpecialValue, 160000000), 0)); - if (this.mInputs.length > 1) { - Gregtech_Recipe_Map.sLiquidFluorineThoriumReactorRecipes.addRecipe(this); - } - } - - public Recipe_GT( - final FluidStack aInput1, final FluidStack aInput2, final FluidStack aInput3, - final FluidStack aInput4, final FluidStack aInput5, final FluidStack aInput6, - final FluidStack aInput7, final FluidStack aInput8, final FluidStack aInput9, - final FluidStack aOutput1, final FluidStack aOutput2, - final int aDuration, final int aEUt) { - this(true, null, null, null, null, new FluidStack[]{aInput1, aInput2, aInput3, aInput4, aInput5, aInput6, aInput7, aInput8, aInput9}, new FluidStack[]{aOutput1, aOutput2}, Math.max(aDuration, 1), aEUt, 0); - if (this.mInputs.length > 1) { - CustomRecipeMap.sFissionFuelProcessing.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 Gregtech_Recipe_Map tMapEntry : Gregtech_Recipe_Map.sMappings) { - tMapEntry.reInit(); - } - for (final GTPP_Recipe_Map tMapEntry : GTPP_Recipe_Map.sMappingsEx) { - tMapEntry.reInit(); - } - - } - - @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(); - } - - @Override - public boolean isRecipeInputEqual(final boolean aDecreaseStacksizeBySuccess, final FluidStack[] aFluidInputs, final ItemStack... aInputs) { - return this.isRecipeInputEqual(aDecreaseStacksizeBySuccess, false, aFluidInputs, aInputs); - } - - @Override - public boolean isRecipeInputEqual(final boolean aDecreaseStacksizeBySuccess, final boolean aDontCheckStackSizes, final FluidStack[] aFluidInputs, final ItemStack... aInputs) { - if ((this.mFluidInputs.length > 0) && (aFluidInputs == null)) { - return false; - } - for (final FluidStack tFluid : this.mFluidInputs) { - if (tFluid != null) { - boolean temp = true; - for (final FluidStack aFluid : aFluidInputs) { - if ((aFluid != null) && aFluid.isFluidEqual(tFluid) && (aDontCheckStackSizes || (aFluid.amount >= tFluid.amount))) { - temp = false; - break; - } - } - if (temp) { - return false; - } - } - } - - if ((this.mInputs.length > 0) && (aInputs == null)) { - return false; - } - - for (final ItemStack tStack : this.mInputs) { - if (tStack != null) { - boolean temp = true; - for (final ItemStack aStack : aInputs) { - if ((GT_Utility.areUnificationsEqual(aStack, tStack, true) || GT_Utility.areUnificationsEqual(GT_OreDictUnificator.get(false, aStack), tStack, true)) && (aDontCheckStackSizes || (aStack.stackSize >= tStack.stackSize))) { - temp = false; - break; - } - } - if (temp) { - return false; - } - } - } - - if (aDecreaseStacksizeBySuccess) { - if (aFluidInputs != null) { - for (final FluidStack tFluid : this.mFluidInputs) { - if (tFluid != null) { - for (final FluidStack aFluid : aFluidInputs) { - if ((aFluid != null) && aFluid.isFluidEqual(tFluid) && (aDontCheckStackSizes || (aFluid.amount >= tFluid.amount))) { - aFluid.amount -= tFluid.amount; - break; - } - } - } - } - } - - if (aInputs != null) { - for (final ItemStack tStack : this.mInputs) { - if (tStack != null) { - for (final ItemStack aStack : aInputs) { - if ((GT_Utility.areUnificationsEqual(aStack, tStack, true) || GT_Utility.areUnificationsEqual(GT_OreDictUnificator.get(false, aStack), tStack, true)) && (aDontCheckStackSizes || (aStack.stackSize >= tStack.stackSize))) { - aStack.stackSize -= tStack.stackSize; - break; - } - } - } - } - } - } - - return true; - } - - public static class GTPP_Recipe_Map extends GT_Recipe_Map { - - public static final Collection sMappingsEx = new ArrayList<>(); - - public GTPP_Recipe_Map(Collection 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); - GT_Recipe_Map.sMappings.remove(this); - GTPP_Recipe_Map.sMappingsEx.add(this); - } - - } - - public static class Gregtech_Recipe_Map { - /** - * Contains all Recipe Maps - */ - public static final Collection sMappings = new ArrayList<>(); - //public static final GT_Recipe_Map sChemicalBathRecipes = new GT_Recipe_Map(new HashSet(200), "gt.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 sCokeOvenRecipes = new GTPP_Recipe_Map(new HashSet(200), "gt.recipe.cokeoven", "Coke Oven", null, RES_PATH_GUI + "basicmachines/Dehydrator", 2, 2, 1, 0, 1, E, 1, E, true, true); - public static final GTPP_Recipe_Map sMatterFab2Recipes = new GTPP_Recipe_Map(new HashSet(200), "gt.recipe.matterfab2", "Matter Fabricator", null, RES_PATH_GUI + "basicmachines/Default", 9, 9, 0, 0, 1, E, 1, E, true, true); - //public static final Gregtech_Recipe_Map sMatterFabRecipes = new Gregtech_Recipe_Map(new HashSet(200), "gt.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(10), "gt.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 sGeoThermalFuels = new GTPP_Recipe_Map(new HashSet(10), "gt.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 sChemicalDehydratorRecipes = new GTPP_Recipe_Map(new HashSet(200), "gt.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 sVacuumFurnaceRecipes = new GTPP_Recipe_Map(new HashSet(500), "gt.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 sAlloyBlastSmelterRecipes = new GTPP_Recipe_Map(new HashSet(200), "gt.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 sSteamTurbineFuels = new GTPP_Recipe_Map(new HashSet(10), "gt.recipe.geothermalfuel", "GeoThermal Fuel", null, RES_PATH_GUI + "basicmachines/Default", 1, 1, 0, 0, 1, "Fuel Value: ", 1000, " EU", true, true); - - //LFTR recipes - public static final GTPP_Recipe_Map sLiquidFluorineThoriumReactorRecipes = new GTPP_Recipe_Map(new HashSet(50), "gt.recipe.lftr", "Liquid Fluoride Thorium Reactor", null, RES_PATH_GUI + "basicmachines/LFTR", 0, 0, 0, 2, 1, "Start: ", 1, " EU", true, true); - public static final GTPP_Recipe_Map sLiquidFluorineThoriumReactorRecipesEx = new GTPP_Recipe_Map(new NoConflictGTRecipeMap(), "gt.recipe.lftr.2", "Liquid Fluoride Thorium Reactor", null, RES_PATH_GUI + "basicmachines/LFTR", 0, 0, 0, 2, 1, "Start: ", 1, " EU", true, true); - - // Ore Milling Map - public static final GTPP_Recipe_Map sOreMillRecipes = new GTPP_Recipe_Map(new HashSet(10000), "gt.recipe.oremill", "Milling", null, RES_PATH_GUI + "basicmachines/LFTR", 3, 4, 1, 0, 1, E, 1, E, true, false); - - //Fission Fuel Plant Recipes - //public static final GTPP_Recipe_Map sFissionFuelProcessing = new GTPP_Recipe_Map(new HashSet(50), "gt.recipe.fissionfuel", "Fission Fuel Processing", null, RES_PATH_GUI + "basicmachines/LFTR", 0, 0, 0, 9, 1, E, 1, E, true, true); - - //Basic Washer Map - public static final GTPP_Recipe_Map sSimpleWasherRecipes = new GTPP_Recipe_Map(new HashSet(3), "gt.recipe.simplewasher", "Simple Dust Washer", null, RES_PATH_GUI + "basicmachines/PotionBrewer", 1, 1, 0, 0, 1, E, 1, E, true, true); - - public static final Gregtech_Recipe_Map sChemicalPlantRecipes = new Gregtech_Recipe_Map( - new HashSet(100), - "gt.recipe.fluidchemicaleactor", - "Chemical Plant", - null, - CORE.MODID+":textures/gui/FluidReactor", - 0, - 0, - 0, - 2, - 1, - "Tier: ", - 1, - E, - true, - false); - - - //RTG Fuel Map - public static final GT_Recipe.GT_Recipe_Map_Fuel sRTGFuels = new Recipe_GT.GT_Recipe_Map_Fuel( - new HashSet(10), "gt.recipe.RTGgenerators", "RTG", null, - "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(10), "gt.recipe.thermalgeneratorfuel", - "Thermal Generator Fuel", null, "gregtech:textures/gui/basicmachines/Default", 1, 1, 0, 0, 1, - "Fuel Value: ", 1000, " EU", true, false); - - //Cyclotron recipe map - public static final GTPP_Recipe_Map sCyclotronRecipes = new GTPP_Recipe_Map(new HashSet(200), "gt.recipe.cyclotron", "COMET - Compact Cyclotron", null, RES_PATH_GUI + "basicmachines/BlastSmelter", 2, 16, 0, 0, 1, E, 1, E, true, true); - - //Advanced Mixer - public static final GTPP_Recipe_Map sAdvancedMixerRecipes = new GTPP_Recipe_Map(new HashSet(1000), "gt.recipe.advanced.mixer", - "Advanced Material Combiner", null, "gregtech:textures/gui/basicmachines/MixerAdvanced", 4, 4, 1, 0, 2, "", 1, "", true, true); - - - //Mini Fusion - public static final GTPP_Recipe_Map sSlowFusionRecipes = new GTPP_Recipe_Map(new HashSet(50), "gt.recipe.slowfusionreactor", - "Mimir - Slow Fusion", null, "gregtech:textures/gui/basicmachines/LFTR", 0, 0, 0, 2, 1, "Start: ", 1, - " EU", true, true); - - - //Component Assembler - public static final GT_Recipe_Map sComponentAssemblerRecipes = new GT_Recipe_Map_Assembler(new HashSet(300), "gt.recipe.componentassembler", "Component Assembler", null, RES_PATH_GUI + "basicmachines/Assembler", 6, 1, 1, 0, 1, E, 1, E, true, true); - - //Special Maps for Multis - public static final GTPP_Recipe_Map sFishPondRecipes = new GTPP_Recipe_Map(new HashSet(3), "gt.recipe.fishpond", "Zhuhai - Fishing Port", null, RES_PATH_GUI + "basicmachines/PotionBrewer", 0, 1, 0, 0, 1, "Requires Circuit: ", 1, ".", true, true); - public static final Gregtech_Recipe_Map sMultiblockCentrifugeRecipes = new GT_Recipe_Map_LargeCentrifuge(); - public static final Gregtech_Recipe_Map sMultiblockElectrolyzerRecipes = new GT_Recipe_Map_LargeElectrolyzer(); - public static final Gregtech_Recipe_Map sAdvFreezerRecipes = new GT_Recipe_Map_AdvancedVacuumFreezer(); - public static final GTPP_Recipe_Map sAdvFreezerRecipes_GT = new GTPP_Recipe_Map(new HashSet(2000), "gt.recipe.temp", "temp", null, RES_PATH_GUI + "basicmachines/PotionBrewer", 0, 0, 0, 0, 0, "", 0, "", false, false); - public static final GTPP_Recipe_Map sMultiblockCentrifugeRecipes_GT = new GTPP_Recipe_Map(new HashSet(2000), "gt.recipe.temp2", "temp2", null, RES_PATH_GUI + "basicmachines/PotionBrewer", 0, 0, 0, 0, 0, "", 0, "", false, false); - public static final GTPP_Recipe_Map sMultiblockElectrolyzerRecipes_GT = new GTPP_Recipe_Map(new HashSet(2000), "gt.recipe.temp3", "temp3", null, RES_PATH_GUI + "basicmachines/PotionBrewer", 0, 0, 0, 0, 0, "", 0, "", false, false); - public static final GTPP_Recipe_Map sChemicalPlant_GT = new GTPP_Recipe_Map(new HashSet(2000), "gt.recipe.temp4", "temp4", null, RES_PATH_GUI + "basicmachines/PotionBrewer", 0, 0, 0, 0, 0, "", 0, "", false, false); - - //Semi-Fluid Fuel Map - public static final GT_Recipe_Map_Fuel sSemiFluidLiquidFuels = new GT_Recipe_Map_Fuel(new HashSet(10), "gt.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 sFlotationCellRecipes = new GTPP_Recipe_Map(new HashSet(10000), "gt.recipe.flotationcell", "Flotation Cell", null, RES_PATH_GUI + "basicmachines/LFTR", 6, 4, 1, 1, 1, "Ore Key: ", 1, E, true, false); - - - - - /** - * HashMap of Recipes based on their Items - */ - public final Map> mRecipeItemMap = new HashMap<>(); - /** - * HashMap of Recipes based on their Fluids - */ - public final Map> mRecipeFluidMap = new HashMap<>(); - /** - * The List of all Recipes - */ - public final Collection 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 Gregtech_Recipe_Map(final Collection 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 Recipe_GT 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 Recipe_GT(aOptimize, aInputs, aOutputs, aSpecial, aOutputChances, aFluidInputs, aFluidOutputs, aDuration, aEUt, aSpecialValue)); - } - - public Recipe_GT addRecipe(final int[] aOutputChances, final FluidStack[] aFluidInputs, final FluidStack[] aFluidOutputs, final int aDuration, final int aEUt, final int aSpecialValue) { - return this.addRecipe(new Recipe_GT(false, null, null, null, aOutputChances, aFluidInputs, aFluidOutputs, aDuration, aEUt, aSpecialValue), false, false, false); - } - - public Recipe_GT 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 Recipe_GT(aOptimize, aInputs, aOutputs, aSpecial, null, aFluidInputs, aFluidOutputs, aDuration, aEUt, aSpecialValue)); - } - - public Recipe_GT addRecipe(final boolean aOptimize, final FluidStack[] aFluidInputs, final FluidStack[] aFluidOutputs, final int aDuration, final int aEUt, final int aSpecialValue) { - return this.addRecipe(new Recipe_GT(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 Recipe_GT addRecipe(final Recipe_GT aRecipe) { - Logger.WARNING("Adding Recipe Method 1"); - return this.addRecipe(aRecipe, true, false, false); - } - - protected Recipe_GT addRecipe(final Recipe_GT 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; - } - 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 Recipe_GT 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 Recipe_GT(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 Recipe_GT 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 Recipe_GT(false, aInputs, aOutputs, aSpecial, null, 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 Recipe_GT addFakeRecipe(final boolean aCheckForCollisions, final Recipe_GT aRecipe) { - return this.addRecipe(aRecipe, aCheckForCollisions, true, false); - } - - public Recipe_GT add(final Recipe_GT 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 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); - } - - public void reInit() { - final Map> tMap = this.mRecipeItemMap; - if (tMap != null) { - tMap.clear(); - } - for (final Recipe_GT tRecipe : this.mRecipeList) { - GT_OreDictUnificator.setStackArray(true, tRecipe.mInputs); - GT_OreDictUnificator.setStackArray(true, tRecipe.mOutputs); - if (tMap != null) { - this.addToItemMap(tRecipe); - } - } - } - - /** - * @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)))); - } - - /** - * @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()); - } - - /** - * @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); - } - - public Recipe_GT 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); - } - - public Recipe_GT findRecipe(final IHasWorldObjectAndCoords aTileEntity, final Recipe_GT aRecipe, final boolean aNotUnificated, final long aVoltage, final FluidStack[] aFluids, final ItemStack... aInputs) { - return this.findRecipe(aTileEntity, aRecipe, aNotUnificated, aVoltage, aFluids, null, aInputs); - } - - /** - * 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 Recipe_GT findRecipe(final IHasWorldObjectAndCoords aTileEntity, final Recipe_GT 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; - } - - // 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; - } - } - } - - // 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 - tRecipes = this.mRecipeItemMap.get(new GT_ItemStack(tStack)); - if (tRecipes != null) { - for (final Recipe_GT 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 Recipe_GT tRecipe : tRecipes) { - if (!tRecipe.mFakeRecipe && tRecipe.isRecipeInputEqual(false, true, aFluids, aInputs)) { - return tRecipe.mEnabled && ((aVoltage * this.mAmperage) >= tRecipe.mEUt) ? tRecipe : null; - } - } - } - } - } - } - - // 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 - tRecipes = this.mRecipeFluidMap.get(aFluid.getFluid()); - if (tRecipes != null) { - for (final Recipe_GT 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; - } - - protected Recipe_GT addToItemMap(final Recipe_GT 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 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()); - } - - } - tList.add(aRecipe); - Logger.WARNING("Method 4 - Added recipe to map? I think."); - } - } - return aRecipe; - } - - public Recipe_GT findRecipe(final IGregTechTileEntity baseMetaTileEntity, final Recipe_GT aRecipe, final boolean aNotUnificated, - final long aVoltage, final FluidStack[] aFluids, final FluidStack[] fluidStacks) { - - ItemStack aInputs[] = null; - // No Recipes? Well, nothing to be found then. - if (this.mRecipeList.isEmpty()) { - return null; - } - - // 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; - } - } - } - - // 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 - tRecipes = this.mRecipeItemMap.get(new GT_ItemStack(tStack)); - if (tRecipes != null) { - for (final Recipe_GT 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 Recipe_GT tRecipe : tRecipes) { - if (!tRecipe.mFakeRecipe && tRecipe.isRecipeInputEqual(false, true, aFluids, aInputs)) { - return tRecipe.mEnabled && ((aVoltage * this.mAmperage) >= tRecipe.mEUt) ? tRecipe : null; - } - } - } - } - } - } - - // 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 - tRecipes = this.mRecipeFluidMap.get(aFluid.getFluid()); - if (tRecipes != null) { - for (final Recipe_GT 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. - // ----------------------------------------------------------------------------------------------------------------- - - /** - * Abstract Class for general Recipe Handling of non GT Recipes - */ - public static abstract class GT_Recipe_Map_NonGTRecipes extends Gregtech_Recipe_Map { - public GT_Recipe_Map_NonGTRecipes(final Collection 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); - } - - @Override - public boolean containsInput(final ItemStack aStack) { - return false; - } - - @Override - public boolean containsInput(final FluidStack aFluid) { - return false; - } - - @Override - public boolean containsInput(final Fluid aFluid) { - return false; - } - - @Override - public Recipe_GT 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 Recipe_GT 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 Recipe_GT addRecipe(final Recipe_GT aRecipe) { - return null; - } - - @Override - public Recipe_GT 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 Recipe_GT 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 Recipe_GT addFakeRecipe(final boolean aCheckForCollisions, final Recipe_GT aRecipe) { - return null; - } - - @Override - public Recipe_GT add(final Recipe_GT aRecipe) { - return null; - } - - @Override - public void reInit() {/**/} - - @Override - protected Recipe_GT addToItemMap(final Recipe_GT aRecipe) { - return null; - } - } - - /** - * Just a Recipe Map with Utility specifically for Fuels. - */ - public static class Gregtech_Recipe_Map_Fuel extends Gregtech_Recipe_Map { - public Gregtech_Recipe_Map_Fuel(final Collection 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 Recipe_GT 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); - } - - public Recipe_GT 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); - } - - public Recipe_GT 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); - } - - public Recipe_GT 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); - } - - public Recipe_GT 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); - } - } - - public static class GT_Recipe_Map_LargeCentrifuge extends Gregtech_Recipe_Map { - private static int INPUT_COUNT; - private static int OUTPUT_COUNT; - private static int FLUID_INPUT_COUNT; - private static int FLUID_OUTPUT_COUNT; - - public GT_Recipe_Map_LargeCentrifuge() { - super(new HashSet(2000), "gt.recipe.largecentrifuge", "Large Centrifuge", null, - RES_PATH_GUI + "basicmachines/FissionFuel", GT_Recipe_Map_LargeCentrifuge.INPUT_COUNT, - GT_Recipe_Map_LargeCentrifuge.OUTPUT_COUNT, 0, 0, 1, "", 1, "", true, true); - } - - @Override - public Recipe_GT addRecipe(final boolean aOptimize, ItemStack[] aInputs, ItemStack[] aOutputs, - final Object aSpecial, final int[] aOutputChances, FluidStack[] aFluidInputs, - FluidStack[] aFluidOutputs, final int aDuration, final int aEUt, final int aSpecialValue) { - final ArrayList adjustedInputs = new ArrayList(); - final ArrayList adjustedOutputs = new ArrayList(); - final ArrayList adjustedFluidInputs = new ArrayList(); - final ArrayList adjustedFluidOutputs = new ArrayList(); - if (aInputs == null) { - aInputs = new ItemStack[0]; - } - for (final ItemStack input : aInputs) { - FluidStack inputFluidContent = FluidContainerRegistry.getFluidForFilledItem(input); - if (inputFluidContent != null) { - final FluidStack fluidStack = inputFluidContent; - fluidStack.amount *= input.stackSize; - if (inputFluidContent.getFluid().getName().equals("ic2steam")) { - inputFluidContent = GT_ModHandler.getSteam((long) inputFluidContent.amount); - } - adjustedFluidInputs.add(inputFluidContent); - } else { - final ItemData itemData = GT_OreDictUnificator.getItemData(input); - if (itemData == null || !itemData.hasValidPrefixMaterialData() - || itemData.mMaterial.mMaterial != Materials.Empty) { - if (itemData != null && itemData.hasValidPrefixMaterialData() - && itemData.mPrefix == OrePrefixes.cell) { - //final ItemStack dustStack = itemData.mMaterial.mMaterial.getDust(input.stackSize); - final ItemStack dustStack = ItemUtils.getGregtechOreStack(OrePrefixes.dust, itemData.mMaterial.mMaterial, input.stackSize); - if (dustStack != null) { - adjustedInputs.add(dustStack); - } else { - adjustedInputs.add(input); - } - } else { - adjustedInputs.add(input); - } - } - } - } - if (aFluidInputs == null) { - aFluidInputs = new FluidStack[0]; - } - for (final FluidStack fluidInput : aFluidInputs) { - adjustedFluidInputs.add(fluidInput); - } - aInputs = adjustedInputs.toArray(new ItemStack[adjustedInputs.size()]); - aFluidInputs = adjustedFluidInputs.toArray(new FluidStack[adjustedFluidInputs.size()]); - if (aOutputs == null) { - aOutputs = new ItemStack[0]; - } - for (final ItemStack output : aOutputs) { - FluidStack outputFluidContent = FluidContainerRegistry.getFluidForFilledItem(output); - if (outputFluidContent != null) { - final FluidStack fluidStack2 = outputFluidContent; - fluidStack2.amount *= output.stackSize; - if (outputFluidContent.getFluid().getName().equals("ic2steam")) { - outputFluidContent = GT_ModHandler.getSteam((long) outputFluidContent.amount); - } - adjustedFluidOutputs.add(outputFluidContent); - } else { - final ItemData itemData = GT_OreDictUnificator.getItemData(output); - if (itemData == null || !itemData.hasValidPrefixMaterialData() - || itemData.mMaterial.mMaterial != Materials.Empty) { - adjustedOutputs.add(output); - } - } - } - if (aFluidOutputs == null) { - aFluidOutputs = new FluidStack[0]; - } - for (final FluidStack fluidOutput : aFluidOutputs) { - adjustedFluidOutputs.add(fluidOutput); - } - aOutputs = adjustedOutputs.toArray(new ItemStack[adjustedOutputs.size()]); - aFluidOutputs = adjustedFluidOutputs.toArray(new FluidStack[adjustedFluidOutputs.size()]); - Recipe_GT mNew = new GT_Recipe_LargeCentrifuge(aOptimize, aInputs, aOutputs, aSpecial, aOutputChances, aFluidInputs, aFluidOutputs, aDuration, aEUt, aSpecialValue); - if (RecipeUtils.doesGregtechRecipeHaveEqualCells(mNew)) { - return this.addRecipe(mNew); - } - else { - return null; - } - } - - static { - GT_Recipe_Map_LargeCentrifuge.INPUT_COUNT = 2; - GT_Recipe_Map_LargeCentrifuge.OUTPUT_COUNT = 2; - GT_Recipe_Map_LargeCentrifuge.FLUID_INPUT_COUNT = 4; - GT_Recipe_Map_LargeCentrifuge.FLUID_OUTPUT_COUNT = 4; - } - - private static class GT_Recipe_LargeCentrifuge extends Recipe_GT { - protected GT_Recipe_LargeCentrifuge(final boolean aOptimize, final ItemStack[] aInputs, - final ItemStack[] aOutputs, final Object aSpecialItems, final int[] aChances, - final FluidStack[] aFluidInputs, final FluidStack[] aFluidOutputs, final int aDuration, - final int aEUt, final int aSpecialValue) { - super(aOptimize, aInputs, aOutputs, aSpecialItems, aChances, aFluidInputs, aFluidOutputs, aDuration, - aEUt, aSpecialValue); - } - - public ArrayList getInputPositionedStacks() { - final int itemLimit = Math.min(this.mInputs.length, GT_Recipe_Map_LargeCentrifuge.INPUT_COUNT); - final int fluidLimit = Math.min(this.mFluidInputs.length, - GT_Recipe_Map_LargeCentrifuge.FLUID_INPUT_COUNT); - final ArrayList inputStacks = new ArrayList(itemLimit + fluidLimit); - for (int i = 0; i < itemLimit; ++i) { - inputStacks.add((PositionedStack) new GT_NEI_MultiBlockHandler.FixedPositionedStack( - (Object) this.mInputs[i].copy(), 48 - i * 18, 5)); - } - for (int i = 0; i < fluidLimit; ++i) { - if (i < 3) { - inputStacks.add((PositionedStack) new GT_NEI_MultiBlockHandler.FixedPositionedStack( - (Object) GT_Utility.getFluidDisplayStack(this.mFluidInputs[i], true), 48 - i * 18, 23)); - } else { - inputStacks.add((PositionedStack) new GT_NEI_MultiBlockHandler.FixedPositionedStack( - (Object) GT_Utility.getFluidDisplayStack(this.mFluidInputs[i], true), 12, 5)); - } - } - return inputStacks; - } - - public ArrayList getOutputPositionedStacks() { - final int itemLimit = Math.max(this.mOutputs.length, 0); - final int fluidLimit = Math.max(this.mFluidOutputs.length, 0); - final ArrayList outputStacks = new ArrayList(itemLimit + fluidLimit); - AutoMap mNEIMap = new AutoMap(); - for (int i = 0; i < itemLimit; ++i) { - if (this.mOutputs[i] != null) - mNEIMap.put((Object) this.mOutputs[i].copy()); - } - for (int i = 0; i < fluidLimit; ++i) { - if (this.mFluidOutputs[i] != null) - mNEIMap.put((Object) GT_Utility.getFluidDisplayStack(this.mFluidOutputs[i], true)); - } - int xPos[] = new int[] {102, 120, 138}; - int yPos[] = new int[] {5, 23, 41, 59}; - int mRow = 0; - int mColumn = 0; - for (int i = 0; i < Math.min(mNEIMap.size(), 16); ++i) { - if (mColumn >= 3) { - mColumn = 0; - mRow++; - } - if (mColumn <= 2 && mRow <= 3) - outputStacks.add( - (PositionedStack) new GT_NEI_MultiBlockHandler.FixedPositionedStack( - (Object) mNEIMap.get(i), xPos[mColumn++], yPos[mRow], this.getOutputChance(i))); - } - return outputStacks; - } - } - } - - public static class GT_Recipe_Map_LargeElectrolyzer extends Gregtech_Recipe_Map { - private static int INPUT_COUNT; - private static int OUTPUT_COUNT; - private static int FLUID_INPUT_COUNT; - private static int FLUID_OUTPUT_COUNT; - - public GT_Recipe_Map_LargeElectrolyzer() { - super(new HashSet(2000), "gt.recipe.largeelectrolyzer", "Large Electrolyzer", null, - RES_PATH_GUI + "basicmachines/FissionFuel", GT_Recipe_Map_LargeElectrolyzer.INPUT_COUNT, - GT_Recipe_Map_LargeElectrolyzer.OUTPUT_COUNT, 0, 0, 1, "", 1, "", true, true); - } - - @Override - public Recipe_GT addRecipe(final boolean aOptimize, ItemStack[] aInputs, ItemStack[] aOutputs, - final Object aSpecial, final int[] aOutputChances, FluidStack[] aFluidInputs, - FluidStack[] aFluidOutputs, final int aDuration, final int aEUt, final int aSpecialValue) { - final ArrayList adjustedInputs = new ArrayList(); - final ArrayList adjustedOutputs = new ArrayList(); - final ArrayList adjustedFluidInputs = new ArrayList(); - final ArrayList adjustedFluidOutputs = new ArrayList(); - if (aInputs == null) { - aInputs = new ItemStack[0]; - } - for (final ItemStack input : aInputs) { - FluidStack inputFluidContent = FluidContainerRegistry.getFluidForFilledItem(input); - if (inputFluidContent != null) { - final FluidStack fluidStack = inputFluidContent; - fluidStack.amount *= input.stackSize; - if (inputFluidContent.getFluid().getName().equals("ic2steam")) { - inputFluidContent = GT_ModHandler.getSteam((long) inputFluidContent.amount); - } - adjustedFluidInputs.add(inputFluidContent); - } else { - final ItemData itemData = GT_OreDictUnificator.getItemData(input); - if (itemData == null || !itemData.hasValidPrefixMaterialData() - || itemData.mMaterial.mMaterial != Materials.Empty) { - if (itemData != null && itemData.hasValidPrefixMaterialData() - && itemData.mPrefix == OrePrefixes.cell) { - //final ItemStack dustStack = itemData.mMaterial.mMaterial.getDust(input.stackSize); - final ItemStack dustStack = ItemUtils.getGregtechOreStack(OrePrefixes.dust, itemData.mMaterial.mMaterial, input.stackSize); - if (dustStack != null) { - adjustedInputs.add(dustStack); - } else { - adjustedInputs.add(input); - } - } else { - adjustedInputs.add(input); - } - } - } - } - if (aFluidInputs == null) { - aFluidInputs = new FluidStack[0]; - } - for (final FluidStack fluidInput : aFluidInputs) { - adjustedFluidInputs.add(fluidInput); - } - aInputs = adjustedInputs.toArray(new ItemStack[adjustedInputs.size()]); - aFluidInputs = adjustedFluidInputs.toArray(new FluidStack[adjustedFluidInputs.size()]); - if (aOutputs == null) { - aOutputs = new ItemStack[0]; - } - for (final ItemStack output : aOutputs) { - FluidStack outputFluidContent = FluidContainerRegistry.getFluidForFilledItem(output); - if (outputFluidContent != null) { - final FluidStack fluidStack2 = outputFluidContent; - fluidStack2.amount *= output.stackSize; - if (outputFluidContent.getFluid().getName().equals("ic2steam")) { - outputFluidContent = GT_ModHandler.getSteam((long) outputFluidContent.amount); - } - adjustedFluidOutputs.add(outputFluidContent); - } else { - final ItemData itemData = GT_OreDictUnificator.getItemData(output); - if (itemData == null || !itemData.hasValidPrefixMaterialData() - || itemData.mMaterial.mMaterial != Materials.Empty) { - adjustedOutputs.add(output); - } - } - } - if (aFluidOutputs == null) { - aFluidOutputs = new FluidStack[0]; - } - for (final FluidStack fluidOutput : aFluidOutputs) { - adjustedFluidOutputs.add(fluidOutput); - } - aOutputs = adjustedOutputs.toArray(new ItemStack[adjustedOutputs.size()]); - aFluidOutputs = adjustedFluidOutputs.toArray(new FluidStack[adjustedFluidOutputs.size()]); - Recipe_GT mNew = new GT_Recipe_LargeElectrolyzer(aOptimize, aInputs, aOutputs, aSpecial, aOutputChances, aFluidInputs, aFluidOutputs, aDuration, aEUt, aSpecialValue); - if (RecipeUtils.doesGregtechRecipeHaveEqualCells(mNew)) { - return this.addRecipe(mNew); - } - else { - return null; - } - } - - static { - GT_Recipe_Map_LargeElectrolyzer.INPUT_COUNT = 2; - GT_Recipe_Map_LargeElectrolyzer.OUTPUT_COUNT = 2; - GT_Recipe_Map_LargeElectrolyzer.FLUID_INPUT_COUNT = 4; - GT_Recipe_Map_LargeElectrolyzer.FLUID_OUTPUT_COUNT = 4; - } - - private static class GT_Recipe_LargeElectrolyzer extends Recipe_GT { - protected GT_Recipe_LargeElectrolyzer(final boolean aOptimize, final ItemStack[] aInputs, - final ItemStack[] aOutputs, final Object aSpecialItems, final int[] aChances, - final FluidStack[] aFluidInputs, final FluidStack[] aFluidOutputs, final int aDuration, - final int aEUt, final int aSpecialValue) { - super(aOptimize, aInputs, aOutputs, aSpecialItems, aChances, aFluidInputs, aFluidOutputs, aDuration, - aEUt, aSpecialValue); - } - - @Override - public ArrayList getInputPositionedStacks() { - final int itemLimit = Math.min(this.mInputs.length, GT_Recipe_Map_LargeElectrolyzer.INPUT_COUNT); - final int fluidLimit = Math.min(this.mFluidInputs.length, - GT_Recipe_Map_LargeElectrolyzer.FLUID_INPUT_COUNT); - final ArrayList inputStacks = new ArrayList(itemLimit + fluidLimit); - for (int i = 0; i < itemLimit; ++i) { - inputStacks.add((PositionedStack) new GT_NEI_MultiBlockHandler.FixedPositionedStack( - (Object) this.mInputs[i].copy(), 48 - i * 18, 5)); - } - for (int i = 0; i < fluidLimit; ++i) { - if (i < 3) { - inputStacks.add((PositionedStack) new GT_NEI_MultiBlockHandler.FixedPositionedStack( - (Object) GT_Utility.getFluidDisplayStack(this.mFluidInputs[i], true), 48 - i * 18, 23)); - } else { - inputStacks.add((PositionedStack) new GT_NEI_MultiBlockHandler.FixedPositionedStack( - (Object) GT_Utility.getFluidDisplayStack(this.mFluidInputs[i], true), 12, 5)); - } - } - return inputStacks; - } - - @Override - public ArrayList getOutputPositionedStacks() { - final int itemLimit = Math.max(this.mOutputs.length, 0); - final int fluidLimit = Math.max(this.mFluidOutputs.length, 0); - final ArrayList outputStacks = new ArrayList(itemLimit + fluidLimit); - AutoMap mNEIMap = new AutoMap(); - for (int i = 0; i < itemLimit; ++i) { - if (this.mOutputs[i] != null) - mNEIMap.put((Object) this.mOutputs[i].copy()); - } - for (int i = 0; i < fluidLimit; ++i) { - if (this.mFluidOutputs[i] != null) - mNEIMap.put((Object) GT_Utility.getFluidDisplayStack(this.mFluidOutputs[i], true)); - } - int xPos[] = new int[] {102, 120, 138}; - int yPos[] = new int[] {5, 23, 41, 59}; - int mRow = 0; - int mColumn = 0; - for (int i = 0; i < Math.min(mNEIMap.size(), 16); ++i) { - if (mColumn >= 3) { - mColumn = 0; - mRow++; - } - if (mColumn <= 2 && mRow <= 3) - outputStacks.add( - (PositionedStack) new GT_NEI_MultiBlockHandler.FixedPositionedStack( - (Object) mNEIMap.get(i), xPos[mColumn++], yPos[mRow], this.getOutputChance(i))); - } - return outputStacks; - } - } - } - - public static class GT_Recipe_Map_AdvancedVacuumFreezer extends Gregtech_Recipe_Map { - private static int INPUT_COUNT; - private static int OUTPUT_COUNT; - private static int FLUID_INPUT_COUNT; - private static int FLUID_OUTPUT_COUNT; - - public GT_Recipe_Map_AdvancedVacuumFreezer() { - super(new HashSet(2000), "gt.recipe.advfreezer", "Adv. Cryogenic Freezer", null, - RES_PATH_GUI + "basicmachines/FissionFuel", GT_Recipe_Map_AdvancedVacuumFreezer.INPUT_COUNT, - GT_Recipe_Map_AdvancedVacuumFreezer.OUTPUT_COUNT, 0, 0, 1, "", 1, "", true, true); - } - - @Override - public Recipe_GT addRecipe(final boolean aOptimize, ItemStack[] aInputs, ItemStack[] aOutputs, - final Object aSpecial, final int[] aOutputChances, FluidStack[] aFluidInputs, - FluidStack[] aFluidOutputs, final int aDuration, final int aEUt, final int aSpecialValue) { - final ArrayList adjustedInputs = new ArrayList(); - final ArrayList adjustedOutputs = new ArrayList(); - final ArrayList adjustedFluidInputs = new ArrayList(); - final ArrayList adjustedFluidOutputs = new ArrayList(); - if (aInputs == null) { - aInputs = new ItemStack[0]; - } - for (final ItemStack input : aInputs) { - FluidStack inputFluidContent = FluidContainerRegistry.getFluidForFilledItem(input); - if (inputFluidContent != null) { - final FluidStack fluidStack = inputFluidContent; - fluidStack.amount *= input.stackSize; - if (inputFluidContent.getFluid().getName().equals("ic2steam")) { - inputFluidContent = GT_ModHandler.getSteam((long) inputFluidContent.amount); - } - adjustedFluidInputs.add(inputFluidContent); - } else { - final ItemData itemData = GT_OreDictUnificator.getItemData(input); - if (itemData == null || !itemData.hasValidPrefixMaterialData() - || itemData.mMaterial.mMaterial != Materials.Empty) { - if (itemData != null && itemData.hasValidPrefixMaterialData() - && itemData.mPrefix == OrePrefixes.cell) { - //final ItemStack dustStack = itemData.mMaterial.mMaterial.getDust(input.stackSize); - final ItemStack dustStack = ItemUtils.getGregtechOreStack(OrePrefixes.dust, itemData.mMaterial.mMaterial, input.stackSize); - if (dustStack != null) { - adjustedInputs.add(dustStack); - } else { - adjustedInputs.add(input); - } - } else { - adjustedInputs.add(input); - } - } - } - } - if (aFluidInputs == null) { - aFluidInputs = new FluidStack[0]; - } - for (final FluidStack fluidInput : aFluidInputs) { - adjustedFluidInputs.add(fluidInput); - } - aInputs = adjustedInputs.toArray(new ItemStack[adjustedInputs.size()]); - aFluidInputs = adjustedFluidInputs.toArray(new FluidStack[adjustedFluidInputs.size()]); - if (aOutputs == null) { - aOutputs = new ItemStack[0]; - } - for (final ItemStack output : aOutputs) { - FluidStack outputFluidContent = FluidContainerRegistry.getFluidForFilledItem(output); - if (outputFluidContent != null) { - final FluidStack fluidStack2 = outputFluidContent; - fluidStack2.amount *= output.stackSize; - if (outputFluidContent.getFluid().getName().equals("ic2steam")) { - outputFluidContent = GT_ModHandler.getSteam((long) outputFluidContent.amount); - } - adjustedFluidOutputs.add(outputFluidContent); - } else { - final ItemData itemData = GT_OreDictUnificator.getItemData(output); - if (itemData == null || !itemData.hasValidPrefixMaterialData() - || itemData.mMaterial.mMaterial != Materials.Empty) { - adjustedOutputs.add(output); - } - } - } - if (aFluidOutputs == null) { - aFluidOutputs = new FluidStack[0]; - } - for (final FluidStack fluidOutput : aFluidOutputs) { - adjustedFluidOutputs.add(fluidOutput); - } - aOutputs = adjustedOutputs.toArray(new ItemStack[adjustedOutputs.size()]); - aFluidOutputs = adjustedFluidOutputs.toArray(new FluidStack[adjustedFluidOutputs.size()]); - - Recipe_GT mNew = new GT_Recipe_AdvFreezer(aOptimize, aInputs, aOutputs, aSpecial, aOutputChances, aFluidInputs, aFluidOutputs, aDuration, aEUt, aSpecialValue); - if (RecipeUtils.doesGregtechRecipeHaveEqualCells(mNew)) { - return this.addRecipe(mNew); - } - else { - return null; - } - } - - static { - GT_Recipe_Map_AdvancedVacuumFreezer.INPUT_COUNT = 2; - GT_Recipe_Map_AdvancedVacuumFreezer.OUTPUT_COUNT = 2; - GT_Recipe_Map_AdvancedVacuumFreezer.FLUID_INPUT_COUNT = 4; - GT_Recipe_Map_AdvancedVacuumFreezer.FLUID_OUTPUT_COUNT = 4; - } - - private static class GT_Recipe_AdvFreezer extends Recipe_GT { - protected GT_Recipe_AdvFreezer(final boolean aOptimize, final ItemStack[] aInputs, - final ItemStack[] aOutputs, final Object aSpecialItems, final int[] aChances, - final FluidStack[] aFluidInputs, final FluidStack[] aFluidOutputs, final int aDuration, - final int aEUt, final int aSpecialValue) { - super(aOptimize, aInputs, aOutputs, aSpecialItems, aChances, aFluidInputs, aFluidOutputs, aDuration, - aEUt, aSpecialValue); - } - - public ArrayList getInputPositionedStacks() { - final int itemLimit = Math.min(this.mInputs.length, GT_Recipe_Map_AdvancedVacuumFreezer.INPUT_COUNT); - final int fluidLimit = Math.min(this.mFluidInputs.length, - GT_Recipe_Map_AdvancedVacuumFreezer.FLUID_INPUT_COUNT); - final ArrayList inputStacks = new ArrayList(itemLimit + fluidLimit); - for (int i = 0; i < itemLimit; ++i) { - inputStacks.add((PositionedStack) new GT_NEI_MultiBlockHandler.FixedPositionedStack( - (Object) this.mInputs[i].copy(), 48 - i * 18, 5)); - } - for (int i = 0; i < fluidLimit; ++i) { - if (i < 3) { - inputStacks.add((PositionedStack) new GT_NEI_MultiBlockHandler.FixedPositionedStack( - (Object) GT_Utility.getFluidDisplayStack(this.mFluidInputs[i], true), 48 - i * 18, 23)); - } else { - inputStacks.add((PositionedStack) new GT_NEI_MultiBlockHandler.FixedPositionedStack( - (Object) GT_Utility.getFluidDisplayStack(this.mFluidInputs[i], true), 12, 5)); - } - } - return inputStacks; - } - - - public ArrayList getOutputPositionedStacks() { - final int itemLimit = Math.min(this.mOutputs.length, GT_Recipe_Map_AdvancedVacuumFreezer.OUTPUT_COUNT); - final int fluidLimit = Math.min(this.mFluidOutputs.length, - GT_Recipe_Map_AdvancedVacuumFreezer.FLUID_OUTPUT_COUNT); - final ArrayList outputStacks = new ArrayList(itemLimit + fluidLimit); - for (int i = 0; i < itemLimit; ++i) { - if (this.mOutputs[i] != null) - outputStacks.add((PositionedStack) new GT_NEI_MultiBlockHandler.FixedPositionedStack( - (Object) this.mOutputs[i].copy(), 102 + i * 18, 5, this.getOutputChance(i))); - } - for (int i = 0; i < fluidLimit; ++i) { - if (this.mFluidOutputs[i] != null) - outputStacks.add((PositionedStack) new GT_NEI_MultiBlockHandler.FixedPositionedStack( - (Object) GT_Utility.getFluidDisplayStack(this.mFluidOutputs[i], true), 102 + i * 18, 23, this.getOutputChance(i))); - } - return outputStacks; - } - } - } - - public ArrayList getInputPositionedStacks() { - return null; - } - - public ArrayList getOutputPositionedStacks() { - return null; - } - - public int compareTo(Recipe_GT 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; - } - - 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 0; - } - -} diff --git a/src/Java/gregtech/api/util/SemiFluidFuelHandler.java b/src/Java/gregtech/api/util/SemiFluidFuelHandler.java index c5b1065831..fa01ea9b5d 100644 --- a/src/Java/gregtech/api/util/SemiFluidFuelHandler.java +++ b/src/Java/gregtech/api/util/SemiFluidFuelHandler.java @@ -1,6 +1,6 @@ package gregtech.api.util; -import static gregtech.api.util.Recipe_GT.Gregtech_Recipe_Map.sSemiFluidLiquidFuels; +import static gregtech.api.util.GTPP_Recipe.GTPP_Recipe_Map.sSemiFluidLiquidFuels; import java.util.HashMap; @@ -29,7 +29,7 @@ public class SemiFluidFuelHandler { FluidStack p = aFuel; if (p != null && aFuelValue > 0) { GT_Recipe aRecipe = - new Recipe_GT(true, + new GTPP_Recipe(true, new ItemStack[] {}, new ItemStack[] {}, null, @@ -100,7 +100,7 @@ public class SemiFluidFuelHandler { } if (aFuelValue <= (128*3)) { - GT_Recipe aRecipe = new Recipe_GT(true, new ItemStack[] {}, new ItemStack[] {}, null, new int[] {}, + GT_Recipe aRecipe = new GTPP_Recipe(true, new ItemStack[] {}, new ItemStack[] {}, null, new int[] {}, new FluidStack[] { p.getKey() }, null, 0, 0, aFuelValue); if (aRecipe.mSpecialValue > 0) { Logger.INFO("Added " + aRecipe.mFluidInputs[0].getLocalizedName() + " to the Semi-Fluid Generator fuel map. Fuel Produces "+(aRecipe.mSpecialValue*1000)+"EU per 1000L."); diff --git a/src/Java/gregtech/api/util/ThermalFuel.java b/src/Java/gregtech/api/util/ThermalFuel.java index 4f6637e13f..d7b732ce5d 100644 --- a/src/Java/gregtech/api/util/ThermalFuel.java +++ b/src/Java/gregtech/api/util/ThermalFuel.java @@ -6,7 +6,7 @@ import net.minecraftforge.fluids.FluidStack; public class ThermalFuel { public static void addThermalFuel(FluidStack aInput1, FluidStack aInput2, FluidStack aOutput1, int euValue, int aSpecialValue) { - GT_Recipe x = new GT_Recipe( + GTPP_Recipe x = new GTPP_Recipe( true, null, null, @@ -18,11 +18,11 @@ public class ThermalFuel { euValue, //No Eu produced aSpecialValue //Magic Number ); - Recipe_GT.Gregtech_Recipe_Map.sGeoThermalFuels.addRecipe(x); + GTPP_Recipe.GTPP_Recipe_Map.sGeoThermalFuels.addRecipe(x); } public static void addSteamTurbineFuel(FluidStack aInput1) { - GT_Recipe x = new GT_Recipe( + GTPP_Recipe x = new GTPP_Recipe( true, null, null, @@ -34,7 +34,7 @@ public class ThermalFuel { MathUtils.findPercentageOfInt((aInput1.amount/2), 95), //No Eu produced 0 //Magic Number ); - Recipe_GT.Gregtech_Recipe_Map.sSteamTurbineFuels.addRecipe(x); + GTPP_Recipe.GTPP_Recipe_Map.sSteamTurbineFuels.addRecipe(x); } diff --git a/src/Java/gtPlusPlus/GTplusplus.java b/src/Java/gtPlusPlus/GTplusplus.java index 6a0de88b05..339c0125fb 100644 --- a/src/Java/gtPlusPlus/GTplusplus.java +++ b/src/Java/gtPlusPlus/GTplusplus.java @@ -19,6 +19,7 @@ import gregtech.api.enums.Materials; import gregtech.api.enums.Textures; import gregtech.api.enums.Textures.BlockIcons; import gregtech.api.util.*; +import gregtech.api.util.GTPP_Recipe.GTPP_Recipe_Map_Internal; import gregtech.api.util.GT_Recipe.GT_Recipe_Map; import gtPlusPlus.api.objects.Logger; import gtPlusPlus.core.chunkloading.GTPP_ChunkManager; @@ -197,7 +198,7 @@ public class GTplusplus implements ActionListener { //SprinklerHandler.registerModFerts(); BlockEventHandler.init(); - Recipe_GT.reInit(); + GTPP_Recipe.reInit(); Logger.INFO("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"); Logger.INFO("| Recipes succesfully Loaded: " + RegistrationHandler.recipesSuccess + " | Failed: " @@ -249,11 +250,15 @@ public class GTplusplus implements ActionListener { public void onLoadComplete(FMLLoadCompleteEvent event) { proxy.onLoadComplete(event); generateGregtechRecipeMaps(); + // Check our maps ar euntouched + Logger.INFO("Making sure that all GT++ recipes are untouched."); + GTPP_Recipe.checkRecipeModifications(); + Logger.INFO("Passed verification checks."); } @Mod.EventHandler public void onIDChangingEvent(FMLModIdMappingEvent aEvent) { - Recipe_GT.reInit(); + GTPP_Recipe.reInit(); } public static void tryPatchTurbineTextures() { @@ -313,9 +318,9 @@ public class GTplusplus implements ActionListener { } } - if (Recipe_GT.Gregtech_Recipe_Map.sMultiblockCentrifugeRecipes_GT.mRecipeList.size() < 1) { - for (GT_Recipe a : Recipe_GT.Gregtech_Recipe_Map.sMultiblockCentrifugeRecipes.mRecipeList) { - Recipe_GT.Gregtech_Recipe_Map.sMultiblockCentrifugeRecipes_GT.add(a); + if (GTPP_Recipe.GTPP_Recipe_Map.sMultiblockCentrifugeRecipes_GT.mRecipeList.size() < 1) { + for (GT_Recipe a : GTPP_Recipe.GTPP_Recipe_Map.sMultiblockCentrifugeRecipes.mRecipeList) { + GTPP_Recipe.GTPP_Recipe_Map.sMultiblockCentrifugeRecipes_GT.add(a); } } @@ -344,9 +349,9 @@ public class GTplusplus implements ActionListener { } } - if (Recipe_GT.Gregtech_Recipe_Map.sMultiblockElectrolyzerRecipes_GT.mRecipeList.size() < 1) { - for (GT_Recipe a : Recipe_GT.Gregtech_Recipe_Map.sMultiblockElectrolyzerRecipes.mRecipeList) { - Recipe_GT.Gregtech_Recipe_Map.sMultiblockElectrolyzerRecipes_GT.add(a); + if (GTPP_Recipe.GTPP_Recipe_Map.sMultiblockElectrolyzerRecipes_GT.mRecipeList.size() < 1) { + for (GT_Recipe a : GTPP_Recipe.GTPP_Recipe_Map.sMultiblockElectrolyzerRecipes.mRecipeList) { + GTPP_Recipe.GTPP_Recipe_Map.sMultiblockElectrolyzerRecipes_GT.add(a); } } diff --git a/src/Java/gtPlusPlus/api/interfaces/IComparableRecipe.java b/src/Java/gtPlusPlus/api/interfaces/IComparableRecipe.java index 5d79fd8a51..ddbf9f38bb 100644 --- a/src/Java/gtPlusPlus/api/interfaces/IComparableRecipe.java +++ b/src/Java/gtPlusPlus/api/interfaces/IComparableRecipe.java @@ -1,7 +1,7 @@ package gtPlusPlus.api.interfaces; import gregtech.api.util.GT_Recipe; -import gregtech.api.util.Recipe_GT; +import gregtech.api.util.GTPP_Recipe; public interface IComparableRecipe extends Comparable{ diff --git a/src/Java/gtPlusPlus/core/item/chemistry/RocketFuels.java b/src/Java/gtPlusPlus/core/item/chemistry/RocketFuels.java index 7745f50010..719e5145e9 100644 --- a/src/Java/gtPlusPlus/core/item/chemistry/RocketFuels.java +++ b/src/Java/gtPlusPlus/core/item/chemistry/RocketFuels.java @@ -9,7 +9,7 @@ import gregtech.api.enums.GT_Values; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Recipe.GT_Recipe_Map; import gregtech.api.util.GT_Utility; -import gregtech.api.util.Recipe_GT; +import gregtech.api.util.GTPP_Recipe; import gtPlusPlus.api.objects.Logger; import gtPlusPlus.api.objects.data.AutoMap; import gtPlusPlus.api.objects.minecraft.ItemPackage; @@ -281,8 +281,8 @@ public class RocketFuels extends ItemPackage { } private static void addRocketFuelsToMap() { - HashMap mRocketFuels = new LinkedHashMap(); - mRocketFuels.put(0, new Recipe_GT( + HashMap mRocketFuels = new LinkedHashMap(); + mRocketFuels.put(0, new GTPP_Recipe( true, new ItemStack[] {}, new ItemStack[] {}, @@ -294,7 +294,7 @@ public class RocketFuels extends ItemPackage { 0, 256)); //Fuel Value - mRocketFuels.put(1, new Recipe_GT( + mRocketFuels.put(1, new GTPP_Recipe( true, new ItemStack[] {}, new ItemStack[] {}, @@ -306,7 +306,7 @@ public class RocketFuels extends ItemPackage { 0, 512)); //Fuel Value - mRocketFuels.put(2, new Recipe_GT( + mRocketFuels.put(2, new GTPP_Recipe( true, new ItemStack[] {}, new ItemStack[] {}, @@ -318,7 +318,7 @@ public class RocketFuels extends ItemPackage { 0, 768)); //Fuel Value - mRocketFuels.put(3, new Recipe_GT( + mRocketFuels.put(3, new GTPP_Recipe( true, new ItemStack[] {}, new ItemStack[] {}, @@ -336,11 +336,11 @@ public class RocketFuels extends ItemPackage { mValidRocketFuelNames.add(FluidRegistry.getFluidName(Diesel)); for (int mID : mRocketFuels.keySet()) { - Recipe_GT aFuelRecipe = mRocketFuels.get(mID); + GTPP_Recipe aFuelRecipe = mRocketFuels.get(mID); if (aFuelRecipe != null) { mValidRocketFuelNames.add(FluidRegistry.getFluidName(aFuelRecipe.mFluidInputs[0].getFluid())); mValidRocketFuels.put(mID, aFuelRecipe.mFluidInputs[0].getFluid()); - Recipe_GT.Gregtech_Recipe_Map.sRocketFuels.add(aFuelRecipe); + GTPP_Recipe.GTPP_Recipe_Map.sRocketFuels.add(aFuelRecipe); } } @@ -1007,8 +1007,8 @@ public class RocketFuels extends ItemPackage { return true; } - private static Recipe_GT getHalfBakedRecipe(ItemStack[] aInputs, FluidStack[] aFluidInputs, int aEU) { - return new Recipe_GT(false, aInputs, null, null, null, aFluidInputs, null, 0, aEU, 0); + private static GTPP_Recipe getHalfBakedRecipe(ItemStack[] aInputs, FluidStack[] aFluidInputs, int aEU) { + return new GTPP_Recipe(false, aInputs, null, null, null, aFluidInputs, null, 0, aEU, 0); } diff --git a/src/Java/gtPlusPlus/core/slots/SlotChemicalPlantInput.java b/src/Java/gtPlusPlus/core/slots/SlotChemicalPlantInput.java index add55b8d27..4b9cda0b9b 100644 --- a/src/Java/gtPlusPlus/core/slots/SlotChemicalPlantInput.java +++ b/src/Java/gtPlusPlus/core/slots/SlotChemicalPlantInput.java @@ -1,7 +1,7 @@ package gtPlusPlus.core.slots; -import gregtech.api.util.Recipe_GT; -import gregtech.api.util.Recipe_GT.Gregtech_Recipe_Map; +import gregtech.api.util.GTPP_Recipe; +import gregtech.api.util.GTPP_Recipe.GTPP_Recipe_Map; import net.minecraft.inventory.IInventory; import net.minecraft.inventory.Slot; import net.minecraft.item.ItemStack; @@ -20,9 +20,9 @@ public class SlotChemicalPlantInput extends Slot { } public static boolean isItemValidForChemicalPlantSlot(ItemStack aStack) { - boolean validItem = Gregtech_Recipe_Map.sChemicalPlantRecipes.containsInput(aStack); + boolean validItem = GTPP_Recipe_Map.sChemicalPlantRecipes.containsInput(aStack); if (!validItem) { - for (Recipe_GT f : Gregtech_Recipe_Map.sChemicalPlantRecipes.mRecipeList) { + for (GTPP_Recipe f : GTPP_Recipe_Map.sChemicalPlantRecipes.mRecipeList) { if (f.mFluidInputs.length > 0) { for (FluidStack g : f.mFluidInputs) { if (g != null) { diff --git a/src/Java/gtPlusPlus/core/tileentities/ModTileEntities.java b/src/Java/gtPlusPlus/core/tileentities/ModTileEntities.java index e7b7c46e7b..2d389d8bb2 100644 --- a/src/Java/gtPlusPlus/core/tileentities/ModTileEntities.java +++ b/src/Java/gtPlusPlus/core/tileentities/ModTileEntities.java @@ -22,6 +22,7 @@ import gtPlusPlus.core.tileentities.machines.TileEntityTradeTable; import gtPlusPlus.core.tileentities.machines.TileEntityWorkbench; import gtPlusPlus.core.tileentities.machines.TileEntityWorkbenchAdvanced; import gtPlusPlus.plugin.villagers.tile.TileEntityGenericSpawner; +import gtPlusPlus.xmod.gregtech.common.Meta_GT_Proxy; public class ModTileEntities { @@ -52,6 +53,12 @@ public class ModTileEntities { if (LoadedMods.Thaumcraft){ } + blacklistTilesFromAcceleration(); + } + + private static void blacklistTilesFromAcceleration() { + Meta_GT_Proxy.setTileEntityClassAsBlacklistedInWorldAccelerator("gtPlusPlus.core.tileentities.general.TileEntityFishTrap"); + Meta_GT_Proxy.setTileEntityClassAsBlacklistedInWorldAccelerator("gtPlusPlus.core.tileentities.general.TileEntityDecayablesChest"); } } diff --git a/src/Java/gtPlusPlus/nei/GTPP_NEI_DefaultHandler.java b/src/Java/gtPlusPlus/nei/GTPP_NEI_DefaultHandler.java index 279f45f756..12c1b501bd 100644 --- a/src/Java/gtPlusPlus/nei/GTPP_NEI_DefaultHandler.java +++ b/src/Java/gtPlusPlus/nei/GTPP_NEI_DefaultHandler.java @@ -19,7 +19,7 @@ import gregtech.api.enums.OrePrefixes; import gregtech.api.gui.GT_GUIContainer_BasicMachine; import gregtech.api.objects.ItemData; import gregtech.api.util.*; -import gregtech.api.util.Recipe_GT.Gregtech_Recipe_Map; +import gregtech.api.util.GTPP_Recipe.GTPP_Recipe_Map; import gregtech.common.gui.GT_GUIContainer_FusionReactor; import gregtech.common.gui.GT_GUIContainer_PrimitiveBlastFurnace; import net.minecraft.client.Minecraft; @@ -39,9 +39,9 @@ public class GTPP_NEI_DefaultHandler GuiContainerManager.addTooltipHandler(new GT_RectHandler()); } - protected final Gregtech_Recipe_Map mRecipeMap; + protected final GTPP_Recipe_Map mRecipeMap; - public GTPP_NEI_DefaultHandler(Gregtech_Recipe_Map tMap) { + public GTPP_NEI_DefaultHandler(GTPP_Recipe_Map tMap) { this.mRecipeMap = tMap; this.transferRects.add(new TemplateRecipeHandler.RecipeTransferRect(new Rectangle(65, 13, 36, 18), getOverlayIdentifier(), new Object[0])); if (!NEI_GT_Config.sIsAdded) { diff --git a/src/Java/gtPlusPlus/nei/GTPP_NEI_DefaultHandlerEx.java b/src/Java/gtPlusPlus/nei/GTPP_NEI_DefaultHandlerEx.java index 8bf048730a..0d9fc52943 100644 --- a/src/Java/gtPlusPlus/nei/GTPP_NEI_DefaultHandlerEx.java +++ b/src/Java/gtPlusPlus/nei/GTPP_NEI_DefaultHandlerEx.java @@ -19,7 +19,7 @@ import gregtech.api.enums.OrePrefixes; import gregtech.api.gui.GT_GUIContainer_BasicMachine; import gregtech.api.objects.ItemData; import gregtech.api.util.*; -import gregtech.api.util.Recipe_GT.Gregtech_Recipe_Map; +import gregtech.api.util.GTPP_Recipe.GTPP_Recipe_Map; import gregtech.common.gui.GT_GUIContainer_FusionReactor; import gregtech.common.gui.GT_GUIContainer_PrimitiveBlastFurnace; import net.minecraft.client.Minecraft; @@ -39,9 +39,9 @@ public class GTPP_NEI_DefaultHandlerEx GuiContainerManager.addTooltipHandler(new GT_RectHandler()); } - protected final Gregtech_Recipe_Map mRecipeMap; + protected final GTPP_Recipe_Map mRecipeMap; - public GTPP_NEI_DefaultHandlerEx(Gregtech_Recipe_Map tMap) { + public GTPP_NEI_DefaultHandlerEx(GTPP_Recipe_Map tMap) { this.mRecipeMap = tMap; this.transferRects.add(new TemplateRecipeHandler.RecipeTransferRect(new Rectangle(65, 13, 36, 18), getOverlayIdentifier(), new Object[0])); if (!NEI_GT_Config.sIsAdded) { diff --git a/src/Java/gtPlusPlus/nei/GT_NEI_FlotationCell.java b/src/Java/gtPlusPlus/nei/GT_NEI_FlotationCell.java index 0d4e84b4b7..c4eff20a27 100644 --- a/src/Java/gtPlusPlus/nei/GT_NEI_FlotationCell.java +++ b/src/Java/gtPlusPlus/nei/GT_NEI_FlotationCell.java @@ -19,7 +19,7 @@ import gregtech.api.gui.GT_GUIContainer_BasicMachine; import gregtech.api.objects.ItemData; import gregtech.api.util.*; import gregtech.api.util.GT_Recipe.GT_Recipe_Map; -import gregtech.api.util.Recipe_GT.Gregtech_Recipe_Map; +import gregtech.api.util.GTPP_Recipe.GTPP_Recipe_Map; import gtPlusPlus.core.util.minecraft.ItemUtils; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.inventory.GuiContainer; @@ -41,7 +41,7 @@ extends TemplateRecipeHandler { protected GT_Recipe_Map mRecipeMap; public GT_NEI_FlotationCell() { - this.mRecipeMap = Gregtech_Recipe_Map.sFlotationCellRecipes; + this.mRecipeMap = GTPP_Recipe_Map.sFlotationCellRecipes; this.transferRects.add(new TemplateRecipeHandler.RecipeTransferRect(new Rectangle(65, 13, 36, 18), this.getRecipeMapName(), new Object[0])); if (!NEI_GT_Config.sIsAdded) { FMLInterModComms.sendRuntimeMessage(GT_Values.GT, "NEIPlugins", "register-crafting-handler", "gregtechplusplus@" + this.getRecipeName() + "@" + this.getRecipeMapName()); @@ -50,8 +50,8 @@ extends TemplateRecipeHandler { } } - public List getSortedRecipes() { - List result = new ArrayList(this.mRecipeMap.mRecipeList); + public List getSortedRecipes() { + List result = new ArrayList(this.mRecipeMap.mRecipeList); Collections.sort(result); return result; } @@ -68,7 +68,7 @@ extends TemplateRecipeHandler { @Override public void loadCraftingRecipes(final String outputId, final Object... results) { if (outputId.equals(getRecipeMapName())) { - for (Recipe_GT tRecipe : getSortedRecipes()) { + for (GTPP_Recipe tRecipe : getSortedRecipes()) { if (!tRecipe.mHidden) { this.arecipes.add(new CachedDefaultRecipe(tRecipe)); } @@ -99,7 +99,7 @@ extends TemplateRecipeHandler { } } } - for (Recipe_GT tRecipe : getSortedRecipes()) { + for (GTPP_Recipe tRecipe : getSortedRecipes()) { if (!tRecipe.mHidden) { CachedDefaultRecipe tNEIRecipe = new CachedDefaultRecipe(tRecipe); for (ItemStack tStack : tResults) { @@ -133,7 +133,7 @@ extends TemplateRecipeHandler { } } } - for (Recipe_GT tRecipe : getSortedRecipes()) { + for (GTPP_Recipe tRecipe : getSortedRecipes()) { if (!tRecipe.mHidden) { CachedDefaultRecipe tNEIRecipe = new CachedDefaultRecipe(tRecipe); for (ItemStack tStack : tInputs) { diff --git a/src/Java/gtPlusPlus/nei/GT_NEI_FluidReactor.java b/src/Java/gtPlusPlus/nei/GT_NEI_FluidReactor.java index 29c3cecb6f..57e6e1a899 100644 --- a/src/Java/gtPlusPlus/nei/GT_NEI_FluidReactor.java +++ b/src/Java/gtPlusPlus/nei/GT_NEI_FluidReactor.java @@ -26,8 +26,8 @@ import gregtech.api.objects.ItemData; import gregtech.api.util.GT_OreDictUnificator; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; -import gregtech.api.util.Recipe_GT; -import gregtech.api.util.Recipe_GT.Gregtech_Recipe_Map; +import gregtech.api.util.GTPP_Recipe; +import gregtech.api.util.GTPP_Recipe.GTPP_Recipe_Map; import gtPlusPlus.core.lib.CORE; import gtPlusPlus.core.util.minecraft.ItemUtils; import net.minecraft.client.Minecraft; @@ -47,10 +47,10 @@ extends TemplateRecipeHandler { GuiContainerManager.addTooltipHandler(new GT_RectHandler()); } - protected Gregtech_Recipe_Map mRecipeMap; + protected GTPP_Recipe_Map mRecipeMap; public GT_NEI_FluidReactor() { - this.mRecipeMap = Gregtech_Recipe_Map.sChemicalPlantRecipes; + this.mRecipeMap = GTPP_Recipe_Map.sChemicalPlantRecipes; this.transferRects.add(new TemplateRecipeHandler.RecipeTransferRect(new Rectangle(65, 13, 36, 18), this.getRecipeMapName(), new Object[0])); if (!NEI_GT_Config.sIsAdded) { FMLInterModComms.sendRuntimeMessage(GT_Values.GT, "NEIPlugins", "register-crafting-handler", "gregtechplusplus@" + this.getRecipeName() + "@" + this.getRecipeMapName()); @@ -59,8 +59,8 @@ extends TemplateRecipeHandler { } } - public List getSortedRecipes() { - List result = new ArrayList(this.mRecipeMap.mRecipeList); + public List getSortedRecipes() { + List result = new ArrayList(this.mRecipeMap.mRecipeList); Collections.sort(result); return result; } @@ -77,7 +77,7 @@ extends TemplateRecipeHandler { @Override public void loadCraftingRecipes(final String outputId, final Object... results) { if (outputId.equals(getRecipeMapName())) { - for (Recipe_GT tRecipe : getSortedRecipes()) { + for (GTPP_Recipe tRecipe : getSortedRecipes()) { if (!tRecipe.mHidden) { this.arecipes.add(new CachedDefaultRecipe(tRecipe)); } @@ -108,7 +108,7 @@ extends TemplateRecipeHandler { } } } - for (Recipe_GT tRecipe : getSortedRecipes()) { + for (GTPP_Recipe tRecipe : getSortedRecipes()) { if (!tRecipe.mHidden) { CachedDefaultRecipe tNEIRecipe = new CachedDefaultRecipe(tRecipe); for (ItemStack tStack : tResults) { @@ -142,7 +142,7 @@ extends TemplateRecipeHandler { } } } - for (Recipe_GT tRecipe : getSortedRecipes()) { + for (GTPP_Recipe tRecipe : getSortedRecipes()) { if (!tRecipe.mHidden) { CachedDefaultRecipe tNEIRecipe = new CachedDefaultRecipe(tRecipe); for (ItemStack tStack : tInputs) { diff --git a/src/Java/gtPlusPlus/nei/GT_NEI_MillingMachine.java b/src/Java/gtPlusPlus/nei/GT_NEI_MillingMachine.java index b868c2422c..8aea87b6d4 100644 --- a/src/Java/gtPlusPlus/nei/GT_NEI_MillingMachine.java +++ b/src/Java/gtPlusPlus/nei/GT_NEI_MillingMachine.java @@ -28,8 +28,8 @@ import gregtech.api.util.GT_OreDictUnificator; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Recipe.GT_Recipe_Map; import gregtech.api.util.GT_Utility; -import gregtech.api.util.Recipe_GT; -import gregtech.api.util.Recipe_GT.Gregtech_Recipe_Map; +import gregtech.api.util.GTPP_Recipe; +import gregtech.api.util.GTPP_Recipe.GTPP_Recipe_Map; import gtPlusPlus.core.util.minecraft.ItemUtils; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.inventory.GuiContainer; @@ -51,7 +51,7 @@ extends TemplateRecipeHandler { protected GT_Recipe_Map mRecipeMap; public GT_NEI_MillingMachine() { - this.mRecipeMap = Gregtech_Recipe_Map.sOreMillRecipes; + this.mRecipeMap = GTPP_Recipe_Map.sOreMillRecipes; this.transferRects.add(new TemplateRecipeHandler.RecipeTransferRect(new Rectangle(65, 13, 36, 18), this.getRecipeMapName(), new Object[0])); if (!NEI_GT_Config.sIsAdded) { FMLInterModComms.sendRuntimeMessage(GT_Values.GT, "NEIPlugins", "register-crafting-handler", "gregtechplusplus@" + this.getRecipeName() + "@" + this.getRecipeMapName()); @@ -60,8 +60,8 @@ extends TemplateRecipeHandler { } } - public List getSortedRecipes() { - List result = new ArrayList(this.mRecipeMap.mRecipeList); + public List getSortedRecipes() { + List result = new ArrayList(this.mRecipeMap.mRecipeList); Collections.sort(result); return result; } @@ -78,7 +78,7 @@ extends TemplateRecipeHandler { @Override public void loadCraftingRecipes(final String outputId, final Object... results) { if (outputId.equals(getRecipeMapName())) { - for (Recipe_GT tRecipe : getSortedRecipes()) { + for (GTPP_Recipe tRecipe : getSortedRecipes()) { if (!tRecipe.mHidden) { this.arecipes.add(new CachedDefaultRecipe(tRecipe)); } @@ -109,7 +109,7 @@ extends TemplateRecipeHandler { } } } - for (Recipe_GT tRecipe : getSortedRecipes()) { + for (GTPP_Recipe tRecipe : getSortedRecipes()) { if (!tRecipe.mHidden) { CachedDefaultRecipe tNEIRecipe = new CachedDefaultRecipe(tRecipe); for (ItemStack tStack : tResults) { @@ -143,7 +143,7 @@ extends TemplateRecipeHandler { } } } - for (Recipe_GT tRecipe : getSortedRecipes()) { + for (GTPP_Recipe tRecipe : getSortedRecipes()) { if (!tRecipe.mHidden) { CachedDefaultRecipe tNEIRecipe = new CachedDefaultRecipe(tRecipe); for (ItemStack tStack : tInputs) { diff --git a/src/Java/gtPlusPlus/nei/GT_NEI_MultiBlockHandler.java b/src/Java/gtPlusPlus/nei/GT_NEI_MultiBlockHandler.java index e3c980e6a4..e5bee4979f 100644 --- a/src/Java/gtPlusPlus/nei/GT_NEI_MultiBlockHandler.java +++ b/src/Java/gtPlusPlus/nei/GT_NEI_MultiBlockHandler.java @@ -19,7 +19,7 @@ import gregtech.api.gui.GT_GUIContainer_BasicMachine; import gregtech.api.objects.GT_ItemStack; import gregtech.api.objects.ItemData; import gregtech.api.util.*; -import gregtech.api.util.Recipe_GT.Gregtech_Recipe_Map; +import gregtech.api.util.GTPP_Recipe.GTPP_Recipe_Map; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.inventory.GuiContainer; @@ -46,9 +46,9 @@ extends TemplateRecipeHandler { GuiContainerManager.addTooltipHandler(new GT_RectHandler()); } - protected final Recipe_GT.Gregtech_Recipe_Map mRecipeMap; + protected final GTPP_Recipe.GTPP_Recipe_Map mRecipeMap; - public GT_NEI_MultiBlockHandler(Gregtech_Recipe_Map aRecipeMap) { + public GT_NEI_MultiBlockHandler(GTPP_Recipe_Map aRecipeMap) { this.mRecipeMap = aRecipeMap; this.transferRects.add(new TemplateRecipeHandler.RecipeTransferRect(new Rectangle(65, 13, 36, 18), getOverlayIdentifier(), new Object[0])); if (!NEI_GT_Config.sIsAdded) { @@ -58,8 +58,8 @@ extends TemplateRecipeHandler { } } - public List getSortedRecipes() { - List result = new ArrayList<>(this.mRecipeMap.mRecipeList); + public List getSortedRecipes() { + List result = new ArrayList<>(this.mRecipeMap.mRecipeList); //List resultReal = new ArrayList(); /*for (Recipe_GT g : this.mRecipeMap.mRecipeList) { @@ -80,7 +80,7 @@ extends TemplateRecipeHandler { public void loadCraftingRecipes(String outputId, Object... results) { if (outputId.equals(getOverlayIdentifier())) { - for (Recipe_GT tRecipe : getSortedRecipes()) { + for (GTPP_Recipe tRecipe : getSortedRecipes()) { if (!tRecipe.mHidden) { this.arecipes.add(new CachedDefaultRecipe(tRecipe)); } @@ -110,7 +110,7 @@ extends TemplateRecipeHandler { } } } - for (Recipe_GT tRecipe : getSortedRecipes()) { + for (GTPP_Recipe tRecipe : getSortedRecipes()) { if (!tRecipe.mHidden) { CachedDefaultRecipe tNEIRecipe = new CachedDefaultRecipe(tRecipe); for (ItemStack tStack : tResults) { @@ -144,7 +144,7 @@ extends TemplateRecipeHandler { } } } - for (Recipe_GT tRecipe : getSortedRecipes()) { + for (GTPP_Recipe tRecipe : getSortedRecipes()) { if (!tRecipe.mHidden) { CachedDefaultRecipe tNEIRecipe = new CachedDefaultRecipe(tRecipe); for (ItemStack tStack : tInputs) { @@ -359,11 +359,11 @@ extends TemplateRecipeHandler { } public class CachedDefaultRecipe extends TemplateRecipeHandler.CachedRecipe { - public final Recipe_GT mRecipe; + public final GTPP_Recipe mRecipe; public final List mOutputs; public final List mInputs; - public CachedDefaultRecipe(Recipe_GT aRecipe) { + public CachedDefaultRecipe(GTPP_Recipe aRecipe) { super(); this.mRecipe = aRecipe; diff --git a/src/Java/gtPlusPlus/nei/GT_NEI_VacFurnace.java b/src/Java/gtPlusPlus/nei/GT_NEI_VacFurnace.java index 571ee79ee6..fd07d66fed 100644 --- a/src/Java/gtPlusPlus/nei/GT_NEI_VacFurnace.java +++ b/src/Java/gtPlusPlus/nei/GT_NEI_VacFurnace.java @@ -19,7 +19,7 @@ import gregtech.api.gui.GT_GUIContainer_BasicMachine; import gregtech.api.objects.ItemData; import gregtech.api.util.*; import gregtech.api.util.GT_Recipe.GT_Recipe_Map; -import gregtech.api.util.Recipe_GT.Gregtech_Recipe_Map; +import gregtech.api.util.GTPP_Recipe.GTPP_Recipe_Map; import gtPlusPlus.core.util.minecraft.ItemUtils; import gtPlusPlus.nei.GT_NEI_MultiBlockHandler.FixedPositionedStack; import net.minecraft.client.Minecraft; @@ -42,7 +42,7 @@ extends TemplateRecipeHandler { protected GT_Recipe_Map mRecipeMap; public GT_NEI_VacFurnace() { - this.mRecipeMap = Gregtech_Recipe_Map.sVacuumFurnaceRecipes; + this.mRecipeMap = GTPP_Recipe_Map.sVacuumFurnaceRecipes; this.transferRects.add(new TemplateRecipeHandler.RecipeTransferRect(new Rectangle(65, 13, 36, 18), this.getRecipeMapName(), new Object[0])); if (!NEI_GT_Config.sIsAdded) { FMLInterModComms.sendRuntimeMessage(GT_Values.GT, "NEIPlugins", "register-crafting-handler", "gregtechplusplus@" + this.getRecipeName() + "@" + this.getRecipeMapName()); @@ -51,8 +51,8 @@ extends TemplateRecipeHandler { } } - public List getSortedRecipes() { - List result = new ArrayList(this.mRecipeMap.mRecipeList); + public List getSortedRecipes() { + List result = new ArrayList(this.mRecipeMap.mRecipeList); Collections.sort(result); return result; } @@ -69,7 +69,7 @@ extends TemplateRecipeHandler { @Override public void loadCraftingRecipes(final String outputId, final Object... results) { if (outputId.equals(getRecipeMapName())) { - for (Recipe_GT tRecipe : getSortedRecipes()) { + for (GTPP_Recipe tRecipe : getSortedRecipes()) { if (!tRecipe.mHidden) { this.arecipes.add(new CachedDefaultRecipe(tRecipe)); } @@ -100,7 +100,7 @@ extends TemplateRecipeHandler { } } } - for (Recipe_GT tRecipe : getSortedRecipes()) { + for (GTPP_Recipe tRecipe : getSortedRecipes()) { if (!tRecipe.mHidden) { CachedDefaultRecipe tNEIRecipe = new CachedDefaultRecipe(tRecipe); for (ItemStack tStack : tResults) { @@ -134,7 +134,7 @@ extends TemplateRecipeHandler { } } } - for (Recipe_GT tRecipe : getSortedRecipes()) { + for (GTPP_Recipe tRecipe : getSortedRecipes()) { if (!tRecipe.mHidden) { CachedDefaultRecipe tNEIRecipe = new CachedDefaultRecipe(tRecipe); for (ItemStack tStack : tInputs) { diff --git a/src/Java/gtPlusPlus/nei/NEI_GT_Config.java b/src/Java/gtPlusPlus/nei/NEI_GT_Config.java index 0a0ba9b9e8..514612752d 100644 --- a/src/Java/gtPlusPlus/nei/NEI_GT_Config.java +++ b/src/Java/gtPlusPlus/nei/NEI_GT_Config.java @@ -4,8 +4,8 @@ import codechicken.nei.api.API; import codechicken.nei.api.IConfigureNEI; import gregtech.api.util.CustomRecipeMap; import gregtech.api.util.GT_Recipe.GT_Recipe_Map; -import gregtech.api.util.Recipe_GT; -import gregtech.api.util.Recipe_GT.Gregtech_Recipe_Map; +import gregtech.api.util.GTPP_Recipe; +import gregtech.api.util.GTPP_Recipe.GTPP_Recipe_Map; import gregtech.nei.GT_NEI_DefaultHandler; import gtPlusPlus.api.objects.data.AutoMap; @@ -19,10 +19,10 @@ implements IConfigureNEI { public synchronized void loadConfig() { sIsAdded = false; - mUniqueRecipeMapHandling.add(Gregtech_Recipe_Map.sChemicalPlantRecipes.mUnlocalizedName); - mUniqueRecipeMapHandling.add(Gregtech_Recipe_Map.sOreMillRecipes.mUnlocalizedName); - mUniqueRecipeMapHandling.add(Gregtech_Recipe_Map.sFlotationCellRecipes.mUnlocalizedName); - mUniqueRecipeMapHandling.add(Gregtech_Recipe_Map.sVacuumFurnaceRecipes.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); // Custom Recipe Maps for (final CustomRecipeMap tMap : CustomRecipeMap.sMappings) { @@ -32,7 +32,7 @@ implements IConfigureNEI { } // Custom Recipe maps - for (final Gregtech_Recipe_Map tMap : Recipe_GT.Gregtech_Recipe_Map.sMappings) { + for (final GTPP_Recipe_Map tMap : GTPP_Recipe.GTPP_Recipe_Map.sMappings) { if (tMap.mNEIAllowed) { if (!mUniqueRecipeMapHandling.contains(tMap.mUnlocalizedName)) { new GTPP_NEI_DefaultHandler(tMap); @@ -41,7 +41,7 @@ implements IConfigureNEI { } // Standard GT Recipe Maps - for (final GT_Recipe_Map tMap : Recipe_GT.GTPP_Recipe_Map.sMappingsEx) { + for (final GT_Recipe_Map tMap : GTPP_Recipe.GTPP_Recipe_Map_Internal.sMappingsEx) { if (tMap.mNEIAllowed) { if (!mUniqueRecipeMapHandling.contains(tMap.mUnlocalizedName)) { new GT_NEI_DefaultHandler(tMap); diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/Meta_GT_Proxy.java b/src/Java/gtPlusPlus/xmod/gregtech/common/Meta_GT_Proxy.java index 76100df0de..63f5043954 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/Meta_GT_Proxy.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/Meta_GT_Proxy.java @@ -1,12 +1,15 @@ package gtPlusPlus.xmod.gregtech.common; import java.lang.reflect.Constructor; +import java.lang.reflect.Field; import java.lang.reflect.InvocationTargetException; import java.util.ArrayList; import java.util.LinkedHashMap; import java.util.List; import java.util.Map; +import org.apache.commons.lang3.ArrayUtils; + import cpw.mods.fml.common.registry.GameRegistry; import cpw.mods.fml.common.registry.LanguageRegistry; import cpw.mods.fml.relauncher.Side; @@ -21,7 +24,7 @@ import gregtech.api.metatileentity.BaseMetaTileEntity; import gregtech.api.util.GT_LanguageManager; import gregtech.api.util.GT_Log; import gregtech.api.util.GT_Utility; -import gregtech.api.util.Recipe_GT; +import gregtech.api.util.GTPP_Recipe; import gregtech.common.GT_Proxy; import gtPlusPlus.api.objects.Logger; import gtPlusPlus.api.objects.data.AutoMap; @@ -38,6 +41,7 @@ import gtPlusPlus.core.util.reflect.ReflectionUtils; import gtPlusPlus.xmod.gregtech.api.metatileentity.BaseCustomTileEntity; import gtPlusPlus.xmod.gregtech.api.metatileentity.custom.power.BaseCustomPower_MTE; import gtPlusPlus.xmod.gregtech.common.covers.CoverManager; +import gtPlusPlus.xmod.gregtech.common.tileentities.machines.basic.GT_MetaTileEntity_WorldAccelerator; import ic2.core.init.BlocksItems; import ic2.core.init.InternalName; import net.minecraft.block.Block; @@ -120,7 +124,7 @@ public class Meta_GT_Proxy { public static void postInit() { mAssemblyAchievements = new AchievementHandler(); fixIC2FluidNames(); - + // Finalise TAE TAE.finalizeTAE(); } @@ -212,11 +216,11 @@ public class Meta_GT_Proxy { public static boolean generatePlasmaRecipesForAdvVacFreezer() { - AutoMap aFreezerMapRebaked = new AutoMap(); - AutoMap aRemovedRecipes = new AutoMap(); + AutoMap aFreezerMapRebaked = new AutoMap(); + AutoMap aRemovedRecipes = new AutoMap(); //Find recipes containing Plasma and map them - for (Recipe_GT y : Recipe_GT.Gregtech_Recipe_Map.sAdvFreezerRecipes.mRecipeList) { + for (GTPP_Recipe y : GTPP_Recipe.GTPP_Recipe_Map.sAdvFreezerRecipes.mRecipeList) { if (y.mFluidInputs.length > 0) { for (FluidStack r : y.mFluidInputs) { if (r.getUnlocalizedName().toLowerCase().contains("plasma")) { @@ -228,7 +232,7 @@ public class Meta_GT_Proxy { } } - AutoMap aNewRecipes = new AutoMap(); + AutoMap aNewRecipes = new AutoMap(); int aAtomicMass = 0; int aAtomicTier = 0; @@ -275,7 +279,7 @@ public class Meta_GT_Proxy { else { //Build a new plasma recipe int aTotalTickTime = (20 * 1 + (aAtomicMass)); - Recipe_GT aTempRecipe = new Recipe_GT(true, + GTPP_Recipe aTempRecipe = new GTPP_Recipe(true, new ItemStack[] {}, new ItemStack[] {}, null, @@ -301,24 +305,24 @@ public class Meta_GT_Proxy { //Add the new recipes to the map we will rebake over the original - for (Recipe_GT w : aNewRecipes) { + for (GTPP_Recipe w : aNewRecipes) { aFreezerMapRebaked.put(w); } //Best not touch the original map if we don't have a valid map to override it with. if (aFreezerMapRebaked.size() > 0) { - int aOriginalCount = Recipe_GT.Gregtech_Recipe_Map.sAdvFreezerRecipes.mRecipeList.size(); + int aOriginalCount = GTPP_Recipe.GTPP_Recipe_Map.sAdvFreezerRecipes.mRecipeList.size(); //Empty the original map - Recipe_GT.Gregtech_Recipe_Map.sAdvFreezerRecipes.mRecipeList.clear(); + GTPP_Recipe.GTPP_Recipe_Map.sAdvFreezerRecipes.mRecipeList.clear(); //Rebake the real map - for (Recipe_GT w : aFreezerMapRebaked) { - Recipe_GT.Gregtech_Recipe_Map.sAdvFreezerRecipes.mRecipeList.add(w); + for (GTPP_Recipe w : aFreezerMapRebaked) { + GTPP_Recipe.GTPP_Recipe_Map.sAdvFreezerRecipes.mRecipeList.add(w); } - return Recipe_GT.Gregtech_Recipe_Map.sAdvFreezerRecipes.mRecipeList.size() >= aOriginalCount; + return GTPP_Recipe.GTPP_Recipe_Map.sAdvFreezerRecipes.mRecipeList.size() >= aOriginalCount; } return false; @@ -405,6 +409,32 @@ public class Meta_GT_Proxy { + public static boolean setTileEntityClassAsBlacklistedInWorldAccelerator(String aClassName) { + if (CORE.GTNH) { + Class aMainModClass = ReflectionUtils.getClass("com.dreammaster.main.MainRegistry"); + Class aCoreModConfig = ReflectionUtils.getClass("com.dreammaster.config"); + if (aMainModClass != null && aCoreModConfig != null) { + Field aCoreConfig = ReflectionUtils.getField(aMainModClass, "CoreConfig"); + if (aCoreConfig != null) { + Field aBlackList = ReflectionUtils.getField(aCoreModConfig, "BlacklistedTileEntiyClassNames"); + Object aInstance = ReflectionUtils.getFieldValue(aCoreConfig); + if (aBlackList != null && aInstance != null) { + String[] aBlackListValue = (String[]) ReflectionUtils.getFieldValue(aBlackList, aInstance); + if (aBlackListValue != null) { + aBlackListValue = ArrayUtils.add(aBlackListValue, aClassName); + ReflectionUtils.setField(aInstance, aBlackList, aBlackListValue); + return true; + } + } + } + } + } + else { + GT_MetaTileEntity_WorldAccelerator.BlacklistedTileEntiyClassNames = ArrayUtils.add(GT_MetaTileEntity_WorldAccelerator.BlacklistedTileEntiyClassNames, aClassName); + return true; + } + return false; + } diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/items/MetaGeneratedGregtechItems.java b/src/Java/gtPlusPlus/xmod/gregtech/common/items/MetaGeneratedGregtechItems.java index 232d4e2cd7..1472ff9f23 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/items/MetaGeneratedGregtechItems.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/items/MetaGeneratedGregtechItems.java @@ -16,7 +16,7 @@ import gregtech.api.objects.ItemData; import gregtech.api.objects.MaterialStack; import gregtech.api.util.GT_FoodStat; import gregtech.api.util.GT_ModHandler; -import gregtech.api.util.Recipe_GT; +import gregtech.api.util.GTPP_Recipe; import gregtech.common.covers.GT_Cover_Arm; import gregtech.common.covers.GT_Cover_Conveyor; import gregtech.common.covers.GT_Cover_Pump; @@ -200,7 +200,7 @@ public class MetaGeneratedGregtechItems extends Gregtech_MetaItem_X32 { GregtechItemList.Pellet_RTG_SR90.set(this.addItem(42, StringUtils.superscript("90")+"Sr Pellet", "", new Object[]{getTcAspectStack(TC_Aspects.RADIO, 4L), getTcAspectStack(TC_Aspects.POTENTIA, 2L), getTcAspectStack(TC_Aspects.METALLUM, 2L)})); GregtechItemList.Pellet_RTG_PO210.set(this.addItem(43, StringUtils.superscript("210")+"Po Pellet", "", new Object[]{getTcAspectStack(TC_Aspects.RADIO, 4L), getTcAspectStack(TC_Aspects.POTENTIA, 2L), getTcAspectStack(TC_Aspects.METALLUM, 2L)})); GregtechItemList.Pellet_RTG_AM241.set(this.addItem(44, StringUtils.superscript("241")+"Am Pellet", "", new Object[]{getTcAspectStack(TC_Aspects.RADIO, 4L), getTcAspectStack(TC_Aspects.POTENTIA, 2L), getTcAspectStack(TC_Aspects.METALLUM, 2L)})); - Recipe_GT.Gregtech_Recipe_Map.sRTGFuels.addRecipe( + GTPP_Recipe.GTPP_Recipe_Map.sRTGFuels.addRecipe( true, new ItemStack[]{GregtechItemList.Pellet_RTG_PU238.get(1)}, new ItemStack[]{}, @@ -210,7 +210,7 @@ public class MetaGeneratedGregtechItems extends Gregtech_MetaItem_X32 { 0, 64, MathUtils.roundToClosestInt(87.7f)); - Recipe_GT.Gregtech_Recipe_Map.sRTGFuels.addRecipe( + GTPP_Recipe.GTPP_Recipe_Map.sRTGFuels.addRecipe( true, new ItemStack[]{GregtechItemList.Pellet_RTG_SR90.get(1)}, new ItemStack[]{}, @@ -220,7 +220,7 @@ public class MetaGeneratedGregtechItems extends Gregtech_MetaItem_X32 { 0, 32, MathUtils.roundToClosestInt(28.8f)); - Recipe_GT.Gregtech_Recipe_Map.sRTGFuels.addRecipe( + GTPP_Recipe.GTPP_Recipe_Map.sRTGFuels.addRecipe( true, new ItemStack[]{GregtechItemList.Pellet_RTG_PO210.get(1)}, new ItemStack[]{}, @@ -230,7 +230,7 @@ public class MetaGeneratedGregtechItems extends Gregtech_MetaItem_X32 { 0, 512, MathUtils.roundToClosestInt(1f)); - Recipe_GT.Gregtech_Recipe_Map.sRTGFuels.addRecipe( + GTPP_Recipe.GTPP_Recipe_Map.sRTGFuels.addRecipe( true, new ItemStack[]{GregtechItemList.Pellet_RTG_AM241.get(1)}, new ItemStack[]{}, diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GT_MetaTileEntity_SemiFluidGenerator.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GT_MetaTileEntity_SemiFluidGenerator.java index bd9708108b..d5a1d8d355 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GT_MetaTileEntity_SemiFluidGenerator.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GT_MetaTileEntity_SemiFluidGenerator.java @@ -14,7 +14,7 @@ import gregtech.api.objects.GT_RenderedTexture; import gregtech.api.util.GT_ModHandler; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; -import gregtech.api.util.Recipe_GT.Gregtech_Recipe_Map; +import gregtech.api.util.GTPP_Recipe.GTPP_Recipe_Map; import gtPlusPlus.api.objects.Logger; import net.minecraft.item.ItemStack; @@ -62,7 +62,7 @@ public class GT_MetaTileEntity_SemiFluidGenerator extends GT_MetaTileEntity_Basi @Override public GT_Recipe.GT_Recipe_Map getRecipes() { //Logger.WARNING("Fuel Count: "+Gregtech_Recipe_Map.sSemiFluidLiquidFuels.mRecipeList.size()); - return Gregtech_Recipe_Map.sSemiFluidLiquidFuels; + return GTPP_Recipe_Map.sSemiFluidLiquidFuels; } @Override diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GregtechMetaTileEntityRocketFuelGenerator.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GregtechMetaTileEntityRocketFuelGenerator.java index 7d20f1eb59..f9bf116362 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GregtechMetaTileEntityRocketFuelGenerator.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GregtechMetaTileEntityRocketFuelGenerator.java @@ -11,7 +11,7 @@ import gregtech.api.metatileentity.MetaTileEntity; import gregtech.api.objects.GT_RenderedTexture; import gregtech.api.util.GT_ModHandler; import gregtech.api.util.GT_Recipe; -import gregtech.api.util.Recipe_GT; +import gregtech.api.util.GTPP_Recipe; import gtPlusPlus.core.util.math.MathUtils; import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.generators.GregtechRocketFuelGeneratorBase; import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock; @@ -45,7 +45,7 @@ extends GregtechRocketFuelGeneratorBase { @Override public GT_Recipe.GT_Recipe_Map getRecipes() { - return Recipe_GT.Gregtech_Recipe_Map.sRocketFuels; + return GTPP_Recipe.GTPP_Recipe_Map.sRocketFuels; } @Override diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GregtechMetaTileEntity_RTG.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GregtechMetaTileEntity_RTG.java index 6f18b89c53..14417cb921 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GregtechMetaTileEntity_RTG.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GregtechMetaTileEntity_RTG.java @@ -13,7 +13,7 @@ import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicGenera import gregtech.api.objects.GT_RenderedTexture; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; -import gregtech.api.util.Recipe_GT; +import gregtech.api.util.GTPP_Recipe; import gtPlusPlus.api.objects.Logger; import gtPlusPlus.core.lib.CORE; @@ -215,7 +215,7 @@ public class GregtechMetaTileEntity_RTG extends GT_MetaTileEntity_BasicGenerator @Override public GT_Recipe.GT_Recipe_Map getRecipes() { - return Recipe_GT.Gregtech_Recipe_Map.sRTGFuels; + return GTPP_Recipe.GTPP_Recipe_Map.sRTGFuels; } @Override diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaTileEntity_BasicWasher.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaTileEntity_BasicWasher.java index c07fa2e927..01944c6ce5 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaTileEntity_BasicWasher.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaTileEntity_BasicWasher.java @@ -7,7 +7,7 @@ import gregtech.api.metatileentity.MetaTileEntity; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicMachine; import gregtech.api.objects.GT_RenderedTexture; import gregtech.api.util.GT_Recipe; -import gregtech.api.util.Recipe_GT; +import gregtech.api.util.GTPP_Recipe; import net.minecraft.item.ItemStack; import net.minecraftforge.fluids.FluidStack; @@ -49,7 +49,7 @@ public class GregtechMetaTileEntity_BasicWasher extends GT_MetaTileEntity_BasicM @Override public GT_Recipe.GT_Recipe_Map getRecipeList() { - return Recipe_GT.Gregtech_Recipe_Map.sSimpleWasherRecipes; + return GTPP_Recipe.GTPP_Recipe_Map.sSimpleWasherRecipes; } @Override diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaTileEntity_ChemicalReactor.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaTileEntity_ChemicalReactor.java index 79d256909d..7505c721f4 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaTileEntity_ChemicalReactor.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaTileEntity_ChemicalReactor.java @@ -17,7 +17,7 @@ import gregtech.api.util.GT_OreDictUnificator; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Recipe.GT_Recipe_Map; import gregtech.api.util.GT_Utility; -import gregtech.api.util.Recipe_GT; +import gregtech.api.util.GTPP_Recipe; import gtPlusPlus.api.objects.random.XSTR; import gtPlusPlus.core.lib.CORE; import gtPlusPlus.core.slots.SlotChemicalPlantInput; diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaTileEntity_CompactFusionReactor.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaTileEntity_CompactFusionReactor.java index 477848a90f..2197ce193d 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaTileEntity_CompactFusionReactor.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaTileEntity_CompactFusionReactor.java @@ -17,7 +17,7 @@ import gregtech.api.metatileentity.MetaTileEntity; import gregtech.api.objects.GT_RenderedTexture; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; -import gregtech.api.util.Recipe_GT; +import gregtech.api.util.GTPP_Recipe; import gtPlusPlus.api.objects.Logger; import gtPlusPlus.core.lib.CORE; @@ -104,7 +104,7 @@ public class GregtechMetaTileEntity_CompactFusionReactor extends GT_MetaTileEnti @Override public GT_Recipe.GT_Recipe_Map getRecipeList() { - return Recipe_GT.Gregtech_Recipe_Map.sSlowFusionRecipes; + return GTPP_Recipe.GTPP_Recipe_Map.sSlowFusionRecipes; } @Override diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaTileEntity_PocketFusion.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaTileEntity_PocketFusion.java index 8b3ada610d..cf9ab2b7e3 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaTileEntity_PocketFusion.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaTileEntity_PocketFusion.java @@ -17,7 +17,7 @@ import gregtech.api.metatileentity.MetaTileEntity; import gregtech.api.objects.GT_RenderedTexture; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; -import gregtech.api.util.Recipe_GT; +import gregtech.api.util.GTPP_Recipe; import gtPlusPlus.api.objects.Logger; import gtPlusPlus.core.lib.CORE; @@ -104,7 +104,7 @@ public class GregtechMetaTileEntity_PocketFusion extends GT_MetaTileEntity_Delux @Override public GT_Recipe.GT_Recipe_Map getRecipeList() { - return Recipe_GT.Gregtech_Recipe_Map.sSlowFusionRecipes; + return GTPP_Recipe.GTPP_Recipe_Map.sSlowFusionRecipes; } @Override diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialCentrifuge.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialCentrifuge.java index 9490fc678b..1601137c87 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialCentrifuge.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialCentrifuge.java @@ -8,7 +8,7 @@ import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.objects.GT_RenderedTexture; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; -import gregtech.api.util.Recipe_GT; +import gregtech.api.util.GTPP_Recipe; import gtPlusPlus.api.objects.Logger; import gtPlusPlus.core.block.ModBlocks; import gtPlusPlus.core.util.minecraft.PlayerUtils; @@ -88,7 +88,7 @@ extends GregtechMeta_MultiBlockBase { @Override public GT_Recipe.GT_Recipe_Map getRecipeMap() { - return Recipe_GT.Gregtech_Recipe_Map.sMultiblockCentrifugeRecipes_GT; + return GTPP_Recipe.GTPP_Recipe_Map.sMultiblockCentrifugeRecipes_GT; } @Override diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialCokeOven.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialCokeOven.java index b8517533e6..cafeddee24 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialCokeOven.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialCokeOven.java @@ -9,7 +9,7 @@ import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.objects.GT_RenderedTexture; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; -import gregtech.api.util.Recipe_GT; +import gregtech.api.util.GTPP_Recipe; import gtPlusPlus.api.objects.Logger; import gtPlusPlus.core.block.ModBlocks; import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GregtechMeta_MultiBlockBase; @@ -83,7 +83,7 @@ extends GregtechMeta_MultiBlockBase { @Override public GT_Recipe.GT_Recipe_Map getRecipeMap() { - return Recipe_GT.Gregtech_Recipe_Map.sCokeOvenRecipes; + return GTPP_Recipe.GTPP_Recipe_Map.sCokeOvenRecipes; } diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialDehydrator.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialDehydrator.java index b5cfff10e4..5a8dcc0df6 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialDehydrator.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialDehydrator.java @@ -15,7 +15,7 @@ import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.objects.GT_RenderedTexture; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; -import gregtech.api.util.Recipe_GT; +import gregtech.api.util.GTPP_Recipe; import gtPlusPlus.api.objects.Logger; import gtPlusPlus.core.block.ModBlocks; import gtPlusPlus.core.util.Utils; @@ -83,7 +83,7 @@ public class GregtechMetaTileEntity_IndustrialDehydrator extends GregtechMeta_Mu } public GT_Recipe.GT_Recipe_Map getRecipeMap() { - return mDehydratorMode ? Recipe_GT.Gregtech_Recipe_Map.sChemicalDehydratorRecipes : Recipe_GT.Gregtech_Recipe_Map.sVacuumFurnaceRecipes; + return mDehydratorMode ? GTPP_Recipe.GTPP_Recipe_Map.sChemicalDehydratorRecipes : GTPP_Recipe.GTPP_Recipe_Map.sVacuumFurnaceRecipes; } public boolean isCorrectMachinePart(ItemStack aStack) { diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialElectrolyzer.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialElectrolyzer.java index aca635fa84..ecbfb3d7de 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialElectrolyzer.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialElectrolyzer.java @@ -75,7 +75,7 @@ extends GregtechMeta_MultiBlockBase { @Override public GT_Recipe.GT_Recipe_Map getRecipeMap() { - return gregtech.api.util.Recipe_GT.Gregtech_Recipe_Map.sMultiblockElectrolyzerRecipes_GT; + return gregtech.api.util.GTPP_Recipe.GTPP_Recipe_Map.sMultiblockElectrolyzerRecipes_GT; } @Override diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialVacuumFreezer.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialVacuumFreezer.java index 82de41f186..4cf8c55005 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialVacuumFreezer.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialVacuumFreezer.java @@ -1,7 +1,7 @@ package gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.processing; -import static gregtech.api.util.Recipe_GT.Gregtech_Recipe_Map.sAdvFreezerRecipes; -import static gregtech.api.util.Recipe_GT.Gregtech_Recipe_Map.sAdvFreezerRecipes_GT; +import static gregtech.api.util.GTPP_Recipe.GTPP_Recipe_Map.sAdvFreezerRecipes; +import static gregtech.api.util.GTPP_Recipe.GTPP_Recipe_Map.sAdvFreezerRecipes_GT; import gregtech.api.GregTech_API; import gregtech.api.enums.TAE; @@ -12,7 +12,7 @@ import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.objects.GT_RenderedTexture; import gregtech.api.util.GT_Recipe; -import gregtech.api.util.Recipe_GT; +import gregtech.api.util.GTPP_Recipe; import gtPlusPlus.api.objects.Logger; import gtPlusPlus.core.block.ModBlocks; import gtPlusPlus.core.util.minecraft.FluidUtils; @@ -112,7 +112,7 @@ public class GregtechMetaTileEntity_IndustrialVacuumFreezer extends GregtechMeta sAdvFreezerRecipes_GT.add(a); } } - return Recipe_GT.Gregtech_Recipe_Map.sAdvFreezerRecipes_GT; + return GTPP_Recipe.GTPP_Recipe_Map.sAdvFreezerRecipes_GT; } public boolean isCorrectMachinePart(final ItemStack aStack) { diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IsaMill.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IsaMill.java index 9dca082807..561dbc1a52 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IsaMill.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IsaMill.java @@ -17,7 +17,7 @@ import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.objects.GT_RenderedTexture; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; -import gregtech.api.util.Recipe_GT; +import gregtech.api.util.GTPP_Recipe; import gtPlusPlus.api.objects.Logger; import gtPlusPlus.api.objects.data.AutoMap; import gtPlusPlus.api.objects.minecraft.BlockPos; @@ -116,7 +116,7 @@ public class GregtechMetaTileEntity_IsaMill extends GregtechMeta_MultiBlockBase @Override public GT_Recipe.GT_Recipe_Map getRecipeMap() { - return Recipe_GT.Gregtech_Recipe_Map.sOreMillRecipes; + return GTPP_Recipe.GTPP_Recipe_Map.sOreMillRecipes; } @Override diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GT4Entity_ThermalBoiler.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GT4Entity_ThermalBoiler.java index 45077f4cf7..9f239d233a 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GT4Entity_ThermalBoiler.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GT4Entity_ThermalBoiler.java @@ -12,7 +12,7 @@ import gregtech.api.objects.GT_RenderedTexture; import gregtech.api.util.GT_ModHandler; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; -import gregtech.api.util.Recipe_GT; +import gregtech.api.util.GTPP_Recipe; import gtPlusPlus.api.objects.Logger; import gtPlusPlus.core.block.ModBlocks; import gtPlusPlus.core.item.general.ItemLavaFilter; @@ -94,7 +94,7 @@ extends GregtechMeta_MultiBlockBase } - for (GT_Recipe tRecipe : Recipe_GT.Gregtech_Recipe_Map.sThermalFuels.mRecipeList) { + for (GT_Recipe tRecipe : GTPP_Recipe.GTPP_Recipe_Map.sThermalFuels.mRecipeList) { FluidStack tFluid = tRecipe.mFluidInputs[0]; if (tFluid != null) { if (depleteInput(tFluid)) { diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMTE_FrothFlotationCell.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMTE_FrothFlotationCell.java index 1ceb6bd93f..cdb15b45c9 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMTE_FrothFlotationCell.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMTE_FrothFlotationCell.java @@ -16,7 +16,7 @@ import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.objects.GT_RenderedTexture; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; -import gregtech.api.util.Recipe_GT; +import gregtech.api.util.GTPP_Recipe; import gtPlusPlus.api.helpers.GregtechPlusPlus_API.Multiblock_API; import gtPlusPlus.api.objects.Logger; import gtPlusPlus.api.objects.minecraft.multi.SpecialMultiBehaviour; @@ -94,7 +94,7 @@ public class GregtechMTE_FrothFlotationCell extends GregtechMeta_MultiBlockBase @Override public GT_Recipe.GT_Recipe_Map getRecipeMap() { - return Recipe_GT.Gregtech_Recipe_Map.sFlotationCellRecipes; + return GTPP_Recipe.GTPP_Recipe_Map.sFlotationCellRecipes; } @Override diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMTE_MiniFusionPlant.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMTE_MiniFusionPlant.java index 579a26dc16..d19d0810d8 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMTE_MiniFusionPlant.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMTE_MiniFusionPlant.java @@ -14,7 +14,7 @@ import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Outpu import gregtech.api.objects.GT_RenderedTexture; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; -import gregtech.api.util.Recipe_GT; +import gregtech.api.util.GTPP_Recipe; import gregtech.api.util.GT_Recipe.GT_Recipe_Map; import gtPlusPlus.api.objects.Logger; import gtPlusPlus.api.objects.data.AutoMap; @@ -104,7 +104,7 @@ public class GregtechMTE_MiniFusionPlant extends GregtechMeta_MultiBlockBase { @Override public GT_Recipe.GT_Recipe_Map getRecipeMap() { - return Recipe_GT.Gregtech_Recipe_Map.sSlowFusionRecipes; + return GTPP_Recipe.GTPP_Recipe_Map.sSlowFusionRecipes; } @Override diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMTE_NuclearReactor.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMTE_NuclearReactor.java index 8d8e50df83..1518053015 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMTE_NuclearReactor.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMTE_NuclearReactor.java @@ -19,7 +19,7 @@ import gregtech.api.objects.GT_ItemStack; import gregtech.api.objects.GT_RenderedTexture; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; -import gregtech.api.util.Recipe_GT; +import gregtech.api.util.GTPP_Recipe; import gtPlusPlus.api.objects.Logger; import gtPlusPlus.core.block.ModBlocks; import gtPlusPlus.core.material.ELEMENT; @@ -394,7 +394,7 @@ public class GregtechMTE_NuclearReactor extends GregtechMeta_MultiBlockBase { @Override public boolean checkRecipe(final ItemStack aStack) { final ArrayList tFluids = this.getStoredFluids(); - final Collection tRecipeList = Recipe_GT.Gregtech_Recipe_Map.sLiquidFluorineThoriumReactorRecipes.mRecipeList; + final Collection tRecipeList = GTPP_Recipe.GTPP_Recipe_Map.sLiquidFluorineThoriumReactorRecipes.mRecipeList; if((tFluids.size() > 0) && (tRecipeList != null)) { //Does input hatch have a LFTR fuel? Logger.WARNING("Found more than one input fluid and a list of valid recipes."); for (final FluidStack hatchFluid1 : tFluids) { //Loops through hatches diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntityGeneratorArray.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntityGeneratorArray.java index 6f9080673f..4d3ee87025 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntityGeneratorArray.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntityGeneratorArray.java @@ -16,7 +16,7 @@ import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.objects.GT_RenderedTexture; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; -import gregtech.api.util.Recipe_GT; +import gregtech.api.util.GTPP_Recipe; import gtPlusPlus.api.objects.Logger; import gtPlusPlus.core.util.minecraft.gregtech.PollutionUtils; import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GregtechMeta_MultiBlockBase; @@ -91,7 +91,7 @@ public class GregtechMetaTileEntityGeneratorArray extends GregtechMeta_MultiBloc return null; } else if (this.mMode == MODE_STEAM) { - return Recipe_GT.Gregtech_Recipe_Map.sSteamTurbineFuels; + return GTPP_Recipe.GTPP_Recipe_Map.sSteamTurbineFuels; } else if (this.mMode == MODE_DIESEL) { return GT_Recipe.GT_Recipe_Map.sDieselFuels; @@ -100,13 +100,13 @@ public class GregtechMetaTileEntityGeneratorArray extends GregtechMeta_MultiBloc return GT_Recipe.GT_Recipe_Map.sTurbineFuels; } else if (this.mMode == MODE_SEMIFLUID) { - return Recipe_GT.Gregtech_Recipe_Map.sSemiFluidLiquidFuels; + return GTPP_Recipe.GTPP_Recipe_Map.sSemiFluidLiquidFuels; } else if (this.mMode == MODE_GEOTHERMAL) { - return Recipe_GT.Gregtech_Recipe_Map.sThermalFuels; + return GTPP_Recipe.GTPP_Recipe_Map.sThermalFuels; } else if (this.mMode == MODE_ROCKETFUEL) { - return Recipe_GT.Gregtech_Recipe_Map.sRocketFuels; + return GTPP_Recipe.GTPP_Recipe_Map.sRocketFuels; } else if (this.mMode == MODE_MAGIC_A) { return GT_Recipe.GT_Recipe_Map.sMagicFuels; diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_AlloyBlastSmelter.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_AlloyBlastSmelter.java index 3592475a5c..98344abb1c 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_AlloyBlastSmelter.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_AlloyBlastSmelter.java @@ -13,7 +13,7 @@ import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.objects.GT_RenderedTexture; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; -import gregtech.api.util.Recipe_GT; +import gregtech.api.util.GTPP_Recipe; import gtPlusPlus.api.objects.Logger; import gtPlusPlus.core.block.ModBlocks; import gtPlusPlus.core.recipe.common.CI; @@ -99,7 +99,7 @@ extends GregtechMeta_MultiBlockBase { @Override public GT_Recipe.GT_Recipe_Map getRecipeMap() { - return Recipe_GT.Gregtech_Recipe_Map.sAlloyBlastSmelterRecipes; + return GTPP_Recipe.GTPP_Recipe_Map.sAlloyBlastSmelterRecipes; } @Override @@ -181,7 +181,7 @@ extends GregtechMeta_MultiBlockBase { if (tInputList.size() > 1) { final long tVoltage = this.getMaxInputVoltage(); final byte tTier = (byte) Math.max(1, GT_Utility.getTier(tVoltage)); - final GT_Recipe tRecipe = Recipe_GT.Gregtech_Recipe_Map.sAlloyBlastSmelterRecipes.findRecipe(this.getBaseMetaTileEntity(), false, gregtech.api.enums.GT_Values.V[tTier], tFluids, tInputs); + final GT_Recipe tRecipe = GTPP_Recipe.GTPP_Recipe_Map.sAlloyBlastSmelterRecipes.findRecipe(this.getBaseMetaTileEntity(), false, gregtech.api.enums.GT_Values.V[tTier], tFluids, tInputs); if ((tRecipe != null) && (tRecipe.isRecipeInputEqual(true, tFluids, tInputs))) { Logger.WARNING("Found some Valid Inputs."); this.mEfficiency = (10000 - ((this.getIdealStatus() - this.getRepairStatus()) * 1000)); diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_Cyclotron.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_Cyclotron.java index f7cf3839fb..0878c8a0f5 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_Cyclotron.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_Cyclotron.java @@ -18,7 +18,7 @@ import gregtech.api.objects.GT_ItemStack; import gregtech.api.objects.GT_RenderedTexture; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; -import gregtech.api.util.Recipe_GT; +import gregtech.api.util.GTPP_Recipe; import gtPlusPlus.api.objects.Logger; import gtPlusPlus.core.block.ModBlocks; import gtPlusPlus.core.item.chemistry.IonParticles; @@ -314,7 +314,7 @@ public class GregtechMetaTileEntity_Cyclotron extends GregtechMeta_MultiBlockBas long tVoltage = getMaxInputVoltage(); byte tTier = (byte) Math.max(1, GT_Utility.getTier(tVoltage)); - GT_Recipe tRecipe = Recipe_GT.Gregtech_Recipe_Map.sCyclotronRecipes.findRecipe(getBaseMetaTileEntity(), false, + GT_Recipe tRecipe = GTPP_Recipe.GTPP_Recipe_Map.sCyclotronRecipes.findRecipe(getBaseMetaTileEntity(), false, gregtech.api.enums.GT_Values.V[tTier], tFluidInputs, tItemInputs); if (tRecipe != null){ if (tRecipe.isRecipeInputEqual(true, tFluidInputs, tItemInputs)) { diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_IndustrialFishingPond.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_IndustrialFishingPond.java index cb9c68b53c..9d0654e114 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_IndustrialFishingPond.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_IndustrialFishingPond.java @@ -16,7 +16,7 @@ import gregtech.api.objects.GT_RenderedTexture; import gregtech.api.util.FishPondFakeRecipe; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; -import gregtech.api.util.Recipe_GT; +import gregtech.api.util.GTPP_Recipe; import gtPlusPlus.api.objects.data.AutoMap; import gtPlusPlus.core.block.ModBlocks; import gtPlusPlus.core.lib.CORE; @@ -548,7 +548,7 @@ public class GregtechMetaTileEntity_IndustrialFishingPond extends GregtechMeta_M ItemStack[] mFishOutput = generateLoot(this.mMode); mFishOutput = removeNulls(mFishOutput); - GT_Recipe g = new Recipe_GT(true, new ItemStack[] {}, mFishOutput, null, new int[] {}, aFluidInputs, mOutputFluids, 200, 16, 0); + GT_Recipe g = new GTPP_Recipe(true, new ItemStack[] {}, mFishOutput, null, new int[] {}, aFluidInputs, mOutputFluids, 200, 16, 0); aMaxParallelRecipes = this.canBufferOutputs(g, aMaxParallelRecipes); if (aMaxParallelRecipes == 0) { log("No Space"); diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_LargeRocketEngine.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_LargeRocketEngine.java index 325ec8f95d..3be1c645be 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_LargeRocketEngine.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_LargeRocketEngine.java @@ -19,7 +19,7 @@ import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Muffl import gregtech.api.objects.GT_RenderedTexture; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; -import gregtech.api.util.Recipe_GT; +import gregtech.api.util.GTPP_Recipe; import gtPlusPlus.api.objects.Logger; import gtPlusPlus.core.block.ModBlocks; import gtPlusPlus.core.item.chemistry.RocketFuels; @@ -181,7 +181,7 @@ public class GregtechMetaTileEntity_LargeRocketEngine extends GregtechMeta_Multi //log("Running "+aircount); log("looking at hatch"); - final Collection tRecipeList = Recipe_GT.Gregtech_Recipe_Map.sRocketFuels.mRecipeList; + final Collection tRecipeList = GTPP_Recipe.GTPP_Recipe_Map.sRocketFuels.mRecipeList; if (tFluids.size() > 0 && tRecipeList != null) { diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_LargeSemifluidGenerator.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_LargeSemifluidGenerator.java index 2425e86c30..f6992841b1 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_LargeSemifluidGenerator.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_LargeSemifluidGenerator.java @@ -14,7 +14,7 @@ import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Dynam import gregtech.api.objects.GT_RenderedTexture; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; -import gregtech.api.util.Recipe_GT.Gregtech_Recipe_Map; +import gregtech.api.util.GTPP_Recipe.GTPP_Recipe_Map; import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GregtechMeta_MultiBlockBase; import net.minecraft.block.Block; import net.minecraft.entity.player.InventoryPlayer; @@ -76,7 +76,7 @@ public class GregtechMetaTileEntity_LargeSemifluidGenerator extends GregtechMeta @Override public boolean checkRecipe(ItemStack aStack) { ArrayList tFluids = getStoredFluids(); - Collection tRecipeList = Gregtech_Recipe_Map.sSemiFluidLiquidFuels.mRecipeList; + Collection tRecipeList = GTPP_Recipe_Map.sSemiFluidLiquidFuels.mRecipeList; if(tFluids.size() > 0 && tRecipeList != null) { //Does input hatch have a semifluid fuel? for (FluidStack hatchFluid1 : tFluids) { //Loops through hatches diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_MassFabricator.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_MassFabricator.java index e78e5ef16c..3a8f188b30 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_MassFabricator.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_MassFabricator.java @@ -18,7 +18,7 @@ import gregtech.api.util.GT_ModHandler; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Recipe.GT_Recipe_Map; import gregtech.api.util.GT_Utility; -import gregtech.api.util.Recipe_GT; +import gregtech.api.util.GTPP_Recipe; import gtPlusPlus.api.objects.Logger; import gtPlusPlus.core.block.ModBlocks; import gtPlusPlus.core.util.minecraft.ItemUtils; @@ -309,7 +309,7 @@ public class GregtechMetaTileEntity_MassFabricator extends GregtechMeta_MultiBlo @Override public GT_Recipe_Map getRecipeMap() { - return this.mMode == MODE_SCRAP ? GT_Recipe_Map.sRecyclerRecipes : Recipe_GT.Gregtech_Recipe_Map.sMatterFab2Recipes; + return this.mMode == MODE_SCRAP ? GT_Recipe_Map.sRecyclerRecipes : GTPP_Recipe.GTPP_Recipe_Map.sMatterFab2Recipes; //return Recipe_GT.Gregtech_Recipe_Map.sMatterFab2Recipes; } @@ -324,7 +324,7 @@ public class GregtechMetaTileEntity_MassFabricator extends GregtechMeta_MultiBlo long tVoltage = getMaxInputVoltage(); byte tTier = (byte) Math.max(1, GT_Utility.getTier(tVoltage)); long tEnergy = getMaxInputEnergy(); - GT_Recipe c = new Recipe_GT(false, new ItemStack[] { GT_Utility.copyAmount(1, aItemInputs[0]) }, + GT_Recipe c = new GTPP_Recipe(false, new ItemStack[] { GT_Utility.copyAmount(1, aItemInputs[0]) }, GT_ModHandler.getRecyclerOutput(GT_Utility.copyAmount(64, aItemInputs[0]), 0) == null ? null : new ItemStack[] { ItemList.IC2_Scrap.get(1) }, null, new int[] { 2000 }, null, null, 100, diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/chemplant/GregtechMTE_ChemicalPlant.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/chemplant/GregtechMTE_ChemicalPlant.java index 9064921c6a..8699393ca2 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/chemplant/GregtechMTE_ChemicalPlant.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/chemplant/GregtechMTE_ChemicalPlant.java @@ -18,7 +18,7 @@ import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_TieredMachi import gregtech.api.objects.GT_RenderedTexture; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; -import gregtech.api.util.Recipe_GT; +import gregtech.api.util.GTPP_Recipe; import gtPlusPlus.api.objects.Logger; import gtPlusPlus.api.objects.data.AutoMap; import gtPlusPlus.core.item.chemistry.general.ItemGenericChemBase; @@ -140,12 +140,12 @@ public class GregtechMTE_ChemicalPlant extends GregtechMeta_MultiBlockBase { @Override public GT_Recipe.GT_Recipe_Map getRecipeMap() { - return Recipe_GT.Gregtech_Recipe_Map.sChemicalPlant_GT; + return GTPP_Recipe.GTPP_Recipe_Map.sChemicalPlant_GT; } public static void generateRecipes() { - for (Recipe_GT i : Recipe_GT.Gregtech_Recipe_Map.sChemicalPlantRecipes.mRecipeList) { - Recipe_GT.Gregtech_Recipe_Map.sChemicalPlant_GT.add(i); + for (GTPP_Recipe i : GTPP_Recipe.GTPP_Recipe_Map.sChemicalPlantRecipes.mRecipeList) { + GTPP_Recipe.GTPP_Recipe_Map.sChemicalPlant_GT.add(i); } } diff --git a/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_FluidCanning.java b/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_FluidCanning.java index 40994040bd..9fe86985f4 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_FluidCanning.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_FluidCanning.java @@ -5,7 +5,7 @@ import java.util.HashSet; import gregtech.api.enums.GT_Values; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Recipe.GT_Recipe_Map; -import gregtech.api.util.Recipe_GT; +import gregtech.api.util.GTPP_Recipe; import gtPlusPlus.api.interfaces.RunnableWithInfo; import gtPlusPlus.api.objects.Logger; import gtPlusPlus.core.lib.CORE; @@ -106,7 +106,7 @@ public class RecipeGen_FluidCanning implements Runnable { //Check validity - Recipe_GT aRecipe = new Recipe_GT( + GTPP_Recipe aRecipe = new GTPP_Recipe( true, new ItemStack[] { aInput }, new ItemStack[] { aOutput }, diff --git a/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Plates.java b/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Plates.java index 007f390112..56d11520d0 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Plates.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Plates.java @@ -3,18 +3,16 @@ package gtPlusPlus.xmod.gregtech.loaders; import java.util.HashSet; import java.util.Set; -import net.minecraft.item.ItemStack; - import gregtech.api.GregTech_API; import gregtech.api.enums.GT_Values; import gregtech.api.enums.ItemList; import gregtech.api.util.GT_Recipe; - import gtPlusPlus.api.interfaces.RunnableWithInfo; import gtPlusPlus.api.objects.Logger; import gtPlusPlus.core.material.Material; import gtPlusPlus.core.material.MaterialGenerator; import gtPlusPlus.core.util.minecraft.ItemUtils; +import net.minecraft.item.ItemStack; public class RecipeGen_Plates extends RecipeGen_Base { @@ -126,14 +124,7 @@ public class RecipeGen_Plates extends RecipeGen_Base { } public static boolean addBenderRecipe(final ItemStack aInput1, final ItemStack aOutput1, int aDuration, final int aEUt) { - if ((aInput1 == null) || (aOutput1 == null)) { - return false; - } - if ((aDuration = GregTech_API.sRecipeFile.get("bender", aInput1, aDuration)) <= 0) { - return false; - } - new GT_Recipe(aEUt, aDuration, aInput1, aOutput1); - return true; + return GT_Values.RA.addBenderRecipe(aInput1, aOutput1, aDuration, aEUt); } public static boolean addExtruderRecipe(final ItemStack aInput, final ItemStack aShape, final ItemStack aOutput, int aDuration, final int aEUt) { diff --git a/src/Java/gtPlusPlus/xmod/gregtech/loaders/misc/AddCustomMachineToPA.java b/src/Java/gtPlusPlus/xmod/gregtech/loaders/misc/AddCustomMachineToPA.java index 321cab4628..e84ce73a47 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/loaders/misc/AddCustomMachineToPA.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/loaders/misc/AddCustomMachineToPA.java @@ -2,7 +2,7 @@ package gtPlusPlus.xmod.gregtech.loaders.misc; import java.lang.reflect.Method; -import gregtech.api.util.Recipe_GT; +import gregtech.api.util.GTPP_Recipe; import gregtech.api.util.GT_Recipe.GT_Recipe_Map; import gtPlusPlus.core.util.reflect.ReflectionUtils; @@ -43,8 +43,8 @@ public class AddCustomMachineToPA { public static void register() { // Simple Washers - registerRecipeMapForID(767, Recipe_GT.Gregtech_Recipe_Map.sSimpleWasherRecipes); - registerRecipeMapBetweenRangeOfIDs(31017, 31020, Recipe_GT.Gregtech_Recipe_Map.sSimpleWasherRecipes); + registerRecipeMapForID(767, GTPP_Recipe.GTPP_Recipe_Map.sSimpleWasherRecipes); + registerRecipeMapBetweenRangeOfIDs(31017, 31020, GTPP_Recipe.GTPP_Recipe_Map.sSimpleWasherRecipes); } diff --git a/src/Java/gtPlusPlus/xmod/gregtech/loaders/recipe/RecipeLoader_AlgaeFarm.java b/src/Java/gtPlusPlus/xmod/gregtech/loaders/recipe/RecipeLoader_AlgaeFarm.java index 1091533a52..053c71c89d 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/loaders/recipe/RecipeLoader_AlgaeFarm.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/loaders/recipe/RecipeLoader_AlgaeFarm.java @@ -4,7 +4,7 @@ import java.util.HashMap; import gregtech.api.enums.GT_Values; import gregtech.api.util.GT_Recipe; -import gregtech.api.util.Recipe_GT; +import gregtech.api.util.GTPP_Recipe; import gtPlusPlus.api.objects.Logger; import gtPlusPlus.api.objects.data.AutoMap; import gtPlusPlus.api.objects.data.WeightedCollection; @@ -103,7 +103,7 @@ public class RecipeLoader_AlgaeFarm { // We set these elsewhere ItemStack[] aOutputs = getOutputsForTier(aTier); - GT_Recipe tRecipe = new Recipe_GT( + GT_Recipe tRecipe = new GTPP_Recipe( false, aInputs, aOutputs, diff --git a/src/Java/gtPlusPlus/xmod/gregtech/loaders/recipe/RecipeLoader_LFTR.java b/src/Java/gtPlusPlus/xmod/gregtech/loaders/recipe/RecipeLoader_LFTR.java index 768bfec3d3..424c2ecce5 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/loaders/recipe/RecipeLoader_LFTR.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/loaders/recipe/RecipeLoader_LFTR.java @@ -5,7 +5,7 @@ import java.util.Collection; import net.minecraft.item.ItemStack; import gregtech.api.util.GT_Recipe; -import gregtech.api.util.Recipe_GT; +import gregtech.api.util.GTPP_Recipe; import gtPlusPlus.api.objects.minecraft.NoConflictGTRecipeMap; import gtPlusPlus.core.recipe.common.CI; @@ -30,7 +30,7 @@ public class RecipeLoader_LFTR { //1l/10t= 1000l/2.5hr LiFBeF2ZrF4U235 //LiFBeF2ThF4UF4 - GT_Recipe LFTR1 = new Recipe_GT( + GT_Recipe LFTR1 = new GTPP_Recipe( true, new ItemStack[] {CI.getNumberedCircuit(1)}, new ItemStack[] {}, @@ -49,7 +49,7 @@ public class RecipeLoader_LFTR { ); //LiFBeF2ZrF4UF4 - GT_Recipe LFTR2 = new Recipe_GT( + GT_Recipe LFTR2 = new GTPP_Recipe( true, new ItemStack[] {CI.getNumberedCircuit(2)}, new ItemStack[] {}, @@ -68,7 +68,7 @@ public class RecipeLoader_LFTR { ); //LiFBeF2ZrF4U235 - GT_Recipe LFTR3 = new Recipe_GT( + GT_Recipe LFTR3 = new GTPP_Recipe( true, new ItemStack[] {CI.getNumberedCircuit(3)}, new ItemStack[] {}, @@ -89,9 +89,9 @@ public class RecipeLoader_LFTR { /*mRecipesLFTR.add(LFTR1); mRecipesLFTR.add(LFTR2); mRecipesLFTR.add(LFTR3);*/ - Recipe_GT.Gregtech_Recipe_Map.sLiquidFluorineThoriumReactorRecipesEx.add(LFTR1); - Recipe_GT.Gregtech_Recipe_Map.sLiquidFluorineThoriumReactorRecipesEx.add(LFTR2); - Recipe_GT.Gregtech_Recipe_Map.sLiquidFluorineThoriumReactorRecipesEx.add(LFTR3); + GTPP_Recipe.GTPP_Recipe_Map.sLiquidFluorineThoriumReactorRecipesEx.add(LFTR1); + GTPP_Recipe.GTPP_Recipe_Map.sLiquidFluorineThoriumReactorRecipesEx.add(LFTR2); + GTPP_Recipe.GTPP_Recipe_Map.sLiquidFluorineThoriumReactorRecipesEx.add(LFTR3); } diff --git a/src/Java/gtPlusPlus/xmod/gregtech/recipes/GregtechRecipeAdder.java b/src/Java/gtPlusPlus/xmod/gregtech/recipes/GregtechRecipeAdder.java index 6b5d8d6802..4138fff564 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/recipes/GregtechRecipeAdder.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/recipes/GregtechRecipeAdder.java @@ -99,17 +99,17 @@ public class GregtechRecipeAdder implements IGregtech_RecipeAdder { // RECIPEHANDLER_CokeOven.debug4(aInput1, aInput2, aFluidInput, // aFluidOutput, aOutput, aDuration, aEUt); if (aFluidInput == null && aInput2 != null) { - Recipe_GT.Gregtech_Recipe_Map.sCokeOvenRecipes.addRecipe(true, new ItemStack[] { aInput1, aInput2 }, + GTPP_Recipe.GTPP_Recipe_Map.sCokeOvenRecipes.addRecipe(true, new ItemStack[] { aInput1, aInput2 }, new ItemStack[] { aOutput }, null, null, null, new FluidStack[] { aFluidOutput }, aDuration, aEUt, 0); } else if (aFluidInput == null && aInput2 == null) { - Recipe_GT.Gregtech_Recipe_Map.sCokeOvenRecipes.addRecipe(true, new ItemStack[] { aInput1 }, + GTPP_Recipe.GTPP_Recipe_Map.sCokeOvenRecipes.addRecipe(true, new ItemStack[] { aInput1 }, new ItemStack[] { aOutput }, null, null, null, new FluidStack[] { aFluidOutput }, aDuration, aEUt, 0); } else { - Recipe_GT.Gregtech_Recipe_Map.sCokeOvenRecipes.addRecipe(true, new ItemStack[] { aInput1, aInput2 }, + GTPP_Recipe.GTPP_Recipe_Map.sCokeOvenRecipes.addRecipe(true, new ItemStack[] { aInput1, aInput2 }, new ItemStack[] { aOutput }, null, null, new FluidStack[] { aFluidInput }, new FluidStack[] { aFluidOutput }, aDuration, aEUt, 0); } @@ -163,14 +163,14 @@ public class GregtechRecipeAdder implements IGregtech_RecipeAdder { // Recipe_GT.Gregtech_Recipe_Map.sMatterFabRecipes.addRecipe(true, // null, new FluidStack[]{aFluidOutput}, aDuration, aEUt, // 0); - Recipe_GT.Gregtech_Recipe_Map.sMatterFab2Recipes.addRecipe(true, null, null, null, null, + GTPP_Recipe.GTPP_Recipe_Map.sMatterFab2Recipes.addRecipe(true, null, null, null, null, new FluidStack[] { aFluidOutput }, aDuration, aEUt, 0); } else { // Recipe_GT.Gregtech_Recipe_Map.sMatterFabRecipes.addRecipe(true, // new FluidStack[]{aFluidInput}, new // FluidStack[]{aFluidOutput}, aDuration, aEUt, 0); - Recipe_GT.Gregtech_Recipe_Map.sMatterFab2Recipes.addRecipe(true, null, null, null, + GTPP_Recipe.GTPP_Recipe_Map.sMatterFab2Recipes.addRecipe(true, null, null, null, new FluidStack[] { aFluidInput }, new FluidStack[] { aFluidOutput }, aDuration, aEUt, 0); } RECIPEHANDLER_MatterFabricator.debug5(aFluidInput, aFluidOutput, aDuration, aEUt); @@ -205,11 +205,11 @@ public class GregtechRecipeAdder implements IGregtech_RecipeAdder { } try { if (aFluidInput == null) { - Recipe_GT.Gregtech_Recipe_Map.sMatterFab2Recipes.addRecipe(true, new ItemStack[] { aInputStack }, + GTPP_Recipe.GTPP_Recipe_Map.sMatterFab2Recipes.addRecipe(true, new ItemStack[] { aInputStack }, null, null, null, new FluidStack[] { aFluidOutput }, aDuration, aEUt, 0); } else { - Recipe_GT.Gregtech_Recipe_Map.sMatterFab2Recipes.addRecipe(true, new ItemStack[] { aInputStack }, + GTPP_Recipe.GTPP_Recipe_Map.sMatterFab2Recipes.addRecipe(true, new ItemStack[] { aInputStack }, null, null, new FluidStack[] { aFluidInput }, new FluidStack[] { aFluidOutput }, aDuration, aEUt, 0); } @@ -282,7 +282,7 @@ public class GregtechRecipeAdder implements IGregtech_RecipeAdder { if ((aDuration = GregTech_API.sRecipeFile.get("dehydrator", aInput, aDuration)) <= 0) { return false; } - Recipe_GT.Gregtech_Recipe_Map.sChemicalDehydratorRecipes.addRecipe(true, new ItemStack[] { aInput }, + GTPP_Recipe.GTPP_Recipe_Map.sChemicalDehydratorRecipes.addRecipe(true, new ItemStack[] { aInput }, aOutput, null, new FluidStack[] { aFluid }, null, aDuration, aEUt, 0); // RECIPEHANDLER_Dehydrator.debug5(aInput, null, aFluid, null, // aOutput, aDuration, aEUt); @@ -332,14 +332,14 @@ public class GregtechRecipeAdder implements IGregtech_RecipeAdder { if (aInput.length == 1) { Logger.WARNING("Dehydrator recipe only has a single input item."); - Recipe_GT.Gregtech_Recipe_Map.sChemicalDehydratorRecipes.addRecipe(true, aInput, aOutputItems, null, + GTPP_Recipe.GTPP_Recipe_Map.sChemicalDehydratorRecipes.addRecipe(true, aInput, aOutputItems, null, aChances, new FluidStack[] { aFluidInput }, new FluidStack[] { aFluidOutput }, aDuration, aEUt, 0); } else { Logger.WARNING("Dehydrator recipe has two input items."); - Recipe_GT.Gregtech_Recipe_Map.sChemicalDehydratorRecipes.addRecipe(true, aInput, aOutputItems, null, + GTPP_Recipe.GTPP_Recipe_Map.sChemicalDehydratorRecipes.addRecipe(true, aInput, aOutputItems, null, aChances, new FluidStack[] { aFluidInput }, new FluidStack[] { aFluidOutput }, aDuration, aEUt, 0); @@ -410,7 +410,7 @@ public class GregtechRecipeAdder implements IGregtech_RecipeAdder { - Recipe_GT.Gregtech_Recipe_Map.sAlloyBlastSmelterRecipes.addRecipe(true, aInput, aOutputStack, null, + GTPP_Recipe.GTPP_Recipe_Map.sAlloyBlastSmelterRecipes.addRecipe(true, aInput, aOutputStack, null, aChance, new FluidStack[] { aInputFluid }, new FluidStack[] { aOutput }, aDuration, aEUt, aSpecialValue); return true; @@ -435,7 +435,7 @@ public class GregtechRecipeAdder implements IGregtech_RecipeAdder { if ((aInput1 == null) || (aInput2 == null) || (aOutput1 == null) || (aDuration < 1) || (aEUt < 1)) { return false; } - Recipe_GT.Gregtech_Recipe_Map.sLiquidFluorineThoriumReactorRecipes.addRecipe(null, + GTPP_Recipe.GTPP_Recipe_Map.sLiquidFluorineThoriumReactorRecipes.addRecipe(null, new FluidStack[] { aInput1, aInput2 }, new FluidStack[] { aOutput1 }, aDuration, aEUt, 16000); return true; } @@ -469,7 +469,7 @@ public class GregtechRecipeAdder implements IGregtech_RecipeAdder { if (aOutput == null || aOutput.length < 1 || !ItemUtils.checkForInvalidItems(aOutput)) { return false; } - if (Recipe_GT.Gregtech_Recipe_Map.sCyclotronRecipes.addRecipe(true, aInputs, aOutput, + if (GTPP_Recipe.GTPP_Recipe_Map.sCyclotronRecipes.addRecipe(true, aInputs, aOutput, null, aChances, new FluidStack[] { aFluidInput }, new FluidStack[] { aFluidOutput }, Math.max(1, aDuration), Math.max(1, aEUt), aSpecialValue) != null) { return true; @@ -493,7 +493,7 @@ public class GregtechRecipeAdder implements IGregtech_RecipeAdder { aFluidOutput.getFluid().getName(), aDuration)) <= 0)) { return false; } - Recipe_GT.Gregtech_Recipe_Map.sAdvancedMixerRecipes.addRecipe(true, + GTPP_Recipe.GTPP_Recipe_Map.sAdvancedMixerRecipes.addRecipe(true, new ItemStack[] { aInput1, aInput2, aInput3, aInput4 }, new ItemStack[] { aOutput1, aOutput2, aOutput3, aOutput4 }, null, null, new FluidStack[] { aFluidInput }, new FluidStack[] { aFluidOutput }, aDuration, aEUt, 0); @@ -516,7 +516,7 @@ public class GregtechRecipeAdder implements IGregtech_RecipeAdder { if (GTNH) { return false; } - Recipe_GT.Gregtech_Recipe_Map.sComponentAssemblerRecipes.addRecipe(true, aInputs, new ItemStack[] { aOutput1 }, + GTPP_Recipe.GTPP_Recipe_Map.sComponentAssemblerRecipes.addRecipe(true, aInputs, new ItemStack[] { aOutput1 }, null, new FluidStack[] { aFluidInput }, null, aDuration, aEUt, 0); return true; } @@ -535,7 +535,7 @@ public class GregtechRecipeAdder implements IGregtech_RecipeAdder { Logger.INFO("Fluid Outputs: "+ItemUtils.getArrayStackNames(aFluidOutputs)); return false; } - Recipe_GT.Gregtech_Recipe_Map.sMultiblockCentrifugeRecipes.addRecipe(true, aInputs, aOutputs, null, aChances, aFluidInputs, aFluidOutputs, aDuration, aEUtick, aSpecial); + GTPP_Recipe.GTPP_Recipe_Map.sMultiblockCentrifugeRecipes.addRecipe(true, aInputs, aOutputs, null, aChances, aFluidInputs, aFluidOutputs, aDuration, aEUtick, aSpecial); return true; } @@ -551,7 +551,7 @@ public class GregtechRecipeAdder implements IGregtech_RecipeAdder { Logger.INFO("Fluid Outputs: "+ItemUtils.getArrayStackNames(aFluidOutputs)); return false; } - Recipe_GT.Gregtech_Recipe_Map.sMultiblockElectrolyzerRecipes.addRecipe(true, aInputs, aOutputs, null, aChances, aFluidInputs, aFluidOutputs, aDuration, aEUtick, aSpecial); + GTPP_Recipe.GTPP_Recipe_Map.sMultiblockElectrolyzerRecipes.addRecipe(true, aInputs, aOutputs, null, aChances, aFluidInputs, aFluidOutputs, aDuration, aEUtick, aSpecial); return true; } @@ -569,7 +569,7 @@ public class GregtechRecipeAdder implements IGregtech_RecipeAdder { Logger.INFO("Fluid Outputs: "+ItemUtils.getArrayStackNames(aFluidOutputs)); return false; } - if (Recipe_GT.Gregtech_Recipe_Map.sAdvFreezerRecipes.addRecipe(true, aInputs, aOutputs, null, aChances, aFluidInputs, aFluidOutputs, aDuration, aEUtick, aSpecial) != null) { + if (GTPP_Recipe.GTPP_Recipe_Map.sAdvFreezerRecipes.addRecipe(true, aInputs, aOutputs, null, aChances, aFluidInputs, aFluidOutputs, aDuration, aEUtick, aSpecial) != null) { return true; } return false; @@ -895,7 +895,7 @@ public class GregtechRecipeAdder implements IGregtech_RecipeAdder { if (aCircuit < 0 || aCircuit > 24) { aCircuit = 22; } - GT_Recipe aSpecialRecipe = new Recipe_GT( + GT_Recipe aSpecialRecipe = new GTPP_Recipe( false, new ItemStack[] {input1, input2}, new ItemStack[] {output, output2}, @@ -1048,7 +1048,7 @@ public class GregtechRecipeAdder implements IGregtech_RecipeAdder { if (aInputStackA == null || aInputStackB == null || plasma == null || aFusionDurationInTicks < 1 || aEu < 1 || aSpecial < 1) { return false; } - Recipe_GT aFusionCustom = new Recipe_GT( + GTPP_Recipe aFusionCustom = new GTPP_Recipe( true, null, null, @@ -1102,7 +1102,7 @@ public class GregtechRecipeAdder implements IGregtech_RecipeAdder { if (aInputStackA == null || aInputStackB == null || plasma == null || aFusionDurationInTicks < 1 || aEu < 1 || aSpecial < 1) { return false; } - Recipe_GT aFusionCustom = new Recipe_GT( + GTPP_Recipe aFusionCustom = new GTPP_Recipe( true, new ItemStack[]{aInputStackA, aInputStackB}, null, @@ -1146,7 +1146,7 @@ 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) { - Recipe_GT aSpecialRecipe = new Recipe_GT( + GTPP_Recipe aSpecialRecipe = new GTPP_Recipe( false, aInputs, aOutputs, @@ -1158,10 +1158,10 @@ public class GregtechRecipeAdder implements IGregtech_RecipeAdder { aEUt, aLevel); - int aSize = Recipe_GT.Gregtech_Recipe_Map.sVacuumFurnaceRecipes.mRecipeList.size(); + int aSize = GTPP_Recipe.GTPP_Recipe_Map.sVacuumFurnaceRecipes.mRecipeList.size(); int aSize2 = aSize; - Recipe_GT.Gregtech_Recipe_Map.sVacuumFurnaceRecipes.addRecipe(aSpecialRecipe); - aSize = Recipe_GT.Gregtech_Recipe_Map.sVacuumFurnaceRecipes.mRecipeList.size(); + GTPP_Recipe.GTPP_Recipe_Map.sVacuumFurnaceRecipes.addRecipe(aSpecialRecipe); + aSize = GTPP_Recipe.GTPP_Recipe_Map.sVacuumFurnaceRecipes.mRecipeList.size(); return aSize > aSize2; } else { return false; @@ -1171,7 +1171,7 @@ public class GregtechRecipeAdder implements IGregtech_RecipeAdder { @Override public boolean addUvLaserRecipe(ItemStack aInput1, ItemStack aInput2, ItemStack aOutput, int time, long eu) { // Generate Special Laser Recipe - GT_Recipe u = new Recipe_GT( + GT_Recipe u = new GTPP_Recipe( false, new ItemStack[] { aInput1, @@ -1215,7 +1215,7 @@ public class GregtechRecipeAdder implements IGregtech_RecipeAdder { } - Recipe_GT aSpecialRecipe = new Recipe_GT( + GTPP_Recipe aSpecialRecipe = new GTPP_Recipe( false, aInputs, aOutputs, @@ -1227,16 +1227,16 @@ public class GregtechRecipeAdder implements IGregtech_RecipeAdder { (int) eu, aTier); - int aSize = Recipe_GT.Gregtech_Recipe_Map.sChemicalPlantRecipes.mRecipeList.size(); + int aSize = GTPP_Recipe.GTPP_Recipe_Map.sChemicalPlantRecipes.mRecipeList.size(); int aSize2 = aSize; - Recipe_GT.Gregtech_Recipe_Map.sChemicalPlantRecipes.add(aSpecialRecipe); - aSize = Recipe_GT.Gregtech_Recipe_Map.sChemicalPlantRecipes.mRecipeList.size(); + GTPP_Recipe.GTPP_Recipe_Map.sChemicalPlantRecipes.add(aSpecialRecipe); + aSize = GTPP_Recipe.GTPP_Recipe_Map.sChemicalPlantRecipes.mRecipeList.size(); return aSize > aSize2; } @Override public boolean addBlastRecipe(ItemStack[] aInputs, FluidStack[] aInputFluids, ItemStack[] aOutputs, FluidStack[] aFluidOutputs, int time, long eu, int aHeat) { - Recipe_GT aSpecialRecipe = new Recipe_GT( + GTPP_Recipe aSpecialRecipe = new GTPP_Recipe( false, aInputs, aOutputs, @@ -1391,11 +1391,11 @@ public class GregtechRecipeAdder implements IGregtech_RecipeAdder { ItemStack[][] aOutputArray = new ItemStack[][] {aOutputsOre1, aOutputsOre2, aOutputsCrushed1, aOutputsCrushed2}; int[] aTime = new int[] {6000, 7500, 7500, 9000}; - int aSize = Recipe_GT.Gregtech_Recipe_Map.sOreMillRecipes.mRecipeList.size(); + int aSize = GTPP_Recipe.GTPP_Recipe_Map.sOreMillRecipes.mRecipeList.size(); int aSize2 = aSize; for (int i=0;i<4;i++) { - Recipe_GT aOreRecipe = new Recipe_GT( + GTPP_Recipe aOreRecipe = new GTPP_Recipe( false, aInputArray[i], aOutputArray[i], @@ -1406,10 +1406,10 @@ public class GregtechRecipeAdder implements IGregtech_RecipeAdder { aTime[i], aEU, 0); - Recipe_GT.Gregtech_Recipe_Map.sOreMillRecipes.add(aOreRecipe); + GTPP_Recipe.GTPP_Recipe_Map.sOreMillRecipes.add(aOreRecipe); } - aSize = Recipe_GT.Gregtech_Recipe_Map.sOreMillRecipes.mRecipeList.size(); + aSize = GTPP_Recipe.GTPP_Recipe_Map.sOreMillRecipes.mRecipeList.size(); return aSize > aSize2; } @@ -1424,10 +1424,10 @@ public class GregtechRecipeAdder implements IGregtech_RecipeAdder { FlotationRecipeHandler.registerOreType(aMat); int aSpecialValue = FlotationRecipeHandler.getHashForMaterial(aMat); - int aSize = Recipe_GT.Gregtech_Recipe_Map.sFlotationCellRecipes.mRecipeList.size(); + int aSize = GTPP_Recipe.GTPP_Recipe_Map.sFlotationCellRecipes.mRecipeList.size(); int aSize2 = aSize; - GT_Recipe aRecipe = new Recipe_GT( + GT_Recipe aRecipe = new GTPP_Recipe( false, new ItemStack[] { ItemUtils.getSimpleStack(aXanthate, 32), @@ -1447,8 +1447,8 @@ public class GregtechRecipeAdder implements IGregtech_RecipeAdder { aEU, aSpecialValue); - Recipe_GT.Gregtech_Recipe_Map.sFlotationCellRecipes.add(aRecipe); - aSize = Recipe_GT.Gregtech_Recipe_Map.sFlotationCellRecipes.mRecipeList.size(); + GTPP_Recipe.GTPP_Recipe_Map.sFlotationCellRecipes.add(aRecipe); + aSize = GTPP_Recipe.GTPP_Recipe_Map.sFlotationCellRecipes.mRecipeList.size(); return aSize > aSize2; } diff --git a/src/Java/gtPlusPlus/xmod/gregtech/recipes/RecipesToRemove.java b/src/Java/gtPlusPlus/xmod/gregtech/recipes/RecipesToRemove.java index 35714aee26..f36d714a03 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/recipes/RecipesToRemove.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/recipes/RecipesToRemove.java @@ -1,7 +1,7 @@ package gtPlusPlus.xmod.gregtech.recipes; import gregtech.api.util.GT_Recipe; -import gregtech.api.util.Recipe_GT; +import gregtech.api.util.GTPP_Recipe; import gtPlusPlus.api.objects.Logger; import gtPlusPlus.core.material.Material; import gtPlusPlus.core.material.ORES; @@ -23,8 +23,8 @@ public class RecipesToRemove { aRareEarthCentrifuging.mEnabled = false; aRareEarthCentrifuging.mHidden = true; GT_Recipe.GT_Recipe_Map.sCentrifugeRecipes.mRecipeList.remove(aRareEarthCentrifuging); - Recipe_GT.GT_Recipe_Map_LargeCentrifuge.sMultiblockCentrifugeRecipes.mRecipeList.remove(aRareEarthCentrifuging); - Recipe_GT.GT_Recipe_Map_LargeCentrifuge.sMultiblockCentrifugeRecipes_GT.mRecipeList.remove(aRareEarthCentrifuging); + GTPP_Recipe.GT_Recipe_Map_LargeCentrifuge.sMultiblockCentrifugeRecipes.mRecipeList.remove(aRareEarthCentrifuging); + GTPP_Recipe.GT_Recipe_Map_LargeCentrifuge.sMultiblockCentrifugeRecipes_GT.mRecipeList.remove(aRareEarthCentrifuging); Logger.INFO("Removed vanilla GT Rare Earth processing."); //Set the Chemical Symbol for Rare Earth now that we are giving it custom outputs //Best not to set this unless the original recipe is removed. diff --git a/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechAdvancedMixer.java b/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechAdvancedMixer.java index e34f480b0e..3cefaa1bf7 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechAdvancedMixer.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechAdvancedMixer.java @@ -6,7 +6,7 @@ import gregtech.api.enums.ItemList; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicMachine_GT_Recipe; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Recipe.GT_Recipe_Map; -import gregtech.api.util.Recipe_GT; +import gregtech.api.util.GTPP_Recipe; import gtPlusPlus.api.objects.Logger; import gtPlusPlus.core.lib.CORE; @@ -24,16 +24,16 @@ public class GregtechAdvancedMixer { private static GT_Recipe_Map map = GT_Recipe.GT_Recipe_Map.sMixerRecipes; private static boolean generateMixerRecipeMap(){ - if (Recipe_GT.Gregtech_Recipe_Map.sAdvancedMixerRecipes.mRecipeList.size() == 0){ + if (GTPP_Recipe.GTPP_Recipe_Map.sAdvancedMixerRecipes.mRecipeList.size() == 0){ GT_Recipe_Map oldMap = GT_Recipe.GT_Recipe_Map.sMixerRecipes; - GT_Recipe_Map map = Recipe_GT.Gregtech_Recipe_Map.sAdvancedMixerRecipes; + GT_Recipe_Map map = GTPP_Recipe.GTPP_Recipe_Map.sAdvancedMixerRecipes; final Collection x = oldMap.mRecipeList; //Logger.INFO("Generating " + map.mUnlocalizedName + " Recipes."); for (final GT_Recipe g : x) { - Recipe_GT.Gregtech_Recipe_Map.sAdvancedMixerRecipes.add(g); + GTPP_Recipe.GTPP_Recipe_Map.sAdvancedMixerRecipes.add(g); } - if (Recipe_GT.Gregtech_Recipe_Map.sAdvancedMixerRecipes.mRecipeList.size() > 0){ + if (GTPP_Recipe.GTPP_Recipe_Map.sAdvancedMixerRecipes.mRecipeList.size() > 0){ return true; } else { diff --git a/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechComponentAssembler.java b/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechComponentAssembler.java index 5d2f5b414d..73d29b2174 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechComponentAssembler.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechComponentAssembler.java @@ -9,7 +9,7 @@ import net.minecraft.item.ItemStack; import gregtech.api.enums.*; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicMachine_GT_Recipe; -import gregtech.api.util.Recipe_GT; +import gregtech.api.util.GTPP_Recipe; import gtPlusPlus.api.objects.Logger; import gtPlusPlus.core.lib.CORE; @@ -33,7 +33,7 @@ public class GregtechComponentAssembler { GregtechItemList.Machine_LV_Component_Maker.set(new GT_MetaTileEntity_BasicMachine_GT_Recipe(985, "basicmachine.componentmaker.tier.01", "Basic Component Maker", 1, "Components, Unite!", - Recipe_GT.Gregtech_Recipe_Map.sComponentAssemblerRecipes, 6, 1, 16000, 0, 1, "Assembler.png", "", false, + GTPP_Recipe.GTPP_Recipe_Map.sComponentAssemblerRecipes, 6, 1, 16000, 0, 1, "Assembler.png", "", false, false, 0, "ASSEMBLER", new Object[] { "ACA", "VMV", "WCW", 'M', GT_MetaTileEntity_BasicMachine_GT_Recipe.X.HULL, 'V', GT_MetaTileEntity_BasicMachine_GT_Recipe.X.ROBOT_ARM, 'A', @@ -42,7 +42,7 @@ public class GregtechComponentAssembler { GT_MetaTileEntity_BasicMachine_GT_Recipe.X.WIRE4 }).getStackForm(1L)); GregtechItemList.Machine_MV_Component_Maker.set(new GT_MetaTileEntity_BasicMachine_GT_Recipe(986, "basicmachine.componentmaker.tier.02", "Advanced Component Maker", 2, "Components, Unite!", - Recipe_GT.Gregtech_Recipe_Map.sComponentAssemblerRecipes, 6, 1, 16000, 0, 1, "Assembler.png", "", false, + GTPP_Recipe.GTPP_Recipe_Map.sComponentAssemblerRecipes, 6, 1, 16000, 0, 1, "Assembler.png", "", false, false, 0, "ASSEMBLER", new Object[] { "ACA", "VMV", "WCW", 'M', GT_MetaTileEntity_BasicMachine_GT_Recipe.X.HULL, 'V', GT_MetaTileEntity_BasicMachine_GT_Recipe.X.ROBOT_ARM, 'A', @@ -51,7 +51,7 @@ public class GregtechComponentAssembler { GT_MetaTileEntity_BasicMachine_GT_Recipe.X.WIRE4 }).getStackForm(1L)); GregtechItemList.Machine_HV_Component_Maker.set(new GT_MetaTileEntity_BasicMachine_GT_Recipe(987, "basicmachine.componentmaker.tier.03", "Advanced Component Maker II", 3, "Components, Unite!", - Recipe_GT.Gregtech_Recipe_Map.sComponentAssemblerRecipes, 6, 1, 16000, 0, 1, "Assembler.png", "", false, + GTPP_Recipe.GTPP_Recipe_Map.sComponentAssemblerRecipes, 6, 1, 16000, 0, 1, "Assembler.png", "", false, false, 0, "ASSEMBLER", new Object[] { "ACA", "VMV", "WCW", 'M', GT_MetaTileEntity_BasicMachine_GT_Recipe.X.HULL, 'V', GT_MetaTileEntity_BasicMachine_GT_Recipe.X.ROBOT_ARM, 'A', @@ -60,7 +60,7 @@ public class GregtechComponentAssembler { GT_MetaTileEntity_BasicMachine_GT_Recipe.X.WIRE4 }).getStackForm(1L)); GregtechItemList.Machine_EV_Component_Maker.set(new GT_MetaTileEntity_BasicMachine_GT_Recipe(988, "basicmachine.componentmaker.tier.04", "Advanced Component Maker III", 4, "Components, Unite!", - Recipe_GT.Gregtech_Recipe_Map.sComponentAssemblerRecipes, 6, 1, 16000, 0, 1, "Assembler.png", "", false, + GTPP_Recipe.GTPP_Recipe_Map.sComponentAssemblerRecipes, 6, 1, 16000, 0, 1, "Assembler.png", "", false, false, 0, "ASSEMBLER", new Object[] { "ACA", "VMV", "WCW", 'M', GT_MetaTileEntity_BasicMachine_GT_Recipe.X.HULL, 'V', GT_MetaTileEntity_BasicMachine_GT_Recipe.X.ROBOT_ARM, 'A', @@ -69,7 +69,7 @@ public class GregtechComponentAssembler { GT_MetaTileEntity_BasicMachine_GT_Recipe.X.WIRE4 }).getStackForm(1L)); GregtechItemList.Machine_IV_Component_Maker.set(new GT_MetaTileEntity_BasicMachine_GT_Recipe(989, "basicmachine.componentmaker.tier.05", "Advanced Component Maker IV", 5, "Components, Unite!", - Recipe_GT.Gregtech_Recipe_Map.sComponentAssemblerRecipes, 6, 1, 16000, 0, 1, "Assembler.png", "", false, + GTPP_Recipe.GTPP_Recipe_Map.sComponentAssemblerRecipes, 6, 1, 16000, 0, 1, "Assembler.png", "", false, false, 0, "ASSEMBLER", new Object[] { "ACA", "VMV", "WCW", 'M', GT_MetaTileEntity_BasicMachine_GT_Recipe.X.HULL, 'V', GT_MetaTileEntity_BasicMachine_GT_Recipe.X.ROBOT_ARM, 'A', @@ -78,7 +78,7 @@ public class GregtechComponentAssembler { GT_MetaTileEntity_BasicMachine_GT_Recipe.X.WIRE4 }).getStackForm(1L)); GregtechItemList.Machine_LuV_Component_Maker.set(new GT_MetaTileEntity_BasicMachine_GT_Recipe(31012, "basicmachine.componentmaker.tier.06", "Advanced Component Maker V", 6, "Components, Unite!", - Recipe_GT.Gregtech_Recipe_Map.sComponentAssemblerRecipes, 6, 1, 24000, 0, 1, "Assembler.png", "", false, + GTPP_Recipe.GTPP_Recipe_Map.sComponentAssemblerRecipes, 6, 1, 24000, 0, 1, "Assembler.png", "", false, false, 0, "ASSEMBLER", new Object[] { "ACA", "VMV", "WCW", 'M', GT_MetaTileEntity_BasicMachine_GT_Recipe.X.HULL, 'V', GT_MetaTileEntity_BasicMachine_GT_Recipe.X.ROBOT_ARM, 'A', @@ -87,7 +87,7 @@ public class GregtechComponentAssembler { GT_MetaTileEntity_BasicMachine_GT_Recipe.X.WIRE4 }).getStackForm(1L)); GregtechItemList.Machine_ZPM_Component_Maker.set(new GT_MetaTileEntity_BasicMachine_GT_Recipe(31013, "basicmachine.componentmaker.tier.07", "Advanced Component Maker VI", 7, "Components, Unite!", - Recipe_GT.Gregtech_Recipe_Map.sComponentAssemblerRecipes, 6, 1, 32000, 0, 1, "Assembler.png", "", false, + GTPP_Recipe.GTPP_Recipe_Map.sComponentAssemblerRecipes, 6, 1, 32000, 0, 1, "Assembler.png", "", false, false, 0, "ASSEMBLER", new Object[] { "ACA", "VMV", "WCW", 'M', GT_MetaTileEntity_BasicMachine_GT_Recipe.X.HULL, 'V', GT_MetaTileEntity_BasicMachine_GT_Recipe.X.ROBOT_ARM, 'A', @@ -96,7 +96,7 @@ public class GregtechComponentAssembler { GT_MetaTileEntity_BasicMachine_GT_Recipe.X.WIRE4 }).getStackForm(1L)); GregtechItemList.Machine_UV_Component_Maker.set(new GT_MetaTileEntity_BasicMachine_GT_Recipe(31014, "basicmachine.componentmaker.tier.08", "Advanced Component Maker VII", 8, "Components, Unite!", - Recipe_GT.Gregtech_Recipe_Map.sComponentAssemblerRecipes, 6, 1, 48000, 0, 1, "Assembler.png", "", false, + GTPP_Recipe.GTPP_Recipe_Map.sComponentAssemblerRecipes, 6, 1, 48000, 0, 1, "Assembler.png", "", false, false, 0, "ASSEMBLER", new Object[] { "ACA", "VMV", "WCW", 'M', GT_MetaTileEntity_BasicMachine_GT_Recipe.X.HULL, 'V', GT_MetaTileEntity_BasicMachine_GT_Recipe.X.ROBOT_ARM, 'A', diff --git a/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechDehydrator.java b/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechDehydrator.java index eecbde9804..5f6f557b11 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechDehydrator.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechDehydrator.java @@ -5,7 +5,7 @@ import net.minecraft.item.ItemStack; import gregtech.api.enums.*; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicMachine_GT_Recipe; import gregtech.api.util.GT_ModHandler; -import gregtech.api.util.Recipe_GT; +import gregtech.api.util.GTPP_Recipe; import gtPlusPlus.api.objects.Logger; import gtPlusPlus.core.lib.CORE; @@ -46,34 +46,34 @@ public class GregtechDehydrator { GregtechItemList.GT_Dehydrator_MV .set(new GT_MetaTileEntity_BasicMachine_GT_Recipe(911, "machine.dehydrator.tier.00", "Basic Dehydrator I", 2, "This dehydrates your Grapes into Raisins. ", - Recipe_GT.Gregtech_Recipe_Map.sChemicalDehydratorRecipes, 2, 9, 16000, 2, 5, "Dehydrator.png", + GTPP_Recipe.GTPP_Recipe_Map.sChemicalDehydratorRecipes, 2, 9, 16000, 2, 5, "Dehydrator.png", "", false, false, 0, "UNBOXINATOR", null).getStackForm(1L)); GregtechItemList.GT_Dehydrator_HV .set(new GT_MetaTileEntity_BasicMachine_GT_Recipe(912, "machine.dehydrator.tier.01", "Basic Dehydrator II", 3, "This dehydrates your Grapes into Raisins. ", - Recipe_GT.Gregtech_Recipe_Map.sChemicalDehydratorRecipes, 2, 9, 32000, 2, 5, "Dehydrator.png", + GTPP_Recipe.GTPP_Recipe_Map.sChemicalDehydratorRecipes, 2, 9, 32000, 2, 5, "Dehydrator.png", "", false, false, 0, "UNBOXINATOR", null).getStackForm(1L)); //Chemical GregtechItemList.GT_Dehydrator_EV .set(new GT_MetaTileEntity_BasicMachine_GT_Recipe(813, "advancedmachine.dehydrator.tier.01", "Chemical Dehydrator I", 4, "This dehydrates your Grapes into Raisins. ", - Recipe_GT.Gregtech_Recipe_Map.sChemicalDehydratorRecipes, 2, 9, 48000, 2, 5, "Dehydrator.png", + GTPP_Recipe.GTPP_Recipe_Map.sChemicalDehydratorRecipes, 2, 9, 48000, 2, 5, "Dehydrator.png", "", false, false, 0, "UNBOXINATOR", null).getStackForm(1L)); GregtechItemList.GT_Dehydrator_IV.set(new GT_MetaTileEntity_BasicMachine_GT_Recipe(814, "advancedmachine.dehydrator.tier.02", "Chemical Dehydrator II", 5, "A hangover is the way your body reacts to dehydration. ", - Recipe_GT.Gregtech_Recipe_Map.sChemicalDehydratorRecipes, 2, 9, 64000, 2, 5, "Dehydrator.png", "", + GTPP_Recipe.GTPP_Recipe_Map.sChemicalDehydratorRecipes, 2, 9, 64000, 2, 5, "Dehydrator.png", "", false, false, 0, "UNBOXINATOR", null).getStackForm(1L)); GregtechItemList.GT_Dehydrator_LuV.set(new GT_MetaTileEntity_BasicMachine_GT_Recipe(815, "advancedmachine.dehydrator.tier.03", "Chemical Dehydrator III", 6, "You could probably make space icecream with this.. ", - Recipe_GT.Gregtech_Recipe_Map.sChemicalDehydratorRecipes, 2, 9, 64000, 2, 5, "Dehydrator.png", "", + GTPP_Recipe.GTPP_Recipe_Map.sChemicalDehydratorRecipes, 2, 9, 64000, 2, 5, "Dehydrator.png", "", false, false, 0, "UNBOXINATOR", null).getStackForm(1L)); GregtechItemList.GT_Dehydrator_ZPM.set(new GT_MetaTileEntity_BasicMachine_GT_Recipe(816, "advancedmachine.dehydrator.tier.04", "Chemical Dehydrator IV", 7, "You can definitely make space icecream with this.. ", - Recipe_GT.Gregtech_Recipe_Map.sChemicalDehydratorRecipes, 2, 9, 64000, 2, 5, "Dehydrator.png", "", + GTPP_Recipe.GTPP_Recipe_Map.sChemicalDehydratorRecipes, 2, 9, 64000, 2, 5, "Dehydrator.png", "", false, false, 0, "UNBOXINATOR", null).getStackForm(1L)); //Advanced diff --git a/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialMassFabricator.java b/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialMassFabricator.java index 6362b07b93..f07be17ffd 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialMassFabricator.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialMassFabricator.java @@ -3,7 +3,7 @@ package gtPlusPlus.xmod.gregtech.registration.gregtech; import gregtech.api.enums.GT_Values; import gregtech.api.enums.Materials; import gregtech.api.util.GT_Recipe; -import gregtech.api.util.Recipe_GT; +import gregtech.api.util.GTPP_Recipe; import gtPlusPlus.api.objects.Logger; import gtPlusPlus.core.lib.CORE; import gtPlusPlus.core.recipe.common.CI; @@ -39,7 +39,7 @@ public class GregtechIndustrialMassFabricator { //Basic UUA1 - GT_Recipe UUA_From_Scrap = new Recipe_GT( + GT_Recipe UUA_From_Scrap = new GTPP_Recipe( false, new ItemStack[] {CI.getNumberedCircuit(9), ItemUtils.getSimpleStack(getScrapPile(), 9)}, new ItemStack[] {GT_Values.NI}, @@ -50,7 +50,7 @@ public class GregtechIndustrialMassFabricator { 32, 0); //Basic UUA2 - GT_Recipe UUA_From_ScrapBoxes = new Recipe_GT( + GT_Recipe UUA_From_ScrapBoxes = new GTPP_Recipe( false, new ItemStack[] {CI.getNumberedCircuit(19), ItemUtils.getSimpleStack(getScrapBox(), 1)}, new ItemStack[] {GT_Values.NI}, @@ -61,12 +61,12 @@ public class GregtechIndustrialMassFabricator { 32, 0); - Recipe_GT.Gregtech_Recipe_Map.sMatterFab2Recipes.add(UUA_From_Scrap); - Recipe_GT.Gregtech_Recipe_Map.sMatterFab2Recipes.add(UUA_From_ScrapBoxes); + GTPP_Recipe.GTPP_Recipe_Map.sMatterFab2Recipes.add(UUA_From_Scrap); + GTPP_Recipe.GTPP_Recipe_Map.sMatterFab2Recipes.add(UUA_From_ScrapBoxes); if (!CORE.MAIN_GREGTECH_5U_EXPERIMENTAL_FORK) { //Basic UUM - GT_Recipe generateUUM = new Recipe_GT( + GT_Recipe generateUUM = new GTPP_Recipe( false, new ItemStack[] {CI.getNumberedCircuit(1)}, new ItemStack[] {GT_Values.NI}, @@ -78,7 +78,7 @@ public class GregtechIndustrialMassFabricator { 0); //Basic UUM - GT_Recipe generateUUMFromUUA = new Recipe_GT( + GT_Recipe generateUUMFromUUA = new GTPP_Recipe( false, new ItemStack[] {CI.getNumberedCircuit(2)}, new ItemStack[] {GT_Values.NI}, @@ -89,13 +89,13 @@ public class GregtechIndustrialMassFabricator { 32, 0); - Recipe_GT.Gregtech_Recipe_Map.sMatterFab2Recipes.add(generateUUM); - Recipe_GT.Gregtech_Recipe_Map.sMatterFab2Recipes.add(generateUUMFromUUA); + GTPP_Recipe.GTPP_Recipe_Map.sMatterFab2Recipes.add(generateUUM); + GTPP_Recipe.GTPP_Recipe_Map.sMatterFab2Recipes.add(generateUUMFromUUA); } else { //Basic UUM - GT_Recipe generateUUM_LV = new Recipe_GT( + GT_Recipe generateUUM_LV = new GTPP_Recipe( false, new ItemStack[] {CI.getNumberedCircuit(15)}, new ItemStack[] {GT_Values.NI}, @@ -105,7 +105,7 @@ public class GregtechIndustrialMassFabricator { 160*20, 256, 0); - GT_Recipe generateUUM_MV = new Recipe_GT( + GT_Recipe generateUUM_MV = new GTPP_Recipe( false, new ItemStack[] {CI.getNumberedCircuit(14)}, new ItemStack[] {GT_Values.NI}, @@ -115,7 +115,7 @@ public class GregtechIndustrialMassFabricator { 160*20, 512, 0); - GT_Recipe generateUUM_HV = new Recipe_GT( + GT_Recipe generateUUM_HV = new GTPP_Recipe( false, new ItemStack[] {CI.getNumberedCircuit(13)}, new ItemStack[] {GT_Values.NI}, @@ -125,7 +125,7 @@ public class GregtechIndustrialMassFabricator { 160*20, 1024, 0); - GT_Recipe generateUUM_EV = new Recipe_GT( + GT_Recipe generateUUM_EV = new GTPP_Recipe( false, new ItemStack[] {CI.getNumberedCircuit(12)}, new ItemStack[] {GT_Values.NI}, @@ -135,7 +135,7 @@ public class GregtechIndustrialMassFabricator { 160*20, 2048, 0); - GT_Recipe generateUUM_IV = new Recipe_GT( + GT_Recipe generateUUM_IV = new GTPP_Recipe( false, new ItemStack[] {CI.getNumberedCircuit(11)}, new ItemStack[] {GT_Values.NI}, @@ -147,7 +147,7 @@ public class GregtechIndustrialMassFabricator { 0); //Basic UUM - GT_Recipe generateUUMFromUUA_LV = new Recipe_GT( + GT_Recipe generateUUMFromUUA_LV = new GTPP_Recipe( false, new ItemStack[] {CI.getNumberedCircuit(5)}, new ItemStack[] {GT_Values.NI}, @@ -157,7 +157,7 @@ public class GregtechIndustrialMassFabricator { 40*20, 256, 0); - GT_Recipe generateUUMFromUUA_MV = new Recipe_GT( + GT_Recipe generateUUMFromUUA_MV = new GTPP_Recipe( false, new ItemStack[] {CI.getNumberedCircuit(4)}, new ItemStack[] {GT_Values.NI}, @@ -167,7 +167,7 @@ public class GregtechIndustrialMassFabricator { 40*20, 512, 0); - GT_Recipe generateUUMFromUUA_HV = new Recipe_GT( + GT_Recipe generateUUMFromUUA_HV = new GTPP_Recipe( false, new ItemStack[] {CI.getNumberedCircuit(3)}, new ItemStack[] {GT_Values.NI}, @@ -177,7 +177,7 @@ public class GregtechIndustrialMassFabricator { 40*20, 1024, 0); - GT_Recipe generateUUMFromUUA_EV = new Recipe_GT( + GT_Recipe generateUUMFromUUA_EV = new GTPP_Recipe( false, new ItemStack[] {CI.getNumberedCircuit(2)}, new ItemStack[] {GT_Values.NI}, @@ -187,7 +187,7 @@ public class GregtechIndustrialMassFabricator { 40*20, 2048, 0); - GT_Recipe generateUUMFromUUA_IV = new Recipe_GT( + GT_Recipe generateUUMFromUUA_IV = new GTPP_Recipe( false, new ItemStack[] {CI.getNumberedCircuit(1)}, new ItemStack[] {GT_Values.NI}, @@ -198,20 +198,20 @@ public class GregtechIndustrialMassFabricator { 4096, 0); - Recipe_GT.Gregtech_Recipe_Map.sMatterFab2Recipes.add(generateUUM_LV); - Recipe_GT.Gregtech_Recipe_Map.sMatterFab2Recipes.add(generateUUM_MV); - Recipe_GT.Gregtech_Recipe_Map.sMatterFab2Recipes.add(generateUUM_HV); - Recipe_GT.Gregtech_Recipe_Map.sMatterFab2Recipes.add(generateUUM_EV); - Recipe_GT.Gregtech_Recipe_Map.sMatterFab2Recipes.add(generateUUM_IV); - Recipe_GT.Gregtech_Recipe_Map.sMatterFab2Recipes.add(generateUUMFromUUA_LV); - Recipe_GT.Gregtech_Recipe_Map.sMatterFab2Recipes.add(generateUUMFromUUA_MV); - Recipe_GT.Gregtech_Recipe_Map.sMatterFab2Recipes.add(generateUUMFromUUA_HV); - Recipe_GT.Gregtech_Recipe_Map.sMatterFab2Recipes.add(generateUUMFromUUA_EV); - Recipe_GT.Gregtech_Recipe_Map.sMatterFab2Recipes.add(generateUUMFromUUA_IV); + GTPP_Recipe.GTPP_Recipe_Map.sMatterFab2Recipes.add(generateUUM_LV); + GTPP_Recipe.GTPP_Recipe_Map.sMatterFab2Recipes.add(generateUUM_MV); + GTPP_Recipe.GTPP_Recipe_Map.sMatterFab2Recipes.add(generateUUM_HV); + GTPP_Recipe.GTPP_Recipe_Map.sMatterFab2Recipes.add(generateUUM_EV); + GTPP_Recipe.GTPP_Recipe_Map.sMatterFab2Recipes.add(generateUUM_IV); + GTPP_Recipe.GTPP_Recipe_Map.sMatterFab2Recipes.add(generateUUMFromUUA_LV); + GTPP_Recipe.GTPP_Recipe_Map.sMatterFab2Recipes.add(generateUUMFromUUA_MV); + GTPP_Recipe.GTPP_Recipe_Map.sMatterFab2Recipes.add(generateUUMFromUUA_HV); + GTPP_Recipe.GTPP_Recipe_Map.sMatterFab2Recipes.add(generateUUMFromUUA_EV); + GTPP_Recipe.GTPP_Recipe_Map.sMatterFab2Recipes.add(generateUUMFromUUA_IV); } - Logger.INFO("Generated "+Recipe_GT.Gregtech_Recipe_Map.sMatterFab2Recipes.mRecipeList.size()+" Matter Fabricator recipes."); + Logger.INFO("Generated "+GTPP_Recipe.GTPP_Recipe_Map.sMatterFab2Recipes.mRecipeList.size()+" Matter Fabricator recipes."); diff --git a/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechMiniRaFusion.java b/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechMiniRaFusion.java index 30835b6daa..fe69ad33e0 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechMiniRaFusion.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechMiniRaFusion.java @@ -1,7 +1,7 @@ package gtPlusPlus.xmod.gregtech.registration.gregtech; import gregtech.api.util.GT_Recipe; -import gregtech.api.util.Recipe_GT; +import gregtech.api.util.GTPP_Recipe; import gtPlusPlus.api.objects.Logger; import gtPlusPlus.xmod.gregtech.api.enums.GregtechItemList; import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Plasma; @@ -28,10 +28,10 @@ public class GregtechMiniRaFusion { } y.mEUt = (int) Math.min(Math.max(0, z), Integer.MAX_VALUE); y.mCanBeBuffered = true; - Recipe_GT.Gregtech_Recipe_Map.sSlowFusionRecipes.add(y); + GTPP_Recipe.GTPP_Recipe_Map.sSlowFusionRecipes.add(y); } } - int mRecipeCount = Recipe_GT.Gregtech_Recipe_Map.sSlowFusionRecipes.mRecipeList.size(); + int mRecipeCount = GTPP_Recipe.GTPP_Recipe_Map.sSlowFusionRecipes.mRecipeList.size(); if (mRecipeCount > 0) { Logger.INFO("[Pocket Fusion] Generated "+mRecipeCount+" recipes for the Pocket Fusion Reactor."); return true; diff --git a/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechSimpleWasher.java b/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechSimpleWasher.java index deb31c8c95..1d4fa84782 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechSimpleWasher.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechSimpleWasher.java @@ -5,7 +5,7 @@ import net.minecraft.item.ItemStack; import gregtech.api.enums.Materials; import gregtech.api.enums.OrePrefixes; import gregtech.api.util.GT_OreDictUnificator; -import gregtech.api.util.Recipe_GT; +import gregtech.api.util.GTPP_Recipe; import gtPlusPlus.core.lib.CORE; import gtPlusPlus.core.util.minecraft.FluidUtils; @@ -49,20 +49,20 @@ public class GregtechSimpleWasher { dustClean = GT_OreDictUnificator.get(OrePrefixes.dust, v, 1L); dustDirty = GT_OreDictUnificator.get(OrePrefixes.dustImpure, v, 1L); if (dustClean != null && dustDirty != null) { - Recipe_GT.Gregtech_Recipe_Map.sSimpleWasherRecipes.addRecipe(false, new ItemStack[] { dustDirty }, + GTPP_Recipe.GTPP_Recipe_Map.sSimpleWasherRecipes.addRecipe(false, new ItemStack[] { dustDirty }, new ItemStack[] { dustClean }, null, new FluidStack[] { FluidUtils.getFluidStack("water", 100) }, null, 5, 8, 0); } } - if (Recipe_GT.Gregtech_Recipe_Map.sSimpleWasherRecipes.mRecipeList.size() > mRecipeCount){ + if (GTPP_Recipe.GTPP_Recipe_Map.sSimpleWasherRecipes.mRecipeList.size() > mRecipeCount){ return true; } return false; } private static boolean generateDirtyCrushedRecipes(){ - int mRecipeCount = Recipe_GT.Gregtech_Recipe_Map.sSimpleWasherRecipes.mRecipeList.size(); + int mRecipeCount = GTPP_Recipe.GTPP_Recipe_Map.sSimpleWasherRecipes.mRecipeList.size(); // Generate Recipe Map for the Dust Washer. ItemStack crushedClean; ItemStack crushedDirty; @@ -70,13 +70,13 @@ public class GregtechSimpleWasher { crushedClean = GT_OreDictUnificator.get(OrePrefixes.crushedPurified, v, 1L); crushedDirty = GT_OreDictUnificator.get(OrePrefixes.crushed, v, 1L); if (crushedClean != null && crushedDirty != null) { - Recipe_GT.Gregtech_Recipe_Map.sSimpleWasherRecipes.addRecipe(false, new ItemStack[] { crushedDirty }, + GTPP_Recipe.GTPP_Recipe_Map.sSimpleWasherRecipes.addRecipe(false, new ItemStack[] { crushedDirty }, new ItemStack[] { crushedClean }, null, new FluidStack[] { FluidUtils.getFluidStack("water", 100) }, null, 5, 8, 0); } } - if (Recipe_GT.Gregtech_Recipe_Map.sSimpleWasherRecipes.mRecipeList.size() > mRecipeCount){ + if (GTPP_Recipe.GTPP_Recipe_Map.sSimpleWasherRecipes.mRecipeList.size() > mRecipeCount){ return true; } return false; -- cgit From 807c856a641cfba29c2159941f16e3991940e699 Mon Sep 17 00:00:00 2001 From: Alkalus Date: Tue, 14 Apr 2020 20:14:34 +0100 Subject: $ Improved recipe verification greatly. --- src/Java/gregtech/api/util/GTPP_Recipe.java | 66 ++++++++++++++++++++++++++--- src/Java/gtPlusPlus/GTplusplus.java | 4 +- 2 files changed, 62 insertions(+), 8 deletions(-) (limited to 'src/Java/gregtech/api/util') diff --git a/src/Java/gregtech/api/util/GTPP_Recipe.java b/src/Java/gregtech/api/util/GTPP_Recipe.java index 107fa89510..51db590d73 100644 --- a/src/Java/gregtech/api/util/GTPP_Recipe.java +++ b/src/Java/gregtech/api/util/GTPP_Recipe.java @@ -19,6 +19,7 @@ import gtPlusPlus.api.objects.Logger; import gtPlusPlus.api.objects.data.AutoMap; import gtPlusPlus.api.objects.minecraft.NoConflictGTRecipeMap; import gtPlusPlus.core.lib.CORE; +import gtPlusPlus.core.util.data.AES; import gtPlusPlus.core.util.minecraft.ItemUtils; import gtPlusPlus.core.util.minecraft.RecipeUtils; import gtPlusPlus.nei.GT_NEI_MultiBlockHandler; @@ -34,30 +35,84 @@ import net.minecraftforge.fluids.FluidStack; */ public class GTPP_Recipe extends GT_Recipe implements IComparableRecipe { - private final int mRecipeHash; + private final String mRecipeHash; + private final AutoMap mHashMap = new AutoMap(); + private static final AES mEncoder = new AES("RecipeChecking"); public GTPP_Recipe(final boolean aOptimize, final ItemStack[] aInputs, final ItemStack[] aOutputs, final Object aSpecialItems, final int[] aChances, final FluidStack[] aFluidInputs, final FluidStack[] aFluidOutputs, final int aDuration, final int aEUt, final int aSpecialValue) { super(aOptimize, aInputs, aOutputs, aSpecialItems, aChances, aFluidInputs, aFluidOutputs, aDuration, aEUt, aSpecialValue); //Logger.SPECIFIC_WARNING(this.getClass().getName()+" | [GregtechRecipe]", "Created new recipe instance for "+ItemUtils.getArrayStackNames(aInputs), 167); mRecipeHash = getRecipeHash(this); + mHashMap.addAll(convertStringDataToInts(getEncodedRecipeData(this))); } public GTPP_Recipe(final ItemStack aInput1, final ItemStack aOutput1, final int aFuelValue, final int aType) { this(aInput1, aOutput1, null, null, null, aFuelValue, aType); } - public static int getRecipeHash(GT_Recipe aRecipe) { - return aRecipe.hashCode(); + private static AutoMap convertStringDataToInts(AutoMap aData){ + AutoMap aMap = new AutoMap(); + for (String string : aData) { + aMap.add(string.hashCode()); + } + return aMap; + } + + private static AutoMap getEncodedRecipeData(GTPP_Recipe aRecipe){ + AutoMap aData = new AutoMap(); + aData.add(mEncoder.encode(aRecipe.mRecipeHash)); + aData.add(mEncoder.encode(""+aRecipe.mCanBeBuffered)); + aData.add(mEncoder.encode(""+aRecipe.mHidden)); + aData.add(mEncoder.encode(""+aRecipe.mEnabled)); + aData.add(mEncoder.encode(""+aRecipe.mDuration)); + aData.add(mEncoder.encode(""+aRecipe.mEUt)); + aData.add(mEncoder.encode(""+aRecipe.mFakeRecipe)); + aData.add(mEncoder.encode(""+aRecipe.mSpecialItems)); + aData.add(mEncoder.encode(aRecipe.mChances.toString())); + aData.add(mEncoder.encode(aRecipe.mInputs.toString())); + aData.add(mEncoder.encode(aRecipe.mOutputs.toString())); + aData.add(mEncoder.encode(aRecipe.mFluidInputs.toString())); + aData.add(mEncoder.encode(aRecipe.mFluidOutputs.toString())); + return aData; + } + + public static String getRecipeHash(GT_Recipe aRecipe) { + String aEncoderString = mEncoder.encode(aRecipe.toString()); + return aEncoderString; } - public final void checkModified() { + private final void checkModified() { if (hasBeenModified()) { CORE.crash("Someone has edited an internal GT++ recipe, which is no longer allowed. Please complain to whoever has done this, not Alkalus."); } } private final boolean hasBeenModified() { - return mRecipeHash != this.hashCode(); + String aEncoderString = mEncoder.encode(this.toString()); + boolean aBasicHashCheck = mRecipeHash.equals(aEncoderString); + if (!aBasicHashCheck) { + Logger.INFO("This Recipe Hash: "+aEncoderString); + Logger.INFO("Expected Hash Code: "+mRecipeHash); + return true; + } + AutoMap aData = new AutoMap(); + aData.addAll(convertStringDataToInts(getEncodedRecipeData(this))); + long aHashTotal = 0; + long aExpectedHashTotal = 0; + for (int a : aData) { + aHashTotal += a; + } + for (int a : mHashMap) { + aExpectedHashTotal += a; + } + if (aHashTotal != aExpectedHashTotal) { + Logger.INFO("This Recipe Hash: "+aEncoderString); + Logger.INFO("Expected Hash Code: "+mRecipeHash); + Logger.INFO("This Recipe Hash: "+aHashTotal); + Logger.INFO("Expected Hash Code: "+aExpectedHashTotal); + return true; + } + return false; } // aSpecialValue = EU per Liter! If there is no Liquid for this Object, then it gets multiplied with 1000! @@ -162,6 +217,7 @@ public class GTPP_Recipe extends GT_Recipe implements IComparableRecipe { public final static void checkRecipeModifications() { for (GTPP_Recipe aRecipe : GTPP_Recipe_Map_Internal.mHashedRecipes.values()) { + Logger.INFO("Checking recipe: "+aRecipe.hashCode()); aRecipe.checkModified(); } } diff --git a/src/Java/gtPlusPlus/GTplusplus.java b/src/Java/gtPlusPlus/GTplusplus.java index 339c0125fb..1bf67c15fc 100644 --- a/src/Java/gtPlusPlus/GTplusplus.java +++ b/src/Java/gtPlusPlus/GTplusplus.java @@ -19,7 +19,6 @@ import gregtech.api.enums.Materials; import gregtech.api.enums.Textures; import gregtech.api.enums.Textures.BlockIcons; import gregtech.api.util.*; -import gregtech.api.util.GTPP_Recipe.GTPP_Recipe_Map_Internal; import gregtech.api.util.GT_Recipe.GT_Recipe_Map; import gtPlusPlus.api.objects.Logger; import gtPlusPlus.core.chunkloading.GTPP_ChunkManager; @@ -250,8 +249,7 @@ public class GTplusplus implements ActionListener { public void onLoadComplete(FMLLoadCompleteEvent event) { proxy.onLoadComplete(event); generateGregtechRecipeMaps(); - // Check our maps ar euntouched - Logger.INFO("Making sure that all GT++ recipes are untouched."); + // Check our maps are untouched GTPP_Recipe.checkRecipeModifications(); Logger.INFO("Passed verification checks."); } -- cgit