diff --git a/build.gradle b/build.gradle index 149d3d9..495530a 100644 --- a/build.gradle +++ b/build.gradle @@ -50,6 +50,16 @@ subprojects { name = "ModMaven" url = "https://modmaven.dev" } + // Crystal Nest repository where Soul Fire'd is hosted. + maven { + name = "Crystal Nest" + url = "https://maven.crystalnest.it" + } + // Fuzs repository where Soul Fire'd required dependency FCAP is hosted. Not needed since 1.21 + maven { + name = "Fuzs Mod Resources" + url = "https://raw.githubusercontent.com/Fuzss/modresources/main/maven/" + } maven { url "https://cursemaven.com" content { @@ -78,6 +88,7 @@ subprojects { "mod_id" : mod_id, "mod_license" : mod_license, "mod_description" : project.mod_description, + "soul_fire_d_version" : soul_fire_d_version ] filesMatching(['pack.mcmeta', 'fabric.mod.json', 'META-INF/mods.toml', '*.mixins.json']) { diff --git a/common/build.gradle b/common/build.gradle index 44276d8..257fc3c 100644 --- a/common/build.gradle +++ b/common/build.gradle @@ -18,7 +18,7 @@ dependencies { compileOnly group: 'org.spongepowered', name: 'mixin', version: '0.8.5' implementation group: 'com.google.code.findbugs', name: 'jsr305', version: '3.0.1' - + implementation "it.crystalnest:soul-fire-d-common:$minecraft_version-$soul_fire_d_version" } publishing { diff --git a/common/src/main/java/lilypuree/decorative_blocks/blocks/BonfireBlock.java b/common/src/main/java/lilypuree/decorative_blocks/blocks/BonfireBlock.java index 235256c..343dac1 100644 --- a/common/src/main/java/lilypuree/decorative_blocks/blocks/BonfireBlock.java +++ b/common/src/main/java/lilypuree/decorative_blocks/blocks/BonfireBlock.java @@ -1,5 +1,6 @@ package lilypuree.decorative_blocks.blocks; +import lilypuree.decorative_blocks.compat.SoulFired; import lilypuree.decorative_blocks.registration.DBBlocks; import lilypuree.decorative_blocks.platform.Services; import net.minecraft.core.BlockPos; @@ -52,10 +53,10 @@ public VoxelShape getCollisionShape(BlockState state, BlockGetter worldIn, Block @Override public void entityInside(BlockState state, Level worldIn, BlockPos pos, Entity entityIn) { - if (!entityIn.fireImmune() && entityIn instanceof LivingEntity && !EnchantmentHelper.hasFrostWalker((LivingEntity) entityIn)) { + if (!entityIn.fireImmune() && (!(entityIn instanceof LivingEntity) || !EnchantmentHelper.hasFrostWalker((LivingEntity) entityIn))) { entityIn.hurt(entityIn.damageSources().inFire(), 1.0F); - if (Services.PLATFORM.isModLoaded("soulfired")) { - Services.SOULFIRED.setSecondsOnFire(entityIn, 3, state.is(DBBlocks.SOUL_BONFIRE.get())); + if (Services.PLATFORM.isModLoaded("soul_fire_d")) { + SoulFired.setSecondsOnFire(entityIn, 3, state.is(DBBlocks.SOUL_BONFIRE.get())); } else entityIn.setSecondsOnFire(3); } diff --git a/common/src/main/java/lilypuree/decorative_blocks/compat/SoulFired.java b/common/src/main/java/lilypuree/decorative_blocks/compat/SoulFired.java new file mode 100644 index 0000000..c93a7d0 --- /dev/null +++ b/common/src/main/java/lilypuree/decorative_blocks/compat/SoulFired.java @@ -0,0 +1,10 @@ +package lilypuree.decorative_blocks.compat; + +import it.crystalnest.soul_fire_d.api.FireManager; +import net.minecraft.world.entity.Entity; + +public class SoulFired { + public static void setSecondsOnFire(Entity entity, int seconds, boolean isSoul) { + FireManager.setOnFire(entity, seconds, isSoul ? FireManager.SOUL_FIRE_TYPE : FireManager.DEFAULT_FIRE_TYPE); + } +} diff --git a/common/src/main/java/lilypuree/decorative_blocks/platform/Services.java b/common/src/main/java/lilypuree/decorative_blocks/platform/Services.java index 7481102..a6048aa 100644 --- a/common/src/main/java/lilypuree/decorative_blocks/platform/Services.java +++ b/common/src/main/java/lilypuree/decorative_blocks/platform/Services.java @@ -2,13 +2,11 @@ import lilypuree.decorative_blocks.Constants; import lilypuree.decorative_blocks.platform.services.IPlatformHelper; -import lilypuree.decorative_blocks.platform.services.SoulFiredHelper; import java.util.ServiceLoader; public class Services { public static final IPlatformHelper PLATFORM = load(IPlatformHelper.class); - public static final SoulFiredHelper SOULFIRED = load(SoulFiredHelper.class); public static T load(Class clazz) { diff --git a/common/src/main/java/lilypuree/decorative_blocks/platform/services/SoulFiredHelper.java b/common/src/main/java/lilypuree/decorative_blocks/platform/services/SoulFiredHelper.java deleted file mode 100644 index 657c45e..0000000 --- a/common/src/main/java/lilypuree/decorative_blocks/platform/services/SoulFiredHelper.java +++ /dev/null @@ -1,7 +0,0 @@ -package lilypuree.decorative_blocks.platform.services; - -import net.minecraft.world.entity.Entity; - -public interface SoulFiredHelper { - public void setSecondsOnFire(Entity entity, int seconds, boolean isSoul); -} diff --git a/fabric/build.gradle b/fabric/build.gradle index 2313054..87e4cab 100644 --- a/fabric/build.gradle +++ b/fabric/build.gradle @@ -2,7 +2,7 @@ plugins { id 'java' id 'idea' id 'maven-publish' - id 'fabric-loom' version '1.4-SNAPSHOT' + id 'fabric-loom' version '1.5-SNAPSHOT' } base { archivesName = "${mod_name}-Fabric-${minecraft_version}" @@ -22,7 +22,7 @@ dependencies { modImplementation "net.fabricmc.fabric-api:fabric-api:${fabric_version}" implementation group: 'com.google.code.findbugs', name: 'jsr305', version: '3.0.1' - modCompileOnly "curse.maven:soulfired-662413:5029260" + modImplementation "it.crystalnest:soul-fire-d-fabric:$minecraft_version-$soul_fire_d_version" // modCompileOnlyApi("mezz.jei:jei-${minecraft_version}-common-api:${jei_version}") diff --git a/fabric/src/main/java/lilypuree/decorative_blocks/compat/SoulFiredHelperFabric.java b/fabric/src/main/java/lilypuree/decorative_blocks/compat/SoulFiredHelperFabric.java deleted file mode 100644 index 157f30e..0000000 --- a/fabric/src/main/java/lilypuree/decorative_blocks/compat/SoulFiredHelperFabric.java +++ /dev/null @@ -1,12 +0,0 @@ -package lilypuree.decorative_blocks.compat; - -import crystalspider.soulfired.api.FireManager; -import lilypuree.decorative_blocks.platform.services.SoulFiredHelper; -import net.minecraft.world.entity.Entity; - -public class SoulFiredHelperFabric implements SoulFiredHelper { - @Override - public void setSecondsOnFire(Entity entity, int seconds, boolean isSoul) { - FireManager.setOnFire(entity, seconds, isSoul ? FireManager.SOUL_FIRE_TYPE : FireManager.DEFAULT_FIRE_TYPE); - } -} diff --git a/fabric/src/main/resources/fabric.mod.json b/fabric/src/main/resources/fabric.mod.json index 9861429..70e7bba 100644 --- a/fabric/src/main/resources/fabric.mod.json +++ b/fabric/src/main/resources/fabric.mod.json @@ -32,13 +32,13 @@ "java": ">=17" }, "suggests": { - "soulfired": "^3.2.1.0" + "soul_fire_d": "^${soul_fire_d_version}" }, "custom": { "mc-publish": { "loaders": ["fabric"], "dependencies": [ - "soulfired@3.2.1.0(optional){modrinth:d6MhxwRo}{curseforge:662413}" + "soul-fire-d@{soul_fire_d_version}(optional){modrinth:d6MhxwRo}{curseforge:662413}" ] } } diff --git a/gradle.properties b/gradle.properties index 2abef18..9d1ac3f 100644 --- a/gradle.properties +++ b/gradle.properties @@ -34,4 +34,5 @@ parchment_version=2023.12.10 # JEI jei_version=17.1.0.39 - +# Soul Fire'd +soul_fire_d_version = 4.0.6 diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index d64cd49..e644113 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 1af9e09..a441313 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.5-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.8-bin.zip networkTimeout=10000 validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME diff --git a/gradlew b/gradlew index a69d9cb..b740cf1 100644 --- a/gradlew +++ b/gradlew @@ -55,7 +55,7 @@ # Darwin, MinGW, and NonStop. # # (3) This script is generated from the Groovy template -# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# https://github.com/gradle/gradle/blob/HEAD/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/. @@ -80,13 +80,11 @@ do esac done -APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit - -APP_NAME="Gradle" +# This is normally unused +# shellcheck disable=SC2034 APP_BASE_NAME=${0##*/} - -# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' +# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) +APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD=maximum @@ -133,22 +131,29 @@ 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. if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then case $MAX_FD in #( max*) + # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. + # shellcheck disable=SC2039,SC3045 MAX_FD=$( ulimit -H -n ) || warn "Could not query maximum file descriptor limit" esac case $MAX_FD in #( '' | soft) :;; #( *) + # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. + # shellcheck disable=SC2039,SC3045 ulimit -n "$MAX_FD" || warn "Could not set maximum file descriptor limit to $MAX_FD" esac @@ -193,11 +198,15 @@ if "$cygwin" || "$msys" ; then done fi -# Collect all arguments for the java command; -# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of -# shell script including quotes and variable substitutions, so put them in -# double quotes to make sure that they get re-expanded; and -# * put everything else in single quotes, so that it's not re-expanded. + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' + +# Collect all arguments for the java command: +# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# and any embedded shellness will be escaped. +# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be +# treated as '${Hostname}' itself on the command line. set -- \ "-Dorg.gradle.appname=$APP_BASE_NAME" \ diff --git a/gradlew.bat b/gradlew.bat index f127cfd..25da30d 100644 --- a/gradlew.bat +++ b/gradlew.bat @@ -26,6 +26,7 @@ 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% @@ -42,11 +43,11 @@ 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. +echo. 1>&2 +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 goto fail @@ -56,11 +57,11 @@ 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. +echo. 1>&2 +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 goto fail diff --git a/neoforge/build.gradle b/neoforge/build.gradle index 377795f..75a99f5 100644 --- a/neoforge/build.gradle +++ b/neoforge/build.gradle @@ -44,7 +44,7 @@ dependencies { compileOnly "mezz.jei:jei-${minecraft_version}-neoforge-api:${jei_version}" // at runtime, use the full JEI jar runtimeOnly "mezz.jei:jei-${minecraft_version}-neoforge:${jei_version}" - compileOnly "curse.maven:soulfired-662413:5029266" + implementation "it.crystalnest:soul-fire-d-neoforge:$minecraft_version-$soul_fire_d_version" } // NeoGradle compiles the game, but we don't want to add our common code to the game's code diff --git a/neoforge/src/main/java/lilypuree/decorative_blocks/compat/SoulFiredHelperForge.java b/neoforge/src/main/java/lilypuree/decorative_blocks/compat/SoulFiredHelperForge.java deleted file mode 100644 index 954815b..0000000 --- a/neoforge/src/main/java/lilypuree/decorative_blocks/compat/SoulFiredHelperForge.java +++ /dev/null @@ -1,12 +0,0 @@ -package lilypuree.decorative_blocks.compat; - -import crystalspider.soulfired.api.FireManager; -import lilypuree.decorative_blocks.platform.services.SoulFiredHelper; -import net.minecraft.world.entity.Entity; - -public class SoulFiredHelperForge implements SoulFiredHelper { - @Override - public void setSecondsOnFire(Entity entity, int seconds, boolean isSoul) { - FireManager.setOnFire(entity, seconds, isSoul ? FireManager.SOUL_FIRE_TYPE : FireManager.DEFAULT_FIRE_TYPE); - } -} diff --git a/neoforge/src/main/resources/META-INF/mods.toml b/neoforge/src/main/resources/META-INF/mods.toml index bfbbbbf..0fcee33 100644 --- a/neoforge/src/main/resources/META-INF/mods.toml +++ b/neoforge/src/main/resources/META-INF/mods.toml @@ -39,14 +39,14 @@ ordering = "NONE" side = "BOTH" [[dependencies.${mod_id}]] -modId = "soulfired" +modId = "soul_fire_d" type="optional" -versionRange = "[3.2.1.0,)" +versionRange = "[{soul_fire_d_version},)" ordering = "NONE" side = "BOTH" [mc-publish] loaders = ['neoforge'] dependencies = [ - "soulfired@3.2.1.0(optional){modrinth:d6MhxwRo}{curseforge:662413}" + "soul-fire-d@{soul_fire_d_version}(optional){modrinth:d6MhxwRo}{curseforge:662413}" ] \ No newline at end of file diff --git a/settings.gradle b/settings.gradle index 8f341b0..cf7380b 100644 --- a/settings.gradle +++ b/settings.gradle @@ -21,7 +21,7 @@ pluginManagement { } plugins { - id 'org.gradle.toolchains.foojay-resolver-convention' version '0.5.0' + id 'org.gradle.toolchains.foojay-resolver-convention' version '0.8.0' } rootProject.name = 'Decorative-Blocks'