aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/gregtech/api
diff options
context:
space:
mode:
authorboubou19 <miisterunknown@gmail.com>2024-08-15 15:38:58 +0200
committerGitHub <noreply@github.com>2024-08-15 15:38:58 +0200
commit0f990a7cfd78c3ede4db09a893e1e6edff164a2a (patch)
tree5ab69d203be91a1c15313f61d9172f9bbdd4ba82 /src/main/java/gregtech/api
parent33c8d91bbe289651270378316fdadab730aa386f (diff)
downloadGT5-Unofficial-0f990a7cfd78c3ede4db09a893e1e6edff164a2a.tar.gz
GT5-Unofficial-0f990a7cfd78c3ede4db09a893e1e6edff164a2a.tar.bz2
GT5-Unofficial-0f990a7cfd78c3ede4db09a893e1e6edff164a2a.zip
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
Diffstat (limited to 'src/main/java/gregtech/api')
-rw-r--r--src/main/java/gregtech/api/items/GT_EnergyArmor_Item.java10
-rw-r--r--src/main/java/gregtech/api/recipe/RecipeMap.java20
-rw-r--r--src/main/java/gregtech/api/util/GT_ModHandler.java5
-rw-r--r--src/main/java/gregtech/api/util/GT_RecipeConstants.java43
4 files changed, 37 insertions, 41 deletions
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
@@ -137,26 +137,6 @@ public final class RecipeMap<B extends RecipeMapBackend> implements IRecipeMap {
@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,
- @Nullable ItemStack[] aOutputs, @Nullable Object aSpecial, @Nullable FluidStack[] aFluidInputs,
@Nullable FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aSpecialValue, ItemStack[][] aAlt,
boolean hidden) {
return addFakeRecipe(
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;
@@ -185,6 +188,20 @@ public class GT_RecipeConstants {
.create(Integer.class, "lftr_output_power");
/**
+ * Research Station data.
+ */
+ public static final RecipeMetadataKey<Integer> RESEARCH_STATION_DATA = SimpleRecipeMetadataKey
+ .create(Integer.class, "research_station_data");
+
+ /**
+ * glass tier required for the biovat recipes.
+ */
+ public static final RecipeMetadataKey<Integer> SIEVERTS = SimpleRecipeMetadataKey.create(Integer.class, "sieverts");
+
+ public static final RecipeMetadataKey<Integer> 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<GT_Recipe> 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);
}
}