romelo333 / notenoughwands

This mod gives the player a number of very configurable and versatile wands
MIT License
7 stars 2 forks source link

[1.10+] Wands not taking proper amount of EXP per level #76

Open SimPiko opened 6 years ago

SimPiko commented 6 years ago

Steps to reproduce:

  1. Get wand that uses Exp as fuel. (depends on config, i've noticed it on Building Wand, Moving Wand and Displacement Wand)
  2. Use it until you lose one level of Exp.

Expected result: Exp bar should be full (or almost full), no matter what Exp level you have Actual result: Exp bar shows weird values.

While playing "Faster Technology" modpack, i've noticed that wands, when has taken whole Exp level, it restores only ~50% of EXP bar (at ~30lvl and up) and it restores more than a bar at ~5lvl or lower (the highlighted part of Exp bar goes waay to the right). I've quickly tested on mc1.12, it also happens there.

I've quickly looked in code here on GitHub, and looks like 'varia/Tools.java' uses pre-1.8 equations for calculating exp amount. It should be something like (at least according to Minecraft Wiki):

if (level > 0 && level < 17)
    return (int) (Math.pow(level, 2) + 6 * level);
else if (level > 16 && level < 32)
    return (int) (2.5 * Math.pow(level, 2) - 40.5 * level + 360);
else
    return (int) (4.5 * Math.pow(level, 2) - 162.5 * level + 2220);

Offtopic-wise, there are probably more mods that somehow forgot to update that (i know Botania had that issue and yes, i know i copy-pasted text from it), but that's another story/issue. Also, i don't know how to post issues properly and English isn't my first language, so i'm sorry if it's too wordy or weird too understand.

RalphFox commented 6 years ago

I'm guessing the issue I was about to report is related to this one. The amount of taken exp when you don't have enough for a single use on the current level on usage, it will take almost half of the previous level upon use, then back to taking a small amount.

Here is a gif: http://g.recordit.co/iXFcCSIXqX.gif too much xp taken

RalphFox commented 6 years ago

Actually it's worser. You can dupe xp with this. I was level 56, close to 57, then I used the teleportation wand, and I jumped to level 57. http://recordit.co/MsqldETdsX http://g.recordit.co/MsqldETdsX.gif