Compat with GT change (#175)

* Compat with GT change

* update gradle+bs+deps

---------

Co-authored-by: Martin Robertz <[email protected]>
This commit is contained in:
miozuneandMartin Robertz authored and GitHub committed 2023-12-04 00:09:20 +01:00
1 parent 3b1b1af852
commit d790afc047
7 files changed
+61 -42

No files matched your search

+4 -19
View File
@@ -1,4 +1,4 @@
//version: 1700844281
//version: 1701530445
/*
DO NOT CHANGE THIS FILE!
Also, you may replace this file at any time if there is an update available.
@@ -28,27 +28,12 @@ import java.util.concurrent.TimeUnit
buildscript {
repositories {
mavenCentral()
maven {
name 'forge'
url 'https://maven.minecraftforge.net'
}
maven {
// GTNH RetroFuturaGradle and ASM Fork
name "GTNH Maven"
url "http://jenkins.usrv.eu:8081/nexus/content/groups/public/"
allowInsecureProtocol = true
}
maven {
name 'sonatype'
url 'https://oss.sonatype.org/content/repositories/snapshots/'
}
maven {
name 'Scala CI dependencies'
url 'https://repo1.maven.org/maven2/'
}
mavenLocal()
}
}
@@ -793,12 +778,12 @@ ext.java17PatchDependenciesCfg = configurations.create("java17PatchDependencies"
}
dependencies {
def lwjgl3ifyVersion = '1.5.1'
def lwjgl3ifyVersion = '1.5.7'
if (modId != 'lwjgl3ify') {
java17Dependencies("com.github.GTNewHorizons:lwjgl3ify:${lwjgl3ifyVersion}")
}
if (modId != 'hodgepodge') {
java17Dependencies('com.github.GTNewHorizons:Hodgepodge:2.3.17')
java17Dependencies('com.github.GTNewHorizons:Hodgepodge:2.3.35')
}
java17PatchDependencies("com.github.GTNewHorizons:lwjgl3ify:${lwjgl3ifyVersion}:forgePatches") {transitive = false}
@@ -1310,7 +1295,7 @@ def addCurseForgeRelation(String type, String name) {
// Updating
def buildscriptGradleVersion = "8.2.1"
def buildscriptGradleVersion = "8.5"
tasks.named('wrapper', Wrapper).configure {
gradleVersion = buildscriptGradleVersion
+7 -8
View File
@@ -34,26 +34,25 @@
* For more details, see https://docs.gradle.org/8.0.1/userguide/java_library_plugin.html#sec:java_library_configurations_graph
*/
dependencies {
api('com.github.GTNewHorizons:NotEnoughItems:2.4.12-GTNH:dev')
api('com.github.GTNewHorizons:Applied-Energistics-2-Unofficial:rv3-beta-286-GTNH:dev')
api('com.github.GTNewHorizons:NotEnoughItems:2.4.13-GTNH:dev')
api('com.github.GTNewHorizons:Applied-Energistics-2-Unofficial:rv3-beta-291-GTNH:dev')
api('curse.maven:cofh-core-69162:2388751')
api('com.github.GTNewHorizons:waila:1.6.5:dev')
implementation("com.github.GTNewHorizons:WirelessCraftingTerminal:1.10.1:dev")
compileOnly('com.github.GTNewHorizons:Baubles:1.0.1.16:dev')
compileOnly('com.github.GTNewHorizons:Baubles:1.0.3:dev')
compileOnly('com.github.GTNewHorizons:ExtraCells2:2.5.34:dev') { transitive = false }
compileOnly('com.github.GTNewHorizons:ForestryMC:4.7.0:dev')
compileOnly('com.github.GTNewHorizons:EnderIO:2.5.5:dev')
compileOnly('com.github.GTNewHorizons:GT5-Unofficial:5.09.44.83:dev') {
compileOnly('com.github.GTNewHorizons:EnderIO:2.5.6:dev')
compileOnly('com.github.GTNewHorizons:GT5-Unofficial:5.09.44.96:dev') {
exclude group: 'com.github.GTNewHorizons', module: 'AE2FluidCraft-Rework'
}
compileOnly('thaumcraft:Thaumcraft:1.7.10-4.2.3.5:dev')
compileOnly('com.gregoriust.gregtech:gregtech_1.7.10:6.14.23:dev') { transitive = false }
compileOnly('com.github.GTNewHorizons:OpenComputers:1.9.19-GTNH:dev') { transitive = false }
compileOnly('com.github.GTNewHorizons:ThaumicEnergistics:1.5.0-GTNH:dev') { transitive = false }
compileOnly('com.github.GTNewHorizons:GTplusplus:1.10.30:dev') { transitive = false }
compileOnly("com.github.GTNewHorizons:Hodgepodge:2.3.31:dev") { transitive = false }
compileOnly('com.github.GTNewHorizons:ThaumicEnergistics:1.5.3-GTNH:dev') { transitive = false }
compileOnly("com.github.GTNewHorizons:Hodgepodge:2.3.38:dev") { transitive = false }
runtimeOnlyNonPublishable("com.github.GTNewHorizons:DuraDisplay:1.1.7:dev")
}
Binary file not shown.
+2 -1
View File
@@ -1,6 +1,7 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.2.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Vendored
+4 -1
View File
@@ -130,10 +130,13 @@ location of your Java installation."
fi
else
JAVACMD=java
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
if ! command -v java >/dev/null 2>&1
then
die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
fi
# Increase the maximum file descriptors if we can.
@@ -1,5 +1,7 @@
package com.glodblock.github.nei.recipes;
import java.util.Collection;
import com.glodblock.github.nei.recipes.extractor.AvaritiaRecipeExtractor;
import com.glodblock.github.nei.recipes.extractor.EnderIORecipeExtractor;
import com.glodblock.github.nei.recipes.extractor.ForestryRecipeExtractor;
@@ -19,8 +21,6 @@ import forestry.factory.recipes.nei.NEIHandlerMoistener;
import forestry.factory.recipes.nei.NEIHandlerSqueezer;
import forestry.factory.recipes.nei.NEIHandlerStill;
import gregapi.recipes.Recipe;
import gregtech.api.util.GTPP_Recipe;
import gregtech.api.util.GT_Recipe;
public class DefaultExtractorLoader implements Runnable {
@@ -32,12 +32,19 @@ public class DefaultExtractorLoader implements Runnable {
FluidRecipe.addRecipeMap("crafting2x2", new VanillaRecipeExtractor(true));
if (ModAndClassUtil.GT5) {
for (GT_Recipe.GT_Recipe_Map tMap : GT_Recipe.GT_Recipe_Map.sMappings) {
FluidRecipe.addRecipeMap(
tMap.mNEIName,
new GregTech5RecipeExtractor(
tMap.mNEIName.equals("gt.recipe.scanner")
|| tMap.mNEIName.equals("gt.recipe.fakeAssemblylineProcess")));
try {
Class<?> recipeMapClazz = Class.forName("gregtech.api.util.GT_Recipe$GT_Recipe_Map");
Collection<?> sMappings = (Collection<?>) recipeMapClazz.getDeclaredField("sMappings").get(null);
for (Object tMap : sMappings) {
String mNEIName = (String) recipeMapClazz.getDeclaredField("mNEIName").get(tMap);
FluidRecipe.addRecipeMap(
mNEIName,
new GregTech5RecipeExtractor(
mNEIName.equals("gt.recipe.scanner")
|| mNEIName.equals("gt.recipe.fakeAssemblylineProcess")));
}
} catch (Exception e) {
throw new RuntimeException(e);
}
}
@@ -47,11 +54,21 @@ public class DefaultExtractorLoader implements Runnable {
}
}
if (ModAndClassUtil.GTPP) {
for (GTPP_Recipe.GTPP_Recipe_Map_Internal gtppMap : GTPP_Recipe.GTPP_Recipe_Map_Internal.sMappingsEx) {
if (gtppMap.mNEIAllowed) {
FluidRecipe.addRecipeMap(gtppMap.mNEIName, new GTPPRecipeExtractor());
if (ModAndClassUtil.GTPP && !ModAndClassUtil.GT5NH) {
try {
Class<?> gtRecipeMapClazz = Class.forName("gregtech.api.util.GT_Recipe$GT_Recipe_Map");
Class<?> gtppRecipeMapClazz = Class.forName("gregtech.api.util.GTPP_Recipe$GTPP_Recipe_Map_Internal");
Collection<?> sMappingsEx = (Collection<?>) gtppRecipeMapClazz.getDeclaredField("sMappingsEx")
.get(null);
for (Object gtppMap : sMappingsEx) {
boolean mNEIAllowed = gtRecipeMapClazz.getDeclaredField("mNEIAllowed").getBoolean(gtppMap);
if (mNEIAllowed) {
String mNEIName = (String) gtRecipeMapClazz.getDeclaredField("mNEIName").get(gtppMap);
FluidRecipe.addRecipeMap(mNEIName, new GTPPRecipeExtractor());
}
}
} catch (Exception e) {
throw new RuntimeException(e);
}
}
@@ -12,6 +12,13 @@ import cpw.mods.fml.common.Loader;
public final class ModAndClassUtil {
/**
* GTNH fork of GregTech5 Unofficial
*/
public static boolean GT5NH = false;
/**
* GregTech5 / GregTech5 Unofficial (Blood-Asp's "official" GT5u)
*/
public static boolean GT5 = false;
public static boolean GT6 = false;
public static boolean EC2 = false;
@@ -119,7 +126,14 @@ public final class ModAndClassUtil {
isTypeFilter = false;
}
if (Loader.isModLoaded("gregtech") && !Loader.isModLoaded("gregapi")) GT5 = true;
if (Loader.isModLoaded("gregtech") && !Loader.isModLoaded("gregapi")) {
try {
Class.forName("gregtech.api.recipe.RecipeMap");
GT5NH = true;
} catch (ClassNotFoundException e) {
GT5 = true;
}
}
if (Loader.isModLoaded("gregapi") && Loader.isModLoaded("gregapi_post")) GT6 = true;
if (Loader.isModLoaded("extracells")) EC2 = true;
if (Loader.isModLoaded("EnderIO")) EIO = true;