Fix cherrypicked raid file

This commit is contained in:
Aubri Seebauer committed 2023-04-03 09:16:03 -04:00
1 parent dcad9611d6
commit 271648712d
1 file changed
+2 -24
@@ -1,7 +1,6 @@
package me.ShermansWorld.AlathraWar; package me.ShermansWorld.AlathraWar;
import com.palmergames.bukkit.towny.TownyAPI; import com.palmergames.bukkit.towny.TownyAPI;
import com.palmergames.bukkit.towny.exceptions.NotRegisteredException;
import com.palmergames.bukkit.towny.exceptions.TownyException; import com.palmergames.bukkit.towny.exceptions.TownyException;
import com.palmergames.bukkit.towny.object.Town; import com.palmergames.bukkit.towny.object.Town;
import com.palmergames.bukkit.towny.object.TownBlock; import com.palmergames.bukkit.towny.object.TownBlock;
@@ -148,27 +147,7 @@ public class Raid {
Main.raidData.getConfig().set("Raids." + String.valueOf(Raid.this.id) + ".raidticks", Main.raidData.getConfig().set("Raids." + String.valueOf(Raid.this.id) + ".raidticks",
(Object) Raid.this.raidTicks); (Object) Raid.this.raidTicks);
Main.raidData.saveConfig(); Main.raidData.saveConfig();
@Override
public void run() {
if (homeBlock != null) {
town.setHomeBlock(homeBlock);
town.setSpawn(townSpawn);
}
// If time runs out, stops scheduled task.
if (Raid.this.raidTicks >= Raid.this.MAXRAIDTICKS) {
Bukkit.getServer().getScheduler().cancelTask(Raid.this.bukkitId[0]);
if (Raid.this.raiderPoints > Raid.this.defenderPoints) {
Raid.this.raidersWin(Raid.this.owner);
} else {
Raid.this.defendersWin();
}
} else {
final Raid this$0 = Raid.this;
Raid.access$7(this$0, this$0.raidTicks + 200);
Main.raidData.getConfig().set("Raids." + String.valueOf(Raid.this.id) + ".raidticks",
(Object) Raid.this.raidTicks);
Main.raidData.saveConfig();
//check and start travel phase //check and start travel phase
if (Raid.this.raidTicks >= RaidPhase.TRAVEL.startTick && Raid.this.phase != RaidPhase.TRAVEL) { if (Raid.this.raidTicks >= RaidPhase.TRAVEL.startTick && Raid.this.phase != RaidPhase.TRAVEL) {
@@ -195,9 +174,9 @@ public class Raid {
//Raid Travel phase behavior //Raid Travel phase behavior
else if (Raid.this.phase == RaidPhase.TRAVEL) { else if (Raid.this.phase == RaidPhase.TRAVEL) {
//Check if a player has arrived at the town (in it) and if so start combat //Check if a player has arrived at the town (in it) and if so start combat
for(String player : raiderPlayers) { for (String player : raiderPlayers) {
WorldCoord playercoord = WorldCoord.parseWorldCoord(Bukkit.getPlayer(player)); WorldCoord playercoord = WorldCoord.parseWorldCoord(Bukkit.getPlayer(player));
if(Raid.this.town.hasTownBlock(playercoord)) { if (Raid.this.town.hasTownBlock(playercoord)) {
startCombat(); startCombat();
} }
} }
@@ -217,7 +196,6 @@ public class Raid {
} }
} }
}, 0L, 200L); }, 0L, 200L);
} }
// End of raid // End of raid