Added party spy

This commit is contained in:
2021-08-08 18:27:30 +02:00
parent 18c3c4c6f4
commit c701621e42
3 changed files with 17 additions and 4 deletions
@@ -24,10 +24,7 @@ import org.bukkit.scheduler.BukkitRunnable;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Objects;
import java.util.*;
import java.util.stream.Collectors;
public class ChatParty implements CommandExecutor, TabCompleter {
@@ -152,6 +149,11 @@ public class ChatParty implements CommandExecutor, TabCompleter {
}
party.removeUser(ChatUserManager.getChatUser(offlinePlayerIfCached.getUniqueId()));
if (offlinePlayerIfCached.getUniqueId().equals(party.getOwnerUuid())) {
sender.sendMessage(MiniMessage.get().parse("<red>You can't remove yourself, please leave instead.</red>"));
return;
}
if (offlinePlayerIfCached.isOnline()) {
Objects.requireNonNull(offlinePlayerIfCached.getPlayer())
.sendMessage(MiniMessage.get().parse("<red>You were removed from the '" + party.getPartyName() + "' chat party."));