Skip to content

Commit

Permalink
Fix a fucking static problem
Browse files Browse the repository at this point in the history
  • Loading branch information
zelytra committed Sep 11, 2021
1 parent 93cce1b commit cfe97b0
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,13 @@ public class Guardian implements Listener {

private final LivingEntity entity;
private final Location spawnLoc;
private static BukkitTask task;
private BukkitTask task;

private final static NamespacedKey spawnLocKey = new NamespacedKey(Daedalus.getInstance(), "spawnLoc");

private final int health = 100;
private final BossBar bossBar;
private final int respawnCooldown = 600; //in seconds
private final int respawnCooldown = 15;//600; //in seconds

public Guardian(Location location) {
this.spawnLoc = location;
Expand Down Expand Up @@ -126,7 +126,9 @@ public static Guardian getGuardianFromList(LivingEntity entity) {
public void death() {
guardianList.remove(this);
this.bossBar.removeAll();

Bukkit.getScheduler().runTaskLater(Daedalus.getInstance(), () -> {

task = Bukkit.getScheduler().runTaskTimer(Daedalus.getInstance(), () -> {
if (this.spawnLoc.isChunkLoaded()) {
new Guardian(this.spawnLoc);
Expand Down

0 comments on commit cfe97b0

Please sign in to comment.