correct eco formatting, use Settings class

This commit is contained in:
jascotty2 2019-09-16 14:09:19 -05:00
parent 291d6582b3
commit 0b85a95a45
2 changed files with 10 additions and 12 deletions

View File

@ -51,24 +51,22 @@ public class GUIOverview extends Gui {
plugin.getLocale().getMessage("interface.anchor.smalltitle").getMessage(), plugin.getLocale().getMessage("interface.anchor.smalltitle").getMessage(),
ChatColor.GRAY + Methods.makeReadable((long) (anchor.getTicksLeft() / 20) * 1000) + " remaining.")); ChatColor.GRAY + Methods.makeReadable((long) (anchor.getTicksLeft() / 20) * 1000) + " remaining."));
if (EconomyManager.isEnabled() && plugin.getConfig().getBoolean("Main.Add Time With Economy")) { if (EconomyManager.isEnabled() && Settings.ADD_TIME_WITH_ECONOMY.getBoolean()) {
setButton(11, GuiUtils.createButtonItem(plugin.getConfig().getMaterial("Interfaces.Economy Icon", CompatibleMaterial.SUNFLOWER), setButton(11, GuiUtils.createButtonItem(Settings.ECO_ICON.getMaterial(CompatibleMaterial.SUNFLOWER),
plugin.getLocale().getMessage("interface.button.addtimewitheconomy").getMessage(), plugin.getLocale().getMessage("interface.button.addtimewitheconomy").getMessage(),
plugin.getLocale().getMessage("interface.button.addtimewitheconomylore") plugin.getLocale().getMessage("interface.button.addtimewitheconomylore")
.processPlaceholder("cost", String.valueOf(plugin.getConfig().getInt("Main.Economy Cost"))).getMessage()), .processPlaceholder("cost", Methods.formatEconomy(Settings.ECONOMY_COST.getDouble())).getMessage()), // EconomyManager.formatEconomy adds its own prefix/suffix
(event) -> anchor.addTime("ECO", player)); event -> anchor.addTime("ECO", event.player));
} }
if (plugin.getConfig().getBoolean("Main.Add Time With XP")) { if (Settings.ADD_TIME_WITH_XP.getBoolean()) {
setButton(15, GuiUtils.createButtonItem(plugin.getConfig().getMaterial("Interfaces.XP Icon", CompatibleMaterial.EXPERIENCE_BOTTLE), setButton(15, GuiUtils.createButtonItem(Settings.XP_ICON.getMaterial(CompatibleMaterial.EXPERIENCE_BOTTLE),
plugin.getLocale().getMessage("interface.button.addtimewithxp").getMessage(), plugin.getLocale().getMessage("interface.button.addtimewithxp").getMessage(),
plugin.getLocale().getMessage("interface.button.addtimewithxplore") plugin.getLocale().getMessage("interface.button.addtimewithxplore")
.processPlaceholder("cost", String.valueOf(plugin.getConfig().getInt("Main.XP Cost"))).getMessage()), .processPlaceholder("cost", String.valueOf(Settings.XP_COST.getInt())).getMessage()),
(event) -> anchor.addTime("XP", player)); event -> anchor.addTime("XP", event.player));
} }
} }
private void runTask() { private void runTask() {

View File

@ -163,8 +163,8 @@ public class Methods {
* @return The economy formatted double. * @return The economy formatted double.
*/ */
public static String formatEconomy(double amt) { public static String formatEconomy(double amt) {
DecimalFormat formatter = new DecimalFormat("#,###.00");
return formatter.format(amt); return formatter.format(amt);
} }
static DecimalFormat formatter = new DecimalFormat("#,###.00");
} }