From 0f990a7cfd78c3ede4db09a893e1e6edff164a2a Mon Sep 17 00:00:00 2001 From: boubou19 Date: Thu, 15 Aug 2024 15:38:58 +0200 Subject: Cleanup (#2803) * remove dead code * use proper materials for tiered circuits * remove yet another RA1 call * remove deprecated usage * small step toward Research station assline recipes migration * remove dead code * remove dead code * remove dead code * migrate BW recipes * remove some more RA1 code * remove bad search and replace + spotlessapply * yeet deprecated code and change how sieverts for recipes are computed * fix loading * fix bad replacements * spotless apply --- .../gregtech/api/items/GT_EnergyArmor_Item.java | 10 +- src/main/java/gregtech/api/recipe/RecipeMap.java | 20 -- src/main/java/gregtech/api/util/GT_ModHandler.java | 5 +- .../java/gregtech/api/util/GT_RecipeConstants.java | 43 ++- .../machines/multiblock/DistillationTower.java | 5 - .../multiblock/logic/CokeOvenProcessingLogic.java | 10 - .../loaders/oreprocessing/ProcessingDirty.java | 50 +++- .../gregtech/loaders/postload/GT_PostLoad.java | 320 +++++++++++---------- 8 files changed, 246 insertions(+), 217 deletions(-) (limited to 'src/main/java/gregtech') diff --git a/src/main/java/gregtech/api/items/GT_EnergyArmor_Item.java b/src/main/java/gregtech/api/items/GT_EnergyArmor_Item.java index 9c7b7c173c..df820f928a 100644 --- a/src/main/java/gregtech/api/items/GT_EnergyArmor_Item.java +++ b/src/main/java/gregtech/api/items/GT_EnergyArmor_Item.java @@ -148,15 +148,7 @@ public class GT_EnergyArmor_Item extends ItemArmor implements ISpecialArmor { } if (aPlayer.motionY >= 0.0D && jumpCharge > 0.0F && !aPlayer.isInWater()) { - if (GT_ModHandler.getJumpKeyDown(aPlayer) && GT_ModHandler.getBoostKeyDown(aPlayer)) { - if (jumpCharge == 1.0F) { - aPlayer.motionX *= 3.5D; - aPlayer.motionZ *= 3.5D; - } - - aPlayer.motionY += (jumpCharge * 0.3F); - jumpCharge = (float) (jumpCharge * 0.75D); - } else if (jumpCharge < 1.0F) { + if (jumpCharge < 1.0F) { jumpCharge = 0.0F; } } diff --git a/src/main/java/gregtech/api/recipe/RecipeMap.java b/src/main/java/gregtech/api/recipe/RecipeMap.java index 70a5fcf3ba..8ca9748f4f 100644 --- a/src/main/java/gregtech/api/recipe/RecipeMap.java +++ b/src/main/java/gregtech/api/recipe/RecipeMap.java @@ -133,26 +133,6 @@ public final class RecipeMap implements IRecipeMap { * Only used for fake Recipe Handlers to show something in NEI, do not use this for adding actual Recipes! * findRecipe won't find fake Recipes, containsInput WILL find fake Recipes */ - @Deprecated - @Nullable - public GT_Recipe addFakeRecipe(boolean aCheckForCollisions, @Nullable ItemStack[] aInputs, - @Nullable ItemStack[] aOutputs, @Nullable Object aSpecial, @Nullable FluidStack[] aFluidInputs, - @Nullable FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aSpecialValue) { - return addFakeRecipe( - aCheckForCollisions, - new GT_Recipe( - false, - aInputs, - aOutputs, - aSpecial, - null, - aFluidInputs, - aFluidOutputs, - aDuration, - aEUt, - aSpecialValue)); - } - @Deprecated @Nullable public GT_Recipe addFakeRecipe(boolean aCheckForCollisions, @Nullable ItemStack[] aInputs, diff --git a/src/main/java/gregtech/api/util/GT_ModHandler.java b/src/main/java/gregtech/api/util/GT_ModHandler.java index 45df4ffeea..18f52d1bd0 100644 --- a/src/main/java/gregtech/api/util/GT_ModHandler.java +++ b/src/main/java/gregtech/api/util/GT_ModHandler.java @@ -451,6 +451,7 @@ public class GT_ModHandler { /** * OUT OF ORDER */ + @Deprecated public static boolean getModeKeyDown(EntityPlayer aPlayer) { return false; } @@ -458,6 +459,7 @@ public class GT_ModHandler { /** * OUT OF ORDER */ + @Deprecated public static boolean getBoostKeyDown(EntityPlayer aPlayer) { return false; } @@ -465,6 +467,7 @@ public class GT_ModHandler { /** * OUT OF ORDER */ + @Deprecated public static boolean getJumpKeyDown(EntityPlayer aPlayer) { return false; } @@ -625,7 +628,7 @@ public class GT_ModHandler { .addTo(aGTRecipeMap); } } catch (Exception e) { - System.err.println(e); + e.printStackTrace(GT_Log.err); } } if (aRemoveIC2Recipe) { diff --git a/src/main/java/gregtech/api/util/GT_RecipeConstants.java b/src/main/java/gregtech/api/util/GT_RecipeConstants.java index 72027cff51..22dc842941 100644 --- a/src/main/java/gregtech/api/util/GT_RecipeConstants.java +++ b/src/main/java/gregtech/api/util/GT_RecipeConstants.java @@ -1,5 +1,6 @@ package gregtech.api.util; +import static gregtech.api.recipe.RecipeMaps.scannerFakeRecipes; import static gregtech.api.util.GT_RecipeMapUtil.convertCellToFluid; import java.util.ArrayList; @@ -18,8 +19,10 @@ import com.elisis.gtnhlanth.common.item.PhotolithographicMask; import com.elisis.gtnhlanth.common.register.LanthItemList; import cpw.mods.fml.common.registry.GameRegistry; +import gregtech.api.enums.GT_Values; import gregtech.api.enums.ItemList; import gregtech.api.enums.Materials; +import gregtech.api.enums.TierEU; import gregtech.api.interfaces.IRecipeMap; import gregtech.api.recipe.RecipeCategories; import gregtech.api.recipe.RecipeMaps; @@ -184,6 +187,20 @@ public class GT_RecipeConstants { public static final RecipeMetadataKey LFTR_OUTPUT_POWER = SimpleRecipeMetadataKey .create(Integer.class, "lftr_output_power"); + /** + * Research Station data. + */ + public static final RecipeMetadataKey RESEARCH_STATION_DATA = SimpleRecipeMetadataKey + .create(Integer.class, "research_station_data"); + + /** + * glass tier required for the biovat recipes. + */ + public static final RecipeMetadataKey SIEVERTS = SimpleRecipeMetadataKey.create(Integer.class, "sieverts"); + + public static final RecipeMetadataKey DECAY_TICKS = SimpleRecipeMetadataKey + .create(Integer.class, "decay_ticks"); + /** * 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. @@ -454,17 +471,18 @@ public class GT_RecipeConstants { tPersistentHash = tPersistentHash * 31 + r.mDuration; tPersistentHash = tPersistentHash * 31 + r.mEUt; Collection ret = new ArrayList<>(3); - ret.add( - RecipeMaps.scannerFakeRecipes.addFakeRecipe( - false, - new ItemStack[] { aResearchItem }, - new ItemStack[] { aOutput }, - new ItemStack[] { ItemList.Tool_DataStick.getWithName(1L, "Writes Research result") }, - null, - null, - aResearchTime, - 30, - -201)); // means it's scanned + ret.addAll( + GT_Values.RA.stdBuilder() + .itemInputs(aResearchItem) + .itemOutputs(aOutput) + .special(ItemList.Tool_DataStick.getWithName(1L, "Writes Research result")) + .duration(aResearchTime) + .eut(TierEU.RECIPE_LV) + .specialValue(-201) // means it's scanned + .noOptimize() + .ignoreCollision() + .fake() + .addTo(scannerFakeRecipes)); ret.add( RecipeMaps.assemblylineVisualRecipes.addFakeRecipe( @@ -575,6 +593,9 @@ public class GT_RecipeConstants { 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); + GT_RecipeMapUtil.SPECIAL_VALUE_ALIASES.add(RESEARCH_STATION_DATA); + GT_RecipeMapUtil.SPECIAL_VALUE_ALIASES.add(SIEVERTS); + GT_RecipeMapUtil.SPECIAL_VALUE_ALIASES.add(DECAY_TICKS); } } diff --git a/src/main/java/gregtech/common/tileentities/machines/multiblock/DistillationTower.java b/src/main/java/gregtech/common/tileentities/machines/multiblock/DistillationTower.java index 9e76883a8b..59efd46c94 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multiblock/DistillationTower.java +++ b/src/main/java/gregtech/common/tileentities/machines/multiblock/DistillationTower.java @@ -163,11 +163,6 @@ public class DistillationTower extends StackableController