Skip to content
This repository was archived by the owner on Jun 15, 2023. It is now read-only.

Commit c0f21df

Browse files
committed
Removed runningTasks ArrayList
Fixes #14
1 parent 5bb8ba9 commit c0f21df

2 files changed

Lines changed: 1 addition & 11 deletions

File tree

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<modelVersion>4.0.0</modelVersion>
77
<groupId>xyz.xenondevs</groupId>
88
<artifactId>particle</artifactId>
9-
<version>1.6.2</version>
9+
<version>1.6.3</version>
1010
<packaging>jar</packaging>
1111

1212
<name>ParticleLib</name>

src/main/java/xyz/xenondevs/particle/task/TaskManager.java

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@
2929
import xyz.xenondevs.particle.utils.ParticleUtils;
3030
import xyz.xenondevs.particle.utils.ReflectionUtils;
3131

32-
import java.util.ArrayList;
3332
import java.util.Collection;
3433
import java.util.List;
3534
import java.util.UUID;
@@ -49,11 +48,6 @@ public final class TaskManager {
4948
*/
5049
private final static TaskManager INSTANCE = new TaskManager();
5150

52-
/**
53-
* A list of IDs of the currently running tasks
54-
*/
55-
private final List<Integer> runningTasks = new ArrayList<>();
56-
5751
/**
5852
* Private constructor because this is a singleton class.
5953
*/
@@ -72,7 +66,6 @@ public int startTask(ParticleTask task) {
7266
int taskId = Bukkit.getScheduler().runTaskTimerAsynchronously(ReflectionUtils.PLUGIN, () -> {
7367
ParticleUtils.sendBulk(task.getPackets(), task.getTargetPlayers());
7468
}, 0, task.getTickDelay()).getTaskId();
75-
runningTasks.add(taskId);
7669

7770
return taskId;
7871
}
@@ -83,10 +76,7 @@ public int startTask(ParticleTask task) {
8376
* @param taskId the id of the task to be stopped.
8477
*/
8578
public void stopTask(int taskId) {
86-
if (!runningTasks.contains(taskId))
87-
return;
8879
Bukkit.getScheduler().cancelTask(taskId);
89-
runningTasks.remove(taskId);
9080
}
9181

9282
/**

0 commit comments

Comments
 (0)