Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Soul Fire'd Compat (1.20.4) #119

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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']) {
Expand Down
2 changes: 1 addition & 1 deletion common/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
Original file line number Diff line number Diff line change
@@ -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;
Expand Down Expand Up @@ -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);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -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);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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> T load(Class<T> clazz) {

Expand Down

This file was deleted.

4 changes: 2 additions & 2 deletions fabric/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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}"
Expand All @@ -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}")
Expand Down

This file was deleted.

4 changes: 2 additions & 2 deletions fabric/src/main/resources/fabric.mod.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": [
"[email protected](optional){modrinth:d6MhxwRo}{curseforge:662413}"
"soul-fire-d@{soul_fire_d_version}(optional){modrinth:d6MhxwRo}{curseforge:662413}"
]
}
}
Expand Down
3 changes: 2 additions & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -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
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -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
Expand Down
35 changes: 22 additions & 13 deletions gradlew
Original file line number Diff line number Diff line change
Expand Up @@ -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/.
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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" \
Expand Down
21 changes: 11 additions & 10 deletions gradlew.bat
Original file line number Diff line number Diff line change
Expand Up @@ -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%

Expand All @@ -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

Expand All @@ -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

Expand Down
2 changes: 1 addition & 1 deletion neoforge/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

This file was deleted.

6 changes: 3 additions & 3 deletions neoforge/src/main/resources/META-INF/mods.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [
"[email protected](optional){modrinth:d6MhxwRo}{curseforge:662413}"
"soul-fire-d@{soul_fire_d_version}(optional){modrinth:d6MhxwRo}{curseforge:662413}"
]
2 changes: 1 addition & 1 deletion settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down