From 0a99bfa6b688afac3b606e947350951c7e2216a7 Mon Sep 17 00:00:00 2001 From: MintTeaTx Date: Tue, 19 Jan 2021 19:02:11 -0600 Subject: [PATCH] Fixing for the latest ars update --- build.gradle | 4 +-- .../common/events/LivingArmorManaBonus.java | 33 +++---------------- .../common/utils/BloodSpellResolver.java | 2 +- .../common/utils/ManaUpgradeHandler.java | 2 +- 4 files changed, 9 insertions(+), 32 deletions(-) diff --git a/build.gradle b/build.gradle index 8c653db..c1b639a 100644 --- a/build.gradle +++ b/build.gradle @@ -125,8 +125,8 @@ dependencies { runtimeOnly fg.deobf("curse.maven:curios:3122651") compileOnly fg.deobf("curse.maven:patchouli:3126931") runtimeOnly fg.deobf("curse.maven:patchouli:3126931") - compileOnly fg.deobf("curse.maven:ars-noveau:3157929") - runtimeOnly fg.deobf("curse.maven:ars-noveau:3157929") + compileOnly fg.deobf("curse.maven:ars-noveau:3173254") + runtimeOnly fg.deobf("curse.maven:ars-noveau:3173254") compileOnly fg.deobf("curse.maven:blood-magic:3149693") runtimeOnly fg.deobf("curse.maven:blood-magic:3149693") diff --git a/src/main/java/com/minttea/tomeofblood/common/events/LivingArmorManaBonus.java b/src/main/java/com/minttea/tomeofblood/common/events/LivingArmorManaBonus.java index 9f443c0..28d25b2 100644 --- a/src/main/java/com/minttea/tomeofblood/common/events/LivingArmorManaBonus.java +++ b/src/main/java/com/minttea/tomeofblood/common/events/LivingArmorManaBonus.java @@ -5,6 +5,7 @@ import com.hollingsworth.arsnouveau.api.event.SpellCastEvent; import com.hollingsworth.arsnouveau.api.spell.AbstractSpellPart; +import com.hollingsworth.arsnouveau.api.spell.Spell; import net.minecraft.entity.LivingEntity; import net.minecraft.entity.player.PlayerEntity; import net.minecraft.util.ResourceLocation; @@ -24,32 +25,19 @@ public class LivingArmorManaBonus { public static void awardSpellCastArmourUpgrade(SpellCastEvent event) { LivingEntity entity = event.getEntityLiving(); - List spell = event.spell; + Spell spell = event.spell; int xpAward = 1; if(entity instanceof PlayerEntity){ PlayerEntity player = (PlayerEntity) entity; if(LivingUtil.hasFullSet(player)){ - for (AbstractSpellPart spellpart: spell) { - - switch (spellpart.getTier()) { - case THREE: - xpAward += 7; - break; - case TWO: - xpAward += 3; - break; - case ONE: - xpAward += 1; - break; - default: - } - } + xpAward = (int)((double) spell.getCastingCost()/100); LivingStats stats = LivingStats.fromPlayer(player); - stats.addExperience(new ResourceLocation("tomeofblood", "mana_bonus"), 1); + stats.addExperience(new ResourceLocation("tomeofblood", "mana_bonus"), xpAward); LOGGER.debug("Arcane Attunement level ", stats.getLevel(new ResourceLocation("tomeofblood", "mana_bonus"))); LivingStats.toPlayer(player, stats); + if(stats) } } @@ -67,15 +55,4 @@ public static void maxManaForArmor(MaxManaCalcEvent event) } } - @SubscribeEvent - public static void manaRegenByLevel(ManaRegenCalcEvent event) { - PlayerEntity player = (PlayerEntity) event.getEntity(); - LivingStats stats = LivingStats.fromPlayer(player); - if(stats != null) { - int level = stats.getLevel(new ResourceLocation("tomeofblood", "mana_bonus")); - double regen = event.getRegen(); - float manaBonus = 1 + (float) level / 10; - event.setRegen((int) (regen * manaBonus)); - } - } } diff --git a/src/main/java/com/minttea/tomeofblood/common/utils/BloodSpellResolver.java b/src/main/java/com/minttea/tomeofblood/common/utils/BloodSpellResolver.java index fd0c708..df7d21c 100644 --- a/src/main/java/com/minttea/tomeofblood/common/utils/BloodSpellResolver.java +++ b/src/main/java/com/minttea/tomeofblood/common/utils/BloodSpellResolver.java @@ -36,7 +36,7 @@ public void expendMana(LivingEntity entity) { if(entity instanceof PlayerEntity) { PlayerEntity player = (PlayerEntity) entity; - int totalCost = ManaUtil.getCastingCost(spell_recipe, player) * 10; + int totalCost = getCastingCost(this.spell,player); SoulNetwork soulNetwork = NetworkHelper.getSoulNetwork(player.getUniqueID()); //LOGGER.debug("Got soulnetwork for " + soulNetwork.getPlayer().getDisplayName().getString()); SoulTicket ticket = new SoulTicket(new StringTextComponent("Spell cast"), totalCost); diff --git a/src/main/java/com/minttea/tomeofblood/common/utils/ManaUpgradeHandler.java b/src/main/java/com/minttea/tomeofblood/common/utils/ManaUpgradeHandler.java index a5461ac..f1d645d 100644 --- a/src/main/java/com/minttea/tomeofblood/common/utils/ManaUpgradeHandler.java +++ b/src/main/java/com/minttea/tomeofblood/common/utils/ManaUpgradeHandler.java @@ -1,5 +1,5 @@ package com.minttea.tomeofblood.common.utils; public class ManaUpgradeHandler { - + }