From ee6312196430274432a106a78c6cd96640f79c32 Mon Sep 17 00:00:00 2001 From: Jerry Date: Mon, 20 Mar 2023 18:44:02 +0800 Subject: [PATCH] add vtools.send.recvmsg permission --- README.md | 2 +- src/main/java/de/strifel/VTools/commands/CommandSend.java | 7 +++---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 750156d..d76117b 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ Tools for Velocity proxy server. |-------|-------------|----------| |/broadcast|Broadcast a message to all servers|vtools.broadcast| |/find|See on which server a user is|vtools.find and vtools.find.autocomplete| -|/send|Send user or users to a different server|vtools.send| +|/send|Send user or users to a different server|vtools.send and vtools.send.recvmsg| |/staffchat|Chat over multiple servers in a staff only chat|vtools.staffchat| |/staffchat c:channelname|Chat over multiple servers in a staff only chat in a specific extra permissions channel|vtools.staffchat.channelname| |/servers|List all servers|vtools.servers| diff --git a/src/main/java/de/strifel/VTools/commands/CommandSend.java b/src/main/java/de/strifel/VTools/commands/CommandSend.java index 770bc5f..b61bd0a 100644 --- a/src/main/java/de/strifel/VTools/commands/CommandSend.java +++ b/src/main/java/de/strifel/VTools/commands/CommandSend.java @@ -48,9 +48,6 @@ public class CommandSend implements SimpleCommand { commandSource.sendMessage(Component.text("Command is only for players.").color(COLOR_RED)); return; } - for (Player player : server.getAllPlayers()) { - oPlayer.add(player); - } } else { Optional p = server.getPlayer(strings[0]); @@ -66,7 +63,9 @@ public class CommandSend implements SimpleCommand { if (oPlayer.size() <= 1) { commandSource.sendMessage(Component.text("You send " + player.getUsername() + " to " + server.getServerInfo().getName()).color(COLOR_YELLOW)); } - //commandSource.sendMessage(Component.text("You got send to " + server.getServerInfo().getName()).color(COLOR_YELLOW)); + if (player.hasPermission("vtools.send.recvmsg")) { + commandSource.sendMessage(Component.text("You got send to " + server.getServerInfo().getName()).color(COLOR_YELLOW)); + } } if (oPlayer.size() > 1) { commandSource.sendMessage(Component.text(String.format("You send %d players to %s", oPlayer.size(), server.getServerInfo().getName())).color(COLOR_YELLOW));