use of net.minecraftforge.event.entity.player.PermissionsChangedEvent in project MinecraftForge by MinecraftForge.
the class ForgeEventFactory method onPermissionChanged.
public static boolean onPermissionChanged(GameProfile gameProfile, int newLevel, PlayerList playerList) {
int oldLevel = playerList.getServer().getProfilePermissions(gameProfile);
ServerPlayer player = playerList.getPlayer(gameProfile.getId());
if (newLevel != oldLevel && player != null) {
return MinecraftForge.EVENT_BUS.post(new PermissionsChangedEvent(player, newLevel, oldLevel));
}
return false;
}
Aggregations