aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/gregtech/api/recipe/check
diff options
context:
space:
mode:
authorNotAPenguin <michiel.vandeginste@gmail.com>2024-09-02 23:17:17 +0200
committerGitHub <noreply@github.com>2024-09-02 23:17:17 +0200
commit1b820de08a05070909a267e17f033fcf58ac8710 (patch)
tree02831a025986a06b20f87e5bcc69d1e0c639a342 /src/main/java/gregtech/api/recipe/check
parentafd3fd92b6a6ab9ab0d0dc3214e6bc8ff7a86c9b (diff)
downloadGT5-Unofficial-1b820de08a05070909a267e17f033fcf58ac8710.tar.gz
GT5-Unofficial-1b820de08a05070909a267e17f033fcf58ac8710.tar.bz2
GT5-Unofficial-1b820de08a05070909a267e17f033fcf58ac8710.zip
The Great Renaming (#3014)
* move kekztech to a single root dir * move detrav to a single root dir * move gtnh-lanthanides to a single root dir * move tectech and delete some gross reflection in gt++ * remove more reflection inside gt5u * delete more reflection in gt++ * fix imports * move bartworks and bwcrossmod * fix proxies * move galactigreg and ggfab * move gtneioreplugin * try to fix gt++ bee loader * apply the rename rules to BW * apply rename rules to bwcrossmod * apply rename rules to detrav scanner mod * apply rename rules to galacticgreg * apply rename rules to ggfab * apply rename rules to goodgenerator * apply rename rules to gtnh-lanthanides * apply rename rules to gt++ * apply rename rules to kekztech * apply rename rules to kubatech * apply rename rules to tectech * apply rename rules to gt apply the rename rules to gt * fix tt import * fix mui hopefully * fix coremod except intergalactic * rename assline recipe class * fix a class name i stumbled on * rename StructureUtility to GTStructureUtility to prevent conflict with structurelib * temporary rename of GTTooltipDataCache to old name * fix gt client/server proxy names
Diffstat (limited to 'src/main/java/gregtech/api/recipe/check')
-rw-r--r--src/main/java/gregtech/api/recipe/check/ResultInsufficientHeat.java4
-rw-r--r--src/main/java/gregtech/api/recipe/check/ResultInsufficientMachineTier.java4
-rw-r--r--src/main/java/gregtech/api/recipe/check/ResultInsufficientPower.java6
-rw-r--r--src/main/java/gregtech/api/recipe/check/ResultInsufficientStartupPower.java4
-rw-r--r--src/main/java/gregtech/api/recipe/check/ResultInsufficientStartupPowerBigInt.java2
-rw-r--r--src/main/java/gregtech/api/recipe/check/SingleRecipeCheck.java59
6 files changed, 39 insertions, 40 deletions
diff --git a/src/main/java/gregtech/api/recipe/check/ResultInsufficientHeat.java b/src/main/java/gregtech/api/recipe/check/ResultInsufficientHeat.java
index 9383abad9d..18edab74e7 100644
--- a/src/main/java/gregtech/api/recipe/check/ResultInsufficientHeat.java
+++ b/src/main/java/gregtech/api/recipe/check/ResultInsufficientHeat.java
@@ -11,7 +11,7 @@ import net.minecraft.util.StatCollector;
import org.jetbrains.annotations.NotNull;
import gregtech.api.enums.HeatingCoilLevel;
-import gregtech.api.util.GT_Utility;
+import gregtech.api.util.GTUtility;
public class ResultInsufficientHeat implements CheckRecipeResult {
@@ -38,7 +38,7 @@ public class ResultInsufficientHeat implements CheckRecipeResult {
return Objects.requireNonNull(
StatCollector.translateToLocalFormatted(
"GT5U.gui.text.insufficient_heat",
- GT_Utility.formatNumbers(required),
+ GTUtility.formatNumbers(required),
HeatingCoilLevel.getDisplayNameFromHeat(required, true)));
}
diff --git a/src/main/java/gregtech/api/recipe/check/ResultInsufficientMachineTier.java b/src/main/java/gregtech/api/recipe/check/ResultInsufficientMachineTier.java
index 1fb2183edb..2f144049f1 100644
--- a/src/main/java/gregtech/api/recipe/check/ResultInsufficientMachineTier.java
+++ b/src/main/java/gregtech/api/recipe/check/ResultInsufficientMachineTier.java
@@ -10,7 +10,7 @@ import net.minecraft.util.StatCollector;
import org.jetbrains.annotations.NotNull;
-import gregtech.api.util.GT_Utility;
+import gregtech.api.util.GTUtility;
public class ResultInsufficientMachineTier implements CheckRecipeResult {
@@ -37,7 +37,7 @@ public class ResultInsufficientMachineTier implements CheckRecipeResult {
return Objects.requireNonNull(
StatCollector.translateToLocalFormatted(
"GT5U.gui.text.insufficient_machine_tier",
- GT_Utility.formatNumbers(required)));
+ GTUtility.formatNumbers(required)));
}
@Override
diff --git a/src/main/java/gregtech/api/recipe/check/ResultInsufficientPower.java b/src/main/java/gregtech/api/recipe/check/ResultInsufficientPower.java
index 45b50aebf6..33b86ecbf8 100644
--- a/src/main/java/gregtech/api/recipe/check/ResultInsufficientPower.java
+++ b/src/main/java/gregtech/api/recipe/check/ResultInsufficientPower.java
@@ -10,7 +10,7 @@ import net.minecraft.util.StatCollector;
import org.jetbrains.annotations.NotNull;
-import gregtech.api.util.GT_Utility;
+import gregtech.api.util.GTUtility;
public class ResultInsufficientPower implements CheckRecipeResult {
@@ -37,8 +37,8 @@ public class ResultInsufficientPower implements CheckRecipeResult {
return Objects.requireNonNull(
StatCollector.translateToLocalFormatted(
"GT5U.gui.text.insufficient_power",
- GT_Utility.formatNumbers(required),
- GT_Utility.getColoredTierNameFromVoltage(required)));
+ GTUtility.formatNumbers(required),
+ GTUtility.getColoredTierNameFromVoltage(required)));
}
@Override
diff --git a/src/main/java/gregtech/api/recipe/check/ResultInsufficientStartupPower.java b/src/main/java/gregtech/api/recipe/check/ResultInsufficientStartupPower.java
index c33e9bfff1..9adf82aa28 100644
--- a/src/main/java/gregtech/api/recipe/check/ResultInsufficientStartupPower.java
+++ b/src/main/java/gregtech/api/recipe/check/ResultInsufficientStartupPower.java
@@ -10,7 +10,7 @@ import net.minecraft.util.StatCollector;
import org.jetbrains.annotations.NotNull;
-import gregtech.api.util.GT_Utility;
+import gregtech.api.util.GTUtility;
public class ResultInsufficientStartupPower implements CheckRecipeResult {
@@ -37,7 +37,7 @@ public class ResultInsufficientStartupPower implements CheckRecipeResult {
return Objects.requireNonNull(
StatCollector.translateToLocalFormatted(
"GT5U.gui.text.insufficient_startup_power",
- GT_Utility.formatNumbers(required)));
+ GTUtility.formatNumbers(required)));
}
@Override
diff --git a/src/main/java/gregtech/api/recipe/check/ResultInsufficientStartupPowerBigInt.java b/src/main/java/gregtech/api/recipe/check/ResultInsufficientStartupPowerBigInt.java
index f4b186c9a1..32aab79465 100644
--- a/src/main/java/gregtech/api/recipe/check/ResultInsufficientStartupPowerBigInt.java
+++ b/src/main/java/gregtech/api/recipe/check/ResultInsufficientStartupPowerBigInt.java
@@ -1,6 +1,6 @@
package gregtech.api.recipe.check;
-import static util.Util.toStandardForm;
+import static kekztech.util.Util.toStandardForm;
import java.math.BigInteger;
import java.util.Objects;
diff --git a/src/main/java/gregtech/api/recipe/check/SingleRecipeCheck.java b/src/main/java/gregtech/api/recipe/check/SingleRecipeCheck.java
index 8683812d84..d339f8acfd 100644
--- a/src/main/java/gregtech/api/recipe/check/SingleRecipeCheck.java
+++ b/src/main/java/gregtech/api/recipe/check/SingleRecipeCheck.java
@@ -22,11 +22,11 @@ import net.minecraftforge.fluids.FluidStack;
import com.google.common.collect.ImmutableMap;
-import gregtech.api.enums.GT_Values;
+import gregtech.api.enums.GTValues;
import gregtech.api.recipe.RecipeMap;
-import gregtech.api.util.GT_Recipe;
-import gregtech.api.util.GT_Utility;
-import gregtech.api.util.GT_Utility.ItemId;
+import gregtech.api.util.GTRecipe;
+import gregtech.api.util.GTUtility;
+import gregtech.api.util.GTUtility.ItemId;
/**
* Used by machines that are locked to a single recipe, for faster recipe check.
@@ -37,10 +37,10 @@ import gregtech.api.util.GT_Utility.ItemId;
* <ul>
* {@link gregtech.api.recipe.FindRecipeQuery#find Find recipe from recipemap}: O(NCR)
* where N = number of machine inputs, C = average amount of recipe candidates found for specific input,
- * R = computation time to {@link GT_Recipe#isRecipeInputEqual check if inputs match to recipe}
+ * R = computation time to {@link GTRecipe#isRecipeInputEqual check if inputs match to recipe}
* </ul>
* <ul>
- * {@link GT_Recipe#isRecipeInputEqual Check if inputs match to recipe}: O(NM)
+ * {@link GTRecipe#isRecipeInputEqual Check if inputs match to recipe}: O(NM)
* where N = number of machine inputs, M = number of recipe inputs
* </ul>
* </ul>
@@ -52,7 +52,7 @@ import gregtech.api.util.GT_Utility.ItemId;
public class SingleRecipeCheck {
@Nonnull
- private final GT_Recipe recipe;
+ private final GTRecipe recipe;
@Nonnull
private final RecipeMap<?> recipeMap;
@Nonnull
@@ -63,7 +63,7 @@ public class SingleRecipeCheck {
private final int totalItemCost;
private final int totalFluidCost;
- private SingleRecipeCheck(@Nonnull GT_Recipe recipe, @Nonnull RecipeMap<?> recipeMap,
+ private SingleRecipeCheck(@Nonnull GTRecipe recipe, @Nonnull RecipeMap<?> recipeMap,
@Nonnull ImmutableMap<ItemId, Integer> itemCost, @Nonnull ImmutableMap<Fluid, Integer> fluidCost) {
this.recipe = recipe;
this.recipeMap = recipeMap;
@@ -81,7 +81,7 @@ public class SingleRecipeCheck {
}
@Nonnull
- public GT_Recipe getRecipe() {
+ public GTRecipe getRecipe() {
return recipe;
}
@@ -188,14 +188,14 @@ public class SingleRecipeCheck {
// At load time we do a recipe check again, so in case the recipe is gone, we can stop tracking.
// Of course the next step would be auto migrating to new recipe (if any), but given
// we don't yet have a mean to uniquely name a recipe, this will have to make do.
- // Consider move serialization code to GT_Recipe once this has been proven to work
+ // Consider move serialization code to GTRecipe once this has been proven to work
NBTTagCompound tag = new NBTTagCompound();
tag.setString("recipemap", recipeMap.unlocalizedName);
if (recipe.mInputs != null) {
- tag.setTag("inputs", writeList(recipe.mInputs, GT_Utility::saveItem));
+ tag.setTag("inputs", writeList(recipe.mInputs, GTUtility::saveItem));
}
if (recipe.mOutputs != null) {
- tag.setTag("outputs", writeList(recipe.mOutputs, GT_Utility::saveItem));
+ tag.setTag("outputs", writeList(recipe.mOutputs, GTUtility::saveItem));
}
if (recipe.mChances != null) {
tag.setIntArray("chances", recipe.mChances);
@@ -270,45 +270,44 @@ public class SingleRecipeCheck {
return null;
}
- GT_Recipe foundRecipe = tryFindRecipe(mapToUse, tag);
+ GTRecipe foundRecipe = tryFindRecipe(mapToUse, tag);
if (foundRecipe == null) return null;
return new SingleRecipeCheck(foundRecipe, mapToUse, loadItemCost(tag), loadFluidCost(tag));
}
private static ImmutableMap<Fluid, Integer> loadFluidCost(NBTTagCompound tag) {
- return GT_Utility.streamCompounds(tag.getTagList("fluidCost", Constants.NBT.TAG_COMPOUND))
+ return GTUtility.streamCompounds(tag.getTagList("fluidCost", Constants.NBT.TAG_COMPOUND))
.collect(
- GT_Utility
+ GTUtility
.toImmutableMapSerial(t -> FluidRegistry.getFluid(t.getString("id")), t -> t.getInteger("count")));
}
private static ImmutableMap<ItemId, Integer> loadItemCost(NBTTagCompound tag) {
- return GT_Utility.streamCompounds(tag.getTagList("itemCost", Constants.NBT.TAG_COMPOUND))
+ return GTUtility.streamCompounds(tag.getTagList("itemCost", Constants.NBT.TAG_COMPOUND))
.collect(
- GT_Utility
- .toImmutableMapSerial(t -> ItemId.create(t.getCompoundTag("id")), t -> t.getInteger("count")));
+ GTUtility.toImmutableMapSerial(t -> ItemId.create(t.getCompoundTag("id")), t -> t.getInteger("count")));
}
- private static GT_Recipe tryFindRecipe(@Nonnull RecipeMap<?> recipeMap, NBTTagCompound tag) {
- ItemStack[] inputs = GT_Utility.streamCompounds(tag.getTagList("inputs", Constants.NBT.TAG_COMPOUND))
- .map(GT_Utility::loadItem)
+ private static GTRecipe tryFindRecipe(@Nonnull RecipeMap<?> recipeMap, NBTTagCompound tag) {
+ ItemStack[] inputs = GTUtility.streamCompounds(tag.getTagList("inputs", Constants.NBT.TAG_COMPOUND))
+ .map(GTUtility::loadItem)
.toArray(ItemStack[]::new);
- ItemStack[] outputs = GT_Utility.streamCompounds(tag.getTagList("outputs", Constants.NBT.TAG_COMPOUND))
- .map(GT_Utility::loadItem)
+ ItemStack[] outputs = GTUtility.streamCompounds(tag.getTagList("outputs", Constants.NBT.TAG_COMPOUND))
+ .map(GTUtility::loadItem)
.toArray(ItemStack[]::new);
- FluidStack[] fInputs = GT_Utility.streamCompounds(tag.getTagList("fInputs", Constants.NBT.TAG_COMPOUND))
+ FluidStack[] fInputs = GTUtility.streamCompounds(tag.getTagList("fInputs", Constants.NBT.TAG_COMPOUND))
.map(FluidStack::loadFluidStackFromNBT)
.toArray(FluidStack[]::new);
- FluidStack[] fOutputs = GT_Utility.streamCompounds(tag.getTagList("fOutputs", Constants.NBT.TAG_COMPOUND))
+ FluidStack[] fOutputs = GTUtility.streamCompounds(tag.getTagList("fOutputs", Constants.NBT.TAG_COMPOUND))
.map(FluidStack::loadFluidStackFromNBT)
.toArray(FluidStack[]::new);
int eut = tag.getInteger("eut");
- GT_Recipe found = recipeMap.findRecipe(null, false, GT_Values.V[GT_Utility.getTier(eut)], fInputs, inputs);
+ GTRecipe found = recipeMap.findRecipe(null, false, GTValues.V[GTUtility.getTier(eut)], fInputs, inputs);
int[] chances = tag.getIntArray("chances");
if (chances.length == 0) chances = null;
- if (found == null || !GT_Utility.equals(inputs, found.mInputs)
+ if (found == null || !GTUtility.equals(inputs, found.mInputs)
|| !Arrays.equals(fInputs, found.mFluidInputs)
- || !GT_Utility.equals(outputs, found.mOutputs)
+ || !GTUtility.equals(outputs, found.mOutputs)
|| !Arrays.equals(fOutputs, found.mFluidOutputs)
|| !Arrays.equals(chances, found.mChances)
|| found.mDuration != tag.getInteger("duration")
@@ -350,7 +349,7 @@ public class SingleRecipeCheck {
private Map<ItemId, Integer> afterItems;
private Map<Fluid, Integer> afterFluids;
- private GT_Recipe recipe;
+ private GTRecipe recipe;
private Builder(@Nonnull RecipeMap<?> recipeMap) {
this.recipeMap = recipeMap;
@@ -368,7 +367,7 @@ public class SingleRecipeCheck {
return this;
}
- public Builder setRecipe(@Nonnull GT_Recipe recipe) {
+ public Builder setRecipe(@Nonnull GTRecipe recipe) {
this.recipe = recipe;
return this;
}