From 22e4314bfb518c8d30595f64c275b10da52c7dbb Mon Sep 17 00:00:00 2001 From: Indyuce Date: Mon, 27 Apr 2020 23:27:31 +0200 Subject: [PATCH] !Removed unused method --- .../mmocore/api/player/attribute/PlayerAttributes.java | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/main/java/net/Indyuce/mmocore/api/player/attribute/PlayerAttributes.java b/src/main/java/net/Indyuce/mmocore/api/player/attribute/PlayerAttributes.java index afa5d39c..c3871370 100644 --- a/src/main/java/net/Indyuce/mmocore/api/player/attribute/PlayerAttributes.java +++ b/src/main/java/net/Indyuce/mmocore/api/player/attribute/PlayerAttributes.java @@ -124,10 +124,6 @@ public class PlayerAttributes { setBase(spent + value); } - public int getTotal() { - return (int) getTotal(spent); - } - /* * 1) two types of attributes: flat attributes which add X to the value, * and relative attributes which add X% and which must be applied @@ -135,7 +131,8 @@ public class PlayerAttributes { * attributes also apply on the base stat, or if they only apply on the * extra stat value */ - public double getTotal(double d) { + public int getTotal() { + double d = spent; for (StatModifier attr : map.values()) if (attr.getType() == ModifierType.FLAT) @@ -145,7 +142,8 @@ public class PlayerAttributes { if (attr.getType() == ModifierType.RELATIVE) d *= attr.getValue(); - return d; + // cast to int at the last moment + return (int) d; } public StatModifier getModifier(String key) {