1
0
mirror of https://github.com/Suiranoil/SkinRestorer.git synced 2026-01-16 04:42:12 +00:00

allow canceling tasks by id

This commit is contained in:
2025-03-27 18:25:41 +03:00
parent 364ca540be
commit 6fbc53e38b
2 changed files with 7 additions and 0 deletions

View File

@@ -121,6 +121,8 @@ public final class SkinRestorer {
PlayerUtils.refreshPlayer(player);
acceptedPlayers.add(player);
SkinRestorer.getTickedScheduler().cancel(player.getUUID());
}
return acceptedPlayers;

View File

@@ -28,6 +28,11 @@ public class TickedScheduler implements Runnable {
this.queue.add(new TickTask(serverTick, serverTick + delay, taskId, task));
}
public void cancel(Object id) {
var taskId = id.hashCode();
this.idMap.remove(taskId);
}
@Override
public void run() {
TickTask nextTask;