mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-12 06:07:27 +00:00
ITimers:
-Added timerIds() function, listing all active timer IDs
This commit is contained in:
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);
|
||||
|
||||
Reference in new issue
Block a user