Compare commits

...
Author SHA1 Message Date
miozune 6e21588782 Adapt to recipemap refactor 2023-10-06 19:44:08 +09:00
6 changed files with 186 additions and 21 deletions

No files matched your search

+35 -6
View File
@@ -1,9 +1,38 @@
*.bat .gradle
.gradle/ .settings
.idea/ /.idea/
out/ /.vscode/
/run/
/build/
/eclipse/
.classpath
.project
/bin/
/config/
/crash-reports/
/logs/
options.txt
/saves/
usernamecache.json
banned-ips.json
banned-players.json
eula.txt
ops.json
server.properties
servers.dat
usercache.json
whitelist.json
/out/
*.iml *.iml
*.ipr *.ipr
*.iws *.iws
run/ src/main/resources/mixins.*([!.]).json
build/ *.bat
*.DS_Store
!gradlew.bat
.factorypath
addon.local.gradle
addon.local.gradle.kts
addon.late.local.gradle
addon.late.local.gradle.kts
layout.json
+2 -2
View File
@@ -1,4 +1,4 @@
//version: 1695474595 //version: 1696265388
/* /*
DO NOT CHANGE THIS FILE! DO NOT CHANGE THIS FILE!
Also, you may replace this file at any time if there is an update available. Also, you may replace this file at any time if there is an update available.
@@ -798,7 +798,7 @@ dependencies {
java17Dependencies("com.github.GTNewHorizons:lwjgl3ify:${lwjgl3ifyVersion}") java17Dependencies("com.github.GTNewHorizons:lwjgl3ify:${lwjgl3ifyVersion}")
} }
if (modId != 'hodgepodge') { if (modId != 'hodgepodge') {
java17Dependencies('com.github.GTNewHorizons:Hodgepodge:2.3.5') java17Dependencies('com.github.GTNewHorizons:Hodgepodge:2.3.7')
} }
java17PatchDependencies("com.github.GTNewHorizons:lwjgl3ify:${lwjgl3ifyVersion}:forgePatches") {transitive = false} java17PatchDependencies("com.github.GTNewHorizons:lwjgl3ify:${lwjgl3ifyVersion}:forgePatches") {transitive = false}
+1 -1
View File
@@ -12,7 +12,7 @@ dependencies {
compileOnly('com.github.GTNewHorizons:ForestryMC:4.6.14:dev') compileOnly('com.github.GTNewHorizons:ForestryMC:4.6.14:dev')
compileOnly('com.github.GTNewHorizons:EnderIO:2.5.0:dev') compileOnly('com.github.GTNewHorizons:EnderIO:2.5.0:dev')
compileOnly('com.github.GTNewHorizons:GT5-Unofficial:5.09.44.27:dev') { compileOnly('com.github.GTNewHorizons:GT5-Unofficial:5.09.44.33-pre:dev') {
exclude group: 'com.github.GTNewHorizons', module: 'AE2FluidCraft-Rework' exclude group: 'com.github.GTNewHorizons', module: 'AE2FluidCraft-Rework'
} }
compileOnly('thaumcraft:Thaumcraft:1.7.10-4.2.3.5:dev') compileOnly('thaumcraft:Thaumcraft:1.7.10-4.2.3.5:dev')
Vendored
+92
View File
@@ -0,0 +1,92 @@
@rem
@rem Copyright 2015 the original author or authors.
@rem
@rem Licensed under the Apache License, Version 2.0 (the "License");
@rem you may not use this file except in compliance with the License.
@rem You may obtain a copy of the License at
@rem
@rem https://www.apache.org/licenses/LICENSE-2.0
@rem
@rem Unless required by applicable law or agreed to in writing, software
@rem distributed under the License is distributed on an "AS IS" BASIS,
@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@rem See the License for the specific language governing permissions and
@rem limitations under the License.
@rem
@if "%DEBUG%"=="" @echo off
@rem ##########################################################################
@rem
@rem Gradle startup script for Windows
@rem
@rem ##########################################################################
@rem Set local scope for the variables with windows NT shell
if "%OS%"=="Windows_NT" setlocal
set DIRNAME=%~dp0
if "%DIRNAME%"=="" set DIRNAME=.
@rem This is normally unused
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%
@rem Resolve any "." and ".." in APP_HOME to make it shorter.
for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
@rem Find java.exe
if defined JAVA_HOME goto findJavaFromJavaHome
set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if %ERRORLEVEL% equ 0 goto execute
echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
goto fail
:findJavaFromJavaHome
set JAVA_HOME=%JAVA_HOME:"=%
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
if exist "%JAVA_EXE%" goto execute
echo.
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
goto fail
:execute
@rem Setup the command line
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
@rem Execute Gradle
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*
:end
@rem End local scope for the variables with windows NT shell
if %ERRORLEVEL% equ 0 goto mainEnd
:fail
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
rem the _cmd.exe /c_ return code!
set EXIT_CODE=%ERRORLEVEL%
if %EXIT_CODE% equ 0 set EXIT_CODE=1
if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE%
exit /b %EXIT_CODE%
:mainEnd
if "%OS%"=="Windows_NT" endlocal
:omega
@@ -1,5 +1,7 @@
package com.glodblock.github.nei.recipes; 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.AvaritiaRecipeExtractor;
import com.glodblock.github.nei.recipes.extractor.EnderIORecipeExtractor; import com.glodblock.github.nei.recipes.extractor.EnderIORecipeExtractor;
import com.glodblock.github.nei.recipes.extractor.ForestryRecipeExtractor; import com.glodblock.github.nei.recipes.extractor.ForestryRecipeExtractor;
@@ -19,8 +21,7 @@ import forestry.factory.recipes.nei.NEIHandlerMoistener;
import forestry.factory.recipes.nei.NEIHandlerSqueezer; import forestry.factory.recipes.nei.NEIHandlerSqueezer;
import forestry.factory.recipes.nei.NEIHandlerStill; import forestry.factory.recipes.nei.NEIHandlerStill;
import gregapi.recipes.Recipe; import gregapi.recipes.Recipe;
import gregtech.api.util.GTPP_Recipe; import gregtech.api.recipe.RecipeMap;
import gregtech.api.util.GT_Recipe;
public class DefaultExtractorLoader implements Runnable { public class DefaultExtractorLoader implements Runnable {
@@ -31,13 +32,32 @@ public class DefaultExtractorLoader implements Runnable {
FluidRecipe.addRecipeMap("crafting", new VanillaRecipeExtractor(true)); FluidRecipe.addRecipeMap("crafting", new VanillaRecipeExtractor(true));
FluidRecipe.addRecipeMap("crafting2x2", new VanillaRecipeExtractor(true)); FluidRecipe.addRecipeMap("crafting2x2", new VanillaRecipeExtractor(true));
if (ModAndClassUtil.GT5NH) {
for (RecipeMap<?> recipeMap : RecipeMap.ALL_RECIPE_MAPS.values()) {
if (recipeMap.getFrontend().getNEIProperties().registerNEI) {
FluidRecipe.addRecipeMap(
recipeMap.unlocalizedName,
new GregTech5RecipeExtractor(
recipeMap.unlocalizedName.equals("gt.recipe.scanner")
|| recipeMap.unlocalizedName.equals("gt.recipe.fakeAssemblylineProcess")));
}
}
}
if (ModAndClassUtil.GT5) { if (ModAndClassUtil.GT5) {
for (GT_Recipe.GT_Recipe_Map tMap : GT_Recipe.GT_Recipe_Map.sMappings) { try {
FluidRecipe.addRecipeMap( Class<?> recipeMapClazz = Class.forName("gregtech.api.util.GT_Recipe$GT_Recipe_Map");
tMap.mNEIName, Collection<?> sMappings = (Collection<?>) recipeMapClazz.getDeclaredField("sMappings").get(null);
new GregTech5RecipeExtractor( for (Object tMap : sMappings) {
tMap.mNEIName.equals("gt.recipe.scanner") String mNEIName = (String) recipeMapClazz.getDeclaredField("mNEIName").get(tMap);
|| tMap.mNEIName.equals("gt.recipe.fakeAssemblylineProcess"))); FluidRecipe.addRecipeMap(
mNEIName,
new GregTech5RecipeExtractor(
mNEIName.equals("gt.recipe.scanner")
|| mNEIName.equals("gt.recipe.fakeAssemblylineProcess")));
}
} catch (Exception e) {
throw new RuntimeException(e);
} }
} }
@@ -48,10 +68,20 @@ public class DefaultExtractorLoader implements Runnable {
} }
if (ModAndClassUtil.GTPP) { if (ModAndClassUtil.GTPP) {
for (GTPP_Recipe.GTPP_Recipe_Map_Internal gtppMap : GTPP_Recipe.GTPP_Recipe_Map_Internal.sMappingsEx) { try {
if (gtppMap.mNEIAllowed) { Class<?> gtRecipeMapClazz = Class.forName("gregtech.api.util.GT_Recipe$GT_Recipe_Map");
FluidRecipe.addRecipeMap(gtppMap.mNEIName, new GTPPRecipeExtractor()); 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) {
// GTNH fork of GT++ doesn't use its own recipemap class
} }
} }
@@ -12,6 +12,13 @@ import cpw.mods.fml.common.Loader;
public final class ModAndClassUtil { 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 GT5 = false;
public static boolean GT6 = false; public static boolean GT6 = false;
public static boolean EC2 = false; public static boolean EC2 = false;
@@ -119,7 +126,14 @@ public final class ModAndClassUtil {
isTypeFilter = false; 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("gregapi") && Loader.isModLoaded("gregapi_post")) GT6 = true;
if (Loader.isModLoaded("extracells")) EC2 = true; if (Loader.isModLoaded("extracells")) EC2 = true;
if (Loader.isModLoaded("EnderIO")) EIO = true; if (Loader.isModLoaded("EnderIO")) EIO = true;