mirror of
https://github.com/Zrips/Jobs.git
synced 2024-11-26 12:35:28 +01:00
Fixed issue when buying items from shop and not setting enchants to item
This commit is contained in:
parent
5aa4f0b763
commit
892c91cdf0
@ -90,9 +90,7 @@ public class ShopManager {
|
||||
}
|
||||
|
||||
public boolean openShopGui(Player player, Integer page) {
|
||||
|
||||
List<ShopItem> ls = getItemsByPage(page);
|
||||
|
||||
if (ls.isEmpty()) {
|
||||
player.sendMessage(Jobs.getLanguage().getMessage("command.shop.info.cantOpen"));
|
||||
return false;
|
||||
@ -108,7 +106,6 @@ public class ShopManager {
|
||||
// if (title.length() > 32)
|
||||
// title = title.substring(0, 30) + "..";
|
||||
|
||||
|
||||
JobsPlayer jPlayer = Jobs.getPlayerManager().getJobsPlayer(player);
|
||||
|
||||
PlayerPoints pointsInfo = jPlayer.getPointsData();
|
||||
@ -401,13 +398,10 @@ public class ShopManager {
|
||||
if (NameSection.isConfigurationSection("GiveItems")) {
|
||||
ConfigurationSection itemsSection = NameSection.getConfigurationSection("GiveItems");
|
||||
Set<String> itemKeys = itemsSection.getKeys(false);
|
||||
|
||||
List<JobItems> items = new ArrayList<>();
|
||||
|
||||
for (String oneItemName : itemKeys) {
|
||||
|
||||
ConfigurationSection itemSection = itemsSection.getConfigurationSection(oneItemName);
|
||||
|
||||
String node = oneItemName.toLowerCase();
|
||||
|
||||
String id = null;
|
||||
@ -433,14 +427,13 @@ public class ShopManager {
|
||||
HashMap<Enchantment, Integer> enchants = new HashMap<>();
|
||||
if (itemSection.contains("Enchants"))
|
||||
for (String eachLine : itemSection.getStringList("Enchants")) {
|
||||
|
||||
if (!eachLine.contains("="))
|
||||
continue;
|
||||
|
||||
String[] split = eachLine.split("=");
|
||||
Enchantment ench = CMIEnchantment.getEnchantment(split[0]);
|
||||
Integer level = 1;
|
||||
if (split.length > 2) {
|
||||
if (split.length > 1) {
|
||||
try {
|
||||
level = Integer.parseInt(split[1]);
|
||||
} catch (NumberFormatException e) {
|
||||
|
Loading…
Reference in New Issue
Block a user