mirror of
https://github.com/songoda/EpicFurnaces.git
synced 2025-03-02 10:11:06 +01:00
Merge branch 'development'
This commit is contained in:
commit
bdccec3c21
@ -4,7 +4,7 @@ stages:
|
||||
variables:
|
||||
name: "EpicFurnaces"
|
||||
path: "/builds/$CI_PROJECT_PATH"
|
||||
version: "4.5.1"
|
||||
version: "4.5.2"
|
||||
|
||||
build:
|
||||
stage: build
|
||||
|
@ -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