aboutsummaryrefslogtreecommitdiff
path: root/src/main
diff options
context:
space:
mode:
authorAlexdoru <57050655+Alexdoru@users.noreply.github.com>2024-09-17 04:04:58 +0200
committerboubou19 <miisterunknown@gmail.com>2024-09-17 22:55:46 +0200
commit670b56865f7e36f53fd2fc81bfb6028b91b5a3eb (patch)
tree1f29ad5d5466834d95b22c09079909182ed7cf76 /src/main
parentc999c4c8175713713994169dbcd3f2cf64189a37 (diff)
downloadGT5-Unofficial-670b56865f7e36f53fd2fc81bfb6028b91b5a3eb.tar.gz
GT5-Unofficial-670b56865f7e36f53fd2fc81bfb6028b91b5a3eb.tar.bz2
GT5-Unofficial-670b56865f7e36f53fd2fc81bfb6028b91b5a3eb.zip
remove reflection from BioRecipes.java that's just calling GTModHandler.addCraftingRecipe with extra steps...
Diffstat (limited to 'src/main')
-rw-r--r--src/main/java/gtPlusPlus/core/item/chemistry/GenericChem.java51
-rw-r--r--src/main/java/gtPlusPlus/plugin/agrichem/BioRecipes.java105
2 files changed, 50 insertions, 106 deletions
diff --git a/src/main/java/gtPlusPlus/core/item/chemistry/GenericChem.java b/src/main/java/gtPlusPlus/core/item/chemistry/GenericChem.java
index 99885d77e8..4ba835d57d 100644
--- a/src/main/java/gtPlusPlus/core/item/chemistry/GenericChem.java
+++ b/src/main/java/gtPlusPlus/core/item/chemistry/GenericChem.java
@@ -40,7 +40,6 @@ import gtPlusPlus.core.material.state.MaterialState;
import gtPlusPlus.core.recipe.common.CI;
import gtPlusPlus.core.util.minecraft.FluidUtils;
import gtPlusPlus.core.util.minecraft.ItemUtils;
-import gtPlusPlus.plugin.agrichem.BioRecipes;
import gtPlusPlus.plugin.agrichem.block.AgrichemFluids;
import gtPlusPlus.xmod.gregtech.api.enums.GregtechItemList;
@@ -866,100 +865,100 @@ public class GenericChem extends ItemPackage {
0,
new Object[] { OrePrefixes.circuit.get(Materials.HV) });
- long bits = 0;
- BioRecipes.addCraftingRecipe(
+ final long bits = 0;
+ GTModHandler.addCraftingRecipe(
GregtechItemList.Circuit_T3RecipeSelector.getWithDamage(1L, 1L),
bits,
new Object[] { "d ", " P ", " ", 'P', GregtechItemList.Circuit_T3RecipeSelector.getWildcard(1L) });
- BioRecipes.addCraftingRecipe(
+ GTModHandler.addCraftingRecipe(
GregtechItemList.Circuit_T3RecipeSelector.getWithDamage(1L, 2L),
bits,
new Object[] { " d ", " P ", " ", 'P', GregtechItemList.Circuit_T3RecipeSelector.getWildcard(1L) });
- BioRecipes.addCraftingRecipe(
+ GTModHandler.addCraftingRecipe(
GregtechItemList.Circuit_T3RecipeSelector.getWithDamage(1L, 3L),
bits,
new Object[] { " d", " P ", " ", 'P', GregtechItemList.Circuit_T3RecipeSelector.getWildcard(1L) });
- BioRecipes.addCraftingRecipe(
+ GTModHandler.addCraftingRecipe(
GregtechItemList.Circuit_T3RecipeSelector.getWithDamage(1L, 4L),
bits,
new Object[] { " ", " Pd", " ", 'P', GregtechItemList.Circuit_T3RecipeSelector.getWildcard(1L) });
- BioRecipes.addCraftingRecipe(
+ GTModHandler.addCraftingRecipe(
GregtechItemList.Circuit_T3RecipeSelector.getWithDamage(1L, 5L),
bits,
new Object[] { " ", " P ", " d", 'P', GregtechItemList.Circuit_T3RecipeSelector.getWildcard(1L) });
- BioRecipes.addCraftingRecipe(
+ GTModHandler.addCraftingRecipe(
GregtechItemList.Circuit_T3RecipeSelector.getWithDamage(1L, 6L),
bits,
new Object[] { " ", " P ", " d ", 'P', GregtechItemList.Circuit_T3RecipeSelector.getWildcard(1L) });
- BioRecipes.addCraftingRecipe(
+ GTModHandler.addCraftingRecipe(
GregtechItemList.Circuit_T3RecipeSelector.getWithDamage(1L, 7L),
bits,
new Object[] { " ", " P ", "d ", 'P', GregtechItemList.Circuit_T3RecipeSelector.getWildcard(1L) });
- BioRecipes.addCraftingRecipe(
+ GTModHandler.addCraftingRecipe(
GregtechItemList.Circuit_T3RecipeSelector.getWithDamage(1L, 8L),
bits,
new Object[] { " ", "dP ", " ", 'P', GregtechItemList.Circuit_T3RecipeSelector.getWildcard(1L) });
- BioRecipes.addCraftingRecipe(
+ GTModHandler.addCraftingRecipe(
GregtechItemList.Circuit_T3RecipeSelector.getWithDamage(1L, 9L),
bits,
new Object[] { "P d", " ", " ", 'P', GregtechItemList.Circuit_T3RecipeSelector.getWildcard(1L) });
- BioRecipes.addCraftingRecipe(
+ GTModHandler.addCraftingRecipe(
GregtechItemList.Circuit_T3RecipeSelector.getWithDamage(1L, 10L),
bits,
new Object[] { "P ", " d", " ", 'P', GregtechItemList.Circuit_T3RecipeSelector.getWildcard(1L) });
- BioRecipes.addCraftingRecipe(
+ GTModHandler.addCraftingRecipe(
GregtechItemList.Circuit_T3RecipeSelector.getWithDamage(1L, 11L),
bits,
new Object[] { "P ", " ", " d", 'P', GregtechItemList.Circuit_T3RecipeSelector.getWildcard(1L) });
- BioRecipes.addCraftingRecipe(
+ GTModHandler.addCraftingRecipe(
GregtechItemList.Circuit_T3RecipeSelector.getWithDamage(1L, 12L),
bits,
new Object[] { "P ", " ", " d ", 'P', GregtechItemList.Circuit_T3RecipeSelector.getWildcard(1L) });
- BioRecipes.addCraftingRecipe(
+ GTModHandler.addCraftingRecipe(
GregtechItemList.Circuit_T3RecipeSelector.getWithDamage(1L, 13L),
bits,
new Object[] { " P", " ", " d", 'P', GregtechItemList.Circuit_T3RecipeSelector.getWildcard(1L) });
- BioRecipes.addCraftingRecipe(
+ GTModHandler.addCraftingRecipe(
GregtechItemList.Circuit_T3RecipeSelector.getWithDamage(1L, 14L),
bits,
new Object[] { " P", " ", " d ", 'P', GregtechItemList.Circuit_T3RecipeSelector.getWildcard(1L) });
- BioRecipes.addCraftingRecipe(
+ GTModHandler.addCraftingRecipe(
GregtechItemList.Circuit_T3RecipeSelector.getWithDamage(1L, 15L),
bits,
new Object[] { " P", " ", "d ", 'P', GregtechItemList.Circuit_T3RecipeSelector.getWildcard(1L) });
- BioRecipes.addCraftingRecipe(
+ GTModHandler.addCraftingRecipe(
GregtechItemList.Circuit_T3RecipeSelector.getWithDamage(1L, 16L),
bits,
new Object[] { " P", "d ", " ", 'P', GregtechItemList.Circuit_T3RecipeSelector.getWildcard(1L) });
- BioRecipes.addCraftingRecipe(
+ GTModHandler.addCraftingRecipe(
GregtechItemList.Circuit_T3RecipeSelector.getWithDamage(1L, 17L),
bits,
new Object[] { " ", " ", "d P", 'P', GregtechItemList.Circuit_T3RecipeSelector.getWildcard(1L) });
- BioRecipes.addCraftingRecipe(
+ GTModHandler.addCraftingRecipe(
GregtechItemList.Circuit_T3RecipeSelector.getWithDamage(1L, 18L),
bits,
new Object[] { " ", "d ", " P", 'P', GregtechItemList.Circuit_T3RecipeSelector.getWildcard(1L) });
- BioRecipes.addCraftingRecipe(
+ GTModHandler.addCraftingRecipe(
GregtechItemList.Circuit_T3RecipeSelector.getWithDamage(1L, 19L),
bits,
new Object[] { "d ", " ", " P", 'P', GregtechItemList.Circuit_T3RecipeSelector.getWildcard(1L) });
- BioRecipes.addCraftingRecipe(
+ GTModHandler.addCraftingRecipe(
GregtechItemList.Circuit_T3RecipeSelector.getWithDamage(1L, 20L),
bits,
new Object[] { " d ", " ", " P", 'P', GregtechItemList.Circuit_T3RecipeSelector.getWildcard(1L) });
- BioRecipes.addCraftingRecipe(
+ GTModHandler.addCraftingRecipe(
GregtechItemList.Circuit_T3RecipeSelector.getWithDamage(1L, 21L),
bits,
new Object[] { "d ", " ", "P ", 'P', GregtechItemList.Circuit_T3RecipeSelector.getWildcard(1L) });
- BioRecipes.addCraftingRecipe(
+ GTModHandler.addCraftingRecipe(
GregtechItemList.Circuit_T3RecipeSelector.getWithDamage(1L, 22L),
bits,
new Object[] { " d ", " ", "P ", 'P', GregtechItemList.Circuit_T3RecipeSelector.getWildcard(1L) });
- BioRecipes.addCraftingRecipe(
+ GTModHandler.addCraftingRecipe(
GregtechItemList.Circuit_T3RecipeSelector.getWithDamage(1L, 23L),
bits,
new Object[] { " d", " ", "P ", 'P', GregtechItemList.Circuit_T3RecipeSelector.getWildcard(1L) });
- BioRecipes.addCraftingRecipe(
+ GTModHandler.addCraftingRecipe(
GregtechItemList.Circuit_T3RecipeSelector.getWithDamage(1L, 24L),
bits,
new Object[] { " ", " d", "P ", 'P', GregtechItemList.Circuit_T3RecipeSelector.getWildcard(1L) });
diff --git a/src/main/java/gtPlusPlus/plugin/agrichem/BioRecipes.java b/src/main/java/gtPlusPlus/plugin/agrichem/BioRecipes.java
index 5164967a90..622ae92281 100644
--- a/src/main/java/gtPlusPlus/plugin/agrichem/BioRecipes.java
+++ b/src/main/java/gtPlusPlus/plugin/agrichem/BioRecipes.java
@@ -23,13 +23,10 @@ import static gtPlusPlus.api.recipe.GTPPRecipeMaps.chemicalDehydratorRecipes;
import static gtPlusPlus.api.recipe.GTPPRecipeMaps.chemicalPlantRecipes;
import static gtPlusPlus.api.recipe.GTPPRecipeMaps.cokeOvenRecipes;
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
-import net.minecraft.enchantment.Enchantment;
import net.minecraft.init.Blocks;
import net.minecraft.init.Items;
import net.minecraft.item.Item;
@@ -58,7 +55,6 @@ import gtPlusPlus.core.util.minecraft.ItemUtils;
import gtPlusPlus.core.util.minecraft.MaterialUtils;
import gtPlusPlus.core.util.minecraft.OreDictUtils;
import gtPlusPlus.core.util.minecraft.RecipeUtils;
-import gtPlusPlus.core.util.reflect.ReflectionUtils;
import gtPlusPlus.plugin.agrichem.block.AgrichemFluids;
import gtPlusPlus.xmod.gregtech.api.enums.GregtechItemList;
import gtPlusPlus.xmod.railcraft.utils.RailcraftUtils;
@@ -1105,153 +1101,102 @@ public class BioRecipes {
0,
new Object[] { OrePrefixes.circuit.get(Materials.ULV) });
- long bits = 0;
- addCraftingRecipe(
+ final long bits = 0;
+ GTModHandler.addCraftingRecipe(
GregtechItemList.Circuit_BioRecipeSelector.getWithDamage(1L, 1L),
bits,
new Object[] { "d ", " P ", " ", 'P', GregtechItemList.Circuit_BioRecipeSelector.getWildcard(1L) });
- addCraftingRecipe(
+ GTModHandler.addCraftingRecipe(
GregtechItemList.Circuit_BioRecipeSelector.getWithDamage(1L, 2L),
bits,
new Object[] { " d ", " P ", " ", 'P', GregtechItemList.Circuit_BioRecipeSelector.getWildcard(1L) });
- addCraftingRecipe(
+ GTModHandler.addCraftingRecipe(
GregtechItemList.Circuit_BioRecipeSelector.getWithDamage(1L, 3L),
bits,
new Object[] { " d", " P ", " ", 'P', GregtechItemList.Circuit_BioRecipeSelector.getWildcard(1L) });
- addCraftingRecipe(
+ GTModHandler.addCraftingRecipe(
GregtechItemList.Circuit_BioRecipeSelector.getWithDamage(1L, 4L),
bits,
new Object[] { " ", " Pd", " ", 'P', GregtechItemList.Circuit_BioRecipeSelector.getWildcard(1L) });
- addCraftingRecipe(
+ GTModHandler.addCraftingRecipe(
GregtechItemList.Circuit_BioRecipeSelector.getWithDamage(1L, 5L),
bits,
new Object[] { " ", " P ", " d", 'P', GregtechItemList.Circuit_BioRecipeSelector.getWildcard(1L) });
- addCraftingRecipe(
+ GTModHandler.addCraftingRecipe(
GregtechItemList.Circuit_BioRecipeSelector.getWithDamage(1L, 6L),
bits,
new Object[] { " ", " P ", " d ", 'P', GregtechItemList.Circuit_BioRecipeSelector.getWildcard(1L) });
- addCraftingRecipe(
+ GTModHandler.addCraftingRecipe(
GregtechItemList.Circuit_BioRecipeSelector.getWithDamage(1L, 7L),
bits,
new Object[] { " ", " P ", "d ", 'P', GregtechItemList.Circuit_BioRecipeSelector.getWildcard(1L) });
- addCraftingRecipe(
+ GTModHandler.addCraftingRecipe(
GregtechItemList.Circuit_BioRecipeSelector.getWithDamage(1L, 8L),
bits,
new Object[] { " ", "dP ", " ", 'P', GregtechItemList.Circuit_BioRecipeSelector.getWildcard(1L) });
- addCraftingRecipe(
+ GTModHandler.addCraftingRecipe(
GregtechItemList.Circuit_BioRecipeSelector.getWithDamage(1L, 9L),
bits,
new Object[] { "P d", " ", " ", 'P', GregtechItemList.Circuit_BioRecipeSelector.getWildcard(1L) });
- addCraftingRecipe(
+ GTModHandler.addCraftingRecipe(
GregtechItemList.Circuit_BioRecipeSelector.getWithDamage(1L, 10L),
bits,
new Object[] { "P ", " d", " ", 'P', GregtechItemList.Circuit_BioRecipeSelector.getWildcard(1L) });
- addCraftingRecipe(
+ GTModHandler.addCraftingRecipe(
GregtechItemList.Circuit_BioRecipeSelector.getWithDamage(1L, 11L),
bits,
new Object[] { "P ", " ", " d", 'P', GregtechItemList.Circuit_BioRecipeSelector.getWildcard(1L) });
- addCraftingRecipe(
+ GTModHandler.addCraftingRecipe(
GregtechItemList.Circuit_BioRecipeSelector.getWithDamage(1L, 12L),
bits,
new Object[] { "P ", " ", " d ", 'P', GregtechItemList.Circuit_BioRecipeSelector.getWildcard(1L) });
- addCraftingRecipe(
+ GTModHandler.addCraftingRecipe(
GregtechItemList.Circuit_BioRecipeSelector.getWithDamage(1L, 13L),
bits,
new Object[] { " P", " ", " d", 'P', GregtechItemList.Circuit_BioRecipeSelector.getWildcard(1L) });
- addCraftingRecipe(
+ GTModHandler.addCraftingRecipe(
GregtechItemList.Circuit_BioRecipeSelector.getWithDamage(1L, 14L),
bits,
new Object[] { " P", " ", " d ", 'P', GregtechItemList.Circuit_BioRecipeSelector.getWildcard(1L) });
- addCraftingRecipe(
+ GTModHandler.addCraftingRecipe(
GregtechItemList.Circuit_BioRecipeSelector.getWithDamage(1L, 15L),
bits,
new Object[] { " P", " ", "d ", 'P', GregtechItemList.Circuit_BioRecipeSelector.getWildcard(1L) });
- addCraftingRecipe(
+ GTModHandler.addCraftingRecipe(
GregtechItemList.Circuit_BioRecipeSelector.getWithDamage(1L, 16L),
bits,
new Object[] { " P", "d ", " ", 'P', GregtechItemList.Circuit_BioRecipeSelector.getWildcard(1L) });
- addCraftingRecipe(
+ GTModHandler.addCraftingRecipe(
GregtechItemList.Circuit_BioRecipeSelector.getWithDamage(1L, 17L),
bits,
new Object[] { " ", " ", "d P", 'P', GregtechItemList.Circuit_BioRecipeSelector.getWildcard(1L) });
- addCraftingRecipe(
+ GTModHandler.addCraftingRecipe(
GregtechItemList.Circuit_BioRecipeSelector.getWithDamage(1L, 18L),
bits,
new Object[] { " ", "d ", " P", 'P', GregtechItemList.Circuit_BioRecipeSelector.getWildcard(1L) });
- addCraftingRecipe(
+ GTModHandler.addCraftingRecipe(
GregtechItemList.Circuit_BioRecipeSelector.getWithDamage(1L, 19L),
bits,
new Object[] { "d ", " ", " P", 'P', GregtechItemList.Circuit_BioRecipeSelector.getWildcard(1L) });
- addCraftingRecipe(
+ GTModHandler.addCraftingRecipe(
GregtechItemList.Circuit_BioRecipeSelector.getWithDamage(1L, 20L),
bits,
new Object[] { " d ", " ", " P", 'P', GregtechItemList.Circuit_BioRecipeSelector.getWildcard(1L) });
- addCraftingRecipe(
+ GTModHandler.addCraftingRecipe(
GregtechItemList.Circuit_BioRecipeSelector.getWithDamage(1L, 21L),
bits,
new Object[] { "d ", " ", "P ", 'P', GregtechItemList.Circuit_BioRecipeSelector.getWildcard(1L) });
- addCraftingRecipe(
+ GTModHandler.addCraftingRecipe(
GregtechItemList.Circuit_BioRecipeSelector.getWithDamage(1L, 22L),
bits,
new Object[] { " d ", " ", "P ", 'P', GregtechItemList.Circuit_BioRecipeSelector.getWildcard(1L) });
- addCraftingRecipe(
+ GTModHandler.addCraftingRecipe(
GregtechItemList.Circuit_BioRecipeSelector.getWithDamage(1L, 23L),
bits,
new Object[] { " d", " ", "P ", 'P', GregtechItemList.Circuit_BioRecipeSelector.getWildcard(1L) });
- addCraftingRecipe(
+ GTModHandler.addCraftingRecipe(
GregtechItemList.Circuit_BioRecipeSelector.getWithDamage(1L, 24L),
bits,
new Object[] { " ", " d", "P ", 'P', GregtechItemList.Circuit_BioRecipeSelector.getWildcard(1L) });
}
-
- public static boolean addCraftingRecipe(ItemStack aResult, long aBitMask, Object[] aRecipe) {
- Method mAddRecipe = ReflectionUtils.getMethod(
- GTModHandler.class,
- "addCraftingRecipe",
- ItemStack.class,
- Enchantment[].class,
- int[].class,
- boolean.class,
- boolean.class,
- boolean.class,
- boolean.class,
- boolean.class,
- boolean.class,
- boolean.class,
- boolean.class,
- boolean.class,
- boolean.class,
- boolean.class,
- boolean.class,
- boolean.class,
- Object[].class);
- boolean didInvoke = false;
- if (mAddRecipe != null) {
- try {
- didInvoke = (boolean) mAddRecipe.invoke(
- null,
- aResult,
- new Enchantment[] {},
- new int[] {},
- false,
- false,
- false,
- false,
- false,
- false,
- false,
- false,
- false,
- false,
- false,
- false,
- true,
- aRecipe);
- } catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
- }
- return didInvoke;
- }
}