Skip to content

Commit

Permalink
Track slots that do nothing
Browse files Browse the repository at this point in the history
This fixes instances where 'next slot' may not work.
  • Loading branch information
APickledWalrus committed Aug 21, 2021
1 parent f119fa5 commit 3584c77
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/main/java/io/github/apickledwalrus/skriptgui/gui/GUI.java
Original file line number Diff line number Diff line change
Expand Up @@ -250,11 +250,9 @@ public void setItem(Object slot, @Nullable ItemStack item, boolean stealable, @N
rawShape = rawShape.replaceFirst("\\+", "" + ch2);
ch = ch2;
}
if (consumer != null) {
slots.put(ch, consumer);
} else { // Just in case as we may be updating a slot
slots.remove(ch);
}

// Although we may be adding null consumers, it lets us track what slots have been set
slots.put(ch, consumer);

if (stealable) {
stealableSlots.add(ch);
Expand Down

0 comments on commit 3584c77

Please sign in to comment.