Skip to content

Commit

Permalink
Properly update comparators when drawer contents change
Browse files Browse the repository at this point in the history
  • Loading branch information
MattiDragon committed Aug 7, 2024
1 parent 58517b8 commit ebc7729
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
3 changes: 2 additions & 1 deletion changelog/3.0.3+1.21.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
* Fixed divide by 0 error when using `stackSizeAffectsCapacity` and inserting items with large stack sizes
* Fixed compacting drawers not updating internal state after reading components, causing ghost items
* Fixed compacting drawers not updating internal state after reading components, causing ghost items
* Comparators are now properly updated when drawer contents change
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ public void onSlotChanged(boolean sortingChanged) {
UpdateHandler.scheduleUpdate(serverWorld, pos, sortingChanged ? UpdateHandler.ChangeType.CONTENT : UpdateHandler.ChangeType.COUNT);
var state = getCachedState();
world.updateListeners(pos, state, state, Block.NOTIFY_LISTENERS);
world.updateComparators(pos, getCachedState().getBlock());
}
}

Expand Down

0 comments on commit ebc7729

Please sign in to comment.