File tree Expand file tree Collapse file tree 3 files changed +12
-15
lines changed
org/mangorage/mangobotcore/plugin/internal Expand file tree Collapse file tree 3 files changed +12
-15
lines changed Original file line number Diff line number Diff line change @@ -52,16 +52,13 @@ repositories {
5252 maven {
5353 url ' https://jitpack.io'
5454 }
55- maven {
56- url = " https://maven.minecraftforge.net/"
57- }
5855}
5956
6057
6158dependencies {
6259
6360 installer(' org.mangorage:installer:4.0.13' )
64- bootstrap(" org.mangorage:mangobotbootstrap:1.0.18 " )
61+ bootstrap(" org.mangorage:mangobotbootstrap:1.0.19 " )
6562
6663 library(' io.github.classgraph:classgraph:4.8.162' )
6764 library(' org.mangorage:scanner:1.1.3' )
Original file line number Diff line number Diff line change 2727
2828 exports org .mangorage .entrypoint ;
2929
30- exports org .mangorage .mangobotcore .plugin .internal to com .google .gson ;
31- exports org .mangorage .mangobotcore .plugin .internal .dependency to com .google .gson ;
30+ exports org .mangorage .mangobotcore .plugin .internal ;
31+ exports org .mangorage .mangobotcore .plugin .internal .dependency ;
32+
33+ opens org .mangorage .mangobotcore .plugin .internal ;
34+ opens org .mangorage .mangobotcore .plugin .internal .dependency ;
35+
36+ exports org .mangorage .mangobotcore ;
3237
3338 provides org .mangorage .mangobotcore .plugin .api .Plugin with org .mangorage .mangobotcore .MangoBotCore ;
3439 uses org .mangorage .mangobotcore .plugin .api .Plugin ;
Original file line number Diff line number Diff line change @@ -44,16 +44,11 @@ public void load() {
4444 LogHelper .info ("Gathering Plugin Info..." );
4545 LibraryManager <PluginContainerImpl > manager = new LibraryManager <>();
4646
47- List <Class <?>> scanner = new ArrayList <>();
47+ Scanner scanner = ScannerBuilder .of ()
48+ .addClassloader ((URLClassLoader ) PluginManagerImpl .class .getClassLoader ())
49+ .build ();
4850
49- ServiceLoader .load (PluginContainerImpl .class .getModule ().getLayer (), Plugin .class )
50- .stream ()
51- .forEach (p -> {
52- scanner .add (p .type ());
53- System .out .println ("Found Service: " + p .type ().getName ());
54- });
55-
56- scanner
51+ scanner .findClassesWithAnnotation (MangoBotPlugin .class )
5752 .forEach (clz -> {
5853 var annotation = clz .getAnnotation (MangoBotPlugin .class );
5954 if (Plugin .class .isAssignableFrom (clz )) {
You can’t perform that action at this time.
0 commit comments