aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/gregtech/api/util/SemiFluidFuelHandler.java
diff options
context:
space:
mode:
authorboubou19 <miisterunknown@gmail.com>2024-07-21 16:36:34 +0200
committerGitHub <noreply@github.com>2024-07-21 21:36:34 +0700
commita8b46c11f5a02608101ef33ed39f103736ba5920 (patch)
tree6daf492e524dcae9f2f5a8cb1d87c057c21a6760 /src/main/java/gregtech/api/util/SemiFluidFuelHandler.java
parent8b077c28bea7bcc046be1e4b8485d69b4c245a43 (diff)
downloadGT5-Unofficial-a8b46c11f5a02608101ef33ed39f103736ba5920.tar.gz
GT5-Unofficial-a8b46c11f5a02608101ef33ed39f103736ba5920.tar.bz2
GT5-Unofficial-a8b46c11f5a02608101ef33ed39f103736ba5920.zip
full RA1 removal (#2713)
* remove addExtractionRecipes * remove addPulverisationRecipe * remove thermalcraft fake compat * deprecate addAlloySmelterRecipe * remove fake compat * remove RA1 fusion recipe usage * remove RA1 centrifuge recipe usage * remove RA1 compressor recipe usage * remove RA1 electrolyzer recipe usage * remove RA1 chemical reactor recipe usage * deprecate GT based recipes adders * obliterate RA1 entries in interfaces (1/?) * remove RA1 blast furnace recipe usage * remove RA1 canner recipe usage * remove RA1 alloy smelter recipe usage * remove RA1 circuit assembler recipe usage * obliterate RA1 entries in interfaces (2/?) * remove RA1 bender recipe usage * clean class * remove RA1 cutter recipe usage * remove RA1 fuels recipe usage * remove RA1 implosion compressor recipe usage * remove RA1 thermal centrifuge recipe usage * clean GT_ModHandler * obliterate RA1 entries in interfaces (3/?) * remove RA1 packager recipe usage * remove RA1 lathe recipe usage * remove RA1 vacuum freezer recipe usage * remove RA1 fluid heater recipe usage * remove RA1 nano forge recipe usage * remove RA1 autoclave recipe usage * obliterate RA1 entries in interfaces (4/?) * remove RA1 cracker recipe usage * remove RA1 pyrolyse recipe usage * remove RA1 pulveriser recipe usage * remove RA1 fluid extractor recipe usage * remove RA1 assembly line recipe usage * remove RA1 alloy blast smelter recipe usage * remove RA1 coke oven recipe usage * obliterate RA1 entries in interfaces (5/?) * remove RA1 dehydrator recipe usage * remove deprecated usages * obliterate RA1 entries in interfaces (6/?) * remove RA1 assembler recipe usage * obliterate RA1 entries in interfaces (7/?) * remove RA1 mixer recipe usage * remove RA1 forge hammer recipe usage * remove RA1 wiremill recipe usage * remove RA1 extruder recipe usage * remove RA1 fluid soldifier recipe usage * remove RA1 chemical bath recipe usage * remove RA1 electromagnetic separator recipe usage * remove RA1 sifter recipe usage * remove distillery recipe usage * remove distillation tower usage * remove extractor usage * obliterate RA1 entries in interfaces (8/?) * remove QFT usage * cleaning * remove packager usage * remove fluid heater usage * remove vacuum freezer usage * remove distillery usage * fix QFT chances arrays * remove fission fuel usage * remove cyclotron usage * remove molecular transformer usage * remove chemplant usage * remove coldtrap and reactor processing unit usage * obliterate RA1 entries in interfaces (9/?) * spotlessApply * fixes * remove addRecipe calls * migrate forge of gods recipes * yeet special value calls (1 / 2) * yeet special value calls (2 / 2) * migrate GG Fuel recipes * migrate all GG maps except EHE * CORE.RA is no more * clear GT_RecipeAdder * remove dead code * clean RecipeMap a bit * spotless apply * fix output chances * Update RecipeLoader.java * fix * remove buggy recipe * migrate to enum for IDs * sort enum * move to enum * fix recipes * spotless apply * fix recipe * remove useless recipes * spotless apply * remove unused blocks * fix GT++ recipe * Update RecipeLoader.java * Update RecipeLoader.java * fix imports * Spotless apply for branch remove_RA1_calls for #2713 (#2742) spotlessApply Co-authored-by: GitHub GTNH Actions <> * fix recipe (cherry picked from commit a25d3b62997f080e064369e940eaf53a96a300e6) * fix (cherry picked from commit d9af01140f3ee77de2be18be70f04f8fbe4b547f) * temporarily remove panic mode * fix recipes * Revert "temporarily remove panic mode" This reverts commit 483cfcf74371b91e7d545f058f9d25ff4fcec95a. * fix recipes --------- Co-authored-by: Dream Master <dream-master@gmx.net> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Diffstat (limited to 'src/main/java/gregtech/api/util/SemiFluidFuelHandler.java')
-rw-r--r--src/main/java/gregtech/api/util/SemiFluidFuelHandler.java114
1 files changed, 38 insertions, 76 deletions
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();