mirror of
https://gitlab.com/phoenix-dvpmt/mmocore.git
synced 2024-11-27 00:45:40 +01:00
Changed MM skill placeholder primitive from int to float
This commit is contained in:
parent
ab2944b26c
commit
6570294900
@ -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;
|
||||
}
|
||||
}
|
||||
|
@ -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) {
|
||||
|
@ -64,7 +64,7 @@ public class SkillResult {
|
||||
cancelReason = reason;
|
||||
}
|
||||
|
||||
public double getModifier(String modifier) {
|
||||
public int getModifier(String modifier) {
|
||||
return skill.getModifier(modifier, level);
|
||||
}
|
||||
|
||||
|
@ -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())));
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user