Skip to content

Commit

Permalink
Fixing for the latest ars update
Browse files Browse the repository at this point in the history
  • Loading branch information
MintTeaTx committed Jan 20, 2021
1 parent 24ce7c8 commit 0a99bfa
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 32 deletions.
4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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")

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -24,32 +25,19 @@ public class LivingArmorManaBonus {
public static void awardSpellCastArmourUpgrade(SpellCastEvent event)
{
LivingEntity entity = event.getEntityLiving();
List<AbstractSpellPart> 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)
}
}

Expand All @@ -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));
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
package com.minttea.tomeofblood.common.utils;

public class ManaUpgradeHandler {

}

0 comments on commit 0a99bfa

Please sign in to comment.