diff options
Diffstat (limited to 'src/main/java/gregtech/api/util')
8 files changed, 290 insertions, 636 deletions
diff --git a/src/main/java/gregtech/api/util/FishPondFakeRecipe.java b/src/main/java/gregtech/api/util/FishPondFakeRecipe.java index dc579ebd9b..b5bfff9e29 100644 --- a/src/main/java/gregtech/api/util/FishPondFakeRecipe.java +++ b/src/main/java/gregtech/api/util/FishPondFakeRecipe.java @@ -1,16 +1,17 @@ package gregtech.api.util; +import static gregtech.api.util.GT_RecipeBuilder.SECONDS; +import static gtPlusPlus.api.recipe.GTPPRecipeMaps.fishPondRecipes; + import java.util.ArrayList; import net.minecraft.item.ItemStack; import net.minecraft.util.WeightedRandomFishable; import net.minecraftforge.common.FishingHooks; -import net.minecraftforge.fluids.FluidStack; +import gregtech.api.enums.GT_Values; import gtPlusPlus.api.objects.Logger; import gtPlusPlus.api.objects.data.AutoMap; -import gtPlusPlus.api.recipe.GTPPRecipeMaps; -import gtPlusPlus.core.recipe.common.CI; import gtPlusPlus.core.util.minecraft.ItemUtils; import gtPlusPlus.core.util.reflect.ReflectionUtils; @@ -49,7 +50,14 @@ public class FishPondFakeRecipe { ItemStack t = (ItemStack) ReflectionUtils .getField(WeightedRandomFishable.class, "field_150711_b") .get(u); - addNewFishPondLoot(mType, new ItemStack[] { t }, new int[] { 10000 }); + GT_Values.RA.stdBuilder() + .itemInputs(GT_Utility.getIntegratedCircuit(mType)) + .itemOutputs(t) + .duration(5 * SECONDS) + .eut(0) + .ignoreCollision() + .addTo(fishPondRecipes); + Logger.INFO("Fishing [" + mType + "]: " + ItemUtils.getArrayStackNames(new ItemStack[] { t })); } catch (IllegalArgumentException | IllegalAccessException e1) { Logger.INFO("Error generating Fish Pond Recipes. [2]"); e1.printStackTrace(); @@ -61,20 +69,4 @@ public class FishPondFakeRecipe { return true; } - - public static void addNewFishPondLoot(int circuit, ItemStack[] outputItems, int[] chances) { - GT_Recipe x = new GT_Recipe( - true, - new ItemStack[] { CI.getNumberedCircuit(circuit) }, - outputItems, - null, - chances, - new FluidStack[] { null }, - new FluidStack[] { null }, - 100, // 1 Tick - 0, // No Eu produced - 0); - Logger.INFO("Fishing [" + circuit + "]: " + ItemUtils.getArrayStackNames(outputItems)); - GTPPRecipeMaps.fishPondRecipes.addRecipe(x, false, false, false); - } } diff --git a/src/main/java/gregtech/api/util/GT_Forestry_Compat.java b/src/main/java/gregtech/api/util/GT_Forestry_Compat.java index 427703e6f7..d383d643d7 100644 --- a/src/main/java/gregtech/api/util/GT_Forestry_Compat.java +++ b/src/main/java/gregtech/api/util/GT_Forestry_Compat.java @@ -1,9 +1,14 @@ package gregtech.api.util; +import static gregtech.api.recipe.RecipeMaps.centrifugeNonCellRecipes; +import static gregtech.api.recipe.RecipeMaps.centrifugeRecipes; +import static gregtech.api.recipe.RecipeMaps.scannerFakeRecipes; +import static gregtech.api.util.GT_RecipeBuilder.SECONDS; +import static gregtech.api.util.GT_RecipeBuilder.TICKS; + import java.util.Map; import net.minecraft.item.ItemStack; -import net.minecraftforge.fluids.FluidStack; import forestry.api.recipes.ICentrifugeRecipe; import forestry.api.recipes.ISqueezerRecipe; @@ -17,112 +22,112 @@ public class GT_Forestry_Compat { public static void populateFakeNeiRecipes() { if (ItemList.FR_Bee_Drone.get(1L) != null) { - RecipeMaps.scannerFakeRecipes.addFakeRecipe( - false, - new ItemStack[] { ItemList.FR_Bee_Drone.getWildcard(1L) }, - new ItemStack[] { ItemList.FR_Bee_Drone.getWithName(1L, "Scanned Drone") }, - null, - new FluidStack[] { Materials.Honey.getFluid(100L) }, - null, - 500, - 2, - 0); + GT_Values.RA.stdBuilder() + .itemInputs(ItemList.FR_Bee_Drone.getWildcard(1L)) + .itemOutputs(ItemList.FR_Bee_Drone.getWithName(1L, "Scanned Drone")) + .fluidInputs(Materials.Honey.getFluid(100L)) + .duration(25 * SECONDS) + .eut(2) + .noOptimize() + .ignoreCollision() + .fake() + .addTo(scannerFakeRecipes); } if (ItemList.FR_Bee_Princess.get(1L) != null) { - RecipeMaps.scannerFakeRecipes.addFakeRecipe( - false, - new ItemStack[] { ItemList.FR_Bee_Princess.getWildcard(1L) }, - new ItemStack[] { ItemList.FR_Bee_Princess.getWithName(1L, "Scanned Princess") }, - null, - new FluidStack[] { Materials.Honey.getFluid(100L) }, - null, - 500, - 2, - 0); + GT_Values.RA.stdBuilder() + .itemInputs(ItemList.FR_Bee_Princess.getWildcard(1L)) + .itemOutputs(ItemList.FR_Bee_Princess.getWithName(1L, "Scanned Princess")) + .fluidInputs(Materials.Honey.getFluid(100L)) + .duration(25 * SECONDS) + .eut(2) + .noOptimize() + .ignoreCollision() + .fake() + .addTo(scannerFakeRecipes); } if (ItemList.FR_Bee_Queen.get(1L) != null) { - RecipeMaps.scannerFakeRecipes.addFakeRecipe( - false, - new ItemStack[] { ItemList.FR_Bee_Queen.getWildcard(1L) }, - new ItemStack[] { ItemList.FR_Bee_Queen.getWithName(1L, "Scanned Queen") }, - null, - new FluidStack[] { Materials.Honey.getFluid(100L) }, - null, - 500, - 2, - 0); + GT_Values.RA.stdBuilder() + .itemInputs(ItemList.FR_Bee_Queen.getWildcard(1L)) + .itemOutputs(ItemList.FR_Bee_Queen.getWithName(1L, "Scanned Queen")) + .fluidInputs(Materials.Honey.getFluid(100L)) + .duration(25 * SECONDS) + .eut(2) + .noOptimize() + .ignoreCollision() + .fake() + .addTo(scannerFakeRecipes); } if (ItemList.FR_Tree_Sapling.get(1L) != null) { - RecipeMaps.scannerFakeRecipes.addFakeRecipe( - false, - new ItemStack[] { ItemList.FR_Tree_Sapling.getWildcard(1L) }, - new ItemStack[] { ItemList.FR_Tree_Sapling.getWithName(1L, "Scanned Sapling") }, - null, - new FluidStack[] { Materials.Honey.getFluid(100L) }, - null, - 500, - 2, - 0); + GT_Values.RA.stdBuilder() + .itemInputs(ItemList.FR_Tree_Sapling.getWildcard(1L)) + .itemOutputs(ItemList.FR_Tree_Sapling.getWithName(1L, "Scanned Sapling")) + .fluidInputs(Materials.Honey.getFluid(100L)) + .duration(25 * SECONDS) + .eut(2) + .noOptimize() + .ignoreCollision() + .fake() + .addTo(scannerFakeRecipes); } if (ItemList.FR_Butterfly.get(1L) != null) { - RecipeMaps.scannerFakeRecipes.addFakeRecipe( - false, - new ItemStack[] { ItemList.FR_Butterfly.getWildcard(1L) }, - new ItemStack[] { ItemList.FR_Butterfly.getWithName(1L, "Scanned Butterfly") }, - null, - new FluidStack[] { Materials.Honey.getFluid(100L) }, - null, - 500, - 2, - 0); + GT_Values.RA.stdBuilder() + .itemInputs(ItemList.FR_Butterfly.getWildcard(1L)) + .itemOutputs(ItemList.FR_Butterfly.getWithName(1L, "Scanned Butterfly")) + .fluidInputs(Materials.Honey.getFluid(100L)) + .duration(25 * SECONDS) + .eut(2) + .noOptimize() + .ignoreCollision() + .fake() + .addTo(scannerFakeRecipes); } if (ItemList.FR_Larvae.get(1L) != null) { - RecipeMaps.scannerFakeRecipes.addFakeRecipe( - false, - new ItemStack[] { ItemList.FR_Larvae.getWildcard(1L) }, - new ItemStack[] { ItemList.FR_Larvae.getWithName(1L, "Scanned Larvae") }, - null, - new FluidStack[] { Materials.Honey.getFluid(100L) }, - null, - 500, - 2, - 0); + GT_Values.RA.stdBuilder() + .itemInputs(ItemList.FR_Larvae.getWildcard(1L)) + .itemOutputs(ItemList.FR_Larvae.getWithName(1L, "Scanned Larvae")) + .fluidInputs(Materials.Honey.getFluid(100L)) + .duration(25 * SECONDS) + .eut(2) + .noOptimize() + .ignoreCollision() + .fake() + .addTo(scannerFakeRecipes); } if (ItemList.FR_Serum.get(1L) != null) { - RecipeMaps.scannerFakeRecipes.addFakeRecipe( - false, - new ItemStack[] { ItemList.FR_Serum.getWildcard(1L) }, - new ItemStack[] { ItemList.FR_Serum.getWithName(1L, "Scanned Serum") }, - null, - new FluidStack[] { Materials.Honey.getFluid(100L) }, - null, - 500, - 2, - 0); + GT_Values.RA.stdBuilder() + .itemInputs(ItemList.FR_Serum.getWildcard(1L)) + .itemOutputs(ItemList.FR_Serum.getWithName(1L, "Scanned Serum")) + .fluidInputs(Materials.Honey.getFluid(100L)) + .duration(25 * SECONDS) + .eut(2) + .noOptimize() + .ignoreCollision() + .fake() + .addTo(scannerFakeRecipes); } if (ItemList.FR_Caterpillar.get(1L) != null) { - RecipeMaps.scannerFakeRecipes.addFakeRecipe( - false, - new ItemStack[] { ItemList.FR_Caterpillar.getWildcard(1L) }, - new ItemStack[] { ItemList.FR_Caterpillar.getWithName(1L, "Scanned Caterpillar") }, - null, - new FluidStack[] { Materials.Honey.getFluid(100L) }, - null, - 500, - 2, - 0); + GT_Values.RA.stdBuilder() + .itemInputs(ItemList.FR_Caterpillar.getWildcard(1L)) + .itemOutputs(ItemList.FR_Caterpillar.getWithName(1L, "Scanned Caterpillar")) + .fluidInputs(Materials.Honey.getFluid(100L)) + .duration(25 * SECONDS) + .eut(2) + .noOptimize() + .ignoreCollision() + .fake() + .addTo(scannerFakeRecipes); } if (ItemList.FR_PollenFertile.get(1L) != null) { - RecipeMaps.scannerFakeRecipes.addFakeRecipe( - false, - new ItemStack[] { ItemList.FR_PollenFertile.getWildcard(1L) }, - new ItemStack[] { ItemList.FR_PollenFertile.getWithName(1L, "Scanned Pollen") }, - null, - new FluidStack[] { Materials.Honey.getFluid(100L) }, - null, - 500, - 2, - 0); + GT_Values.RA.stdBuilder() + .itemInputs(ItemList.FR_PollenFertile.getWildcard(1L)) + .itemOutputs(ItemList.FR_PollenFertile.getWithName(1L, "Scanned Pollen")) + .fluidInputs(Materials.Honey.getFluid(100L)) + .duration(25 * SECONDS) + .eut(2) + .noOptimize() + .ignoreCollision() + .fake() + .addTo(scannerFakeRecipes); } } @@ -139,28 +144,21 @@ public class GT_Forestry_Compat { .copy(); i++; } - RecipeMaps.centrifugeRecipes.addRecipe( - true, - new ItemStack[] { tRecipe.getInput() }, - tOutputs, - null, - tChances, - null, - null, - 128, - 5, - 0); - RecipeMaps.centrifugeNonCellRecipes.addRecipe( - true, - new ItemStack[] { tRecipe.getInput() }, - tOutputs, - null, - tChances, - null, - null, - 128, - 5, - 0); + GT_Values.RA.stdBuilder() + .itemInputs(tRecipe.getInput()) + .itemOutputs(tOutputs) + .outputChances(tChances) + .duration(6 * SECONDS + 8 * TICKS) + .eut(5) + .addTo(centrifugeRecipes); + + GT_Values.RA.stdBuilder() + .itemInputs(tRecipe.getInput()) + .itemOutputs(tOutputs) + .outputChances(tChances) + .duration(6 * SECONDS + 8 * TICKS) + .eut(5) + .addTo(centrifugeNonCellRecipes); } } catch (Throwable e) { if (GT_Values.D1) { @@ -172,18 +170,17 @@ public class GT_Forestry_Compat { public static void transferSqueezerRecipes() { try { for (ISqueezerRecipe tRecipe : RecipeManagers.squeezerManager.recipes()) { - if ((tRecipe.getResources().length == 1) && (tRecipe.getFluidOutput() != null)) { - RecipeMaps.fluidExtractionRecipes.addRecipe( - true, - new ItemStack[] { tRecipe.getResources()[0] }, - new ItemStack[] { tRecipe.getRemnants() }, - null, - new int[] { (int) (tRecipe.getRemnantsChance() * 10000) }, - null, - new FluidStack[] { tRecipe.getFluidOutput() }, - 32, - 8, - 0); + if ((tRecipe.getResources().length == 1) && (tRecipe.getFluidOutput() != null) + && (tRecipe.getResources()[0] != null) + && (tRecipe.getRemnants() != null)) { + GT_Values.RA.stdBuilder() + .itemInputs(tRecipe.getResources()[0]) + .itemOutputs(tRecipe.getRemnants()) + .outputChances((int) (tRecipe.getRemnantsChance() * 10000)) + .fluidOutputs(tRecipe.getFluidOutput()) + .duration(1 * SECONDS + 12 * TICKS) + .eut(8) + .addTo(RecipeMaps.fluidExtractionRecipes); } } } catch (Throwable e) { diff --git a/src/main/java/gregtech/api/util/GT_ModHandler.java b/src/main/java/gregtech/api/util/GT_ModHandler.java index 70dc2f30b0..8c43a5334b 100644 --- a/src/main/java/gregtech/api/util/GT_ModHandler.java +++ b/src/main/java/gregtech/api/util/GT_ModHandler.java @@ -10,7 +10,6 @@ import static gregtech.api.enums.GT_Values.RA; import static gregtech.api.enums.GT_Values.V; import static gregtech.api.enums.GT_Values.W; import static gregtech.api.recipe.RecipeMaps.alloySmelterRecipes; -import static gregtech.api.recipe.RecipeMaps.extractorRecipes; import static gregtech.api.recipe.RecipeMaps.oreWasherRecipes; import static gregtech.api.util.GT_RecipeBuilder.SECONDS; import static gregtech.api.util.GT_RecipeBuilder.TICKS; @@ -576,184 +575,6 @@ public class GT_ModHandler { } /** - * LiquidTransposer Recipe for both directions - */ - @Deprecated - public static boolean addLiquidTransposerRecipe(ItemStack aEmptyContainer, FluidStack aLiquid, - ItemStack aFullContainer, int aMJ) { - return true; - } - - /** - * LiquidTransposer Recipe for filling Containers - */ - @Deprecated - public static boolean addLiquidTransposerFillRecipe(ItemStack aEmptyContainer, FluidStack aLiquid, - ItemStack aFullContainer, int aMJ) { - return true; - } - - /** - * LiquidTransposer Recipe for emptying Containers - */ - @Deprecated - public static boolean addLiquidTransposerEmptyRecipe(ItemStack aFullContainer, FluidStack aLiquid, - ItemStack aEmptyContainer, int aMJ) { - return true; - } - - /** - * IC2-Extractor Recipe. Overloads old Recipes automatically - */ - @Deprecated - public static boolean addExtractionRecipe(ItemStack aInput, ItemStack aOutput) { - aOutput = GT_OreDictUnificator.get(true, aOutput); - if (aInput == null || aOutput == null) return false; - RA.stdBuilder() - .itemInputs(aInput) - .itemOutputs(aOutput) - .duration(15 * SECONDS) - .eut(2) - .addTo(extractorRecipes); - return true; - } - - /** - * RC-BlastFurnace Recipes - */ - @Deprecated - public static boolean addRCBlastFurnaceRecipe(ItemStack aInput, ItemStack aOutput, int aTime) { - return true; - } - - @Deprecated - public static boolean addPulverisationRecipe(ItemStack aInput, ItemStack aOutput1) { - return addPulverisationRecipe(aInput, aOutput1, null, 0, false); - } - - @Deprecated - public static boolean addPulverisationRecipe(ItemStack aInput, ItemStack aOutput1, ItemStack aOutput2) { - return addPulverisationRecipe(aInput, aOutput1, aOutput2, 100, false); - } - - @Deprecated - public static boolean addPulverisationRecipe(ItemStack aInput, ItemStack aOutput1, ItemStack aOutput2, - int aChance) { - return addPulverisationRecipe(aInput, aOutput1, aOutput2, aChance, false); - } - - @Deprecated - public static boolean addPulverisationRecipe(ItemStack aInput, ItemStack aOutput1, boolean aOverwrite) { - return addPulverisationRecipe(aInput, aOutput1, null, 0, aOverwrite); - } - - @Deprecated - public static boolean addPulverisationRecipe(ItemStack aInput, ItemStack aOutput1, ItemStack aOutput2, - boolean aOverwrite) { - return addPulverisationRecipe(aInput, aOutput1, aOutput2, 100, aOverwrite); - } - - @Deprecated - public static boolean addPulverisationRecipe(ItemStack aInput, ItemStack aOutput1, ItemStack aOutput2, int aChance, - boolean aOverwrite) { - return addPulverisationRecipe(aInput, aOutput1, aOutput2, aChance, null, 0, aOverwrite); - } - - /** - * Adds Several Pulverizer-Type Recipes. - */ - @Deprecated - public static boolean addPulverisationRecipe(ItemStack aInput, ItemStack aOutput1, ItemStack aOutput2, int aChance2, - ItemStack aOutput3, int aChance3, boolean aOverwrite) { - aOutput1 = GT_OreDictUnificator.get(true, aOutput1); - aOutput2 = GT_OreDictUnificator.get(true, aOutput2); - if (GT_Utility.isStackInvalid(aInput) || GT_Utility.isStackInvalid(aOutput1)) return false; - - if (GT_Utility.getContainerItem(aInput, false) == null) { - RA.addPulveriserRecipe( - aInput, - new ItemStack[] { aOutput1, aOutput2, aOutput3 }, - new int[] { 10000, aChance2 <= 0 ? 1000 : 100 * aChance2, aChance3 <= 0 ? 1000 : 100 * aChance3 }, - 400, - 2); - } - return true; - } - - @Deprecated - public static boolean addPulverisationRecipe(ItemStack aInputItem, ItemStack[] aOutputArray, int[] aChanceArray, - int aEUt, int aRecipeDurationInTicks) { - - ItemStack[] aUnifiedOutputArray = new ItemStack[aOutputArray.length]; - int counter = 0; - - for (ItemStack item : aOutputArray) { - aUnifiedOutputArray[counter] = GT_OreDictUnificator.get(true, item); - counter++; - } - - RA.addPulveriserRecipe(aInputItem, aOutputArray, aChanceArray, aRecipeDurationInTicks, aEUt); - - return true; - } - - @Deprecated - public static boolean addImmersiveEngineeringRecipe(ItemStack aInput, ItemStack aOutput1, ItemStack aOutput2, - int aChance2, ItemStack aOutput3, int aChance3) { - return true; - } - - @Deprecated - public static boolean addMagneticraftRecipe(ItemStack aInput, ItemStack aOutput1, ItemStack aOutput2, int aChance2, - ItemStack aOutput3, int aChance3) { - return true; - } - - /** - * Adds a Recipe to the Sawmills of ThermalCraft - */ - @Deprecated - public static boolean addSawmillRecipe(ItemStack aInput1, ItemStack aOutput1, ItemStack aOutput2) { - return true; - } - - /** - * Induction Smelter Recipes and Alloy Smelter Recipes - */ - @Deprecated - public static boolean addAlloySmelterRecipe(ItemStack aInput1, ItemStack aInput2, ItemStack aOutput1, int aDuration, - int aEUt, boolean aAllowSecondaryInputEmpty) { - if (aInput1 == null || (aInput2 == null && !aAllowSecondaryInputEmpty) || aOutput1 == null) return false; - aOutput1 = GT_OreDictUnificator.get(true, aOutput1); - RA.stdBuilder() - .itemInputs(aInput1, aInput2) - .itemOutputs(aOutput1) - .duration(aDuration) - .eut(aEUt) - .addTo(alloySmelterRecipes); - return true; - } - - /** - * Induction Smelter Recipes for TE - */ - public static boolean addInductionSmelterRecipe(ItemStack aInput1, ItemStack aInput2, ItemStack aOutput1, - ItemStack aOutput2, int aEnergy, int aChance) { - return true; - } - - /** - * Smelts Ores to Ingots - */ - public static boolean addOreToIngotSmeltingRecipe(ItemStack aInput, ItemStack aOutput) { - aOutput = GT_OreDictUnificator.get(true, aOutput); - if (aInput == null || aOutput == null) return false; - FurnaceRecipes.smelting() - .func_151394_a(aInput, GT_Utility.copyOrNull(aOutput), 0.0F); - return true; - } - - /** * Adds GT versions of the IC2 recipes from the supplied IC2RecipeList. */ public static void addIC2RecipesToGT(Map<IRecipeInput, RecipeOutput> aIC2RecipeList, RecipeMap<?> aGTRecipeMap, @@ -781,35 +602,27 @@ public class GT_ModHandler { .contains("ic2.itemPurifiedCrushed")))) continue; switch (aGTRecipeMap.unlocalizedName) { - case "gt.recipe.macerator", "gt.recipe.extractor", "gt.recipe.compressor" -> aGTRecipeMap - .addRecipe( - true, - new ItemStack[] { GT_Utility.copyAmount( + case "gt.recipe.macerator", "gt.recipe.extractor", "gt.recipe.compressor" -> GT_Values.RA + .stdBuilder() + .itemInputs( + GT_Utility.copyAmount( iRecipeInputRecipeOutputEntry.getKey() .getAmount(), - tStack) }, - iRecipeInputRecipeOutputEntry.getValue().items.toArray(new ItemStack[0]), - null, - null, - null, - null, - 300, - 2, - 0); - case "gt.recipe.thermalcentrifuge" -> aGTRecipeMap.addRecipe( - true, - new ItemStack[] { GT_Utility.copyAmount( - iRecipeInputRecipeOutputEntry.getKey() - .getAmount(), - tStack) }, - iRecipeInputRecipeOutputEntry.getValue().items.toArray(new ItemStack[0]), - null, - null, - null, - null, - 500, - 48, - 0); + tStack)) + .itemOutputs(iRecipeInputRecipeOutputEntry.getValue().items.toArray(new ItemStack[0])) + .duration(15 * SECONDS) + .eut(2) + .addTo(aGTRecipeMap); + case "gt.recipe.thermalcentrifuge" -> GT_Values.RA.stdBuilder() + .itemInputs( + GT_Utility.copyAmount( + iRecipeInputRecipeOutputEntry.getKey() + .getAmount(), + tStack)) + .itemOutputs(iRecipeInputRecipeOutputEntry.getValue().items.toArray(new ItemStack[0])) + .duration(25 * SECONDS) + .eut(48) + .addTo(aGTRecipeMap); } } catch (Exception e) { System.err.println(e); @@ -870,48 +683,10 @@ public class GT_ModHandler { return emptyRecipeMap; } - public static Map<IRecipeInput, RecipeOutput> getMassFabricatorList() { - try { - return ic2.api.recipe.Recipes.matterAmplifier.getRecipes(); - } catch (Throwable e) { - /* Do nothing */ - } - return emptyRecipeMap; - } - - /** - * IC2-ThermalCentrifuge Recipe. Overloads old Recipes automatically - */ - @Deprecated - public static boolean addThermalCentrifugeRecipe(ItemStack aInput, int[] aChances, int aHeat, Object... aOutput) { - if (aInput == null || aOutput == null || aOutput.length == 0 || aOutput[0] == null) return false; - RA.addThermalCentrifugeRecipe( - aInput, - (ItemStack) aOutput[0], - aOutput.length >= 2 ? (ItemStack) aOutput[1] : null, - aOutput.length >= 3 ? (ItemStack) aOutput[2] : null, - aChances, - 500, - 48); - return true; - } - - @Deprecated - public static boolean addThermalCentrifugeRecipe(ItemStack aInput, int aHeat, Object... aOutput) { - if (aInput == null || aOutput == null || aOutput.length == 0 || aOutput[0] == null) return false; - RA.addThermalCentrifugeRecipe( - aInput, - (ItemStack) aOutput[0], - aOutput.length >= 2 ? (ItemStack) aOutput[1] : null, - aOutput.length >= 3 ? (ItemStack) aOutput[2] : null, - 500, - 48); - return true; - } - /** * IC2-OreWasher Recipe. Overloads old Recipes automatically */ + @Deprecated public static boolean addOreWasherRecipe(ItemStack aInput, int[] aChances, int aWaterAmount, Object... aOutput) { if (aInput == null || aOutput == null || aOutput.length == 0 || aOutput[0] == null) return false; RA.stdBuilder() @@ -934,76 +709,6 @@ public class GT_ModHandler { return true; } - public static boolean addOreWasherRecipe(ItemStack aInput, int aWaterAmount, Object... aOutput) { - if (aInput == null || aOutput == null || aOutput.length == 0 || aOutput[0] == null) return false; - RA.stdBuilder() - .itemInputs(aInput) - .itemOutputs((ItemStack) aOutput[0], (ItemStack) aOutput[1], (ItemStack) aOutput[2]) - .fluidInputs(GT_ModHandler.getWater(aWaterAmount)) - .duration(25 * SECONDS) - .eut(16) - .addTo(oreWasherRecipes); - - RA.stdBuilder() - .itemInputs(aInput) - .itemOutputs((ItemStack) aOutput[0], (ItemStack) aOutput[1], (ItemStack) aOutput[2]) - .fluidInputs(GT_ModHandler.getDistilledWater(aWaterAmount / 5)) - .duration(15 * SECONDS) - .eut(16) - .addTo(oreWasherRecipes); - return true; - } - - /** - * IC2-Compressor Recipe. Overloads old Recipes automatically - */ - @Deprecated - public static boolean addCompressionRecipe(ItemStack aInput, ItemStack aOutput) { - return addCompressionRecipe(aInput, aOutput, 300, 2); - } - - /** - * IC2-Compressor Recipe. Overloads old Recipes automatically - */ - @Deprecated - public static boolean addCompressionRecipe(ItemStack aInput, ItemStack aOutput, int duration, int EUPerTick) { - aOutput = GT_OreDictUnificator.get(true, aOutput); - if (aInput == null || aOutput == null || GT_Utility.areStacksEqual(aInput, aOutput, true)) return false; - RA.addCompressorRecipe(aInput, aOutput, duration, EUPerTick); - return true; - } - - /** - * @param aValue Scrap = 5000, Scrapbox = 45000, Diamond Dust 125000 - */ - public static boolean addIC2MatterAmplifier(ItemStack aAmplifier, int aValue) { - if (aAmplifier == null || aValue <= 0) return false; - try { - NBTTagCompound tNBT = new NBTTagCompound(); - tNBT.setInteger("amplification", aValue); - GT_Utility - .callMethod(ic2.api.recipe.Recipes.matterAmplifier, "addRecipe", false, false, false, aAmplifier, tNBT); - } catch (Throwable e) { - /* Do nothing */ - } - return true; - } - - /** - * Rolling Machine Crafting Recipe - */ - public static boolean addRollingMachineRecipe(ItemStack aResult, Object[] aRecipe) { - aResult = GT_OreDictUnificator.get(true, aResult); - if (aResult == null || aRecipe == null || aResult.stackSize <= 0) return false; - try { - mods.railcraft.api.crafting.RailcraftCraftingManager.rollingMachine.getRecipeList() - .add(new ShapedOreRecipe(GT_Utility.copyOrNull(aResult), aRecipe)); - } catch (Throwable e) { - return addCraftingRecipe(GT_Utility.copyOrNull(aResult), aRecipe); - } - return true; - } - public static void stopBufferingCraftingRecipes() { sBufferCraftingRecipes = false; @@ -2498,54 +2203,4 @@ public class GT_ModHandler { */ public static long DONT_REMOVE_SHAPELESS = B[13]; } - - /** - * Copy of the original Helper Class of Thermal Expansion, just to make sure it works even when other Mods include - * TE-APIs - */ - public static class ThermalExpansion { - - public static void addFurnaceRecipe(int energy, ItemStack input, ItemStack output) {} - - public static void addPulverizerRecipe(int energy, ItemStack input, ItemStack primaryOutput) {} - - public static void addPulverizerRecipe(int energy, ItemStack input, ItemStack primaryOutput, - ItemStack secondaryOutput) {} - - public static void addPulverizerRecipe(int energy, ItemStack input, ItemStack primaryOutput, - ItemStack secondaryOutput, int secondaryChance) {} - - public static void addSawmillRecipe(int energy, ItemStack input, ItemStack primaryOutput) {} - - public static void addSawmillRecipe(int energy, ItemStack input, ItemStack primaryOutput, - ItemStack secondaryOutput) {} - - public static void addSawmillRecipe(int energy, ItemStack input, ItemStack primaryOutput, - ItemStack secondaryOutput, int secondaryChance) {} - - public static void addSmelterRecipe(int energy, ItemStack primaryInput, ItemStack secondaryInput, - ItemStack primaryOutput) {} - - public static void addSmelterRecipe(int energy, ItemStack primaryInput, ItemStack secondaryInput, - ItemStack primaryOutput, ItemStack secondaryOutput) {} - - public static void addSmelterRecipe(int energy, ItemStack primaryInput, ItemStack secondaryInput, - ItemStack primaryOutput, ItemStack secondaryOutput, int secondaryChance) {} - - public static void addSmelterBlastOre(Materials aMaterial) {} - - public static void addCrucibleRecipe(int energy, ItemStack input, FluidStack output) {} - - public static void addTransposerFill(int energy, ItemStack input, ItemStack output, FluidStack fluid, - boolean reversible) {} - - public static void addTransposerExtract(int energy, ItemStack input, ItemStack output, FluidStack fluid, - int chance, boolean reversible) {} - - public static void addMagmaticFuel(String fluidName, int energy) {} - - public static void addCompressionFuel(String fluidName, int energy) {} - - public static void addCoolant(String fluidName, int energy) {} - } } diff --git a/src/main/java/gregtech/api/util/GT_RecipeBuilder.java b/src/main/java/gregtech/api/util/GT_RecipeBuilder.java index 6f7c9a81bb..66bc11444a 100644 --- a/src/main/java/gregtech/api/util/GT_RecipeBuilder.java +++ b/src/main/java/gregtech/api/util/GT_RecipeBuilder.java @@ -334,14 +334,6 @@ public class GT_RecipeBuilder { return this; } - /** - * Really just {@link #special(Object)}, but with a different signature to make it less confusing. WARNING: only for - * legacy recipe map. do not abuse. - */ - public GT_RecipeBuilder specialItem(ItemStack specialItem) { - return special(specialItem); - } - public GT_RecipeBuilder duration(int duration) { this.duration = duration; return this; diff --git a/src/main/java/gregtech/api/util/GT_RecipeConstants.java b/src/main/java/gregtech/api/util/GT_RecipeConstants.java index d9d6c7d7d2..0828112fc7 100644 --- a/src/main/java/gregtech/api/util/GT_RecipeConstants.java +++ b/src/main/java/gregtech/api/util/GT_RecipeConstants.java @@ -97,6 +97,88 @@ public class GT_RecipeConstants { public static final RecipeMetadataKey<Boolean> ON_FIRE = SimpleRecipeMetadataKey.create(Boolean.class, "on_fire"); /** + * Nano Forge Tier. + */ + public static final RecipeMetadataKey<Integer> NANO_FORGE_TIER = SimpleRecipeMetadataKey + .create(Integer.class, "nano_forge_tier"); + + /** + * FOG Exotic recipe tier. + */ + public static final RecipeMetadataKey<Integer> FOG_EXOTIC_TIER = SimpleRecipeMetadataKey + .create(Integer.class, "fog_exotic_tier"); + + /** + * FOG Plasma recipe tier. + */ + public static final RecipeMetadataKey<Integer> FOG_PLASMA_TIER = SimpleRecipeMetadataKey + .create(Integer.class, "fog_plasma_tier"); + + /** + * DEFC Casing tier. + */ + public static final RecipeMetadataKey<Integer> DEFC_CASING_TIER = SimpleRecipeMetadataKey + .create(Integer.class, "defc_casing_tier"); + + /** + * Chemplant Casing tier. Beware, codewise index starts at 0, but it is tier 1. + */ + public static final RecipeMetadataKey<Integer> CHEMPLANT_CASING_TIER = SimpleRecipeMetadataKey + .create(Integer.class, "chemplant_casing_tier"); + + /** + * QFT Focus tier. + */ + public static final RecipeMetadataKey<Integer> QFT_FOCUS_TIER = SimpleRecipeMetadataKey + .create(Integer.class, "qft_focus_tier"); + + /** + * Dissolution Tank Ratio. + */ + public static final RecipeMetadataKey<Integer> DISSOLUTION_TANK_RATIO = SimpleRecipeMetadataKey + .create(Integer.class, "dissolution_tank_ratio"); + + /** + * Duration in days for the RTG. + */ + public static final RecipeMetadataKey<Integer> RTG_DURATION_IN_DAYS = SimpleRecipeMetadataKey + .create(Integer.class, "rtg_duration_in_days"); + + /** + * Basic output for the Large Naquadah Generator. + */ + public static final RecipeMetadataKey<Integer> LNG_BASIC_OUTPUT = SimpleRecipeMetadataKey + .create(Integer.class, "lng_basic_output"); + + /** + * Coil tier for the Naquadah Fuel Refinery. + */ + public static final RecipeMetadataKey<Integer> NFR_COIL_TIER = SimpleRecipeMetadataKey + .create(Integer.class, "nfr_coil_tier"); + + /** + * NKE range for the neutron activator. + */ + public static final RecipeMetadataKey<Integer> NKE_RANGE = SimpleRecipeMetadataKey + .create(Integer.class, "nke_range"); + /** + * Precise Assembler casing tier. + */ + public static final RecipeMetadataKey<Integer> PRECISE_ASSEMBLER_CASING_TIER = SimpleRecipeMetadataKey + .create(Integer.class, "precise_assembler_casing_tier"); + /** + * CoAL casing tier. + */ + public static final RecipeMetadataKey<Integer> COAL_CASING_TIER = SimpleRecipeMetadataKey + .create(Integer.class, "coal_casing_tier"); + + /** + * LFTR output power. + */ + public static final RecipeMetadataKey<Integer> LFTR_OUTPUT_POWER = SimpleRecipeMetadataKey + .create(Integer.class, "lftr_output_power"); + + /** * Add a arc furnace recipe. Adds to both normal arc furnace and plasma arc furnace. * Will override the fluid input with oxygen/plasma for the respective recipe maps, so there is no point setting it. */ @@ -328,5 +410,19 @@ public class GT_RecipeConstants { GT_RecipeMapUtil.SPECIAL_VALUE_ALIASES.add(COIL_HEAT); GT_RecipeMapUtil.SPECIAL_VALUE_ALIASES.add(FUSION_THRESHOLD); GT_RecipeMapUtil.SPECIAL_VALUE_ALIASES.add(FUEL_VALUE); + GT_RecipeMapUtil.SPECIAL_VALUE_ALIASES.add(NANO_FORGE_TIER); + GT_RecipeMapUtil.SPECIAL_VALUE_ALIASES.add(FOG_EXOTIC_TIER); + GT_RecipeMapUtil.SPECIAL_VALUE_ALIASES.add(FOG_PLASMA_TIER); + GT_RecipeMapUtil.SPECIAL_VALUE_ALIASES.add(DEFC_CASING_TIER); + GT_RecipeMapUtil.SPECIAL_VALUE_ALIASES.add(CHEMPLANT_CASING_TIER); + GT_RecipeMapUtil.SPECIAL_VALUE_ALIASES.add(QFT_FOCUS_TIER); + GT_RecipeMapUtil.SPECIAL_VALUE_ALIASES.add(DISSOLUTION_TANK_RATIO); + GT_RecipeMapUtil.SPECIAL_VALUE_ALIASES.add(RTG_DURATION_IN_DAYS); + GT_RecipeMapUtil.SPECIAL_VALUE_ALIASES.add(LNG_BASIC_OUTPUT); + GT_RecipeMapUtil.SPECIAL_VALUE_ALIASES.add(NFR_COIL_TIER); + GT_RecipeMapUtil.SPECIAL_VALUE_ALIASES.add(NKE_RANGE); + GT_RecipeMapUtil.SPECIAL_VALUE_ALIASES.add(PRECISE_ASSEMBLER_CASING_TIER); + GT_RecipeMapUtil.SPECIAL_VALUE_ALIASES.add(COAL_CASING_TIER); + } } diff --git a/src/main/java/gregtech/api/util/GasSpargingRecipe.java b/src/main/java/gregtech/api/util/GasSpargingRecipe.java index 667cc78d85..527359e0e8 100644 --- a/src/main/java/gregtech/api/util/GasSpargingRecipe.java +++ b/src/main/java/gregtech/api/util/GasSpargingRecipe.java @@ -2,10 +2,10 @@ package gregtech.api.util; import net.minecraftforge.fluids.FluidStack; +import gregtech.api.enums.TierEU; import gtPlusPlus.api.objects.data.AutoMap; import gtPlusPlus.core.util.data.ArrayUtils; import gtPlusPlus.core.util.minecraft.ItemUtils; -import gtPlusPlus.core.util.minecraft.MaterialUtils; public class GasSpargingRecipe implements Comparable<GasSpargingRecipe> { @@ -29,7 +29,7 @@ public class GasSpargingRecipe implements Comparable<GasSpargingRecipe> { mFluidOutputs = aOutputs; mMaxOutputQuantity = aMaxOutputQuantity; mDuration = 500; - mEUt = MaterialUtils.getVoltageForTier(5); + mEUt = (int) TierEU.RECIPE_IV; } @Override diff --git a/src/main/java/gregtech/api/util/HotFuel.java b/src/main/java/gregtech/api/util/HotFuel.java deleted file mode 100644 index 6054a57b84..0000000000 --- a/src/main/java/gregtech/api/util/HotFuel.java +++ /dev/null @@ -1,40 +0,0 @@ -package gregtech.api.util; - -import net.minecraft.item.ItemStack; -import net.minecraftforge.fluids.FluidStack; - -import gtPlusPlus.api.recipe.GTPPRecipeMaps; - -public class HotFuel { - - public static void addNewHotFuel(FluidStack aInput1, FluidStack aOutput1, ItemStack[] outputItems, int[] chances, - int aSpecialValue) { - GTPPRecipeMaps.thermalBoilerRecipes.addRecipe( - true, - null, - outputItems, - null, - chances, - new FluidStack[] { aInput1 }, - new FluidStack[] { aOutput1 }, - 1, // 1 Tick - 0, // No Eu produced - aSpecialValue // Magic Number - ); - } - - public static void addNewHotFuel(FluidStack aInput1, FluidStack aOutput1, FluidStack aOutput2, int aSpecialValue) { - GTPPRecipeMaps.thermalBoilerRecipes.addRecipe( - false, - null, - null, - null, - null, - new FluidStack[] { aInput1 }, - new FluidStack[] { aOutput1, aOutput2 }, - 20, // 1 Second - 0, // No Eu produced - aSpecialValue // Magic Number - ); - } -} diff --git a/src/main/java/gregtech/api/util/SemiFluidFuelHandler.java b/src/main/java/gregtech/api/util/SemiFluidFuelHandler.java index e3baa9ac90..aa983a5804 100644 --- a/src/main/java/gregtech/api/util/SemiFluidFuelHandler.java +++ b/src/main/java/gregtech/api/util/SemiFluidFuelHandler.java @@ -1,5 +1,6 @@ package gregtech.api.util; +import static gregtech.api.util.GT_RecipeConstants.FUEL_VALUE; import static gtPlusPlus.api.recipe.GTPPRecipeMaps.semiFluidFuels; import java.util.HashMap; @@ -8,6 +9,7 @@ import net.minecraft.item.ItemStack; import net.minecraftforge.fluids.FluidContainerRegistry; import net.minecraftforge.fluids.FluidStack; +import gregtech.api.enums.GT_Values; import gregtech.api.recipe.RecipeMaps; import gtPlusPlus.api.objects.Logger; import gtPlusPlus.api.objects.data.Pair; @@ -15,45 +17,6 @@ import gtPlusPlus.core.util.minecraft.FluidUtils; public class SemiFluidFuelHandler { - public static boolean addSemiFluidFuel(ItemStack aFuelItem, int aFuelValue) { - FluidStack p = FluidContainerRegistry.getFluidForFilledItem(aFuelItem); - if (p != null && aFuelValue > 0) { - return addSemiFluidFuel(p, aFuelValue); - } else { - Logger.INFO("Fuel value for " + aFuelItem.getDisplayName() + " is <= 0, ignoring."); - } - return false; - } - - public static boolean addSemiFluidFuel(FluidStack aFuel, int aFuelValue) { - FluidStack p = aFuel; - if (p != null && aFuelValue > 0) { - GT_Recipe aRecipe = new GT_Recipe( - true, - new ItemStack[] {}, - new ItemStack[] {}, - null, - new int[] {}, - new FluidStack[] { p }, - 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."); - semiFluidFuels.add(aRecipe); - return true; - } - } else { - Logger.INFO("Fuel value for " + p != null ? p.getLocalizedName() : "NULL Fluid" + " is <= 0, ignoring."); - } - return false; - } - public static boolean generateFuels() { final FluidStack aCreosote = FluidUtils.getFluidStack("creosote", 1000); final FluidStack aHeavyFuel = FluidUtils.getFluidStack("liquid_heavy_fuel", 1000); @@ -89,46 +52,45 @@ public class SemiFluidFuelHandler { } } for (Pair<FluidStack, Integer> p : aFoundFluidsFromItems.values()) { - if (p != null) { - int aFuelValue = p.getValue(); - if (p.getKey() - .isFluidEqual(aCreosote)) { - aFuelValue *= 6; - } else if (p.getKey() - .isFluidEqual(aHeavyFuel) - || p.getKey() - .isFluidEqual(aHeavyOil)) { - aFuelValue *= 1.5; - } else { - aFuelValue *= 2; - } + if (p == null) { + continue; + } - if (aFuelValue <= (128 * 3)) { - GT_Recipe aRecipe = new GT_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."); - semiFluidFuels.add(aRecipe); + int aFuelValue = p.getValue(); + if (p.getKey() + .isFluidEqual(aCreosote)) { + aFuelValue *= 6; + } else if (p.getKey() + .isFluidEqual(aHeavyFuel) + || p.getKey() + .isFluidEqual(aHeavyOil)) { + aFuelValue *= 1.5; + } else { + aFuelValue *= 2; } - } else { - Logger.INFO( - "Boosted Fuel value for " + p.getKey() - .getLocalizedName() + " exceeds 512k, ignoring."); - } + + if (aFuelValue <= (128 * 3)) { + + GT_Values.RA.stdBuilder() + .fluidInputs(p.getKey()) + .duration(0) + .eut(0) + .metadata(FUEL_VALUE, aFuelValue) + .addTo(semiFluidFuels); + + Logger.INFO( + "Added " + p.getKey() + .getLocalizedName() + + " to the Semi-Fluid Generator fuel map. Fuel Produces " + + (aFuelValue * 1000) + + "EU per 1000L."); + + } else { + Logger.INFO( + "Boosted Fuel value for " + p.getKey() + .getLocalizedName() + " exceeds 512k, ignoring."); } + } return !semiFluidFuels.getAllRecipes() .isEmpty(); |