From ac9bfcc0b01de285d707278138e59f1f3f970e63 Mon Sep 17 00:00:00 2001 From: montlikadani Date: Thu, 26 Sep 2019 20:07:26 +0200 Subject: [PATCH] Do not hide the item from shop --- Changelog.txt | 1 + .../java/com/gamingmesh/jobs/config/ShopManager.java | 11 ++++++----- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/Changelog.txt b/Changelog.txt index 9e827201..fd42603a 100644 --- a/Changelog.txt +++ b/Changelog.txt @@ -22,3 +22,4 @@ - Added option to leave from job in jobs GUI. - Quest objective amount is now optional (default 1) - Fixed issue when used 1.12 and lower versions then some materials not work correctly. +- Added option to jobs shop to hide icon if a player there are no enough points to buy a item diff --git a/src/main/java/com/gamingmesh/jobs/config/ShopManager.java b/src/main/java/com/gamingmesh/jobs/config/ShopManager.java index badc248f..e43fc3c1 100644 --- a/src/main/java/com/gamingmesh/jobs/config/ShopManager.java +++ b/src/main/java/com/gamingmesh/jobs/config/ShopManager.java @@ -205,11 +205,6 @@ public class ShopManager { ShopItem item = ls.get(i); - if (item.isHideIfNoEnoughPoints() && item.getRequiredTotalLevels() != -1 && - Jobs.getPlayerManager().getJobsPlayer(player).getTotalLevels() < item.getRequiredTotalLevels()) { - continue; - } - ArrayList Lore = new ArrayList<>(); CMIMaterial mat = CMIMaterial.get(item.getIconMaterial()); @@ -224,6 +219,12 @@ public class ShopManager { } } + if (item.isHideIfNoEnoughPoints() && item.getRequiredTotalLevels() != -1 && + Jobs.getPlayerManager().getJobsPlayer(player).getTotalLevels() < item.getRequiredTotalLevels()) { + mat = CMIMaterial.STONE_BUTTON; + Lore.add(Jobs.getLanguage().getMessage("command.shop.info.NoPoints")); + } + if (mat == null) mat = CMIMaterial.STONE_BUTTON;