Fix some bugs

Signed-off-by: Etzelia <etzelia@hotmail.com>
checkup
Etzelia 2019-09-20 21:17:18 -05:00
parent c71f388748
commit c191aad9cc
No known key found for this signature in database
GPG Key ID: 708511AE7ABC5314
2 changed files with 9 additions and 2 deletions

View File

@ -29,11 +29,12 @@ public class CheckupCommand implements CommandExecutor {
public static void join(Player player) {
Checkup checkup;
checkup:
for (UUID uuid : checkups.keySet()) {
checkup = checkups.get(uuid);
for (Player pl : checkup.players) {
if (pl.getUniqueId().equals(player.getUniqueId())) {
continue; // Don't check twice, even if they re-logged
continue checkup; // Don't check twice, even if they re-logged
}
}
checkup.players.add(player);
@ -104,10 +105,11 @@ public class CheckupCommand implements CommandExecutor {
Checkup checkup = checkups.get(player.getUniqueId());
Player next;
while (checkup.hasNext()) {
// Loop until current player is online
// Loop until next player is online
next = checkup.next();
if (next.isOnline()) {
player.teleport(next.getLocation());
EtzTechUtil.sms(player, ChatColor.GREEN + "You are now checking on " + ChatColor.YELLOW + next.getName());
checkups.put(player.getUniqueId(), checkup);
return;
}

View File

@ -43,6 +43,8 @@ commands:
karattrophy:
description: 24 karat trophy command
aliases: [trophy]
checkup:
description: Checkup command
permissions:
qol.admin:
description: Ability to reload the plugin
@ -77,6 +79,9 @@ permissions:
qol.karattrophy:
description: Ability to use the Karat Trophy Command
default: op
qol.checkup:
description: Ability to use the Checkup Command
default: op
qol.auditable:
description: Audits command usage
default: op