We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
hasItem
1 parent d448997 commit d031a9dCopy full SHA for d031a9d
inventory-framework-platform-bukkit/src/main/java/me/devnatan/inventoryframework/BukkitViewContainer.java
@@ -108,7 +108,14 @@ private void requireSupportedItem(Object item) {
108
109
@Override
110
public boolean hasItem(int slot) {
111
- return inventory.getItem(slot) != null;
+ try {
112
+ return inventory.getItem(slot) != null;
113
+ } catch (final ArrayIndexOutOfBoundsException ignored) {
114
+ // just supress AIOOBE here, we cannot check if slot matches container constraints
115
+ // by `size >= 0 && size <= getLastSlot()` because some containers are not aligned.
116
+ // Aligned inventory types = perfect grid (NxN) like chest, workbench..
117
+ return false;
118
+ }
119
}
120
121
0 commit comments