diff --git a/api/src/main/java/net/md_5/bungee/api/plugin/Command.java b/api/src/main/java/net/md_5/bungee/api/plugin/Command.java index eba3040a..b4566327 100644 --- a/api/src/main/java/net/md_5/bungee/api/plugin/Command.java +++ b/api/src/main/java/net/md_5/bungee/api/plugin/Command.java @@ -4,6 +4,7 @@ import com.google.common.base.Preconditions; import lombok.AccessLevel; import lombok.Data; import lombok.RequiredArgsConstructor; +import lombok.Setter; import net.md_5.bungee.api.CommandSender; /** @@ -17,6 +18,8 @@ public abstract class Command private final String name; private final String permission; private final String[] aliases; + @Setter(AccessLevel.PROTECTED) + private String permissionMessage; /** * Construct a new command with no permissions or aliases. @@ -42,6 +45,7 @@ public abstract class Command this.name = name; this.permission = permission; this.aliases = aliases; + this.permissionMessage = null; } /** diff --git a/api/src/main/java/net/md_5/bungee/api/plugin/PluginManager.java b/api/src/main/java/net/md_5/bungee/api/plugin/PluginManager.java index e7cd8a27..b4da08dc 100644 --- a/api/src/main/java/net/md_5/bungee/api/plugin/PluginManager.java +++ b/api/src/main/java/net/md_5/bungee/api/plugin/PluginManager.java @@ -172,7 +172,7 @@ public final class PluginManager { if ( tabResults == null ) { - sender.sendMessage( proxy.getTranslation( "no_permission" ) ); + sender.sendMessage( ( command.getPermissionMessage() == null ) ? proxy.getTranslation( "no_permission" ) : command.getPermissionMessage() ); } return true; }