Update permissions to mention the plugin they're from

This commit is contained in:
destro174 2022-01-27 21:09:23 +01:00
parent 831bac1be9
commit 615458adab
8 changed files with 20 additions and 20 deletions

View File

@ -271,7 +271,7 @@ public final class Config {
} }
} }
public static String SERVERMUTEPERMISSION = "command.mute-server"; public static String SERVERMUTEPERMISSION = "chat.command.mute-server";
public static String SPYPERMISSION = "chat.socialspy"; public static String SPYPERMISSION = "chat.socialspy";
private static void permissions() { private static void permissions() {
SERVERMUTEPERMISSION = getString("permissions.server-mute", SERVERMUTEPERMISSION); SERVERMUTEPERMISSION = getString("permissions.server-mute", SERVERMUTEPERMISSION);

View File

@ -111,7 +111,7 @@ public class ChatPlugin extends JavaPlugin {
chatAPI.ReloadConfig(); chatAPI.ReloadConfig();
chatAPI.ReloadChatFilters(); chatAPI.ReloadChatFilters();
serverConfig = new ServerConfig(Bukkit.getServerName()); serverConfig = new ServerConfig(Bukkit.getServerName());
Bukkit.broadcast("Reloaded ChatPlugin Config.", "command.proxy.reloadchat"); Bukkit.broadcast("Reloaded ChatPlugin Config.", "command.chat.reloadchat");
ALogger.info("Reloaded ChatPlugin config."); ALogger.info("Reloaded ChatPlugin config.");
} }
} }

View File

@ -6,28 +6,28 @@ authors: [Destro, Teriuihi]
depend: [LuckPerms] depend: [LuckPerms]
commands: commands:
globalchat: globalchat:
permission: command.globalchat permission: command.chat.globalchat
permission-message: You do not have permission! permission-message: You do not have permission!
aliases: gc aliases: gc
toggleglobalchat: toggleglobalchat:
permission: command.globalchat permission: command.chat.globalchat
permission-message: You do not have permission! permission-message: You do not have permission!
aliases: togglegc aliases: togglegc
message: message:
permission: command.message permission: command.chat.message
aliases: [msg, tell] aliases: [msg, tell]
reply: reply:
permission: command.message permission: command.chat.message
aliases: r aliases: r
ignore: ignore:
permission: command.ignore permission: command.chat.ignore
unignore: unignore:
permission: command.ignore permission: command.chat.ignore
muteserver: muteserver:
permission: command.mute-server permission: command.chat.mute-server
spy: spy:
permission: command.togglespy permission: command.chat.togglespy
chatparty: chatparty:
permission: command.chatparty permission: command.chat.chatparty
pc: pc:
permission: command.pc permission: command.chat.pc

View File

@ -16,7 +16,7 @@ public class GlobalAdminChat {
public GlobalAdminChat(ProxyServer proxyServer) { public GlobalAdminChat(ProxyServer proxyServer) {
LiteralCommandNode<CommandSource> command = LiteralArgumentBuilder LiteralCommandNode<CommandSource> command = LiteralArgumentBuilder
.<CommandSource>literal("globaladminchat") .<CommandSource>literal("globaladminchat")
.requires(ctx -> ctx.hasPermission("command.proxy.globaladminchat")) .requires(ctx -> ctx.hasPermission("command.chat.globaladminchat"))
.then(RequiredArgumentBuilder .then(RequiredArgumentBuilder
.<CommandSource, String>argument("message", StringArgumentType.greedyString()) .<CommandSource, String>argument("message", StringArgumentType.greedyString())
.executes(context -> { .executes(context -> {

View File

@ -13,7 +13,7 @@ public class Reload {
public Reload(ProxyServer proxyServer) { public Reload(ProxyServer proxyServer) {
LiteralCommandNode<CommandSource> command = LiteralArgumentBuilder LiteralCommandNode<CommandSource> command = LiteralArgumentBuilder
.<CommandSource>literal("reloadchat") .<CommandSource>literal("reloadchat")
.requires(ctx -> ctx.hasPermission("command.proxy.reloadchat")) .requires(ctx -> ctx.hasPermission("command.chat.reloadchat"))
.executes(context -> { .executes(context -> {
VelocityChat.getPlugin().ReloadConfig(); VelocityChat.getPlugin().ReloadConfig();
return 1; return 1;

View File

@ -42,7 +42,7 @@ public class SendMail {
LiteralCommandNode<CommandSource> command = LiteralArgumentBuilder LiteralCommandNode<CommandSource> command = LiteralArgumentBuilder
.<CommandSource>literal("mail") .<CommandSource>literal("mail")
.requires(ctx -> ctx.hasPermission("command.proxy.mail")) .requires(ctx -> ctx.hasPermission("command.chat.mail"))
.then(LiteralArgumentBuilder.<CommandSource>literal("send") .then(LiteralArgumentBuilder.<CommandSource>literal("send")
.then(playerNode .then(playerNode
.then(RequiredArgumentBuilder .then(RequiredArgumentBuilder
@ -63,7 +63,7 @@ public class SendMail {
}) })
) )
.then(LiteralArgumentBuilder.<CommandSource>literal("list") .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") .then(LiteralArgumentBuilder.<CommandSource>literal("unread")
.executes(context -> { .executes(context -> {
VelocityChat.getPlugin().getChatHandler().readMail(context.getSource(), true); VelocityChat.getPlugin().getChatHandler().readMail(context.getSource(), true);
@ -96,7 +96,7 @@ public class SendMail {
) )
) )
.then(LiteralArgumentBuilder.<CommandSource>literal("admin") .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? // TODO admin command, remove, edit?
.executes(context -> { .executes(context -> {
sendAdminHelpMessage(context.getSource()); sendAdminHelpMessage(context.getSource());

View File

@ -85,7 +85,7 @@ public class ChatHandler {
public void globalAdminChat(String message) { public void globalAdminChat(String message) {
Component component = GsonComponentSerializer.gson().deserialize(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); target.sendMessage(component);
}); });
} }
@ -108,7 +108,7 @@ public class ChatHandler {
Component component = Utility.parseMiniMessage(Config.GACFORMAT, templates); 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); target.sendMessage(component);
}); });
} }

View File

@ -44,7 +44,7 @@ public class ChatListener {
Component message = Utility.parseMiniMessage(Config.GACFORMAT, templates); 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); target.sendMessage(message);
}); });
} }