forked from SteamWar/SteamWar
Fix arena start condition
This commit is contained in:
@@ -85,6 +85,14 @@ public class ServerStarter {
|
||||
directory = new File(SERVER_PATH, mode.getFolder());
|
||||
arguments.put("config", mode.getConfig());
|
||||
tempWorld(SERVER_PATH + mode.getFolder() + "/arenas/" + map);
|
||||
startCondition = () -> {
|
||||
if(playersToSend.stream().anyMatch(player -> Subserver.isArena(Subserver.getSubserver(player)))) {
|
||||
playersToSend.forEach(player -> Chatter.of(player).system("FIGHT_IN_ARENA"));
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
};
|
||||
return this;
|
||||
}
|
||||
|
||||
|
||||
@@ -60,19 +60,7 @@ public class FightCommand extends SWCommand {
|
||||
sender.sendMessage(start);
|
||||
}
|
||||
|
||||
private static boolean alreadyInArena(PlayerChatter sender){
|
||||
if(Subserver.isArena(Subserver.getSubserver(sender.getPlayer()))){
|
||||
sender.system("FIGHT_IN_ARENA");
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
static void createArena(PlayerChatter sender, String precommand, boolean allowMerging, ArenaMode arenaMode, String map, boolean historic, FightCallback callback) {
|
||||
if(alreadyInArena(sender))
|
||||
return;
|
||||
|
||||
if (arenaMode == null) {
|
||||
getModes(sender, precommand, historic);
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user