Skip to content

Commit

Permalink
oop now it's in the correct place my b
Browse files Browse the repository at this point in the history
  • Loading branch information
CammiePone committed Jan 8, 2024
1 parent b060435 commit 8cbc0b5
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ public boolean addMana(double amount, boolean simulate) {
}

public boolean drainMana(double amount, boolean simulate) {
amount *= entity.getAttributeValue(ArcanusEntityAttributes.MANA_COST_MULT.get());
if(getMana() >= 0 && getMana() + getTrueMaxMana() >= amount) {
if(!simulate) {
if(amount > getMana()) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package dev.cammiescorner.arcanuscontinuum.common.packets.c2s;

import dev.cammiescorner.arcanuscontinuum.Arcanus;
import dev.cammiescorner.arcanuscontinuum.api.entities.ArcanusEntityAttributes;
import dev.cammiescorner.arcanuscontinuum.api.spells.Spell;
import dev.cammiescorner.arcanuscontinuum.api.spells.SpellComponent;
import dev.cammiescorner.arcanuscontinuum.api.spells.SpellGroup;
Expand Down Expand Up @@ -59,7 +58,7 @@ public static void handler(MinecraftServer server, ServerPlayerEntity player, Se
return;
}

if(!ArcanusComponents.drainMana(player, spell.getManaCost() * player.getAttributeValue(ArcanusEntityAttributes.MANA_COST_MULT.get()), false)) {
if(!ArcanusComponents.drainMana(player, spell.getManaCost(), false)) {
player.sendMessage(Arcanus.translate("spell", "not_enough_mana").formatted(Formatting.RED, Formatting.ITALIC), true);
return;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package dev.cammiescorner.arcanuscontinuum.common.packets.c2s;

import dev.cammiescorner.arcanuscontinuum.Arcanus;
import dev.cammiescorner.arcanuscontinuum.api.entities.ArcanusEntityAttributes;
import dev.cammiescorner.arcanuscontinuum.api.spells.Pattern;
import dev.cammiescorner.arcanuscontinuum.api.spells.Spell;
import dev.cammiescorner.arcanuscontinuum.api.spells.SpellComponent;
Expand Down Expand Up @@ -75,7 +74,7 @@ public static void handler(MinecraftServer server, ServerPlayerEntity player, Se
return;
}

if(!ArcanusComponents.drainMana(player, spell.getManaCost() * player.getAttributeValue(ArcanusEntityAttributes.MANA_COST_MULT.get()), player.isCreative())) {
if(!ArcanusComponents.drainMana(player, spell.getManaCost(), player.isCreative())) {
player.sendMessage(Arcanus.translate("spell", "not_enough_mana"), true);
return;
}
Expand Down

0 comments on commit 8cbc0b5

Please sign in to comment.