mirror of
https://gitlab.com/phoenix-dvpmt/mmocore.git
synced 2024-11-27 00:45:40 +01:00
Removed use of deprecated methods
This commit is contained in:
parent
a653ffbfe1
commit
0fd1f6bbce
@ -46,7 +46,7 @@ public class PlayerStats {
|
||||
}
|
||||
|
||||
public double getStat(String stat) {
|
||||
return getMap().getInstance(stat).getTotal();
|
||||
return getMap().getStat(stat);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -33,7 +33,7 @@ public class StatModifiersCommandTreeNode extends CommandTreeNode {
|
||||
sender.sendMessage("Stat Modifiers (" + instance.getKeys().size() + "):");
|
||||
for (String key : instance.getKeys()) {
|
||||
StatModifier mod = instance.getModifier(key);
|
||||
sender.sendMessage("- " + key + ": " + mod.getValue() + " " + mod.getType().name());
|
||||
sender.sendMessage("-> '" + key + "' " + mod.getValue() + " " + mod.getType().name() + " " + mod.getSlot() + " " + mod.getSource());
|
||||
}
|
||||
|
||||
return CommandResult.SUCCESS;
|
||||
|
@ -133,7 +133,7 @@ public class PlayerStats extends EditableInventory {
|
||||
|
||||
if (holder.endsWith("_extra")) {
|
||||
final String stat = UtilityMethods.enumName(holder.substring(0, holder.length() - 6));
|
||||
return StatManager.format(stat, MythicLib.plugin.getStats().getTotalValue(stat, stats.getMap()) - stats.getBase(stat));
|
||||
return StatManager.format(stat, stats.getStat(stat) - stats.getBase(stat));
|
||||
}
|
||||
|
||||
if (holder.startsWith("attribute_")) {
|
||||
@ -142,7 +142,7 @@ public class PlayerStats extends EditableInventory {
|
||||
}
|
||||
|
||||
final String stat = UtilityMethods.enumName(holder);
|
||||
return StatManager.format(stat, MythicLib.plugin.getStats().getTotalValue(stat, stats.getMap()));
|
||||
return StatManager.format(stat, stats.getStat(stat));
|
||||
}
|
||||
};
|
||||
}
|
||||
|
@ -50,8 +50,7 @@ public class AttributeManager implements MMOCoreManager {
|
||||
final ConfigurationSection statsConfig = new ConfigFile(MythicLib.plugin, "", "stats").getConfig();
|
||||
for (PlayerAttribute attr : getAll()) {
|
||||
final MMOCoreAttributeStatHandler handler = new MMOCoreAttributeStatHandler(statsConfig, attr);
|
||||
MythicLib.plugin.getStats().registerStat(handler.getStat(), handler);
|
||||
MythicLib.plugin.getStats().registerStat(handler.getStat() + "_PERCENT", handler);
|
||||
MythicLib.plugin.getStats().registerStat(handler, handler.getStat() + "_PERCENT");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user