diff --git a/build.gradle b/build.gradle index 4e952e900..a09f22208 100644 --- a/build.gradle +++ b/build.gradle @@ -205,6 +205,7 @@ dependencies { modCompileOnly (compatLibs.bewitchment) { transitive = false } // modLocalRuntime (compatLibs.bundles.bewitchment) { transitive = false } // modApi("com.github.Virtuoel:Pehkui:${compatLibs.pehkui}") + modCompileOnly (compatLibs.malum) { transitive = false } modLocalImplementation (compatLibs.trinkets) { exclude group: "net.fabricmc" exclude group: "net.fabricmc.fabric-api" diff --git a/gradle/compat-libs.versions.toml b/gradle/compat-libs.versions.toml index 929f8738f..63061d180 100644 --- a/gradle/compat-libs.versions.toml +++ b/gradle/compat-libs.versions.toml @@ -17,6 +17,7 @@ flk = "1.6.0+kotlin.1.5.0" golemsGalore = "3328376" # v1.0.0+mc1.17 kano="0.4.1" libgui = "3.3.5+1.16.5" +malum="5441759" midnightlib="1.4.1-fabric" mobz = "3498091" omegaConfig = "1.2.1-1.18.1" @@ -44,6 +45,7 @@ eldritchMobs = { group = "maven.modrinth", name = "eldritch-mobs", version.re flk = { group = "net.fabricmc", name = "fabric-language-kotlin", version.ref = "flk" } golemsGalore = { group = "curse.maven", name = "golems-galore-387197", version.ref = "golemsGalore" } libgui = { group = "io.github.cottonmc", name = "LibGui", version.ref = "libgui" } +malum = { group = "curse.maven", name = "malum-484064", version.ref = "malum"} midnightlib = { module = "maven.modrinth:midnightlib", version.ref = "midnightlib"} mobz = { group = "curse.maven", name = "mobz-336554", version.ref = "mobz" } omegaConfig = { group = "com.github.Draylar.omega-config", name = "omega-config-base", version.ref = "omegaConfig" } diff --git a/src/main/java/ladysnake/requiem/compat/MalumCompat.java b/src/main/java/ladysnake/requiem/compat/MalumCompat.java index a1fae6025..a79d08cbf 100644 --- a/src/main/java/ladysnake/requiem/compat/MalumCompat.java +++ b/src/main/java/ladysnake/requiem/compat/MalumCompat.java @@ -34,21 +34,26 @@ */ package ladysnake.requiem.compat; +import com.sammy.malum.MalumMod; +import com.sammy.malum.common.components.MalumComponents; +import com.sammy.malum.common.components.MalumLivingEntityDataComponent; import ladysnake.requiem.api.v1.RequiemPlugin; import ladysnake.requiem.api.v1.annotation.CalledThroughReflection; import ladysnake.requiem.api.v1.event.requiem.PossessionStartCallback; +import java.util.Optional; + public class MalumCompat implements RequiemPlugin { @CalledThroughReflection public static void init() { - /*TODO malum also has a soulless, allow them too - PossessionStartCallback.EVENT.register(Requiem.id("soulless"), (target, possessor, simulate) -> { - if (MalumComponents.MALUM_LIVING_ENTITY_COMPONENT.soulData.soulless) { - return PossessionStartCallback.Result.ALLOW; - } - return PossessionStartCallback.Result.PASS; + PossessionStartCallback.EVENT.register(MalumMod.malumPath("soulless"), (target, possessor, simulate) -> { + Optional optionalComponent = MalumComponents.MALUM_LIVING_ENTITY_COMPONENT.maybeGet(target); + if (optionalComponent.isPresent() && optionalComponent.get().soulData.soulless) { + return PossessionStartCallback.Result.ALLOW; + } + return PossessionStartCallback.Result.PASS; }); - */ + } } diff --git a/src/main/java/ladysnake/requiem/compat/RequiemCompatibilityManager.java b/src/main/java/ladysnake/requiem/compat/RequiemCompatibilityManager.java index 93db67111..f45ae8f67 100644 --- a/src/main/java/ladysnake/requiem/compat/RequiemCompatibilityManager.java +++ b/src/main/java/ladysnake/requiem/compat/RequiemCompatibilityManager.java @@ -61,6 +61,7 @@ public static void init() { load("golemsgalore", GolemsGaloreCompat.class); // Haema must be loaded before Origins, because vampire data must be stored before the origin gets cleared load("bewitchment", BewitchmentCompat.class); + load("malum", MalumCompat.class); load("origins", OriginsCompat.class); load("snowmercy", SnowMercyCompat.class); load("the_bumblezone", BumblezoneCompat.class);