diff --git a/api/src/main/java/net/md_5/bungee/api/event/PermissionCheckEvent.java b/api/src/main/java/net/md_5/bungee/api/event/PermissionCheckEvent.java index 9c383078..d997a9dd 100644 --- a/api/src/main/java/net/md_5/bungee/api/event/PermissionCheckEvent.java +++ b/api/src/main/java/net/md_5/bungee/api/event/PermissionCheckEvent.java @@ -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. */ diff --git a/proxy/src/main/java/net/md_5/bungee/UserConnection.java b/proxy/src/main/java/net/md_5/bungee/UserConnection.java index ba4fa908..4a04e8eb 100644 --- a/proxy/src/main/java/net/md_5/bungee/UserConnection.java +++ b/proxy/src/main/java/net/md_5/bungee/UserConnection.java @@ -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