Removed unused code
This commit is contained in:
parent
604d06b700
commit
a61399bd71
|
|
@ -39,18 +39,12 @@ public class PluginMessage implements PluginMessageListener {
|
||||||
}
|
}
|
||||||
case "globalchat": {
|
case "globalchat": {
|
||||||
if (ChatPlugin.getInstance().serverGlobalChatEnabled() && !ChatPlugin.getInstance().serverMuted()) {
|
if (ChatPlugin.getInstance().serverGlobalChatEnabled() && !ChatPlugin.getInstance().serverMuted()) {
|
||||||
String uuidString = in.readUTF();
|
UUID uuid = UUID.fromString(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);
|
|
||||||
String message = in.readUTF();
|
String message = in.readUTF();
|
||||||
|
|
||||||
Bukkit.getOnlinePlayers().stream().filter(p -> p.hasPermission(Config.GCPERMISSION)).forEach(p -> {
|
Bukkit.getOnlinePlayers().stream().filter(p -> p.hasPermission(Config.GCPERMISSION)).forEach(p -> {
|
||||||
ChatUser chatUser = ChatUserManager.getChatUser(p.getUniqueId());
|
ChatUser chatUser = ChatUserManager.getChatUser(p.getUniqueId());
|
||||||
if (chatUser.getIgnoredPlayers().contains(uuid)) {
|
if (!chatUser.getIgnoredPlayers().contains(uuid)) {
|
||||||
p.sendMessage(GsonComponentSerializer.gson().deserialize(message));
|
p.sendMessage(GsonComponentSerializer.gson().deserialize(message));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -9,6 +9,8 @@ import com.velocitypowered.api.proxy.Player;
|
||||||
import com.velocitypowered.api.proxy.ServerConnection;
|
import com.velocitypowered.api.proxy.ServerConnection;
|
||||||
import com.velocitypowered.api.proxy.messages.ChannelIdentifier;
|
import com.velocitypowered.api.proxy.messages.ChannelIdentifier;
|
||||||
|
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
public class PluginMessageListener {
|
public class PluginMessageListener {
|
||||||
|
|
||||||
//todo add an extra listener for nicknames?
|
//todo add an extra listener for nicknames?
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user