-Added timerIds() function, listing all active timer IDs
This commit is contained in:
Luis C.M committed 2023-01-03 19:30:15 -06:00
1 parent b167755cc0
commit d2611385de
2 files changed
+10 -1

No files matched your search

+1 -1
Submodule src/api updated: ceaffeb044...3686b6028f.
@@ -25,6 +25,15 @@ public class DataTimers implements ITimers {
this.parent = parent;
}
public int[] timerIds() {
Integer[] ids = timers.keySet().toArray(new Integer[0]);
int[] intIds = new int[ids.length];
for (int i = 0; i < ids.length; i++) {
intIds[i] = ids[i];
}
return intIds;
}
public void start(int id, int ticks, boolean repeat) {
if(this.timers.containsKey(id)) {
throw new CustomNPCsException("There is already a timer with id: " + id);