File tree 1 file changed +14
-2
lines changed
src/main/java/net/ioixd/blackbox
1 file changed +14
-2
lines changed Original file line number Diff line number Diff line change 24
24
import org .bukkit .plugin .RegisteredListener ;
25
25
import org .jetbrains .annotations .NotNull ;
26
26
27
+ import net .ioixd .blackbox .Native ;
28
+
27
29
/**
28
30
* Represents a BlackBox plugin loader, allowing plugins in the form of .dll,
29
31
* .so, and .wasm
@@ -65,8 +67,18 @@ public Plugin loadPlugin(@NotNull final File file) throws InvalidPluginException
65
67
this .wasm = true ;
66
68
}
67
69
68
- Native .loadPlugin (library , this .wasm );
69
-
70
+ // Native.loadPlugin randomly gives a null pointer execption on every version of
71
+ // the plugin I've ever made, no matter what.
72
+ try {
73
+ // Getting the class manually
74
+ Class <?> cls = Class .forName ("net.ioixd.blackbox.Native" );
75
+ // Getting the method manually
76
+ Method kill = cls .getMethod ("loadPlugin" , String .class , boolean .class );
77
+ // Calling the method manually.
78
+ kill .invoke (null , library , this .wasm );
79
+ } catch (Exception e ) {
80
+ e .printStackTrace ();
81
+ }
70
82
server .getLogger ().info ("Loading native plugin " + libraryName );
71
83
72
84
BlackBoxPlugin plugin = new BlackBoxPlugin (libraryName ,
You can’t perform that action at this time.
0 commit comments