mirror of
https://github.com/taoneill/war.git
synced 2025-01-05 07:17:34 +01:00
Prevent joining zone during reset
This commit is contained in:
parent
df871c1c5b
commit
346fd25955
@ -1150,9 +1150,10 @@ public class Warzone {
|
||||
team.resetPoints();
|
||||
team.setRemainingLives(team.getTeamConfig().resolveInt(TeamConfig.LIFEPOOL));
|
||||
}
|
||||
this.getVolume().resetBlocksAsJob();
|
||||
this.initializeZoneAsJob();
|
||||
War.war.log("Last player left warzone " + this.getName() + ". Warzone blocks resetting automatically...", Level.INFO);
|
||||
if (!this.isReinitializing()) {
|
||||
this.reinitialize();
|
||||
War.war.getLogger().log(Level.INFO, "Last player left warzone {0}. Warzone blocks resetting automatically...", new Object[] {this.getName()});
|
||||
}
|
||||
}
|
||||
|
||||
WarPlayerLeaveEvent event1 = new WarPlayerLeaveEvent(player.getName());
|
||||
|
@ -53,6 +53,8 @@ public class JoinCommand extends AbstractWarCommand {
|
||||
}
|
||||
if (zone.getWarzoneConfig().getBoolean(WarzoneConfig.DISABLED)) {
|
||||
this.badMsg("join.disabled");
|
||||
} else if (zone.isReinitializing()) {
|
||||
this.badMsg("join.disabled");
|
||||
} else if (zone.getWarzoneConfig().getBoolean(WarzoneConfig.AUTOASSIGN)) {
|
||||
this.badMsg("join.aarequired");
|
||||
} else if (!zone.getWarzoneConfig().getBoolean(WarzoneConfig.JOINMIDBATTLE) && zone.isEnoughPlayers()) {
|
||||
|
@ -335,7 +335,7 @@ public class WarPlayerListener implements Listener {
|
||||
if (locLobby != null && currentTeam == null && locLobby.isInAnyGate(playerLoc)) {
|
||||
Warzone zone = locLobby.getZone();
|
||||
Team locTeamGate = locLobby.getTeamGate(playerLoc);
|
||||
if (zone.getWarzoneConfig().getBoolean(WarzoneConfig.DISABLED)) {
|
||||
if (zone.getWarzoneConfig().getBoolean(WarzoneConfig.DISABLED) || zone.isReinitializing()) {
|
||||
War.war.badMsg(player, "join.disabled");
|
||||
event.setTo(zone.getTeleport());
|
||||
} else if (!zone.getWarzoneConfig().getBoolean(WarzoneConfig.JOINMIDBATTLE) && zone.isEnoughPlayers()) {
|
||||
@ -374,7 +374,7 @@ public class WarPlayerListener implements Listener {
|
||||
if (zone != null && zone.getTeleport() != null) {
|
||||
if (zone.getWarzoneConfig().getBoolean(WarzoneConfig.AUTOJOIN)
|
||||
&& zone.getTeams().size() >= 1 && currentTeam == null) {
|
||||
if (zone.getWarzoneConfig().getBoolean(WarzoneConfig.DISABLED)) {
|
||||
if (zone.getWarzoneConfig().getBoolean(WarzoneConfig.DISABLED) || zone.isReinitializing()) {
|
||||
War.war.badMsg(player, "join.disabled");
|
||||
event.setTo(hub.getLocation());
|
||||
} else if (!zone.getWarzoneConfig().getBoolean(WarzoneConfig.JOINMIDBATTLE) && zone.isEnoughPlayers()) {
|
||||
|
Loading…
Reference in New Issue
Block a user