Make the default permission message configurable

This commit is contained in:
Shane Freeder 2018-11-18 19:49:56 +00:00
parent 4da5176b89
commit f944b0b8d6
2 changed files with 11 additions and 1 deletions

View file

@ -73,7 +73,7 @@ public final class PaperCommand extends Command {
if (sender.hasPermission(BASE_PERM + permission) || sender.hasPermission("bukkit.command.paper")) {
return true;
}
sender.sendMessage(text("I'm sorry, but you do not have permission to perform this command. Please contact the server administrators if you believe that this is in error.", RED));
sender.sendMessage(Bukkit.permissionMessage());
return false;
}

View file

@ -2900,6 +2900,16 @@ public final class CraftServer implements Server {
return io.papermc.paper.configuration.GlobalConfiguration.get().commands.suggestPlayerNamesWhenNullTabCompletions;
}
@Override
public String getPermissionMessage() {
return net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer.legacyAmpersand().serialize(io.papermc.paper.configuration.GlobalConfiguration.get().messages.noPermission);
}
@Override
public net.kyori.adventure.text.Component permissionMessage() {
return io.papermc.paper.configuration.GlobalConfiguration.get().messages.noPermission;
}
@Override
public com.destroystokyo.paper.profile.PlayerProfile createProfile(@Nonnull UUID uuid) {
return createProfile(uuid, null);