Skip to content

Commit

Permalink
Dont invoke ItemGroupEvents.MODIFY_ENTRIES_ALL for the OP tab, when t…
Browse files Browse the repository at this point in the history
…he OP tab is disabled (#4045)
  • Loading branch information
AshyBoxy authored Aug 26, 2024
1 parent 9b16164 commit 3fc0e55
Showing 1 changed file with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -71,14 +71,14 @@ public void getStacks(ItemGroup.DisplayContext context, CallbackInfo ci) {
var mutableSearchTabStacks = new LinkedList<>(searchTabStacks);
var entries = new FabricItemGroupEntries(context, mutableDisplayStacks, mutableSearchTabStacks);

final Event<ItemGroupEvents.ModifyEntries> modifyEntriesEvent = ItemGroupEventsImpl.getModifyEntriesEvent(registryKey);
// Now trigger the events
if (registryKey != ItemGroups.OPERATOR || context.hasPermissions()) {
final Event<ItemGroupEvents.ModifyEntries> modifyEntriesEvent = ItemGroupEventsImpl.getModifyEntriesEvent(registryKey);

if (modifyEntriesEvent != null) {
modifyEntriesEvent.invoker().modifyEntries(entries);
}
if (modifyEntriesEvent != null) {
modifyEntriesEvent.invoker().modifyEntries(entries);
}

// Now trigger the global event
if (registryKey != ItemGroups.OPERATOR || context.hasPermissions()) {
ItemGroupEvents.MODIFY_ENTRIES_ALL.invoker().modifyEntries(self, entries);
}

Expand Down

0 comments on commit 3fc0e55

Please sign in to comment.