Dont invoke ItemGroupEvents.MODIFY_ENTRIES_ALL for the OP tab, when the OP tab is disabled ()

This commit is contained in:
AshyBoxy 2024-08-26 12:02:11 +01:00 committed by GitHub
parent 9b16164179
commit 3fc0e552c4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -71,14 +71,14 @@ abstract class ItemGroupMixin implements FabricItemGroupImpl {
var mutableSearchTabStacks = new LinkedList<>(searchTabStacks);
var entries = new FabricItemGroupEntries(context, mutableDisplayStacks, mutableSearchTabStacks);
final Event<ItemGroupEvents.ModifyEntries> modifyEntriesEvent = ItemGroupEventsImpl.getModifyEntriesEvent(registryKey);
if (modifyEntriesEvent != null) {
modifyEntriesEvent.invoker().modifyEntries(entries);
}
// Now trigger the global event
// 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);
}
ItemGroupEvents.MODIFY_ENTRIES_ALL.invoker().modifyEntries(self, entries);
}