Skip to content

Commit f453695

Browse files
committed
crash bandicoot 2 gringo stake house
1 parent c2aece5 commit f453695

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

src/main/java/net/ioixd/blackbox/BlackBoxPluginLoader.java

+14-2
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@
2424
import org.bukkit.plugin.RegisteredListener;
2525
import org.jetbrains.annotations.NotNull;
2626

27+
import net.ioixd.blackbox.Native;
28+
2729
/**
2830
* Represents a BlackBox plugin loader, allowing plugins in the form of .dll,
2931
* .so, and .wasm
@@ -65,8 +67,18 @@ public Plugin loadPlugin(@NotNull final File file) throws InvalidPluginException
6567
this.wasm = true;
6668
}
6769

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+
}
7082
server.getLogger().info("Loading native plugin " + libraryName);
7183

7284
BlackBoxPlugin plugin = new BlackBoxPlugin(libraryName,

0 commit comments

Comments
 (0)