mirror of
https://github.com/darksaid98/AlathranWars.git
synced 2026-12-01 22:14:45 +00:00
tabcompletion changes
This commit is contained in:
1 parent
56a897d6a3
commit
0869229548
5 files changed
+89
-49
No files matched your search
@@ -253,7 +253,7 @@ public class Raid {
|
||||
* @param p
|
||||
* @param wc
|
||||
*/
|
||||
private synchronized void doLootAt(Player p, WorldCoord wc) {
|
||||
public synchronized void doLootAt(Player p, WorldCoord wc) {
|
||||
p.addPotionEffect(new PotionEffect(PotionEffectType.GLOWING, 60, 0, true, false, true));
|
||||
|
||||
//check if this loot is in progress
|
||||
|
||||
@@ -474,8 +474,8 @@ public class AdminCommands implements CommandExecutor {
|
||||
side1Players.append(", ");
|
||||
}
|
||||
//cut off last two characters
|
||||
side1Towns = new StringBuilder(side1Towns.substring(0, side1Towns.length() - 2));
|
||||
side1Players = new StringBuilder(side1Players.substring(0, side1Players.length() - 2));
|
||||
if(side1Towns.length() > 2) side1Towns = new StringBuilder(side1Towns.substring(0, side1Towns.length() - 2));
|
||||
if(side1Players.length() > 2) side1Players = new StringBuilder(side1Players.substring(0, side1Players.length() - 2));
|
||||
p.sendMessage(Helper.Chatlabel() + w.getSide1() + " Towns: " + side1Towns);
|
||||
p.sendMessage(Helper.Chatlabel() + w.getSide1() + " Players: " + side1Players);
|
||||
p.sendMessage(Helper.Chatlabel() + "oOo-----------------===-----------------oOo");
|
||||
@@ -490,10 +490,19 @@ public class AdminCommands implements CommandExecutor {
|
||||
side2Players.append(", ");
|
||||
}
|
||||
//cut off last two characters
|
||||
side2Towns = new StringBuilder(side2Towns.substring(0, side2Towns.length() - 2));
|
||||
side2Players = new StringBuilder(side2Players.substring(0, side2Players.length() - 2));
|
||||
if(side2Towns.length() > 2) side2Towns = new StringBuilder(side2Towns.substring(0, side2Towns.length() - 2));
|
||||
if(side2Players.length() > 2) side2Players = new StringBuilder(side2Players.substring(0, side2Players.length() - 2));
|
||||
p.sendMessage(Helper.Chatlabel() + w.getSide2() + " Towns: " + side2Towns);
|
||||
p.sendMessage(Helper.Chatlabel() + w.getSide2() + " Players: " + side2Players);
|
||||
p.sendMessage(Helper.Chatlabel() + "oOo-----------------===-----------------oOo");
|
||||
StringBuilder surrenderedTowns = new StringBuilder();
|
||||
for (String t : w.getSurrenderedTowns()) {
|
||||
surrenderedTowns.append(t);
|
||||
surrenderedTowns.append(", ");
|
||||
}
|
||||
//cut off last two characters
|
||||
if(surrenderedTowns.length() > 2) surrenderedTowns = new StringBuilder(surrenderedTowns.substring(0, surrenderedTowns.length() - 2));
|
||||
p.sendMessage(Helper.Chatlabel() + w.getSide2() + " Towns: " + surrenderedTowns);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -527,7 +536,7 @@ public class AdminCommands implements CommandExecutor {
|
||||
activeRaiders.append(", ");
|
||||
}
|
||||
//cut off last two characters
|
||||
activeRaiders = new StringBuilder(activeRaiders.substring(0, activeRaiders.length() - 2));
|
||||
if(activeRaiders.length() > 2) activeRaiders = new StringBuilder(activeRaiders.substring(0, activeRaiders.length() - 2));
|
||||
p.sendMessage(Helper.Chatlabel() + "Raiding Players: " + activeRaiders);
|
||||
return true;
|
||||
}
|
||||
@@ -561,7 +570,7 @@ public class AdminCommands implements CommandExecutor {
|
||||
attackers.append(", ");
|
||||
}
|
||||
//cut off last two characters
|
||||
attackers = new StringBuilder(attackers.substring(0, attackers.length() - 2));
|
||||
if(attackers.length() > 2) attackers = new StringBuilder(attackers.substring(0, attackers.length() - 2));
|
||||
p.sendMessage(Helper.Chatlabel() + "Attacking Players: " + attackers);
|
||||
StringBuilder defenders = new StringBuilder();
|
||||
for (String pl : s.getAttackerPlayers()) {
|
||||
@@ -569,7 +578,7 @@ public class AdminCommands implements CommandExecutor {
|
||||
defenders.append(", ");
|
||||
}
|
||||
//cut off last two characters
|
||||
defenders = new StringBuilder(defenders.substring(0, defenders.length() - 2));
|
||||
if(defenders.length() > 2) defenders = new StringBuilder(defenders.substring(0, defenders.length() - 2));
|
||||
p.sendMessage(Helper.Chatlabel() + "Defending Players: " + defenders);
|
||||
return true;
|
||||
}
|
||||
@@ -793,6 +802,11 @@ public class AdminCommands implements CommandExecutor {
|
||||
if (args[5].equalsIgnoreCase("value")) {
|
||||
WorldCoord wc = WorldCoord.parseWorldCoord(p.getWorld().getName(), (int) Double.parseDouble(args[7]), (int) Double.parseDouble(args[8]));
|
||||
Raid.LootBlock lb = r.getLootedChunks().get(wc);
|
||||
if(lb == null) {
|
||||
r.addLootedChunk(wc);
|
||||
lb = r.getLootedChunks().get(wc);
|
||||
p.sendMessage(Helper.Chatlabel() + "Created empty loot chunk data to modify");
|
||||
}
|
||||
lb.value = Double.parseDouble(args[6]);
|
||||
p.sendMessage(Helper.Chatlabel() + "Set value for a chunk [" + args[7] + "," + args[8] + "] in raid against " + args[4] + " in war " + args[3] + " to " + args[6]);
|
||||
Main.warLogger.log("Set value for a chunk [" + args[7] + "," + args[8] + "] in raid against " + args[4] + " in war " + args[3] + " to " + args[6]);
|
||||
|
||||
@@ -87,6 +87,10 @@ public class AdminTabCompletion implements TabCompleter {
|
||||
"reset"
|
||||
});
|
||||
|
||||
List<String> empty = List.of(new String[]{
|
||||
""
|
||||
});
|
||||
|
||||
|
||||
/**
|
||||
* //done
|
||||
@@ -163,7 +167,7 @@ public class AdminTabCompletion implements TabCompleter {
|
||||
public List<String> onTabComplete(CommandSender sender, Command command, String label, String[] args) {
|
||||
final Player p = (Player) sender;
|
||||
if (!p.hasPermission("AlathraWar.admin")) {
|
||||
return null;
|
||||
return empty;
|
||||
}
|
||||
|
||||
if (args.length == 0) {
|
||||
@@ -179,7 +183,7 @@ public class AdminTabCompletion implements TabCompleter {
|
||||
if (args.length > 4) {
|
||||
if (args.length > 5) {
|
||||
if (args.length > 6) {
|
||||
return null;
|
||||
return empty;
|
||||
} else {
|
||||
return NameUtil.filterByStart(CommandHelper.getPlayers(), args[5]);
|
||||
}
|
||||
@@ -197,7 +201,7 @@ public class AdminTabCompletion implements TabCompleter {
|
||||
if (args.length > 3) {
|
||||
if (args.length > 4) {
|
||||
if (args.length > 5) {
|
||||
return null;
|
||||
return empty;
|
||||
} else {
|
||||
return NameUtil.filterByStart(CommandHelper.getPlayers(), args[4]);
|
||||
}
|
||||
@@ -209,7 +213,7 @@ public class AdminTabCompletion implements TabCompleter {
|
||||
}
|
||||
}
|
||||
default -> {
|
||||
return null;
|
||||
return empty;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
@@ -223,7 +227,7 @@ public class AdminTabCompletion implements TabCompleter {
|
||||
if (args.length > 4) {
|
||||
if (args.length > 5) {
|
||||
if (args.length > 6) {
|
||||
return null;
|
||||
return empty;
|
||||
} else {
|
||||
return NameUtil.filterByStart(CommandHelper.getWarSides(args[3]), args[5]);
|
||||
}
|
||||
@@ -237,7 +241,7 @@ public class AdminTabCompletion implements TabCompleter {
|
||||
if (args.length > 4) {
|
||||
if (args.length > 5) {
|
||||
if (args.length > 6) {
|
||||
return null;
|
||||
return empty;
|
||||
} else {
|
||||
return NameUtil.filterByStart(CommandHelper.getWarSides(args[3]), args[5]);
|
||||
}
|
||||
@@ -250,7 +254,7 @@ public class AdminTabCompletion implements TabCompleter {
|
||||
} else if (args[2].equalsIgnoreCase("war")) {
|
||||
if (args.length > 4) {
|
||||
if (args.length > 5) {
|
||||
return null;
|
||||
return empty;
|
||||
} else {
|
||||
return NameUtil.filterByStart(CommandHelper.getWarSides(args[3]), args[4]);
|
||||
}
|
||||
@@ -268,7 +272,7 @@ public class AdminTabCompletion implements TabCompleter {
|
||||
if (args.length > 5) {
|
||||
if (args.length > 6) {
|
||||
if (args.length > 7) {
|
||||
return null;
|
||||
return empty;
|
||||
} else {
|
||||
return NameUtil.filterByStart(CommandHelper.getWarSides(args[4]), args[6]);
|
||||
}
|
||||
@@ -286,7 +290,7 @@ public class AdminTabCompletion implements TabCompleter {
|
||||
if (args.length > 5) {
|
||||
if (args.length > 6) {
|
||||
if (args.length > 7) {
|
||||
return null;
|
||||
return empty;
|
||||
} else {
|
||||
return NameUtil.filterByStart(CommandHelper.getWarSides(args[4]), args[6]);
|
||||
}
|
||||
@@ -303,7 +307,7 @@ public class AdminTabCompletion implements TabCompleter {
|
||||
if (args.length > 4) {
|
||||
if (args.length > 5) {
|
||||
if (args.length > 6) {
|
||||
return null;
|
||||
return empty;
|
||||
} else {
|
||||
return NameUtil.filterByStart(CommandHelper.getWarSides(args[4]), args[5]);
|
||||
}
|
||||
@@ -323,7 +327,7 @@ public class AdminTabCompletion implements TabCompleter {
|
||||
if (args.length > 4) {
|
||||
if (args.length > 5) {
|
||||
if (args.length > 6) {
|
||||
return null;
|
||||
return empty;
|
||||
} else {
|
||||
return NameUtil.filterByStart(CommandHelper.getPlayers(), args[5]);
|
||||
}
|
||||
@@ -346,13 +350,13 @@ public class AdminTabCompletion implements TabCompleter {
|
||||
return NameUtil.filterByStart(force, args[1]);
|
||||
}
|
||||
} else if (args[0].equalsIgnoreCase("help")) {
|
||||
return null;
|
||||
return empty;
|
||||
} else if (args[0].equalsIgnoreCase("info")) {
|
||||
if (args.length > 2) {
|
||||
if (args[1].equalsIgnoreCase("raid")) {
|
||||
if (args.length > 3) {
|
||||
if (args.length > 4) {
|
||||
return null;
|
||||
return empty;
|
||||
} else {
|
||||
return NameUtil.filterByStart(CommandHelper.getTownyTowns(), args[3]);
|
||||
}
|
||||
@@ -362,7 +366,7 @@ public class AdminTabCompletion implements TabCompleter {
|
||||
} else if (args[1].equalsIgnoreCase("siege")) {
|
||||
if (args.length > 3) {
|
||||
if (args.length > 4) {
|
||||
return null;
|
||||
return empty;
|
||||
} else {
|
||||
return NameUtil.filterByStart(CommandHelper.getTownyTowns(), args[3]);
|
||||
}
|
||||
@@ -371,7 +375,7 @@ public class AdminTabCompletion implements TabCompleter {
|
||||
}
|
||||
} else if (args[1].equalsIgnoreCase("war")) {
|
||||
if (args.length > 3) {
|
||||
return null;
|
||||
return empty;
|
||||
} else {
|
||||
return NameUtil.filterByStart(CommandHelper.getWarNames(), args[2]);
|
||||
}
|
||||
@@ -401,7 +405,7 @@ public class AdminTabCompletion implements TabCompleter {
|
||||
*/
|
||||
case "score", "time" -> {
|
||||
if (args.length > 6) {
|
||||
return null;
|
||||
return empty;
|
||||
} else {
|
||||
return NameUtil.filterByStart(addSet, args[5]);
|
||||
}
|
||||
@@ -410,7 +414,7 @@ public class AdminTabCompletion implements TabCompleter {
|
||||
if (args.length > 6) {
|
||||
if (args.length > 7) {
|
||||
if (args.length > 8) {
|
||||
return null;
|
||||
return empty;
|
||||
} else {
|
||||
return List.of(new String[]{String.valueOf(p.getLocation().getZ())});
|
||||
}
|
||||
@@ -423,14 +427,14 @@ public class AdminTabCompletion implements TabCompleter {
|
||||
}
|
||||
case "gather" -> {
|
||||
if (args.length > 6) {
|
||||
return null;
|
||||
return empty;
|
||||
} else {
|
||||
return NameUtil.filterByStart(CommandHelper.getTownyTowns(), args[5]);
|
||||
}
|
||||
}
|
||||
case "phase" -> {
|
||||
if (args.length > 6) {
|
||||
return null;
|
||||
return empty;
|
||||
} else {
|
||||
return NameUtil.filterByStart(CommandHelper.getRaidPhases(), args[5]);
|
||||
}
|
||||
@@ -440,7 +444,7 @@ public class AdminTabCompletion implements TabCompleter {
|
||||
if (args.length > 7) {
|
||||
if (args.length > 8) {
|
||||
if (args.length > 9) {
|
||||
return null;
|
||||
return empty;
|
||||
} else {
|
||||
return List.of(new String[]{String.valueOf(p.getLocation().getZ())});
|
||||
}
|
||||
@@ -448,7 +452,7 @@ public class AdminTabCompletion implements TabCompleter {
|
||||
return List.of(new String[]{String.valueOf(p.getLocation().getX())});
|
||||
}
|
||||
} else {
|
||||
return null;
|
||||
return empty;
|
||||
}
|
||||
} else {
|
||||
return NameUtil.filterByStart(lootSet, args[5]);
|
||||
@@ -456,13 +460,13 @@ public class AdminTabCompletion implements TabCompleter {
|
||||
}
|
||||
case "owner" -> {
|
||||
if (args.length > 6) {
|
||||
return null;
|
||||
return empty;
|
||||
} else {
|
||||
return NameUtil.filterByStart(CommandHelper.getPlayers(), args[5]);
|
||||
}
|
||||
}
|
||||
default -> {
|
||||
return null;
|
||||
return empty;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
@@ -481,7 +485,7 @@ public class AdminTabCompletion implements TabCompleter {
|
||||
switch (args[2]) {
|
||||
case "score", "time" -> {
|
||||
if (args.length > 6) {
|
||||
return null;
|
||||
return empty;
|
||||
} else {
|
||||
return NameUtil.filterByStart(addSet, args[5]);
|
||||
}
|
||||
@@ -490,7 +494,7 @@ public class AdminTabCompletion implements TabCompleter {
|
||||
if (args.length > 6) {
|
||||
if (args.length > 7) {
|
||||
if (args.length > 8) {
|
||||
return null;
|
||||
return empty;
|
||||
} else {
|
||||
return List.of(new String[]{String.valueOf(p.getLocation().getZ())});
|
||||
}
|
||||
@@ -503,13 +507,13 @@ public class AdminTabCompletion implements TabCompleter {
|
||||
}
|
||||
case "owner" -> {
|
||||
if (args.length > 6) {
|
||||
return null;
|
||||
return empty;
|
||||
} else {
|
||||
return NameUtil.filterByStart(CommandHelper.getPlayers(), args[5]);
|
||||
}
|
||||
}
|
||||
default -> {
|
||||
return null;
|
||||
return empty;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
@@ -539,7 +543,7 @@ public class AdminTabCompletion implements TabCompleter {
|
||||
if (args.length > 5) {
|
||||
if (args.length > 6) {
|
||||
if (args.length > 7) {
|
||||
return null;
|
||||
return empty;
|
||||
} else {
|
||||
return NameUtil.filterByStart(CommandHelper.getTownyTowns(), args[4]);
|
||||
}
|
||||
@@ -557,7 +561,7 @@ public class AdminTabCompletion implements TabCompleter {
|
||||
case "raidTimeTown" -> {
|
||||
if (args.length > 4) {
|
||||
if (args.length > 5) {
|
||||
return null;
|
||||
return empty;
|
||||
} else {
|
||||
return NameUtil.filterByStart(CommandHelper.getTownyTowns(), args[4]);
|
||||
}
|
||||
@@ -569,15 +573,22 @@ public class AdminTabCompletion implements TabCompleter {
|
||||
case "raidTimeWar" -> {
|
||||
if (args.length > 4) {
|
||||
if (args.length > 5) {
|
||||
if (args.length > 6) {
|
||||
|
||||
if (args.length > 7) {
|
||||
return NameUtil.filterByStart(CommandHelper.getWarSides(args[4]), args[6]);
|
||||
if(args[3].equalsIgnoreCase("reset")) {
|
||||
if (args.length > 6) {
|
||||
return empty;
|
||||
} else {
|
||||
return null;
|
||||
return NameUtil.filterByStart(CommandHelper.getWarSides(args[4]), args[6]);
|
||||
}
|
||||
} else {
|
||||
return null;
|
||||
if (args.length > 6) {
|
||||
if (args.length > 7) {
|
||||
return empty;
|
||||
} else {
|
||||
return NameUtil.filterByStart(CommandHelper.getWarSides(args[4]), args[6]);
|
||||
}
|
||||
} else {
|
||||
return empty;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
return NameUtil.filterByStart(CommandHelper.getWarNames(), args[4]);
|
||||
@@ -591,7 +602,7 @@ public class AdminTabCompletion implements TabCompleter {
|
||||
|
||||
if (args.length > 4) {
|
||||
if (args.length > 5) {
|
||||
return null;
|
||||
return empty;
|
||||
} else {
|
||||
return NameUtil.filterByStart(CommandHelper.getWarSides(args[3]), args[4]);
|
||||
}
|
||||
@@ -601,7 +612,7 @@ public class AdminTabCompletion implements TabCompleter {
|
||||
}
|
||||
case "name" -> {
|
||||
if (args.length > 4) {
|
||||
return null;
|
||||
return empty;
|
||||
} else {
|
||||
return NameUtil.filterByStart(CommandHelper.getWarNames(), args[3]);
|
||||
}
|
||||
@@ -611,14 +622,14 @@ public class AdminTabCompletion implements TabCompleter {
|
||||
if (args.length > 5) {
|
||||
if (args.length > 6) {
|
||||
if (args.length > 7) {
|
||||
return null;
|
||||
return empty;
|
||||
} else {
|
||||
if (args[5].equalsIgnoreCase("town")) {
|
||||
return NameUtil.filterByStart(CommandHelper.getTownyTowns(), args[6]);
|
||||
} else if (args[5].equalsIgnoreCase("nation")) {
|
||||
return NameUtil.filterByStart(CommandHelper.getTownyNations(), args[6]);
|
||||
} else {
|
||||
return null;
|
||||
return empty;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
@@ -632,7 +643,7 @@ public class AdminTabCompletion implements TabCompleter {
|
||||
}
|
||||
}
|
||||
default -> {
|
||||
return null;
|
||||
return empty;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -105,6 +105,7 @@ public class RaidCommands implements CommandExecutor {
|
||||
} else if(TownyAPI.getInstance().getTown(args[4]) != null) {
|
||||
gatherTown = TownyAPI.getInstance().getTown(args[4]);
|
||||
} else {
|
||||
if (admin) p.sendMessage(String.valueOf(Helper.Chatlabel()) + "No valid town set for gather town, defaulting to current location");
|
||||
raidOwner.sendMessage(String.valueOf(Helper.Chatlabel()) + "No valid town set for gather town, defaulting to current location");
|
||||
gatherTown = TownyAPI.getInstance().getTownOrNull(WorldCoord.parseWorldCoord(raidOwner.getLocation()).getTownBlock());
|
||||
}
|
||||
@@ -112,10 +113,12 @@ public class RaidCommands implements CommandExecutor {
|
||||
gatherTown = TownyAPI.getInstance().getTownOrNull(WorldCoord.parseWorldCoord(raidOwner.getLocation()).getTownBlock());
|
||||
}
|
||||
} catch (NotRegisteredException e2) {
|
||||
if (admin) p.sendMessage(String.valueOf(Helper.Chatlabel()) + "You must be within a town's claim to begin a raid. That town you are in will be the gathering town.");
|
||||
raidOwner.sendMessage(String.valueOf(Helper.Chatlabel()) + "You must be within a town's claim to begin a raid. That town you are in will be the gathering town.");
|
||||
return;
|
||||
}
|
||||
if (gatherTown == null) {
|
||||
if (admin) p.sendMessage(String.valueOf(Helper.Chatlabel()) + "You must be within a town's claim to begin a raid. That town you are in will be the gathering town.");
|
||||
raidOwner.sendMessage(String.valueOf(Helper.Chatlabel()) + "You must be within a town's claim to begin a raid. That town you are in will be the gathering town.");
|
||||
return;
|
||||
}
|
||||
@@ -136,15 +139,19 @@ public class RaidCommands implements CommandExecutor {
|
||||
//if were admin, see if an owner arg exists, and if so then use it
|
||||
raid2 = new Raid(war, raidedTown, gatherTown, true, raidOwner);
|
||||
} else if (c == 1) {
|
||||
if (admin) p.sendMessage(String.valueOf(Helper.Chatlabel()) + "This town is already being raided at this time!");
|
||||
raidOwner.sendMessage(String.valueOf(Helper.Chatlabel()) + "This town is already being raided at this time!");
|
||||
return;
|
||||
} else if (c == 0) {
|
||||
if (admin) p.sendMessage(String.valueOf(Helper.Chatlabel()) + "Your side has raided too recently!");
|
||||
raidOwner.sendMessage(String.valueOf(Helper.Chatlabel()) + "Your side has raided too recently!");
|
||||
return;
|
||||
} else if (c == -1) {
|
||||
if (admin) p.sendMessage(String.valueOf(Helper.Chatlabel()) + "This town was raided too recently!");
|
||||
raidOwner.sendMessage(String.valueOf(Helper.Chatlabel()) + "This town was raided too recently!");
|
||||
return;
|
||||
} else if (c == -2) {
|
||||
if (admin) p.sendMessage(String.valueOf(Helper.Chatlabel()) + "At least on member of the raided town must be online to defend it!");
|
||||
raidOwner.sendMessage(String.valueOf(Helper.Chatlabel()) + "At least on member of the raided town must be online to defend it!");
|
||||
return;
|
||||
} else {
|
||||
@@ -161,15 +168,19 @@ public class RaidCommands implements CommandExecutor {
|
||||
if (c == 2) {
|
||||
raid2 = new Raid(war, raidedTown, gatherTown, false, raidOwner);
|
||||
} else if (c == 1) {
|
||||
if (admin) p.sendMessage(String.valueOf(Helper.Chatlabel()) + "This town is already being raided at this time!");
|
||||
raidOwner.sendMessage(String.valueOf(Helper.Chatlabel()) + "This town is already being raided at this time!");
|
||||
return;
|
||||
} else if (c == 0) {
|
||||
if (admin) p.sendMessage(String.valueOf(Helper.Chatlabel()) + "Your side has raided too recently!");
|
||||
raidOwner.sendMessage(String.valueOf(Helper.Chatlabel()) + "Your side has raided too recently!");
|
||||
return;
|
||||
} else if (c == -1) {
|
||||
if (admin) p.sendMessage(String.valueOf(Helper.Chatlabel()) + "This town was raided too recently!");
|
||||
raidOwner.sendMessage(String.valueOf(Helper.Chatlabel()) + "This town was raided too recently!");
|
||||
return;
|
||||
} else if (c == -2) {
|
||||
if (admin) p.sendMessage(String.valueOf(Helper.Chatlabel()) + "At least on member of the raided town must be online to defend it!");
|
||||
raidOwner.sendMessage(String.valueOf(Helper.Chatlabel()) + "At least on member of the raided town must be online to defend it!");
|
||||
return;
|
||||
} else {
|
||||
@@ -181,15 +192,18 @@ public class RaidCommands implements CommandExecutor {
|
||||
Town leaderTown = TownyAPI.getInstance().getResident(raidOwner).getTownOrNull();
|
||||
int sideR = war.getSide(leaderTown.getName());
|
||||
if (sideR == 0) {
|
||||
if (admin) p.sendMessage(Helper.Chatlabel() + "You are not in this war.");
|
||||
raidOwner.sendMessage(Helper.Chatlabel() + "You are not in this war.");
|
||||
return;
|
||||
} else if (sideR == -1) {
|
||||
if (admin) p.sendMessage(Helper.Chatlabel() + "You have surrendered.");
|
||||
raidOwner.sendMessage(Helper.Chatlabel() + "You have surrendered.");
|
||||
return;
|
||||
}
|
||||
|
||||
// Attacking own side
|
||||
if (war.getSide(raidedTown) == sideR) {
|
||||
if (admin) p.sendMessage(Helper.Chatlabel() + "You cannot attack your own towns.");
|
||||
raidOwner.sendMessage(Helper.Chatlabel() + "You cannot attack your own towns.");
|
||||
return;
|
||||
}
|
||||
@@ -197,6 +211,7 @@ public class RaidCommands implements CommandExecutor {
|
||||
//check player balance
|
||||
final OfflinePlayer offlinePlayer = Bukkit.getOfflinePlayer(p.getUniqueId());
|
||||
if (Main.econ.getBalance(offlinePlayer) <= 1000.0) {
|
||||
if (admin) p.sendMessage(String.valueOf(Helper.Chatlabel()) + "You must have at least $1000 to put up to start a raid.");
|
||||
raidOwner.sendMessage(String.valueOf(Helper.Chatlabel()) + "You must have at least $1000 to put up to start a raid.");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@ package me.ShermansWorld.AlathraWar.data;
|
||||
|
||||
public enum RaidPhase {
|
||||
START(0, 0),
|
||||
GATHER(1, 1),
|
||||
GATHER(1, 0),
|
||||
TRAVEL(2, 18000),
|
||||
COMBAT(3, 24000),
|
||||
END(4, 72000);
|
||||
|
||||
Reference in new issue
Block a user