aboutsummaryrefslogtreecommitdiff
path: root/src/Java
diff options
context:
space:
mode:
authorAlkalus <3060479+draknyte1@users.noreply.github.com>2019-03-04 18:26:33 +0000
committerAlkalus <3060479+draknyte1@users.noreply.github.com>2019-03-04 18:26:33 +0000
commitaf27ff015c4197bb5a6ddb7dd38769f8950a4ac9 (patch)
treed2b7eb3a05e2aec4f124cc054a535508a6141aae /src/Java
parent8ead0095f30769b0c12d558953323d45a2790d6e (diff)
downloadGT5-Unofficial-af27ff015c4197bb5a6ddb7dd38769f8950a4ac9.tar.gz
GT5-Unofficial-af27ff015c4197bb5a6ddb7dd38769f8950a4ac9.tar.bz2
GT5-Unofficial-af27ff015c4197bb5a6ddb7dd38769f8950a4ac9.zip
+ Added more TC wrappers.
Diffstat (limited to 'src/Java')
-rw-r--r--src/Java/gtPlusPlus/xmod/thaumcraft/aspect/TC_ResearchNoteData_Wrapper.java4
-rw-r--r--src/Java/gtPlusPlus/xmod/thaumcraft/aspect/TC_ResearchPage_Wrapper.java19
-rw-r--r--src/Java/gtPlusPlus/xmod/thaumcraft/objects/wrapper/recipe/Base_Recipe_Wrapper.java10
-rw-r--r--src/Java/gtPlusPlus/xmod/thaumcraft/objects/wrapper/recipe/TC_CrucibleRecipe_Wrapper.java19
-rw-r--r--src/Java/gtPlusPlus/xmod/thaumcraft/objects/wrapper/recipe/TC_IArcaneRecipe_Wrapper.java19
-rw-r--r--src/Java/gtPlusPlus/xmod/thaumcraft/objects/wrapper/recipe/TC_InfusionEnchantmentRecipe_Wrapper.java19
-rw-r--r--src/Java/gtPlusPlus/xmod/thaumcraft/objects/wrapper/recipe/TC_InfusionRecipe_Wrapper.java19
-rw-r--r--src/Java/gtPlusPlus/xmod/thaumcraft/util/ThaumcraftUtils.java73
8 files changed, 144 insertions, 38 deletions
diff --git a/src/Java/gtPlusPlus/xmod/thaumcraft/aspect/TC_ResearchNoteData_Wrapper.java b/src/Java/gtPlusPlus/xmod/thaumcraft/aspect/TC_ResearchNoteData_Wrapper.java
index 64f1ce088a..dbec20cdb8 100644
--- a/src/Java/gtPlusPlus/xmod/thaumcraft/aspect/TC_ResearchNoteData_Wrapper.java
+++ b/src/Java/gtPlusPlus/xmod/thaumcraft/aspect/TC_ResearchNoteData_Wrapper.java
@@ -2,6 +2,10 @@ package gtPlusPlus.xmod.thaumcraft.aspect;
public class TC_ResearchNoteData_Wrapper {
+ public TC_ResearchNoteData_Wrapper(Object researchNoteData) {
+ // TODO Auto-generated constructor stub
+ }
+
public Object getResearchNoteData() {
// TODO Auto-generated method stub
return null;
diff --git a/src/Java/gtPlusPlus/xmod/thaumcraft/aspect/TC_ResearchPage_Wrapper.java b/src/Java/gtPlusPlus/xmod/thaumcraft/aspect/TC_ResearchPage_Wrapper.java
index 256e9c19ed..23d3a9f575 100644
--- a/src/Java/gtPlusPlus/xmod/thaumcraft/aspect/TC_ResearchPage_Wrapper.java
+++ b/src/Java/gtPlusPlus/xmod/thaumcraft/aspect/TC_ResearchPage_Wrapper.java
@@ -1,6 +1,11 @@
package gtPlusPlus.xmod.thaumcraft.aspect;
import java.util.List;
+
+import gtPlusPlus.xmod.thaumcraft.objects.wrapper.recipe.TC_CrucibleRecipe_Wrapper;
+import gtPlusPlus.xmod.thaumcraft.objects.wrapper.recipe.TC_IArcaneRecipe_Wrapper;
+import gtPlusPlus.xmod.thaumcraft.objects.wrapper.recipe.TC_InfusionEnchantmentRecipe_Wrapper;
+import gtPlusPlus.xmod.thaumcraft.objects.wrapper.recipe.TC_InfusionRecipe_Wrapper;
import net.minecraft.item.ItemStack;
import net.minecraft.item.crafting.FurnaceRecipes;
import net.minecraft.item.crafting.IRecipe;
@@ -66,7 +71,7 @@ public class TC_ResearchPage_Wrapper {
this.recipe = recipe;
}
- public TC_ResearchPage_Wrapper(IArcaneRecipe[] recipe) {
+ public TC_ResearchPage_Wrapper(TC_IArcaneRecipe_Wrapper[] recipe) {
this.type = TC_PageType_Wrapper.TEXT;
this.text = null;
this.research = null;
@@ -78,7 +83,7 @@ public class TC_ResearchPage_Wrapper {
this.recipe = recipe;
}
- public TC_ResearchPage_Wrapper(CrucibleRecipe[] recipe) {
+ public TC_ResearchPage_Wrapper(TC_CrucibleRecipe_Wrapper[] recipe) {
this.type = TC_PageType_Wrapper.TEXT;
this.text = null;
this.research = null;
@@ -90,7 +95,7 @@ public class TC_ResearchPage_Wrapper {
this.recipe = recipe;
}
- public TC_ResearchPage_Wrapper(InfusionRecipe[] recipe) {
+ public TC_ResearchPage_Wrapper(TC_InfusionRecipe_Wrapper[] recipe) {
this.type = TC_PageType_Wrapper.TEXT;
this.text = null;
this.research = null;
@@ -114,7 +119,7 @@ public class TC_ResearchPage_Wrapper {
this.recipe = recipe;
}
- public TC_ResearchPage_Wrapper(IArcaneRecipe recipe) {
+ public TC_ResearchPage_Wrapper(TC_IArcaneRecipe_Wrapper recipe) {
this.type = TC_PageType_Wrapper.TEXT;
this.text = null;
this.research = null;
@@ -127,7 +132,7 @@ public class TC_ResearchPage_Wrapper {
this.recipeOutput = recipe.getRecipeOutput();
}
- public TC_ResearchPage_Wrapper(CrucibleRecipe recipe) {
+ public TC_ResearchPage_Wrapper(TC_CrucibleRecipe_Wrapper recipe) {
this.type = TC_PageType_Wrapper.TEXT;
this.text = null;
this.research = null;
@@ -153,7 +158,7 @@ public class TC_ResearchPage_Wrapper {
this.recipeOutput = FurnaceRecipes.smelting().getSmeltingResult(input);
}
- public TC_ResearchPage_Wrapper(InfusionRecipe recipe) {
+ public TC_ResearchPage_Wrapper(TC_InfusionRecipe_Wrapper recipe) {
this.type = TC_PageType_Wrapper.TEXT;
this.text = null;
this.research = null;
@@ -171,7 +176,7 @@ public class TC_ResearchPage_Wrapper {
}
- public TC_ResearchPage_Wrapper(InfusionEnchantmentRecipe recipe) {
+ public TC_ResearchPage_Wrapper(TC_InfusionEnchantmentRecipe_Wrapper recipe) {
this.type = TC_PageType_Wrapper.TEXT;
this.text = null;
this.research = null;
diff --git a/src/Java/gtPlusPlus/xmod/thaumcraft/objects/wrapper/recipe/Base_Recipe_Wrapper.java b/src/Java/gtPlusPlus/xmod/thaumcraft/objects/wrapper/recipe/Base_Recipe_Wrapper.java
new file mode 100644
index 0000000000..914144445c
--- /dev/null
+++ b/src/Java/gtPlusPlus/xmod/thaumcraft/objects/wrapper/recipe/Base_Recipe_Wrapper.java
@@ -0,0 +1,10 @@
+package gtPlusPlus.xmod.thaumcraft.objects.wrapper.recipe;
+
+import net.minecraft.item.ItemStack;
+
+public interface Base_Recipe_Wrapper {
+
+ public abstract ItemStack getRecipeOutput();
+
+ public abstract ItemStack getRecipeInput();
+}
diff --git a/src/Java/gtPlusPlus/xmod/thaumcraft/objects/wrapper/recipe/TC_CrucibleRecipe_Wrapper.java b/src/Java/gtPlusPlus/xmod/thaumcraft/objects/wrapper/recipe/TC_CrucibleRecipe_Wrapper.java
new file mode 100644
index 0000000000..8ee4e7011d
--- /dev/null
+++ b/src/Java/gtPlusPlus/xmod/thaumcraft/objects/wrapper/recipe/TC_CrucibleRecipe_Wrapper.java
@@ -0,0 +1,19 @@
+package gtPlusPlus.xmod.thaumcraft.objects.wrapper.recipe;
+
+import net.minecraft.item.ItemStack;
+
+public class TC_CrucibleRecipe_Wrapper implements Base_Recipe_Wrapper {
+
+ @Override
+ public ItemStack getRecipeInput() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public ItemStack getRecipeOutput() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+}
diff --git a/src/Java/gtPlusPlus/xmod/thaumcraft/objects/wrapper/recipe/TC_IArcaneRecipe_Wrapper.java b/src/Java/gtPlusPlus/xmod/thaumcraft/objects/wrapper/recipe/TC_IArcaneRecipe_Wrapper.java
new file mode 100644
index 0000000000..fede079f7b
--- /dev/null
+++ b/src/Java/gtPlusPlus/xmod/thaumcraft/objects/wrapper/recipe/TC_IArcaneRecipe_Wrapper.java
@@ -0,0 +1,19 @@
+package gtPlusPlus.xmod.thaumcraft.objects.wrapper.recipe;
+
+import net.minecraft.item.ItemStack;
+
+public class TC_IArcaneRecipe_Wrapper implements Base_Recipe_Wrapper {
+
+ @Override
+ public ItemStack getRecipeInput() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public ItemStack getRecipeOutput() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+}
diff --git a/src/Java/gtPlusPlus/xmod/thaumcraft/objects/wrapper/recipe/TC_InfusionEnchantmentRecipe_Wrapper.java b/src/Java/gtPlusPlus/xmod/thaumcraft/objects/wrapper/recipe/TC_InfusionEnchantmentRecipe_Wrapper.java
new file mode 100644
index 0000000000..b52fa0e6a7
--- /dev/null
+++ b/src/Java/gtPlusPlus/xmod/thaumcraft/objects/wrapper/recipe/TC_InfusionEnchantmentRecipe_Wrapper.java
@@ -0,0 +1,19 @@
+package gtPlusPlus.xmod.thaumcraft.objects.wrapper.recipe;
+
+import net.minecraft.item.ItemStack;
+
+public class TC_InfusionEnchantmentRecipe_Wrapper implements Base_Recipe_Wrapper {
+
+ @Override
+ public ItemStack getRecipeInput() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public ItemStack getRecipeOutput() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+}
diff --git a/src/Java/gtPlusPlus/xmod/thaumcraft/objects/wrapper/recipe/TC_InfusionRecipe_Wrapper.java b/src/Java/gtPlusPlus/xmod/thaumcraft/objects/wrapper/recipe/TC_InfusionRecipe_Wrapper.java
new file mode 100644
index 0000000000..a0c539f937
--- /dev/null
+++ b/src/Java/gtPlusPlus/xmod/thaumcraft/objects/wrapper/recipe/TC_InfusionRecipe_Wrapper.java
@@ -0,0 +1,19 @@
+package gtPlusPlus.xmod.thaumcraft.objects.wrapper.recipe;
+
+import net.minecraft.item.ItemStack;
+
+public class TC_InfusionRecipe_Wrapper implements Base_Recipe_Wrapper {
+
+ @Override
+ public ItemStack getRecipeInput() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public ItemStack getRecipeOutput() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+}
diff --git a/src/Java/gtPlusPlus/xmod/thaumcraft/util/ThaumcraftUtils.java b/src/Java/gtPlusPlus/xmod/thaumcraft/util/ThaumcraftUtils.java
index 6e275e9b67..c60a140819 100644
--- a/src/Java/gtPlusPlus/xmod/thaumcraft/util/ThaumcraftUtils.java
+++ b/src/Java/gtPlusPlus/xmod/thaumcraft/util/ThaumcraftUtils.java
@@ -5,34 +5,35 @@ import static gtPlusPlus.xmod.thaumcraft.HANDLER_Thaumcraft.sItemsToGetAspects;
import java.lang.reflect.Field;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
-import java.util.*;
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
-import net.minecraft.block.Block;
-import net.minecraft.entity.Entity;
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.item.ItemStack;
-import net.minecraft.item.crafting.IRecipe;
-import net.minecraft.world.World;
import gregtech.api.GregTech_API;
import gregtech.api.enums.ConfigCategories;
import gregtech.api.enums.TC_Aspects;
import gregtech.api.util.GT_LanguageManager;
import gregtech.api.util.GT_Utility;
-
import gtPlusPlus.api.objects.Logger;
-import gtPlusPlus.api.objects.data.AutoMap;
import gtPlusPlus.api.objects.data.Pair;
-import gtPlusPlus.core.lib.CORE;
import gtPlusPlus.core.util.reflect.ReflectionUtils;
import gtPlusPlus.xmod.thaumcraft.HANDLER_Thaumcraft;
import gtPlusPlus.xmod.thaumcraft.aspect.GTPP_AspectStack;
-import gtPlusPlus.xmod.thaumcraft.aspect.TC_Aspect_Wrapper;
import gtPlusPlus.xmod.thaumcraft.aspect.TC_AspectList_Wrapper;
+import gtPlusPlus.xmod.thaumcraft.aspect.TC_Aspect_Wrapper;
import gtPlusPlus.xmod.thaumcraft.aspect.TC_ResearchCategories_Wrapper;
import gtPlusPlus.xmod.thaumcraft.aspect.TC_ResearchCategoryList_Wrapper;
import gtPlusPlus.xmod.thaumcraft.aspect.TC_ResearchItem_Wrapper;
import gtPlusPlus.xmod.thaumcraft.aspect.TC_ResearchNoteData_Wrapper;
import gtPlusPlus.xmod.thaumcraft.aspect.TC_ResearchPage_Wrapper;
+import gtPlusPlus.xmod.thaumcraft.objects.wrapper.recipe.TC_CrucibleRecipe_Wrapper;
+import gtPlusPlus.xmod.thaumcraft.objects.wrapper.recipe.TC_IArcaneRecipe_Wrapper;
+import gtPlusPlus.xmod.thaumcraft.objects.wrapper.recipe.TC_InfusionEnchantmentRecipe_Wrapper;
+import gtPlusPlus.xmod.thaumcraft.objects.wrapper.recipe.TC_InfusionRecipe_Wrapper;
+import net.minecraft.block.Block;
+import net.minecraft.item.ItemStack;
+import net.minecraft.item.crafting.IRecipe;
+import net.minecraft.world.World;
public class ThaumcraftUtils {
@@ -40,10 +41,6 @@ public class ThaumcraftUtils {
private static Class mClass_Aspect;
private static Field mField_Aspects;
- /*public static boolean addAspectToItem(ItemStack item, Aspect[] aspects, int amount) {
- return addAspectToItem(item, getEnumAspect(aspect.getName()), amount);
- }*/
-
public static boolean addAspectToItem(ItemStack item, TC_Aspect_Wrapper aspect, int amount) {
return addAspectToItem(item, new TC_Aspect_Wrapper[] {aspect}, new Integer[] {amount});
@@ -105,15 +102,15 @@ public class ThaumcraftUtils {
} else if ((tPage instanceof IRecipe)) {
tPages.add(new TC_ResearchPage_Wrapper((IRecipe) tPage));
}
- /*else if ((tPage instanceof IArcaneRecipe)) {
- tPages.add(new TC_ResearchPage_Wrapper((IArcaneRecipe) tPage));
- } else if ((tPage instanceof CrucibleRecipe)) {
- tPages.add(new TC_ResearchPage_Wrapper((CrucibleRecipe) tPage));
- } else if ((tPage instanceof InfusionRecipe)) {
- tPages.add(new TC_ResearchPage_Wrapper((InfusionRecipe) tPage));
- } else if ((tPage instanceof InfusionEnchantmentRecipe)) {
- tPages.add(new TC_ResearchPage_Wrapper((InfusionEnchantmentRecipe) tPage));
- }*/
+ else if ((tPage instanceof TC_IArcaneRecipe_Wrapper)) {
+ tPages.add(new TC_ResearchPage_Wrapper((TC_IArcaneRecipe_Wrapper) tPage));
+ } else if ((tPage instanceof TC_CrucibleRecipe_Wrapper)) {
+ tPages.add(new TC_ResearchPage_Wrapper((TC_CrucibleRecipe_Wrapper) tPage));
+ } else if ((tPage instanceof TC_InfusionRecipe_Wrapper)) {
+ tPages.add(new TC_ResearchPage_Wrapper((TC_InfusionRecipe_Wrapper) tPage));
+ } else if ((tPage instanceof TC_InfusionEnchantmentRecipe_Wrapper)) {
+ tPages.add(new TC_ResearchPage_Wrapper((TC_InfusionEnchantmentRecipe_Wrapper) tPage));
+ }
}
if ((aType & 0x40) != 0) {
rResearch.setAutoUnlock();
@@ -226,6 +223,7 @@ public class ThaumcraftUtils {
private static final Method mMethod_addCrucibleRecipe;
private static final Method mMethod_getObjectAspects;
private static final Method mMethod_updateData;
+ private static final Method mMethod_getData;
private static final Field mField_PortholeBlacklist;
static {
@@ -255,8 +253,12 @@ public class ThaumcraftUtils {
mMethod_addCrucibleRecipe = ReflectionUtils.getMethod(mClass_ThaumcraftApi, "addCrucibleRecipe", String.class,
ItemStack.class, Object.class, mClass_AspectList);
- mMethod_getObjectAspects = ReflectionUtils.getMethod(mClass_ThaumcraftApi, "getObjectAspects", ItemStack.class);
+
+ mMethod_getObjectAspects = ReflectionUtils.getMethod(mClass_ThaumcraftApiHelper, "getObjectAspects", ItemStack.class);
+
+
mMethod_updateData = ReflectionUtils.getMethod(mClass_ResearchManager, "updateData", ItemStack.class, ReflectionUtils.getClass("thaumcraft.common.lib.research.ResearchNoteData"));
+ mMethod_getData = ReflectionUtils.getMethod(mClass_ResearchManager, "getData", ItemStack.class);
/*
* Fields
@@ -359,8 +361,17 @@ public class ThaumcraftUtils {
mMethod_updateData.invoke(a, b.getResearchNoteData());
} catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException e) {
e.printStackTrace();
- }
-
+ }
+ }
+
+ public static Object getResearchNoteData(ItemStack a) {
+ //getData(a);
+ try {
+ return mMethod_getData.invoke(a);
+ } catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException e) {
+ e.printStackTrace();
+ }
+ return null;
}
public static boolean isItemResearchNotes(ItemStack aStack) {
@@ -380,13 +391,13 @@ public class ThaumcraftUtils {
public static TC_ResearchNoteData_Wrapper gatherResults(ItemStack note) {
TC_ResearchNoteData_Wrapper research = null;
if (isItemResearchNotes(note)) {
- research = new TC_ResearchNoteData_Wrapper(ResearchManager.getData(note));
+ research = new TC_ResearchNoteData_Wrapper(getResearchNoteData(note));
}
return research;
}
- public static void placeAspectIntoResearchNote(ItemStack note, World aWorld, final int q, final int r, final Aspect aspect) {
- TC_ResearchNoteData_Wrapper data = gatherResults(note);
+ public static void placeAspectIntoResearchNote(ItemStack note, World aWorld, final int q, final int r, final TC_Aspect_Wrapper aspect) {
+ /*TC_ResearchNoteData_Wrapper data = gatherResults(note);
String mGTPP = CORE.gameProfile.getName();
EntityPlayer player = CORE.getFakePlayer(aWorld);
@@ -416,7 +427,7 @@ public class ThaumcraftUtils {
if (!aWorld.isRemote && ResearchManager.checkResearchCompletion(note, data, player.getCommandSenderName())) {
note.setItemDamage(64);
}
- }
+ }*/
}
public static void completeResearchNote(World aWorld, ItemStack aStack) {