From 1b820de08a05070909a267e17f033fcf58ac8710 Mon Sep 17 00:00:00 2001 From: NotAPenguin Date: Mon, 2 Sep 2024 23:17:17 +0200 Subject: 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 --- .../api/recipe/check/ResultInsufficientHeat.java | 4 +- .../check/ResultInsufficientMachineTier.java | 4 +- .../api/recipe/check/ResultInsufficientPower.java | 6 +-- .../check/ResultInsufficientStartupPower.java | 4 +- .../ResultInsufficientStartupPowerBigInt.java | 2 +- .../api/recipe/check/SingleRecipeCheck.java | 59 +++++++++++----------- 6 files changed, 39 insertions(+), 40 deletions(-) (limited to 'src/main/java/gregtech/api/recipe/check') 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; * * * @@ -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 itemCost, @Nonnull ImmutableMap 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 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 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 afterItems; private Map 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; } -- cgit