mirror of
https://github.com/MinecraftForge/MinecraftForge.git
synced 2026-11-13 00:37:52 +00:00
Fix inverted hooks for PermissionsChangedEvent (#8089)
Because IEventBus#post returns true on cancellation and the patched-in hooks inverts the return of the ForgeHooks method, if the player whose permission level is being changed is online and the event is not cancelled, the permission change _is_ cancelled. The fix is inverting the patched-in hooks and the default return value of the ForgeHooks method, so that the permission change is cancelled only if the player is online, the event is fired, and the event is cancelled. Fixes #8088
This commit is contained in:
1 parent
a31adc2823
commit
b2dbe9de51
2 files changed
+3
-3
No files matched your search
@@ -794,6 +794,6 @@ public class ForgeEventFactory
|
||||
{
|
||||
return MinecraftForge.EVENT_BUS.post(new PermissionsChangedEvent(player, newLevel, oldLevel));
|
||||
}
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user