mirror of
https://github.com/darksaid98/AlathranWars.git
synced 2026-12-04 14:38:57 +00:00
raid creation bugs
This commit is contained in:
1 parent
23f61e99a4
commit
2a733fe867
4 files changed
+19
-4
No files matched your search
@@ -103,7 +103,7 @@ public class Raid {
|
|||||||
final boolean side1AreRaiders, final int raidTicks, Player owner) {
|
final boolean side1AreRaiders, final int raidTicks, Player owner) {
|
||||||
|
|
||||||
this.bukkitId = new int[1];
|
this.bukkitId = new int[1];
|
||||||
// this.activeRaiders = activeRaiders == null ? new ArrayList<>() : activeRaiders;
|
this.activeRaiders = activeRaiders == null ? new ArrayList<>() : activeRaiders;
|
||||||
this.war = war;
|
this.war = war;
|
||||||
this.raidTicks = raidTicks;
|
this.raidTicks = raidTicks;
|
||||||
this.raidedTown = raidedTown;
|
this.raidedTown = raidedTown;
|
||||||
@@ -145,7 +145,7 @@ public class Raid {
|
|||||||
public Raid(final War war, final Town raidedTown, final Town gatherTown,
|
public Raid(final War war, final Town raidedTown, final Town gatherTown,
|
||||||
final boolean side1AreRaiders, Player owner) {
|
final boolean side1AreRaiders, Player owner) {
|
||||||
this.bukkitId = new int[1];
|
this.bukkitId = new int[1];
|
||||||
// this.activeRaiders = activeRaiders == null ? new ArrayList<>() : activeRaiders;
|
this.activeRaiders = activeRaiders == null ? new ArrayList<>() : activeRaiders;
|
||||||
this.war = war;
|
this.war = war;
|
||||||
this.raidTicks = 0;
|
this.raidTicks = 0;
|
||||||
this.raidedTown = raidedTown;
|
this.raidedTown = raidedTown;
|
||||||
@@ -198,6 +198,7 @@ public class Raid {
|
|||||||
this.bukkitId[0] = Bukkit.getServer().getScheduler().scheduleSyncRepeatingTask((Plugin) Main.getInstance(),
|
this.bukkitId[0] = Bukkit.getServer().getScheduler().scheduleSyncRepeatingTask((Plugin) Main.getInstance(),
|
||||||
getTickLoop(), 0L, incremental);
|
getTickLoop(), 0L, incremental);
|
||||||
|
|
||||||
|
this.save();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -767,6 +768,7 @@ public class Raid {
|
|||||||
}
|
}
|
||||||
raidTicks += incremental;
|
raidTicks += incremental;
|
||||||
|
|
||||||
|
//check for end
|
||||||
if (Raid.this.raidTicks >= RaidPhase.END.startTick && Raid.this.phase == RaidPhase.COMBAT) {
|
if (Raid.this.raidTicks >= RaidPhase.END.startTick && Raid.this.phase == RaidPhase.COMBAT) {
|
||||||
Raid.this.phase = RaidPhase.END;
|
Raid.this.phase = RaidPhase.END;
|
||||||
}
|
}
|
||||||
@@ -781,6 +783,11 @@ public class Raid {
|
|||||||
startCombat();
|
startCombat();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//check and start gather phase
|
||||||
|
if (Raid.this.raidTicks >= RaidPhase.GATHER.startTick && Raid.this.phase == RaidPhase.GATHER) {
|
||||||
|
startGather();
|
||||||
|
}
|
||||||
|
|
||||||
if (Raid.this.phase == RaidPhase.END) {
|
if (Raid.this.phase == RaidPhase.END) {
|
||||||
//TODO: fix raid scoring
|
//TODO: fix raid scoring
|
||||||
//for raiders to win, they need a significant up from the defenders
|
//for raiders to win, they need a significant up from the defenders
|
||||||
|
|||||||
@@ -1367,12 +1367,14 @@ public class AdminCommands implements CommandExecutor {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
} else if (args[3].equalsIgnoreCase("reset")) {
|
} else if (args[3].equalsIgnoreCase("reset")) {
|
||||||
if (args[6].equals(w.getSide1())) {
|
|
||||||
|
if (args.length >= 6) {
|
||||||
|
if (args[5].equals(w.getSide1())) {
|
||||||
w.setLastRaidTimeSide1(0L);
|
w.setLastRaidTimeSide1(0L);
|
||||||
p.sendMessage(Helper.Chatlabel() + "Reset last raid time in war " + args[4]);
|
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]);
|
Main.warLogger.log(Helper.Chatlabel() + "Reset last raid time in war " + args[4]);
|
||||||
return finalizeWar(w);
|
return finalizeWar(w);
|
||||||
} else if (args[6].equals(w.getSide2())) {
|
} else if (args[5].equals(w.getSide2())) {
|
||||||
w.setLastRaidTimeSide2(0L);
|
w.setLastRaidTimeSide2(0L);
|
||||||
p.sendMessage(Helper.Chatlabel() + "Reset last raid time in war " + args[4]);
|
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]);
|
Main.warLogger.log(Helper.Chatlabel() + "Reset last raid time in war " + args[4]);
|
||||||
@@ -1385,6 +1387,10 @@ public class AdminCommands implements CommandExecutor {
|
|||||||
p.sendMessage(Helper.color("c") + "Usage: /alathrawaradmin modify war raidTimeWar [add,set,reset] [town/war] [amt] [side]");
|
p.sendMessage(Helper.color("c") + "Usage: /alathrawaradmin modify war raidTimeWar [add,set,reset] [town/war] [amt] [side]");
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
p.sendMessage(Helper.color("c") + "Usage: /alathrawaradmin modify war raidTimeWar [add,set,reset] [town/war] [amt] [side]");
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
p.sendMessage(Helper.color("c") + "Error: War not found!");
|
p.sendMessage(Helper.color("c") + "Error: War not found!");
|
||||||
|
|||||||
@@ -570,6 +570,7 @@ public class AdminTabCompletion implements TabCompleter {
|
|||||||
if (args.length > 4) {
|
if (args.length > 4) {
|
||||||
if (args.length > 5) {
|
if (args.length > 5) {
|
||||||
if (args.length > 6) {
|
if (args.length > 6) {
|
||||||
|
|
||||||
if (args.length > 7) {
|
if (args.length > 7) {
|
||||||
return NameUtil.filterByStart(CommandHelper.getWarSides(args[4]), args[6]);
|
return NameUtil.filterByStart(CommandHelper.getWarSides(args[4]), args[6]);
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -210,6 +210,7 @@ public class RaidCommands implements CommandExecutor {
|
|||||||
|
|
||||||
//publish raid
|
//publish raid
|
||||||
Main.econ.withdrawPlayer(offlinePlayer, 1000);
|
Main.econ.withdrawPlayer(offlinePlayer, 1000);
|
||||||
|
raid2.addActiveRaider(raidOwner.getName());
|
||||||
RaidData.addRaid(raid2);
|
RaidData.addRaid(raid2);
|
||||||
raid2.start(); //funny funny method haha
|
raid2.start(); //funny funny method haha
|
||||||
WarData.saveWar(raid2.getWar());
|
WarData.saveWar(raid2.getWar());
|
||||||
|
|||||||
Reference in new issue
Block a user