File tree Expand file tree Collapse file tree 1 file changed +11
-4
lines changed
src/main/java/io/github/syst3ms/skriptparser/registration Expand file tree Collapse file tree 1 file changed +11
-4
lines changed Original file line number Diff line number Diff line change 55import io .github .syst3ms .skriptparser .lang .Trigger ;
66
77import java .util .ArrayList ;
8+ import java .util .Collections ;
89import java .util .List ;
910
1011/**
1112 * The base for all addons, modules that hook into the API to register syntax and handle triggers.
1213 */
1314public abstract class SkriptAddon {
14- private static final List <SkriptAddon > addons = new ArrayList <>();
15- private String name ;
15+
1616 private final List <Class <? extends SkriptEvent >> handledEvents = new ArrayList <>();
17+ private static final List <SkriptAddon > ADDONS = new ArrayList <>();
1718
1819 {
19- addons .add (this );
20+ ADDONS .add (this );
2021 }
2122
23+ /**
24+ * Returns unmodifiable list of all SkriptAddons that are registered globally.
25+ *
26+ * @return SkriptAddons that are registered.
27+ */
2228 public static List <SkriptAddon > getAddons () {
23- return addons ;
29+ return Collections . unmodifiableList ( ADDONS ) ;
2430 }
2531
2632 /**
@@ -51,4 +57,5 @@ public final boolean canHandleEvent(SkriptEvent event) {
5157 void addHandledEvent (Class <? extends SkriptEvent > event ) {
5258 handledEvents .add (event );
5359 }
60+
5461}
You can’t perform that action at this time.
0 commit comments