Skip to content

Commit 3584c77

Browse files
Track slots that do nothing
This fixes instances where 'next slot' may not work.
1 parent f119fa5 commit 3584c77

File tree

1 file changed

+3
-5
lines changed
  • src/main/java/io/github/apickledwalrus/skriptgui/gui

1 file changed

+3
-5
lines changed

src/main/java/io/github/apickledwalrus/skriptgui/gui/GUI.java

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -250,11 +250,9 @@ public void setItem(Object slot, @Nullable ItemStack item, boolean stealable, @N
250250
rawShape = rawShape.replaceFirst("\\+", "" + ch2);
251251
ch = ch2;
252252
}
253-
if (consumer != null) {
254-
slots.put(ch, consumer);
255-
} else { // Just in case as we may be updating a slot
256-
slots.remove(ch);
257-
}
253+
254+
// Although we may be adding null consumers, it lets us track what slots have been set
255+
slots.put(ch, consumer);
258256

259257
if (stealable) {
260258
stealableSlots.add(ch);

0 commit comments

Comments
 (0)