War side checks

(cherry picked from commit 26cd6d04f8)
This commit is contained in:
Isaac authored and Aubri Seebauer committed 2023-04-09 21:12:28 -04:00
1 parent 6d9e1ef2ec
commit 2e4285a630
2 files changed
+28 -2

No files matched your search

@@ -90,6 +90,16 @@ public class WarCommands implements CommandExecutor {
return true;
}
// Side checks
int side = war.getSide(args[2]);
if (side == -1) {
p.sendMessage(Helper.Chatlabel() + "You've surrendered!");
return true;
} else if (war.getSide(args[2]) > 0) {
p.sendMessage(Helper.Chatlabel() + "You're already in this war!");
return true;
}
// Side check
if (!war.getSide1().equalsIgnoreCase(args[2]) && !war.getSide2().equalsIgnoreCase(args[2])) {
p.sendMessage(Helper.Chatlabel()