Skip to content

Commit

Permalink
Blacklist null issue
Browse files Browse the repository at this point in the history
Fixes Issue #7
  • Loading branch information
BuildTools committed May 19, 2021
1 parent 50fd84a commit a993e0e
Showing 1 changed file with 8 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -105,11 +105,14 @@ public static void inputItemAction(InventoryClickEvent e, Gui gui, int slot, lon
ConfigurationSection slotSection = section.getConfigurationSection(CONFIG_GETTER_VAL_SLOT + slot);
ItemStack i = e.getWhoClicked().getItemOnCursor();
if (e.getWhoClicked().getItemOnCursor().getType() != Material.AIR) {
for (String s : plugin.getItemBlacklistConfig().getConfigurationSection("BLACKLISTED_ITEMS").getKeys(false)) {
ItemStack blacklistedStack = plugin.getItemBlacklistConfig().getItemStack("BLACKLISTED_ITEMS" + "." + s);
if (i.isSimilar(blacklistedStack)) {
e.getWhoClicked().sendMessage(Messages.MESSAGE_EVENT_INPUT_BLACKLISTED);
return;
ConfigurationSection blacklist = plugin.getItemBlacklistConfig().getConfigurationSection("BLACKLISTED_ITEMS");
if (blacklist != null) {
for (String s : blacklist.getKeys(false)) {
ItemStack blacklistedStack = plugin.getItemBlacklistConfig().getItemStack("BLACKLISTED_ITEMS" + "." + s);
if (i.isSimilar(blacklistedStack)) {
e.getWhoClicked().sendMessage(Messages.MESSAGE_EVENT_INPUT_BLACKLISTED);
return;
}
}
}
if (slotSection.getItemStack(CONFIG_GETTER_VAL_STACK) == null) {
Expand Down

0 comments on commit a993e0e

Please sign in to comment.