diff options
Diffstat (limited to 'src/main/java/gregtech/api')
-rw-r--r-- | src/main/java/gregtech/api/interfaces/IRecipeMutableAccess.java | 18 | ||||
-rw-r--r-- | src/main/java/gregtech/api/util/GTRecipeRegistrator.java | 17 |
2 files changed, 3 insertions, 32 deletions
diff --git a/src/main/java/gregtech/api/interfaces/IRecipeMutableAccess.java b/src/main/java/gregtech/api/interfaces/IRecipeMutableAccess.java deleted file mode 100644 index 5c6d931d5a..0000000000 --- a/src/main/java/gregtech/api/interfaces/IRecipeMutableAccess.java +++ /dev/null @@ -1,18 +0,0 @@ -package gregtech.api.interfaces; - -import net.minecraft.item.ItemStack; - -/** - * Mixed-in interface for recipe classes in Forge and Vanilla that allows mutating the input and output items. - */ -public interface IRecipeMutableAccess { - - /** @return Gets the current output item of the recipe */ - ItemStack gt5u$getRecipeOutputItem(); - - /** Sets a new output item on the recipe */ - void gt5u$setRecipeOutputItem(ItemStack newItem); - - /** @return The raw list or array of recipe inputs, the exact type depends on the underlying recipe type. */ - Object gt5u$getRecipeInputs(); -} 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) { |