Changed MM skill placeholder primitive from int to float

This commit is contained in:
Aria 2019-10-09 16:25:05 +02:00
parent ab2944b26c
commit 6570294900
4 changed files with 9 additions and 9 deletions

View File

@ -52,7 +52,7 @@ public class PlayerSkillData {
ambers = 0;
}
public double getCachedModifier(String name) {
public int getCachedModifier(String name) {
return cache.containsKey(name) ? cache.get(name).getValue() : 0;
}
@ -63,7 +63,7 @@ public class PlayerSkillData {
cacheModifier(mmSkill, "level", cast.getLevel());
}
public void cacheModifier(MythicMobSkill skill, String name, double value) {
public void cacheModifier(MythicMobSkill skill, String name, int value) {
cache.put(skill.getInternalName() + "." + name, new CachedModifier(value));
}
@ -75,9 +75,9 @@ public class PlayerSkillData {
public class CachedModifier {
private final long date = System.currentTimeMillis();
private final double value;
private final int value;
public CachedModifier(double value) {
public CachedModifier(int value) {
this.value = value;
}
@ -85,7 +85,7 @@ public class PlayerSkillData {
return date + 1000 * 60 < System.currentTimeMillis();
}
public double getValue() {
public int getValue() {
return value;
}
}

View File

@ -190,8 +190,8 @@ public abstract class Skill {
modifiers.put(modifier, linear);
}
public double getModifier(String modifier, int level) {
return modifiers.get(modifier).calculate(level);
public int getModifier(String modifier, int level) {
return (int) modifiers.get(modifier).calculate(level);
}
public boolean isUnlocked(PlayerData profess) {

View File

@ -64,7 +64,7 @@ public class SkillResult {
cancelReason = reason;
}
public double getModifier(String modifier) {
public int getModifier(String modifier) {
return skill.getModifier(modifier, level);
}

View File

@ -47,6 +47,6 @@ public class MythicMobsDrops implements Listener {
private void registerPlaceholders() {
MythicMobs.inst().getPlaceholderManager().register("mmocore.skill", Placeholder.meta((metadata, arg) -> String.valueOf(PlayerData.get(metadata.getCaster().getEntity().getUniqueId()).getSkillData().getCachedModifier(arg))));
MythicMobs.inst().getPlaceholderManager().register("mmocore.mana", Placeholder.meta((metadata, arg) -> String.valueOf(PlayerData.get(metadata.getCaster().getEntity().getUniqueId()).getMana())));
MythicMobs.inst().getPlaceholderManager().register("mmocore.mana", Placeholder.meta((metadata, arg) -> String.valueOf((int) PlayerData.get(metadata.getCaster().getEntity().getUniqueId()).getMana())));
}
}