Handle Iron's Spellbooks compat optionally

This commit is contained in:
2026-01-05 17:44:41 +01:00
parent 9f23e4b434
commit e04fe58dcc
2 changed files with 190 additions and 186 deletions
-1
View File
@@ -139,7 +139,6 @@ dependencies {
// Iron's Spellbooks API only
compileOnly fg.deobf("io.redspace.ironsspellbooks:irons_spellbooks:${irons_spells_version}:api")
implementation fg.deobf("io.redspace.ironsspellbooks:irons_spellbooks:${irons_spells_version}")
// GECKOLIB — deobfuscated, full mod
implementation fg.deobf("software.bernie.geckolib:geckolib-forge-${geckolib_version}")
@@ -56,14 +56,18 @@ public class IronsSpellbooksCompat {
int magicScaling = stats.getAttributeLevel("magic_scaling");
int willpower = stats.getAttributeLevel("willpower");
applyIntelligence(player, intelligence);
applyCharisma(player, charisma);
applyMagicScaling(player, magicScaling);
applyWillpowerCastEfficiency(player, willpower);
Loaded.applyIntelligence(player, intelligence);
Loaded.applyCharisma(player, charisma);
Loaded.applyMagicScaling(player, magicScaling);
Loaded.applyWillpowerCastEfficiency(player, willpower);
});
}
public static void applyIntelligence(Player player, int intelligence) {
private static final class Loaded {
private Loaded() {
}
private static void applyIntelligence(Player player, int intelligence) {
if (intelligence <= 0) {
clearIntelligence(player);
return;
@@ -92,7 +96,7 @@ public class IronsSpellbooksCompat {
removeModifier(player, (Attribute) AttributeRegistry.MANA_REGEN.get(), INT_MANA_REGEN_UUID);
}
public static void applyWillpowerCastEfficiency(Player player, int willpower) {
private static void applyWillpowerCastEfficiency(Player player, int willpower) {
clearWillpower(player);
if (willpower <= 0) {
return;
@@ -125,7 +129,7 @@ public class IronsSpellbooksCompat {
removeModifier(player, attr, WILL_MANA_COST_UUID);
}
public static void applyCharisma(Player player, int charisma) {
private static void applyCharisma(Player player, int charisma) {
clearCharisma(player);
if (charisma <= 0) {
return;
@@ -194,7 +198,7 @@ public class IronsSpellbooksCompat {
}
}
public static void applyMagicScaling(Player player, int magicScaling) {
private static void applyMagicScaling(Player player, int magicScaling) {
if (magicScaling <= 0) {
clearMagicScaling(player);
return;
@@ -263,4 +267,5 @@ public class IronsSpellbooksCompat {
inst.removeModifier(id);
}
}
}
}