Skip to content

Commit c0a7ab8

Browse files
committed
Sets the slots to check automaticly when acces it froim the menu class
1 parent 011368e commit c0a7ab8

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

Menu Library/src/main/java/org/broken/arrow/library/menu/MenuUtility.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -675,15 +675,14 @@ public CheckItemsInsideMenu getCheckItemsInsideMenu() {
675675
*/
676676
@Nonnull
677677
public CheckItemsInsideMenu getCheckItemsInsideMenuByStrings(@Nullable List<String> blackListedMaterials) {
678+
List<ItemStack> materials = new ArrayList<>();
678679
if (blackListedMaterials != null) {
679-
List<ItemStack> materials = new ArrayList<>();
680680
for (String item : blackListedMaterials) {
681681
Material material = convertMaterialFromString(menuAPI, item);
682682
materials.add(new ItemStack(material));
683683
}
684-
this.checkItemsInsideMenu.setBlacklistedItems(materials);
685684
}
686-
return this.checkItemsInsideMenu;
685+
return getCheckItemsInsideMenuByItems(materials);
687686
}
688687

689688
/**
@@ -696,9 +695,10 @@ public CheckItemsInsideMenu getCheckItemsInsideMenuByStrings(@Nullable List<Stri
696695
*/
697696
@Nonnull
698697
public CheckItemsInsideMenu getCheckItemsInsideMenuByItems(@Nullable List<ItemStack> blackListedMaterials) {
699-
if (blackListedMaterials != null) {
698+
if (blackListedMaterials != null && !blackListedMaterials.isEmpty()) {
700699
this.checkItemsInsideMenu.setBlacklistedItems(blackListedMaterials);
701700
}
701+
this.checkItemsInsideMenu.setSlotsToCheck(this.getFillSpace());
702702
return this.checkItemsInsideMenu;
703703
}
704704

0 commit comments

Comments
 (0)