diff options
author | Alexdoru <57050655+Alexdoru@users.noreply.github.com> | 2024-09-28 13:25:01 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-09-28 11:25:01 +0000 |
commit | 86f1765b171f4cc6f163b8027d1330f4e5094e2d (patch) | |
tree | b6e293bd3c976558fc4e4b7190e4d342c2ddc555 /src/main/java/gregtech/api/util | |
parent | 6b1f145f5028f1bc92cf478e5963224e7d94b5cd (diff) | |
download | GT5-Unofficial-86f1765b171f4cc6f163b8027d1330f4e5094e2d.tar.gz GT5-Unofficial-86f1765b171f4cc6f163b8027d1330f4e5094e2d.tar.bz2 GT5-Unofficial-86f1765b171f4cc6f163b8027d1330f4e5094e2d.zip |
Remove more reflection + reorganize mixin accessors packages (#3260)
Co-authored-by: Martin Robertz <dream-master@gmx.net>
Co-authored-by: boubou19 <miisterunknown@gmail.com>
Diffstat (limited to 'src/main/java/gregtech/api/util')
-rw-r--r-- | src/main/java/gregtech/api/util/GTRecipeRegistrator.java | 17 |
1 files changed, 3 insertions, 14 deletions
diff --git a/src/main/java/gregtech/api/util/GTRecipeRegistrator.java b/src/main/java/gregtech/api/util/GTRecipeRegistrator.java index 919b37e7d9..745a544a52 100644 --- a/src/main/java/gregtech/api/util/GTRecipeRegistrator.java +++ b/src/main/java/gregtech/api/util/GTRecipeRegistrator.java @@ -31,7 +31,6 @@ import static gregtech.api.util.GTRecipeConstants.UniversalArcFurnace; import static gregtech.api.util.GTUtility.calculateRecipeEU; import static gregtech.api.util.GTUtility.getTier; -import java.lang.reflect.Field; import java.util.ArrayList; import java.util.Arrays; import java.util.IdentityHashMap; @@ -53,7 +52,6 @@ import com.google.common.collect.HashMultimap; import com.google.common.collect.ImmutableList; import com.google.common.collect.SetMultimap; -import cpw.mods.fml.relauncher.ReflectionHelper; import gregtech.api.GregTechAPI; import gregtech.api.enums.GTValues; import gregtech.api.enums.Materials; @@ -63,6 +61,7 @@ import gregtech.api.enums.TierEU; import gregtech.api.objects.ItemData; import gregtech.api.objects.MaterialStack; import gregtech.api.recipe.RecipeCategories; +import gregtech.mixin.interfaces.accessors.ShapedOreRecipeAccessor; import ic2.api.reactor.IReactorComponent; /** @@ -123,8 +122,6 @@ public class GTRecipeRegistrator { new RecipeShape(null, sMt1, null, sMt1, null, null, null, null, null), new RecipeShape(sMt1, sMt1, null, sMt2, null, sMt1, sMt2, null, null), new RecipeShape(null, sMt1, sMt1, sMt1, null, sMt2, null, null, sMt2) }; - public static final Field SHAPED_ORE_RECIPE_WIDTH = ReflectionHelper.findField(ShapedOreRecipe.class, "width"); - public static final Field SHAPED_ORE_RECIPE_HEIGHT = ReflectionHelper.findField(ShapedOreRecipe.class, "height"); private static volatile Map<RecipeShape, List<IRecipe>> indexedRecipeListCache; private static final String[][] sShapesA = new String[][] { null, null, null, { "Helmet", s_P + s_P + s_P, s_P + s_H + s_P }, @@ -791,19 +788,11 @@ public class GTRecipeRegistrator { } private static int getRecipeWidth(ShapedOreRecipe r) { - try { - return (int) SHAPED_ORE_RECIPE_WIDTH.get(r); - } catch (ReflectiveOperationException e) { - throw new RuntimeException(e); - } + return ((ShapedOreRecipeAccessor) r).gt5u$getWidth(); } private static int getRecipeHeight(ShapedOreRecipe r) { - try { - return (int) SHAPED_ORE_RECIPE_HEIGHT.get(r); - } catch (ReflectiveOperationException e) { - throw new RuntimeException(e); - } + return ((ShapedOreRecipeAccessor) r).gt5u$getHeight(); } private static int getRecipeHeight(ShapedRecipes r) { |