mirror of
https://github.com/songoda/EpicFurnaces.git
synced 2025-01-05 23:37:34 +01:00
Fixed issue where the economy cost was displaying as xp cost.
This commit is contained in:
parent
aa920f0005
commit
11827d1e83
@ -114,9 +114,9 @@ public class Furnace {
|
||||
if (plugin.getLevelManager().getLevels().containsKey(this.level.getLevel() + 1)) {
|
||||
|
||||
Level level = plugin.getLevelManager().getLevel(this.level.getLevel() + 1);
|
||||
int cost = type == CostType.ECONOMY ? level.getCostEconomy() : level.getCostExperience();
|
||||
|
||||
if (type == CostType.ECONOMY) {
|
||||
int cost = level.getCostEconomy();
|
||||
if (!EconomyManager.isEnabled()) {
|
||||
player.sendMessage("Economy not enabled.");
|
||||
return;
|
||||
@ -129,6 +129,7 @@ public class Furnace {
|
||||
EconomyManager.withdrawBalance(player, cost);
|
||||
upgradeFinal(level, player);
|
||||
} else if (type == CostType.EXPERIENCE) {
|
||||
int cost = level.getCostExperience();
|
||||
if (player.getLevel() >= cost || player.getGameMode() == GameMode.CREATIVE) {
|
||||
if (player.getGameMode() != GameMode.CREATIVE) {
|
||||
player.setLevel(player.getLevel() - cost);
|
||||
|
@ -179,7 +179,7 @@ public class GUIOverview extends Gui {
|
||||
plugin.getLocale().getMessage("interface.furnace.upgradewitheconomy").getMessage(),
|
||||
nextLevel != null
|
||||
? plugin.getLocale().getMessage("interface.furnace.upgradewitheconomylore")
|
||||
.processPlaceholder("cost", nextLevel.getCostExperience()).getMessage()
|
||||
.processPlaceholder("cost", Methods.formatEconomy(nextLevel.getCostEconomy())).getMessage()
|
||||
: plugin.getLocale().getMessage("interface.furnace.alreadymaxed").getMessage()),
|
||||
(event) -> {
|
||||
furnace.upgrade(player, CostType.ECONOMY);
|
||||
|
Loading…
Reference in New Issue
Block a user