diff --git a/dependencies.gradle b/dependencies.gradle index 13387d1..5c9f712 100644 --- a/dependencies.gradle +++ b/dependencies.gradle @@ -1,23 +1,25 @@ // Add your dependencies here dependencies { - implementation('com.github.GTNewHorizons:NotEnoughItems:2.7.43-GTNH:dev') + implementation("com.github.GTNewHorizons:NotEnoughItems:2.8.74-GTNH:dev") - compileOnly('com.github.GTNewHorizons:GT5-Unofficial:5.09.51.282:dev') - compileOnly('com.github.GTNewHorizons:EnderIO:2.9.12:dev') - compileOnly('com.github.GTNewHorizons:Draconic-Evolution:1.4.18-GTNH:dev') - compileOnly('com.github.GTNewHorizons:ForestryMC:4.10.7:dev') - compileOnly('com.github.GTNewHorizons:AdventureBackpack2:1.3.9-GTNH:dev') - compileOnly("com.github.GTNewHorizons:ProjectRed:4.11.4-GTNH:dev") - compileOnly("com.github.GTNewHorizons:Minecraft-Backpack-Mod:2.5.0-GTNH:dev") + compileOnly("com.github.GTNewHorizons:GT5-Unofficial:5.09.52.342:dev") + compileOnly("com.github.GTNewHorizons:EnderIO:2.10.21:dev") + compileOnly("com.github.GTNewHorizons:Draconic-Evolution:1.5.19-GTNH:dev") + compileOnly("com.github.GTNewHorizons:ForestryMC:4.11.8:dev") + compileOnly("com.github.GTNewHorizons:AdventureBackpack2:1.4.15-GTNH:dev") + compileOnly("com.github.GTNewHorizons:ProjectRed:4.12.27-GTNH:dev") + compileOnly("com.github.GTNewHorizons:Minecraft-Backpack-Mod:2.6.9-GTNH:dev") compileOnly("curse.maven:thaumcraft-nei-plugin-225095:2241913") compileOnly("thaumcraft:Thaumcraft:1.7.10-4.2.3.5:dev") + compileOnly("com.github.GTNewHorizons:AspectRecipeIndex:1.0.0:dev") // For testing in dev environment. - // runtimeOnlyNonPublishable('com.github.GTNewHorizons:StorageDrawers:2.1.0-GTNH') - // runtimeOnlyNonPublishable("com.github.GTNewHorizons:waila:1.8.4") - // runtimeOnlyNonPublishable('thaumcraft:Thaumcraft:1.7.10-4.2.3.5:dev') - // runtimeOnlyNonPublishable("com.github.GTNewHorizons:Baubles:1.0.4:dev") - // runtimeOnlyNonPublishable('curse.maven:thaumcraft-nei-plugin-225095:2241913') + // runtimeOnlyNonPublishable("com.github.GTNewHorizons:StorageDrawers:2.2.16-GTNH") + // runtimeOnlyNonPublishable("com.github.GTNewHorizons:waila:1.19.22") + // runtimeOnlyNonPublishable("thaumcraft:Thaumcraft:1.7.10-4.2.3.5:dev") + // runtimeOnlyNonPublishable("com.github.GTNewHorizons:Baubles-Expanded:2.2.9-GTNH:dev") + // runtimeOnlyNonPublishable(rfg.deobf("curse.maven:thaumcraft-nei-plugin-225095:2241913")) + // runtimeOnlyNonPublishable("com.github.GTNewHorizons:AspectRecipeIndex:1.0.0:dev") } diff --git a/gradle.properties b/gradle.properties index e6c865b..e0b32c9 100644 --- a/gradle.properties +++ b/gradle.properties @@ -39,9 +39,33 @@ remoteMappings = https\://raw.githubusercontent.com/MinecraftForge/FML/1.7.10/co # `./gradlew runClient --username=AnotherPlayer`, or configuring this command in your IDE. developmentEnvironmentUserName = Developer -# Enables using modern Java syntax (up to version 17) via Jabel, while still targeting JVM 8. -# See https://github.com/bsideup/jabel for details on how this works. -enableModernJavaSyntax = true +# Enables modern Java syntax support. Valid values: +# - false: No modern syntax, Java 8 only +# - jabel: Jabel syntax-only support, compiles to J8 bytecode +# - jvmDowngrader: Full modern Java via JVM Downgrader (syntax + stdlib APIs) +# - modern: Native modern Java bytecode, no downgrading +enableModernJavaSyntax = jabel + +# If set, ignores the above setting and compiles with the given toolchain. This may cause unexpected issues, +# and should *not* be used in most situations. -1 disables this. +# forceToolchainVersion = -1 + +# Target JVM version for JVM Downgrader bytecode downgrading. +# Only used when enableModernJavaSyntax = jvmDowngrader +# downgradeTargetVersion = 8 + +# Comma-separated list of Java versions for multi-release jar support (JVM Downgrader only). +# Classes will be available in META-INF/versions/N/ for each version N in this list. +# Default: "21,25" (J25+ gets native classes, J21-24 gets partial downgrade, J8-20 gets full downgrade). +# jvmDowngraderMultiReleaseVersions = 21,25 + +# Specifies how JVM Downgrader API stubs are provided. Options: +# - shade: Shade minimized stubs into the jar +# - gtnhlib: GTNHLib provides stubs at runtime (adds version constraint) +# - external: Another dependency provides stubs (no constraint, no warning) +# - (empty): Warning reminding you to configure stubs +# Note: 'shade' option requires you to verify license compliance, see: https://github.com/unimined/JvmDowngrader/blob/main/LICENSE.md +# jvmDowngraderStubsProvider = # Enables injecting missing generics into the decompiled source code for a better coding experience. # Turns most publicly visible List, Map, etc. into proper List, Map types. @@ -96,7 +120,9 @@ usesMixinDebug = false # Specify the location of your implementation of IMixinConfigPlugin. Leave it empty otherwise. mixinPlugin = -# Specify the package that contains all of your Mixins. You may only place Mixins in this package or the build will fail! +# Specify the package that contains all of your Mixins. The package must exist or +# the build will fail. If you have a package property defined in your mixins..json, +# it must match with this or the build will fail. mixinsPackage = # Specify the core mod entry class if you use a core mod. This class must implement IFMLLoadingPlugin! @@ -151,7 +177,7 @@ modrinthProjectId = # type can be one of [project, version], # and the name is the Modrinth project or version slug/id of the other mod. # Example: required-project:fplib;optional-project:gasstation;incompatible-project:gregtech -# Note: GTNH Mixins is automatically set as a required dependency if usesMixins = true +# Note: UniMixins is automatically set as a required dependency if usesMixins = true. modrinthRelations = # Publishing to CurseForge requires you to set the CURSEFORGE_TOKEN environment variable to one of your CurseForge API tokens. @@ -172,6 +198,12 @@ curseForgeRelations = # projects. New projects should not use this parameter. # customArchiveBaseName = +# Optional parameter to customize the default working directory used by the runClient* tasks. Relative to the project directory. +# runClientWorkingDirectory = run/client + +# Optional parameter to customize the default working directory used by the runServer* tasks. Relative to the project directory. +# runServerWorkingDirectory = run/server + # Optional parameter to have the build automatically fail if an illegal version is used. # This can be useful if you e.g. only want to allow versions in the form of '1.1.xxx'. # The check is ONLY performed if the version is a git tag. @@ -201,3 +233,6 @@ curseForgeRelations = # This is meant to be set in $HOME/.gradle/gradle.properties. # ideaCheckSpotlessOnBuild = true +# Non-GTNH properties +org.gradle.configuration-cache = true +org.gradle.parallel = true diff --git a/gradle/gradle-daemon-jvm.properties b/gradle/gradle-daemon-jvm.properties new file mode 100644 index 0000000..863cff9 --- /dev/null +++ b/gradle/gradle-daemon-jvm.properties @@ -0,0 +1,12 @@ +#This file is generated by updateDaemonJvm +toolchainUrl.FREE_BSD.AARCH64=https\://api.foojay.io/disco/v3.0/ids/c5ee947fbfb70bc347d8d531e3a578c4/redirect +toolchainUrl.FREE_BSD.X86_64=https\://api.foojay.io/disco/v3.0/ids/cd495626d2ee49a75447e3fdc6afb287/redirect +toolchainUrl.LINUX.AARCH64=https\://api.foojay.io/disco/v3.0/ids/c5ee947fbfb70bc347d8d531e3a578c4/redirect +toolchainUrl.LINUX.X86_64=https\://api.foojay.io/disco/v3.0/ids/cd495626d2ee49a75447e3fdc6afb287/redirect +toolchainUrl.MAC_OS.AARCH64=https\://api.foojay.io/disco/v3.0/ids/e1118b4c7c2858d28154d086dbff010e/redirect +toolchainUrl.MAC_OS.X86_64=https\://api.foojay.io/disco/v3.0/ids/faa12903720d410b387cc69ccafb1a74/redirect +toolchainUrl.UNIX.AARCH64=https\://api.foojay.io/disco/v3.0/ids/1630f7ebef05444cb27a2709ea0249b3/redirect +toolchainUrl.UNIX.X86_64=https\://api.foojay.io/disco/v3.0/ids/cd495626d2ee49a75447e3fdc6afb287/redirect +toolchainUrl.WINDOWS.AARCH64=https\://api.foojay.io/disco/v3.0/ids/a4c09dd2e2d7079373d30e524bbc2829/redirect +toolchainUrl.WINDOWS.X86_64=https\://api.foojay.io/disco/v3.0/ids/b96cb7670c095245220e7d01d5927b58/redirect +toolchainVersion=25 diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index 9bbc975..d997cfc 100644 Binary files a/gradle/wrapper/gradle-wrapper.jar and b/gradle/wrapper/gradle-wrapper.jar differ diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 37f853b..dbc3ce4 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.13-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-9.4.0-bin.zip networkTimeout=10000 validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME diff --git a/gradlew b/gradlew index faf9300..0262dcb 100755 --- a/gradlew +++ b/gradlew @@ -1,7 +1,7 @@ #!/bin/sh # -# Copyright © 2015-2021 the original authors. +# Copyright © 2015 the original authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -57,7 +57,7 @@ # Darwin, MinGW, and NonStop. # # (3) This script is generated from the Groovy template -# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# https://github.com/gradle/gradle/blob/b631911858264c0b6e4d6603d677ff5218766cee/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt # within the Gradle project. # # You can find Gradle at https://github.com/gradle/gradle/. @@ -114,7 +114,6 @@ case "$( uname )" in #( NONSTOP* ) nonstop=true ;; esac -CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar # Determine the Java command to use to start the JVM. @@ -172,7 +171,6 @@ fi # For Cygwin or MSYS, switch paths to Windows format before running java if "$cygwin" || "$msys" ; then APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) - CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) JAVACMD=$( cygpath --unix "$JAVACMD" ) @@ -212,8 +210,7 @@ DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' set -- \ "-Dorg.gradle.appname=$APP_BASE_NAME" \ - -classpath "$CLASSPATH" \ - org.gradle.wrapper.GradleWrapperMain \ + -jar "$APP_HOME/gradle/wrapper/gradle-wrapper.jar" \ "$@" # Stop when "xargs" is not available. diff --git a/gradlew.bat b/gradlew.bat index 9d21a21..c4bdd3a 100644 --- a/gradlew.bat +++ b/gradlew.bat @@ -70,11 +70,10 @@ 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 %* +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %* :end @rem End local scope for the variables with windows NT shell diff --git a/settings.gradle b/settings.gradle index ff436f2..035355d 100644 --- a/settings.gradle +++ b/settings.gradle @@ -17,7 +17,7 @@ pluginManagement { } plugins { - id 'com.gtnewhorizons.gtnhsettingsconvention' version '1.0.38' + id 'com.gtnewhorizons.gtnhsettingsconvention' version '2.0.23' } diff --git a/src/main/java/com/gtnh/findit/FindIt.java b/src/main/java/com/gtnh/findit/FindIt.java index 16f3df7..5935ead 100644 --- a/src/main/java/com/gtnh/findit/FindIt.java +++ b/src/main/java/com/gtnh/findit/FindIt.java @@ -86,7 +86,7 @@ public class FindIt { this.pluginsList.add(new BackpackProvider()); } - if (Loader.isModLoaded("thaumcraftneiplugin") && Loader.isModLoaded("Thaumcraft")) { + if (Loader.isModLoaded("Thaumcraft")) { this.pluginsList.add(new ThaumcraftProvider()); } diff --git a/src/main/java/com/gtnh/findit/handler/ThaumcraftProvider.java b/src/main/java/com/gtnh/findit/handler/ThaumcraftProvider.java index bb2f56a..ce4b836 100644 --- a/src/main/java/com/gtnh/findit/handler/ThaumcraftProvider.java +++ b/src/main/java/com/gtnh/findit/handler/ThaumcraftProvider.java @@ -5,11 +5,12 @@ import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; -import com.djgiannuzz.thaumcraftneiplugin.items.ItemAspect; +import com.gtnewhorizons.aspectrecipeindex.common.items.ItemAspect; import com.gtnh.findit.IStackFilter; import com.gtnh.findit.IStackFilter.IStackFilterProvider; import com.gtnh.findit.service.itemfinder.FindItemRequest; +import cpw.mods.fml.common.Loader; import thaumcraft.api.aspects.Aspect; import thaumcraft.api.aspects.AspectList; import thaumcraft.api.aspects.IAspectContainer; @@ -17,6 +18,9 @@ import thaumcraft.api.aspects.IEssentiaContainerItem; public class ThaumcraftProvider implements IStackFilterProvider { + public static final boolean ASPECTRECIPEINDEX = Loader.isModLoaded("aspectrecipeindex"); + public static final boolean TCNEIPLUGIN = Loader.isModLoaded("thaumcraftneiplugin"); + static class AspectStackFilter implements IStackFilter { AspectList filterAspects; @@ -29,14 +33,26 @@ public class ThaumcraftProvider implements IStackFilterProvider { public boolean matches(FindItemRequest request) { ItemStack stack = request.getStackToFind(); Item item = stack.getItem(); - if (!(item instanceof ItemAspect || item instanceof IEssentiaContainerItem)) return false; + if (item instanceof IEssentiaContainerItem container) { + AspectList stackAspects = container.getAspects(stack); + if (stackAspects == null || stackAspects.aspects.isEmpty()) return false; + for (Aspect a : stackAspects.getAspects()) { + if (filterAspects.getAmount(a) > 0) return true; + } + return false; + } + Aspect aspect; + if (ASPECTRECIPEINDEX && item instanceof ItemAspect) { + aspect = ItemAspect.getAspect(stack); + } else if (TCNEIPLUGIN && item instanceof com.djgiannuzz.thaumcraftneiplugin.items.ItemAspect) { + AspectList stackAspects = com.djgiannuzz.thaumcraftneiplugin.items.ItemAspect.getAspects(stack); + if (stackAspects == null || stackAspects.aspects.isEmpty()) return false; + aspect = stackAspects.getAspects()[0]; + } else { + return false; + } - AspectList stackAspects = ItemAspect.getAspects(stack); - if (stackAspects == null || stackAspects.size() != 1) return false; - - Aspect stackAspect = stackAspects.getAspects()[0]; - - return filterAspects.getAmount(stackAspect) > 0; + return filterAspects.getAmount(aspect) > 0; } }