aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--build.gradle.kts6
-rw-r--r--src/main/java/com/github/technus/tectech/compatibility/gtpp/GtppAtomLoader.java12
2 files changed, 15 insertions, 3 deletions
diff --git a/build.gradle.kts b/build.gradle.kts
index a6241492d3..99e6fa0b11 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -170,8 +170,12 @@ dependencies {
//Hard Dependencies
compile("net.industrial-craft:industrialcraft-2:$ic2Version:dev")
compile("com.github.GTNewHorizons:StructureLib:1.0.12:dev")
- compile("com.github.GTNewHorizons:GT5-Unofficial:master-SNAPSHOT:dev"){
+ compile("com.github.GTNewHorizons:GT5-Unofficial:$gt5uVersion:dev"){
exclude("net.industrial-craft", "industrialcraft-2")
+ exclude("com.github.GTNewHorizons", "StructureLib")
+ }
+ compileOnly("com.github.GTNewHorizons:Applied-Energistics-2-Unofficial:master-SNAPSHOT:dev") {
+ isTransitive = false
}
compile("eu.usrv:YAMCore:$yamcoreVersion:deobf")
diff --git a/src/main/java/com/github/technus/tectech/compatibility/gtpp/GtppAtomLoader.java b/src/main/java/com/github/technus/tectech/compatibility/gtpp/GtppAtomLoader.java
index 32db2caed9..bf96d61795 100644
--- a/src/main/java/com/github/technus/tectech/compatibility/gtpp/GtppAtomLoader.java
+++ b/src/main/java/com/github/technus/tectech/compatibility/gtpp/GtppAtomLoader.java
@@ -40,6 +40,14 @@ public class GtppAtomLoader implements Runnable{
}
//endregion
+ private static Method getMethodWithReplacements(Class<?> owner, String name1, String name2, Class<?>... arguments) throws ReflectiveOperationException {
+ try {
+ return owner.getMethod(name1, arguments);
+ } catch (ReflectiveOperationException e) {
+ return owner.getMethod(name2, arguments);
+ }
+ }
+
@Override
public void run() {
//region reflect a bit
@@ -47,9 +55,9 @@ public class GtppAtomLoader implements Runnable{
ELEMENT=Class.forName("gtPlusPlus.core.material.ELEMENT");
ELEMENT_INSTANCE=ELEMENT.getMethod("getInstance").invoke(null);
- Class clazz=Class.forName("gtPlusPlus.core.material.Material");
+ Class<?> clazz=Class.forName("gtPlusPlus.core.material.Material");
getUnlocalizedName=clazz.getMethod("getUnlocalizedName");
- getFluid=clazz.getMethod("getFluid", int.class);
+ getFluid=getMethodWithReplacements(clazz,"getFluidStack", "getFluid", int.class);
clazz=Class.forName("gtPlusPlus.core.material.MaterialGenerator");
generate=clazz.getMethod("generate", Class.forName("gtPlusPlus.core.material.Material"), boolean.class, boolean.class);