War side checks

This commit is contained in:
Isaac committed 2023-04-06 14:40:03 +01:00
1 parent 9c62de50a9
commit 26cd6d04f8
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()