Skip to content

Commit

Permalink
fix: block updater needing to run at location
Browse files Browse the repository at this point in the history
  • Loading branch information
Quagington committed Dec 8, 2024
1 parent 907fed9 commit b8eab41
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package be.isach.ultracosmetics.util;

import be.isach.ultracosmetics.task.UltraTask;
import org.bukkit.Location;
import org.bukkit.block.Block;
import org.bukkit.entity.Player;

Expand Down Expand Up @@ -31,7 +32,9 @@ public void run() {

@Override
public void schedule() {
task = getScheduler().runLaterAsync(this::run, delay);
if (blocks.isEmpty()) return;
Location location = blocks.iterator().next().getLocation();
task = getScheduler().runAtLocationLater(location, this::run, delay);
}

public static boolean isUpdating(Block block) {
Expand Down

0 comments on commit b8eab41

Please sign in to comment.