Removed several Siege features not needed for Raids

This commit is contained in:
Isaac committed 2023-04-03 10:19:49 +01:00
1 parent 168851ec63
commit 81e0ca47cd
1 file changed
+15 -22
@@ -11,7 +11,6 @@ import org.bukkit.plugin.Plugin;
import java.util.ArrayList; import java.util.ArrayList;
/* RAID EXPLANATION /* RAID EXPLANATION
Raids are run by raiding parties, who gather at a separate town, Raids are run by raiding parties, who gather at a separate town,
@@ -45,6 +44,7 @@ TODO LIST:
/** /**
* This is based on the existing Siege Class * This is based on the existing Siege Class
*
* @author AubriTheHuman * @author AubriTheHuman
* @author NinjaMandalorian * @author NinjaMandalorian
* @author ShermansWorld * @author ShermansWorld
@@ -71,17 +71,17 @@ public class Raid {
// Constructs raid for staging phase // Constructs raid for staging phase
public Raid(final int id, final War war, final Town town, final String raiders, final String defenders, public Raid(final int id, final War war, final Town town, final String raiders, final String defenders,
final boolean side1AreRaiders, final boolean side2AreRaiders) { final boolean side1AreRaiders, final boolean side2AreRaiders) {
/* /*
this.raidTicks = 0; * this.raidTicks = 0;
this.bukkitId = new int[1]; * this.bukkitId = new int[1];
this.raiderPlayers = new ArrayList<String>(); * this.raiderPlayers = new ArrayList<String>();
this.defenderPlayers = new ArrayList<String>(); * this.defenderPlayers = new ArrayList<String>();
this.war = war; * this.war = war;
this.town = town; * this.town = town;
this.raiders = raiders; * this.raiders = raiders;
this.id = id; * this.id = id;
*/ */
} }
public void start() { public void start() {
@@ -97,7 +97,6 @@ public class Raid {
// Creates 10 second looping function for Raid // Creates 10 second looping function for Raid
this.bukkitId[0] = Bukkit.getServer().getScheduler().scheduleSyncRepeatingTask((Plugin) Main.getInstance(), this.bukkitId[0] = Bukkit.getServer().getScheduler().scheduleSyncRepeatingTask((Plugin) Main.getInstance(),
(Runnable) new Runnable() { (Runnable) new Runnable() {
int homeBlockControl = 0;
@Override @Override
public void run() { public void run() {
@@ -105,13 +104,8 @@ public class Raid {
town.setHomeBlock(homeBlock); town.setHomeBlock(homeBlock);
town.setSpawn(townSpawn); town.setSpawn(townSpawn);
} }
if (Raid.this.side1AreRaiders) {
Raid.this.raiderPlayers = Raid.this.war.getSide1Players(); // If time runs out, stops scheduled task.
Raid.this.defenderPlayers = Raid.this.war.getSide2Players();
} else {
Raid.this.raiderPlayers = Raid.this.war.getSide2Players();
Raid.this.defenderPlayers = Raid.this.war.getSide1Players();
}
if (Raid.this.raidTicks >= Raid.this.MAXRAIDTICKS) { if (Raid.this.raidTicks >= Raid.this.MAXRAIDTICKS) {
Bukkit.getServer().getScheduler().cancelTask(Raid.this.bukkitId[0]); Bukkit.getServer().getScheduler().cancelTask(Raid.this.bukkitId[0]);
if (Raid.this.raiderPoints > Raid.this.defenderPoints) { if (Raid.this.raiderPoints > Raid.this.defenderPoints) {
@@ -126,7 +120,7 @@ public class Raid {
(Object) Raid.this.raidTicks); (Object) Raid.this.raidTicks);
Main.raidData.saveConfig(); Main.raidData.saveConfig();
// Raid update
if (Raid.this.raidTicks % 6000 == 0) { if (Raid.this.raidTicks % 6000 == 0) {
Bukkit.broadcastMessage(String.valueOf(Helper.Chatlabel()) + "Report on the raid of " Bukkit.broadcastMessage(String.valueOf(Helper.Chatlabel()) + "Report on the raid of "
+ Raid.this.town.getName() + ":"); + Raid.this.town.getName() + ":");
@@ -144,12 +138,11 @@ public class Raid {
// End of raid // End of raid
public void stop() { public void stop() {
Bukkit.getScheduler().cancelTask(this.bukkitId[0]); Bukkit.getScheduler().cancelTask(this.bukkitId[0]);
RaidCommands.raids.remove(this); //im not making this rn -Aubri RaidCommands.raids.remove(this); // im not making this rn -Aubri
Main.raidData.getConfig().set("Raids." + String.valueOf(this.id), (Object) null); Main.raidData.getConfig().set("Raids." + String.valueOf(this.id), (Object) null);
Main.raidData.saveConfig(); Main.raidData.saveConfig();
} }
/** /**
* Need to add call to KillsListener (defined seperate from Siege) * Need to add call to KillsListener (defined seperate from Siege)
*/ */