Skip to content

Commit ec14288

Browse files
committed
Removed useless methods of task scheduling
1 parent 97fce22 commit ec14288

File tree

3 files changed

+0
-49
lines changed

3 files changed

+0
-49
lines changed

bukkit/src/main/java/it/renvins/serverpulse/bukkit/scheduler/BukkitTaskScheduler.java

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -22,23 +22,8 @@ public void runAsync(Runnable task) {
2222
plugin.getServer().getScheduler().runTaskAsynchronously(plugin, task);
2323
}
2424

25-
@Override
26-
public Task runTaskTimer(Runnable task, long delayTicks, long periodTicks) {
27-
return new BukkitTaskWrapper(plugin.getServer().getScheduler().runTaskTimer(plugin, task, delayTicks, periodTicks));
28-
}
29-
3025
@Override
3126
public Task runTaskTimerAsync(Runnable task, long delayTicks, long periodTicks) {
3227
return new BukkitTaskWrapper(plugin.getServer().getScheduler().runTaskTimerAsynchronously(plugin, task, delayTicks, periodTicks));
3328
}
34-
35-
@Override
36-
public Task runTaskLater(Runnable task, long delayTicks) {
37-
return new BukkitTaskWrapper(plugin.getServer().getScheduler().runTaskLater(plugin, task, delayTicks));
38-
}
39-
40-
@Override
41-
public Task runTaskLaterAsync(Runnable task, long delayTicks) {
42-
return new BukkitTaskWrapper(plugin.getServer().getScheduler().runTaskLaterAsynchronously(plugin, task, delayTicks));
43-
}
4429
}

common/src/main/java/it/renvins/serverpulse/common/scheduler/TaskScheduler.java

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -14,26 +14,6 @@ default void runSync(Runnable task) {
1414
throw new UnsupportedOperationException("Synchronous task execution is not supported.");
1515
}
1616

17-
/**
18-
* Runs a task timer synchronously on the main thread.
19-
*
20-
* @param task The task to run
21-
* @throws UnsupportedOperationException if the implementation does not support synchronous task execution
22-
*/
23-
default Task runTaskTimer(Runnable task, long delayTicks, long periodTicks) {
24-
throw new UnsupportedOperationException("Synchronous task execution is not supported.");
25-
}
26-
27-
/**
28-
* Runs a task later synchronously on the main thread.
29-
*
30-
* @param task The task to run
31-
* @throws UnsupportedOperationException if the implementation does not support synchronous task execution
32-
*/
33-
default Task runTaskLater(Runnable task, long delayTicks) {
34-
throw new UnsupportedOperationException("Synchronous task execution is not supported.");
35-
}
36-
3717
/**
3818
* Runs a task asynchronously on a separate thread.
3919
*
@@ -49,13 +29,6 @@ default Task runTaskLater(Runnable task, long delayTicks) {
4929
*/
5030
Task runTaskTimerAsync(Runnable task, long delayTicks, long periodTicks);
5131

52-
/**
53-
* Runs a task later asynchronously on a separate thread.
54-
*
55-
* @param task The task to run
56-
* @return A Task object representing the task
57-
*/
58-
Task runTaskLaterAsync(Runnable task, long delayTicks);
5932

6033
/**
6134
* Returns an Executor that runs tasks synchronously on the main thread

velocity/src/main/java/it/renvins/serverpulse/velocity/scheduler/VelocityTaskScheduler.java

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,4 @@ public Task runTaskTimerAsync(Runnable task, long delayTicks, long periodTicks)
2424
.repeat(periodTicks / 20, TimeUnit.SECONDS)
2525
.schedule());
2626
}
27-
28-
@Override
29-
public Task runTaskLaterAsync(Runnable task, long delayTicks) {
30-
return new VelocityTaskWrapper(plugin.getServer().getScheduler().buildTask(plugin, task)
31-
.delay(delayTicks / 20, TimeUnit.SECONDS)
32-
.schedule());
33-
}
3427
}

0 commit comments

Comments
 (0)