dirty fix for /spy not working
This commit is contained in:
@@ -25,9 +25,9 @@ public class Spy implements CommandExecutor {
|
||||
@Override
|
||||
public void run() {
|
||||
UUID uuid = ((Player) sender).getUniqueId();
|
||||
Utility.flipPermission(uuid, Config.SPYPERMISSION);
|
||||
//Queries.setGlobalChatState(chatUser.isGcOn(), chatUser.getUuid());
|
||||
sender.sendMessage(MiniMessage.get().parse("You have turned spy " + (!Utility.hasPermission(uuid, Config.GCPERMISSION) ? "<green>on." : "<red>off."))); // TODO load from config and minimessage
|
||||
ChatUser user = ChatUserManager.getChatUser(uuid);
|
||||
user.toggleSpy();
|
||||
sender.sendMessage(MiniMessage.get().parse("You have turned spy " + (user.isSpy() ? "<green>on." : "<red>off."))); // TODO load from config and minimessage
|
||||
}
|
||||
}.runTaskAsynchronously(ChatPlugin.getInstance());
|
||||
return false;
|
||||
|
||||
@@ -72,7 +72,7 @@ public class ChatHandler {
|
||||
sendPrivateMessage(player, target, "privatemessage", component);
|
||||
Component spymessage = miniMessage.parse(Config.MESSAGESPY, templates);
|
||||
for(Player pl : Bukkit.getOnlinePlayers()) {
|
||||
if(pl.hasPermission(Config.SPYPERMISSION) && !pl.equals(player) && !pl.getName().equalsIgnoreCase(target)) { // todo add a toggle for social spy
|
||||
if(pl.hasPermission(Config.SPYPERMISSION) && ChatUserManager.getChatUser(pl.getUniqueId()).isSpy() && !pl.equals(player) && !pl.getName().equalsIgnoreCase(target)) { // todo add a toggle for social spy
|
||||
pl.sendMessage(spymessage);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -39,10 +39,13 @@ public class PluginMessage implements PluginMessageListener {
|
||||
String target = in.readUTF();
|
||||
Player p = Bukkit.getPlayer(uuid);
|
||||
if (p != null) {
|
||||
p.sendMessage(GsonComponentSerializer.gson().deserialize(in.readUTF()));
|
||||
p.playSound(p.getLocation(), Sound.BLOCK_NOTE_BLOCK_BASS, 1, 1); // todo load this from config
|
||||
ChatUser user = ChatUserManager.getChatUser(uuid);
|
||||
user.setReplyTarget(target);
|
||||
ChatUser chatUser = ChatUserManager.getChatUser(uuid);
|
||||
if (!chatUser.getIgnoredPlayers().contains(uuid)) {
|
||||
p.sendMessage(GsonComponentSerializer.gson().deserialize(in.readUTF()));
|
||||
p.playSound(p.getLocation(), Sound.BLOCK_NOTE_BLOCK_BASS, 1, 1); // todo load this from config
|
||||
ChatUser user = ChatUserManager.getChatUser(uuid);
|
||||
user.setReplyTarget(target);
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -51,9 +54,12 @@ public class PluginMessage implements PluginMessageListener {
|
||||
String target = in.readUTF();
|
||||
Player p = Bukkit.getPlayer(uuid);
|
||||
if (p != null) {
|
||||
p.sendMessage(GsonComponentSerializer.gson().deserialize(in.readUTF()));
|
||||
ChatUser user = ChatUserManager.getChatUser(uuid);
|
||||
user.setReplyTarget(target);
|
||||
ChatUser chatUser = ChatUserManager.getChatUser(uuid);
|
||||
if (!chatUser.getIgnoredPlayers().contains(uuid)) {
|
||||
p.sendMessage(GsonComponentSerializer.gson().deserialize(in.readUTF()));
|
||||
ChatUser user = ChatUserManager.getChatUser(uuid);
|
||||
user.setReplyTarget(target);
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -15,7 +15,7 @@ commands:
|
||||
aliases: togglegc
|
||||
message:
|
||||
permission: command.message
|
||||
aliases: msg
|
||||
aliases: [msg, tell]
|
||||
reply:
|
||||
permission: command.message
|
||||
aliases: r
|
||||
|
||||
Reference in New Issue
Block a user