aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/gtPlusPlus/xmod/reliquary/util/AlkahestRecipeWrapper.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/gtPlusPlus/xmod/reliquary/util/AlkahestRecipeWrapper.java')
-rw-r--r--src/main/java/gtPlusPlus/xmod/reliquary/util/AlkahestRecipeWrapper.java77
1 files changed, 41 insertions, 36 deletions
diff --git a/src/main/java/gtPlusPlus/xmod/reliquary/util/AlkahestRecipeWrapper.java b/src/main/java/gtPlusPlus/xmod/reliquary/util/AlkahestRecipeWrapper.java
index 6086b74ec4..1418a8d086 100644
--- a/src/main/java/gtPlusPlus/xmod/reliquary/util/AlkahestRecipeWrapper.java
+++ b/src/main/java/gtPlusPlus/xmod/reliquary/util/AlkahestRecipeWrapper.java
@@ -1,47 +1,52 @@
package gtPlusPlus.xmod.reliquary.util;
+import gtPlusPlus.core.util.reflect.ReflectionUtils;
import java.lang.reflect.Constructor;
import java.lang.reflect.InvocationTargetException;
-
-import gtPlusPlus.core.util.reflect.ReflectionUtils;
import net.minecraft.item.ItemStack;
public class AlkahestRecipeWrapper {
- public ItemStack item = null;
- public int yield = 0;
- public int cost = 0;
- public String dictionaryName = null;
+ public ItemStack item = null;
+ public int yield = 0;
+ public int cost = 0;
+ public String dictionaryName = null;
+
+ public AlkahestRecipeWrapper(ItemStack par1, int par2, int par3) {
+ this.item = par1;
+ this.yield = par2;
+ this.cost = par3;
+ }
- public AlkahestRecipeWrapper(ItemStack par1, int par2, int par3) {
- this.item = par1;
- this.yield = par2;
- this.cost = par3;
- }
+ public AlkahestRecipeWrapper(String par1, int par2, int par3) {
+ this.dictionaryName = par1;
+ this.yield = par2;
+ this.cost = par3;
+ }
- public AlkahestRecipeWrapper(String par1, int par2, int par3) {
- this.dictionaryName = par1;
- this.yield = par2;
- this.cost = par3;
- }
+ public Object getOriginalRecipe() {
+ try {
+ Constructor<?> o;
+ if (dictionaryName == null) {
+ o = ReflectionUtils.getClass("xreliquary.util.alkahestry.AlkahestRecipe")
+ .getConstructor(ItemStack.class, int.class, int.class);
+ } else {
+ o = ReflectionUtils.getClass("xreliquary.util.alkahestry.AlkahestRecipe")
+ .getConstructor(String.class, int.class, int.class);
+ }
- public Object getOriginalRecipe() {
- try {
- Constructor<?> o;
- if (dictionaryName == null) {
- o = ReflectionUtils.getClass("xreliquary.util.alkahestry.AlkahestRecipe").getConstructor(ItemStack.class, int.class, int.class);
- }
- else {
- o = ReflectionUtils.getClass("xreliquary.util.alkahestry.AlkahestRecipe").getConstructor(String.class, int.class, int.class);
- }
-
- Object r = o.newInstance(dictionaryName == null ? item : dictionaryName, yield, cost);
- if (r != null) {
- return r;
- }
+ Object r = o.newInstance(dictionaryName == null ? item : dictionaryName, yield, cost);
+ if (r != null) {
+ return r;
+ }
- } catch (NoSuchMethodException | SecurityException | InstantiationException | IllegalAccessException | IllegalArgumentException | InvocationTargetException e) {
- // oops
- }
- return null;
- }
-} \ No newline at end of file
+ } catch (NoSuchMethodException
+ | SecurityException
+ | InstantiationException
+ | IllegalAccessException
+ | IllegalArgumentException
+ | InvocationTargetException e) {
+ // oops
+ }
+ return null;
+ }
+}