Update permissions to mention the plugin they're from
This commit is contained in:
@@ -16,7 +16,7 @@ public class GlobalAdminChat {
|
||||
public GlobalAdminChat(ProxyServer proxyServer) {
|
||||
LiteralCommandNode<CommandSource> command = LiteralArgumentBuilder
|
||||
.<CommandSource>literal("globaladminchat")
|
||||
.requires(ctx -> ctx.hasPermission("command.proxy.globaladminchat"))
|
||||
.requires(ctx -> ctx.hasPermission("command.chat.globaladminchat"))
|
||||
.then(RequiredArgumentBuilder
|
||||
.<CommandSource, String>argument("message", StringArgumentType.greedyString())
|
||||
.executes(context -> {
|
||||
|
||||
@@ -13,7 +13,7 @@ public class Reload {
|
||||
public Reload(ProxyServer proxyServer) {
|
||||
LiteralCommandNode<CommandSource> command = LiteralArgumentBuilder
|
||||
.<CommandSource>literal("reloadchat")
|
||||
.requires(ctx -> ctx.hasPermission("command.proxy.reloadchat"))
|
||||
.requires(ctx -> ctx.hasPermission("command.chat.reloadchat"))
|
||||
.executes(context -> {
|
||||
VelocityChat.getPlugin().ReloadConfig();
|
||||
return 1;
|
||||
|
||||
@@ -42,7 +42,7 @@ public class SendMail {
|
||||
|
||||
LiteralCommandNode<CommandSource> command = LiteralArgumentBuilder
|
||||
.<CommandSource>literal("mail")
|
||||
.requires(ctx -> ctx.hasPermission("command.proxy.mail"))
|
||||
.requires(ctx -> ctx.hasPermission("command.chat.mail"))
|
||||
.then(LiteralArgumentBuilder.<CommandSource>literal("send")
|
||||
.then(playerNode
|
||||
.then(RequiredArgumentBuilder
|
||||
@@ -63,7 +63,7 @@ public class SendMail {
|
||||
})
|
||||
)
|
||||
.then(LiteralArgumentBuilder.<CommandSource>literal("list")
|
||||
.requires(ctx -> ctx.hasPermission("command.proxy.list"))// TODO permission
|
||||
.requires(ctx -> ctx.hasPermission("command.chat.mail.list"))// TODO permission
|
||||
.then(LiteralArgumentBuilder.<CommandSource>literal("unread")
|
||||
.executes(context -> {
|
||||
VelocityChat.getPlugin().getChatHandler().readMail(context.getSource(), true);
|
||||
@@ -96,7 +96,7 @@ public class SendMail {
|
||||
)
|
||||
)
|
||||
.then(LiteralArgumentBuilder.<CommandSource>literal("admin")
|
||||
.requires(ctx -> ctx.hasPermission("command.proxy.mail.admin"))// TODO permission
|
||||
.requires(ctx -> ctx.hasPermission("command.chat.mail.admin"))// TODO permission
|
||||
// TODO admin command, remove, edit?
|
||||
.executes(context -> {
|
||||
sendAdminHelpMessage(context.getSource());
|
||||
|
||||
@@ -85,7 +85,7 @@ public class ChatHandler {
|
||||
public void globalAdminChat(String message) {
|
||||
Component component = GsonComponentSerializer.gson().deserialize(message);
|
||||
|
||||
VelocityChat.getPlugin().getProxy().getAllPlayers().stream().filter(target -> target.hasPermission("command.proxy.globaladminchat")/*TODO permission*/).forEach(target -> {
|
||||
VelocityChat.getPlugin().getProxy().getAllPlayers().stream().filter(target -> target.hasPermission("command.chat.globaladminchat")/*TODO permission*/).forEach(target -> {
|
||||
target.sendMessage(component);
|
||||
});
|
||||
}
|
||||
@@ -108,7 +108,7 @@ public class ChatHandler {
|
||||
|
||||
Component component = Utility.parseMiniMessage(Config.GACFORMAT, templates);
|
||||
|
||||
VelocityChat.getPlugin().getProxy().getAllPlayers().stream().filter(target -> target.hasPermission("command.proxy.globaladminchat")/*TODO permission*/).forEach(target -> {
|
||||
VelocityChat.getPlugin().getProxy().getAllPlayers().stream().filter(target -> target.hasPermission("command.chat.globaladminchat")/*TODO permission*/).forEach(target -> {
|
||||
target.sendMessage(component);
|
||||
});
|
||||
}
|
||||
|
||||
@@ -44,7 +44,7 @@ public class ChatListener {
|
||||
|
||||
Component message = Utility.parseMiniMessage(Config.GACFORMAT, templates);
|
||||
|
||||
plugin.getProxy().getAllPlayers().stream().filter(target -> target.hasPermission("command.proxy.globaladminchat")).forEach(target -> {
|
||||
plugin.getProxy().getAllPlayers().stream().filter(target -> target.hasPermission("command.chat.globaladminchat")).forEach(target -> {
|
||||
target.sendMessage(message);
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user