Exemption by-permission for command warm-up

Permission node: war.warmupexempt
This commit is contained in:
cmastudios 2014-02-26 19:07:00 -06:00
parent 8bf6d6047d
commit 09e0919042
2 changed files with 3 additions and 2 deletions

View File

@ -39,7 +39,7 @@ public class WarhubCommand extends AbstractWarCommand {
playerWarzone.handlePlayerLeave(player, War.war.getWarHub().getLocation(), true);
}
int warmup = War.war.getWarConfig().getInt(WarConfig.TPWARMUP);
if (warmup > 0) {
if (warmup > 0 && !player.hasPermission("war.warmupexempt")) {
final int TICKS_PER_SECOND = 20;
TeleportPlayerJob job = new TeleportPlayerJob(player, War.war.getWarHub().getLocation());
job.runTaskLater(War.war, warmup);

View File

@ -35,7 +35,8 @@ public class WarzoneCommand extends AbstractWarCommand {
int warmup = War.war.getWarConfig().getInt(WarConfig.TPWARMUP);
if (playerWarzone != null) {
playerWarzone.handlePlayerLeave(player, warzone.getTeleport(), true);
} else if (warmup > 0) {
}
if (warmup > 0 && !player.hasPermission("war.warmupexempt")) {
final int TICKS_PER_SECOND = 20;
TeleportPlayerJob job = new TeleportPlayerJob(player, warzone.getTeleport());
job.runTaskLater(War.war, warmup);