Fixed attribute exp tables not claiming the right amount of times when shift clicking

This commit is contained in:
Indyuce 2022-07-07 13:07:51 +02:00
parent bf4df777e5
commit c788a88a82

View File

@ -136,9 +136,12 @@ public class PlayerAttributes {
* @param value Amount of attribute points spent in the attribute * @param value Amount of attribute points spent in the attribute
*/ */
public void addBase(int value) { public void addBase(int value) {
PlayerAttribute attribute = MMOCore.plugin.attributeManager.get(id);
setBase(spent + value); setBase(spent + value);
// Apply exp table as many times as required
final PlayerAttribute attribute = MMOCore.plugin.attributeManager.get(id);
if (attribute.hasExperienceTable()) if (attribute.hasExperienceTable())
while (value-- > 0)
attribute.getExperienceTable().claim(data, spent, attribute); attribute.getExperienceTable().claim(data, spent, attribute);
} }