Weird method name

This commit is contained in:
Indyuce 2022-08-19 14:59:03 +02:00
parent 95c355eeed
commit a498c43bf4
2 changed files with 7 additions and 2 deletions

View File

@ -101,7 +101,12 @@ public class PlayerAttributes {
return getInstance(attribute.getId()); return getInstance(attribute.getId());
} }
@Deprecated
public int countSkillPoints() { public int countSkillPoints() {
return countPoints();
}
public int countPoints() {
int n = 0; int n = 0;
for (AttributeInstance ins : instances.values()) for (AttributeInstance ins : instances.values())
n += ins.getBase(); n += ins.getBase();

View File

@ -31,7 +31,7 @@ public class AttributeView extends EditableInventory {
Placeholders holders = new Placeholders(); Placeholders holders = new Placeholders();
holders.register("attribute_points", inv.getPlayerData().getAttributePoints()); holders.register("attribute_points", inv.getPlayerData().getAttributePoints());
holders.register("points", inv.getPlayerData().getAttributeReallocationPoints()); holders.register("points", inv.getPlayerData().getAttributeReallocationPoints());
holders.register("total", inv.getPlayerData().getAttributes().countSkillPoints()); holders.register("total", inv.getPlayerData().getAttributes().countPoints());
return holders; return holders;
} }
}; };
@ -93,7 +93,7 @@ public class AttributeView extends EditableInventory {
public void whenClicked(InventoryClickContext context, InventoryItem item) { public void whenClicked(InventoryClickContext context, InventoryItem item) {
if (item.getFunction().equalsIgnoreCase("reallocation")) { if (item.getFunction().equalsIgnoreCase("reallocation")) {
int spent = playerData.getAttributes().countSkillPoints(); int spent = playerData.getAttributes().countPoints();
if (spent < 1) { if (spent < 1) {
MMOCore.plugin.configManager.getSimpleMessage("no-attribute-points-spent").send(player); MMOCore.plugin.configManager.getSimpleMessage("no-attribute-points-spent").send(player);
MMOCore.plugin.soundManager.getSound(SoundEvent.NOT_ENOUGH_POINTS).playTo(getPlayer()); MMOCore.plugin.soundManager.getSound(SoundEvent.NOT_ENOUGH_POINTS).playTo(getPlayer());