Skip to content

Commit

Permalink
Fix ArrayIndexOutOfBoundsException (#38)
Browse files Browse the repository at this point in the history
  • Loading branch information
senseiwells authored Sep 24, 2024
1 parent cb30e83 commit 3060f08
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/main/java/eu/pb4/sgui/api/gui/HotbarGui.java
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,10 @@ public void clearSlot(int index) {

@Override
public boolean click(int index, ClickType type, SlotActionType action) {
return super.click(VANILLA_TO_GUI_IDS[index], type, action);
if (index >= 0 && index < SIZE) {
return super.click(VANILLA_TO_GUI_IDS[index], type, action);
}
return super.click(index, type, action);
}

@Override
Expand Down

0 comments on commit 3060f08

Please sign in to comment.