raid purges self on completion, polishes

This commit is contained in:
Aubri Seebauer committed 2023-04-20 20:45:38 -04:00
1 parent 40061cf40a
commit 6586d92046
7 files changed
+104 -114

No files matched your search

@@ -1338,12 +1338,12 @@ public class AdminCommands implements CommandExecutor {
} else if (args[3].equalsIgnoreCase("set")) {
if (args.length >= 7) {
if (args[6].equals(w.getSide1())) {
w.setLastRaidTimeSide1(Long.parseLong(args[6]));
w.setLastRaidTimeSide1(Integer.parseInt(args[6]));
p.sendMessage(Helper.Chatlabel() + "Set last raid time in war " + args[4] + " to " + args[6]);
Main.warLogger.log(Helper.Chatlabel() + "Set last raid time in war " + args[4] + " to " + args[6]);
return finalizeWar(w);
} else if (args[6].equals(w.getSide2())) {
w.setLastRaidTimeSide2(Long.parseLong(args[6]));
w.setLastRaidTimeSide2(Integer.parseInt(args[6]));
p.sendMessage(Helper.Chatlabel() + "Set last raid time in war " + args[4] + " to " + args[6]);
Main.warLogger.log(Helper.Chatlabel() + "Set last raid time in war " + args[4] + " to " + args[6]);
return finalizeWar(w);
@@ -1359,12 +1359,12 @@ public class AdminCommands implements CommandExecutor {
if (args.length >= 6) {
if (args[5].equals(w.getSide1())) {
w.setLastRaidTimeSide1(0L);
w.setLastRaidTimeSide1(0);
p.sendMessage(Helper.Chatlabel() + "Reset last raid time in war " + args[4]);
Main.warLogger.log(Helper.Chatlabel() + "Reset last raid time in war " + args[4]);
return finalizeWar(w);
} else if (args[5].equals(w.getSide2())) {
w.setLastRaidTimeSide2(0L);
w.setLastRaidTimeSide2(0);
p.sendMessage(Helper.Chatlabel() + "Reset last raid time in war " + args[4]);
Main.warLogger.log(Helper.Chatlabel() + "Reset last raid time in war " + args[4]);
return finalizeWar(w);
@@ -577,7 +577,7 @@ public class AdminTabCompletion implements TabCompleter {
if (args.length > 6) {
return empty;
} else {
return NameUtil.filterByStart(CommandHelper.getWarSides(args[4]), args[6]);
return NameUtil.filterByStart(CommandHelper.getWarSides(args[4]), args[5]);
}
} else {
if (args.length > 6) {
@@ -129,6 +129,14 @@ public class RaidCommands implements CommandExecutor {
//if this is run as admin, shift our check forward a slot
if (raidedTown.getName().equalsIgnoreCase(args[2 + (admin ? 1 : 0)]) && gatherTown != null) {
//check if the town were attempting to raid is in the war
if(!war.getSide1Towns().contains(raidedTown.getName()) && !war.getSide2Towns().contains(raidedTown.getName())) {
if (admin) p.sendMessage(String.valueOf(Helper.Chatlabel()) + "The town you are trying to raid is not part of the war!");
raidOwner.sendMessage(String.valueOf(Helper.Chatlabel()) + "The town you are trying to raid is not part of the war!");
return;
}
townExists = true;
Raid raid2;