mirror of
https://github.com/SpigotMC/BungeeCord.git
synced 2024-11-28 05:05:21 +01:00
Merge pull request #245 from weaondara/master
add permission to check in PermissionCheckEvent
This commit is contained in:
commit
d067662967
@ -23,6 +23,10 @@ public class PermissionCheckEvent extends Event
|
||||
* The command sender being checked for a permission.
|
||||
*/
|
||||
private final CommandSender sender;
|
||||
/**
|
||||
* The permission to check.
|
||||
*/
|
||||
private final String permission;
|
||||
/**
|
||||
* The outcome of this permission check.
|
||||
*/
|
||||
|
@ -92,6 +92,7 @@ public final class UserConnection implements ProxiedPlayer
|
||||
public void setDisplayName(String name)
|
||||
{
|
||||
Preconditions.checkArgument( name.length() <= 16, "Display name cannot be longer than 16 characters" );
|
||||
displayName=name;
|
||||
bungee.getTabListHandler().onDisconnect( this );
|
||||
bungee.getTabListHandler().onConnect( this );
|
||||
}
|
||||
@ -250,7 +251,7 @@ public final class UserConnection implements ProxiedPlayer
|
||||
@Synchronized("permMutex")
|
||||
public boolean hasPermission(String permission)
|
||||
{
|
||||
return bungee.getPluginManager().callEvent( new PermissionCheckEvent( this, permissions.contains( permission ) ) ).hasPermission();
|
||||
return bungee.getPluginManager().callEvent( new PermissionCheckEvent( this, permission, permissions.contains( permission ) ) ).hasPermission();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
Loading…
Reference in New Issue
Block a user