File tree Expand file tree Collapse file tree 1 file changed +46
-0
lines changed
src/main/java/me/hsgamer/bettergui/util Expand file tree Collapse file tree 1 file changed +46
-0
lines changed Original file line number Diff line number Diff line change 1+ package me .hsgamer .bettergui .util ;
2+
3+ import io .github .projectunified .minelib .scheduler .async .AsyncScheduler ;
4+ import io .github .projectunified .minelib .scheduler .entity .EntityScheduler ;
5+ import io .github .projectunified .minelib .scheduler .global .GlobalScheduler ;
6+ import org .bukkit .entity .Entity ;
7+ import org .bukkit .plugin .Plugin ;
8+ import org .bukkit .plugin .java .JavaPlugin ;
9+
10+ /**
11+ * The utility class for the scheduler
12+ */
13+ public class SchedulerUtil {
14+ private static Plugin getProvidingPlugin () {
15+ return JavaPlugin .getProvidingPlugin (SchedulerUtil .class );
16+ }
17+
18+ /**
19+ * Get the global scheduler
20+ *
21+ * @return the global scheduler
22+ */
23+ public static GlobalScheduler global () {
24+ return GlobalScheduler .get (getProvidingPlugin ());
25+ }
26+
27+ /**
28+ * Get the async scheduler
29+ *
30+ * @return the async scheduler
31+ */
32+ public static AsyncScheduler async () {
33+ return AsyncScheduler .get (getProvidingPlugin ());
34+ }
35+
36+ /**
37+ * Get the entity scheduler
38+ *
39+ * @param entity the entity
40+ *
41+ * @return the entity scheduler
42+ */
43+ public static EntityScheduler entity (Entity entity ) {
44+ return EntityScheduler .get (getProvidingPlugin (), entity );
45+ }
46+ }
You can’t perform that action at this time.
0 commit comments