Completions and shadowmute support in RP

This commit is contained in:
Draycia committed 2020-07-01 08:16:40 -07:00
1 parent 5c0d901aaf
commit 03e8f4ec53
3 files changed
+13 -5

No files matched your search

@@ -27,12 +27,16 @@ public class MeCommand extends BaseCommand {
String format = PlaceholderAPI.setPlaceholders(player, simpleChat.getConfig().getString("language.me"));
Component component = MiniMessage.instance().parse(format, "message", message);
for (Player onlinePlayer : Bukkit.getOnlinePlayers()) {
if (simpleChat.playerHasPlayerIgnored(onlinePlayer, player)) {
continue;
}
if (simpleChat.isUserShadowMuted(player)) {
simpleChat.getAudiences().player(player).sendMessage(component);
} else {
for (Player onlinePlayer : Bukkit.getOnlinePlayers()) {
if (simpleChat.playerHasPlayerIgnored(onlinePlayer, player)) {
continue;
}
simpleChat.getAudiences().player(onlinePlayer).sendMessage(component);
simpleChat.getAudiences().player(onlinePlayer).sendMessage(component);
}
}
}
@@ -2,6 +2,7 @@ package net.draycia.simplechat.commands;
import co.aikar.commands.BaseCommand;
import co.aikar.commands.annotation.CommandAlias;
import co.aikar.commands.annotation.CommandCompletion;
import co.aikar.commands.annotation.CommandPermission;
import co.aikar.commands.annotation.Default;
import net.draycia.simplechat.SimpleChat;
@@ -20,6 +21,7 @@ public class MessageCommand extends BaseCommand {
}
@Default
@CommandCompletion("@players")
public void baseCommand(Player player, String target, String... args) {
OfflinePlayer targetPlayer = Bukkit.getOfflinePlayer(target);
@@ -2,6 +2,7 @@ package net.draycia.simplechat.commands;
import co.aikar.commands.BaseCommand;
import co.aikar.commands.annotation.CommandAlias;
import co.aikar.commands.annotation.CommandCompletion;
import co.aikar.commands.annotation.CommandPermission;
import co.aikar.commands.annotation.Default;
import net.draycia.simplechat.SimpleChat;
@@ -21,6 +22,7 @@ public class ShadowMuteCommand extends BaseCommand {
}
@Default
@CommandCompletion("@players")
public void baseCommand(CommandSender sender, OfflinePlayer target) {
boolean isNowMuted = simpleChat.toggleShadowMute(target);