use of gg.projecteden.utils.TimeUtils.Timespan in project Nexus by ProjectEdenGG.
the class LockdownCommand method start.
@Path("start <time/reason...>")
void start(String input) {
if (lockdown) {
send(PREFIX + "Overriding previous lockdown: &c" + reason);
reason = null;
end = null;
}
lockdown = true;
Timespan timespan = Timespan.find(input);
reason = timespan.getRest();
if (timespan.getOriginal() > 0)
end = timespan.fromNow();
String message = "&c" + name() + " initiated lockdown for &e" + (timespan.isNull() ? "" : timespan.format(FormatType.LONG) + "&c for &e") + timespan.getRest();
broadcast(message);
for (Player player : OnlinePlayers.getAll()) if (!canBypass(player.getUniqueId())) {
player.kick(getLockdownReason());
broadcast("Removed " + player.getName() + " from server");
}
}
Aggregations