1
0
mirror of https://github.com/Zrips/Jobs.git synced 2024-11-25 12:05:16 +01:00

Do not hide the item from shop

This commit is contained in:
montlikadani 2019-09-26 20:07:26 +02:00
parent f894a6aa09
commit ac9bfcc0b0
2 changed files with 7 additions and 5 deletions

View File

@ -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

View File

@ -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<String> 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;