Skip to content

Commit

Permalink
Made new calculations toggleable (deactivated by default)
Browse files Browse the repository at this point in the history
  • Loading branch information
EdwinMindcraft committed Mar 20, 2018
1 parent 50f9442 commit 442ce17
Show file tree
Hide file tree
Showing 15 changed files with 2,154 additions and 2,134 deletions.
2 changes: 1 addition & 1 deletion src/main/java/am2/api/extensions/IEntityExtension.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

public interface IEntityExtension {

boolean hasEnoughtMana(float f);
boolean hasEnoughMana(float f);

void setContingency(ContingencyType type, SpellData stack);

Expand Down
3 changes: 1 addition & 2 deletions src/main/java/am2/client/gui/AMIngameGUI.java
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@
import net.minecraft.potion.PotionEffect;
import net.minecraft.util.EnumHand;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.math.MathHelper;
import net.minecraftforge.client.event.RenderGameOverlayEvent;
import net.minecraftforge.event.entity.player.ItemTooltipEvent;
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
Expand Down Expand Up @@ -278,7 +277,7 @@ else if (hasOverloadMana)
ISpellCaster caster = spellStack.getCapability(SpellCaster.INSTANCE, null);
if (caster != null) {
float manaCost = caster.getManaCost(Minecraft.getMinecraft().theWorld, Minecraft.getMinecraft().thePlayer);
spellcost = (EntityExtension.For(Minecraft.getMinecraft().thePlayer).hasEnoughtMana(manaCost) ? ChatFormatting.AQUA.toString() : ChatFormatting.DARK_RED.toString()) + " (" + (int)(manaCost) + ")";
spellcost = (EntityExtension.For(Minecraft.getMinecraft().thePlayer).hasEnoughMana(manaCost) ? ChatFormatting.AQUA.toString() : ChatFormatting.DARK_RED.toString()) + " (" + (int)(manaCost) + ")";
spellcost += ChatFormatting.RESET.toString();
}
}
Expand Down
3 changes: 3 additions & 0 deletions src/main/java/am2/client/packet/AMPacketProcessorClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -363,13 +363,16 @@ private void handlePlayerLoginData(byte[] data, EntityPlayer player){
ArsMagica2.config.setSkillTreeSecondaryTierCap(skillTreeLock);
int[] disabledSkills = rdr.getIntArray();
double manaCap = rdr.getDouble();
boolean oldCalc = rdr.getBoolean();

ArsMagica2.config.setManaCap(manaCap);
ArsMagica2.config.setOldXpCalculations(oldCalc);

LogHelper.info("Received player login packet.");
LogHelper.debug("Secondary tree cap: %d", skillTreeLock);
LogHelper.debug("Disabled skills: %d", disabledSkills.length);
LogHelper.debug("Mana cap: %.2f", manaCap);
LogHelper.debug("Old XP System: {}", oldCalc);

ArsMagica2.disabledSkills.disableAllSkillsIn(disabledSkills);
}
Expand Down
Loading

0 comments on commit 442ce17

Please sign in to comment.