Removed unused code

This commit is contained in:
Teriuihi 2021-07-31 22:26:42 +02:00
parent 604d06b700
commit a61399bd71
2 changed files with 4 additions and 8 deletions

View File

@ -39,18 +39,12 @@ public class PluginMessage implements PluginMessageListener {
}
case "globalchat": {
if (ChatPlugin.getInstance().serverGlobalChatEnabled() && !ChatPlugin.getInstance().serverMuted()) {
String uuidString = in.readUTF();
if (!uuidString.matches("\\b[0-9a-f]{8}\\b-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-\\b[0-9a-f]{12}\\b")) {
Bukkit.broadcast(GsonComponentSerializer.gson().deserialize(uuidString), Config.GCPERMISSION);
break;
}
UUID uuid = UUID.fromString(uuidString);
UUID uuid = UUID.fromString(in.readUTF());
String message = in.readUTF();
Bukkit.getOnlinePlayers().stream().filter(p -> p.hasPermission(Config.GCPERMISSION)).forEach(p -> {
ChatUser chatUser = ChatUserManager.getChatUser(p.getUniqueId());
if (chatUser.getIgnoredPlayers().contains(uuid)) {
if (!chatUser.getIgnoredPlayers().contains(uuid)) {
p.sendMessage(GsonComponentSerializer.gson().deserialize(message));
}
});

View File

@ -9,6 +9,8 @@ import com.velocitypowered.api.proxy.Player;
import com.velocitypowered.api.proxy.ServerConnection;
import com.velocitypowered.api.proxy.messages.ChannelIdentifier;
import java.util.UUID;
public class PluginMessageListener {
//todo add an extra listener for nicknames?