parent
c71f388748
commit
c191aad9cc
|
@ -29,11 +29,12 @@ public class CheckupCommand implements CommandExecutor {
|
||||||
|
|
||||||
public static void join(Player player) {
|
public static void join(Player player) {
|
||||||
Checkup checkup;
|
Checkup checkup;
|
||||||
|
checkup:
|
||||||
for (UUID uuid : checkups.keySet()) {
|
for (UUID uuid : checkups.keySet()) {
|
||||||
checkup = checkups.get(uuid);
|
checkup = checkups.get(uuid);
|
||||||
for (Player pl : checkup.players) {
|
for (Player pl : checkup.players) {
|
||||||
if (pl.getUniqueId().equals(player.getUniqueId())) {
|
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);
|
checkup.players.add(player);
|
||||||
|
@ -104,10 +105,11 @@ public class CheckupCommand implements CommandExecutor {
|
||||||
Checkup checkup = checkups.get(player.getUniqueId());
|
Checkup checkup = checkups.get(player.getUniqueId());
|
||||||
Player next;
|
Player next;
|
||||||
while (checkup.hasNext()) {
|
while (checkup.hasNext()) {
|
||||||
// Loop until current player is online
|
// Loop until next player is online
|
||||||
next = checkup.next();
|
next = checkup.next();
|
||||||
if (next.isOnline()) {
|
if (next.isOnline()) {
|
||||||
player.teleport(next.getLocation());
|
player.teleport(next.getLocation());
|
||||||
|
EtzTechUtil.sms(player, ChatColor.GREEN + "You are now checking on " + ChatColor.YELLOW + next.getName());
|
||||||
checkups.put(player.getUniqueId(), checkup);
|
checkups.put(player.getUniqueId(), checkup);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
@ -43,6 +43,8 @@ commands:
|
||||||
karattrophy:
|
karattrophy:
|
||||||
description: 24 karat trophy command
|
description: 24 karat trophy command
|
||||||
aliases: [trophy]
|
aliases: [trophy]
|
||||||
|
checkup:
|
||||||
|
description: Checkup command
|
||||||
permissions:
|
permissions:
|
||||||
qol.admin:
|
qol.admin:
|
||||||
description: Ability to reload the plugin
|
description: Ability to reload the plugin
|
||||||
|
@ -77,6 +79,9 @@ permissions:
|
||||||
qol.karattrophy:
|
qol.karattrophy:
|
||||||
description: Ability to use the Karat Trophy Command
|
description: Ability to use the Karat Trophy Command
|
||||||
default: op
|
default: op
|
||||||
|
qol.checkup:
|
||||||
|
description: Ability to use the Checkup Command
|
||||||
|
default: op
|
||||||
qol.auditable:
|
qol.auditable:
|
||||||
description: Audits command usage
|
description: Audits command usage
|
||||||
default: op
|
default: op
|
||||||
|
|
Loading…
Reference in New Issue