mirror of
https://gitlab.com/phoenix-dvpmt/mmocore.git
synced 2025-11-18 06:24:17 +01:00
Fixed an issue with skill lore placeholders
This commit is contained in:
parent
b561bc547b
commit
37bd89c593
@ -14,6 +14,7 @@ import net.Indyuce.mmocore.util.formula.ScalingFormula;
|
||||
import org.apache.commons.lang.Validate;
|
||||
import org.bukkit.configuration.ConfigurationSection;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
@ -146,7 +147,7 @@ public class ClassSkill implements CooldownObject, Unlockable {
|
||||
return Objects.requireNonNull(parameters.get(parameter), "Could not find parameter called '" + parameter + "'");
|
||||
}
|
||||
|
||||
public double getParameter(@NotNull String parameter, int level, @NotNull PlayerData caster) {
|
||||
public double getParameter(@NotNull String parameter, int level, @Nullable PlayerData caster) {
|
||||
try {
|
||||
return getParameterFormula(parameter).evaluate(level, caster);
|
||||
} catch (FormulaFailsafeException exception) {
|
||||
@ -165,14 +166,14 @@ public class ClassSkill implements CooldownObject, Unlockable {
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public List<String> calculateLore(PlayerData data, int x) {
|
||||
public List<String> calculateLore(PlayerData data, int skillLevel) {
|
||||
|
||||
// Calculate placeholders
|
||||
var placeholders = new Placeholders();
|
||||
|
||||
// Skill parameters
|
||||
for (var param : parameters.keySet()) {
|
||||
var baseValue = getParameter(param, data);
|
||||
var baseValue = getParameter(param, skillLevel, data);
|
||||
var modifiedValue = data.getMMOPlayerData().getSkillModifierMap().calculateValue(skill.getHandler(), baseValue, param);
|
||||
var formatted = skill.getDecimalFormat(param).format(modifiedValue);
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user