We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 51aff8f commit 2d79031Copy full SHA for 2d79031
invui-core/src/main/java/xyz/xenondevs/invui/InvUI.java
@@ -31,7 +31,7 @@ private InvUI() {
31
32
public @NotNull Plugin getPlugin() {
33
if (plugin == null) {
34
- plugin = tryFindPlugin();
+ setPlugin(tryFindPlugin());
35
36
if (plugin == null)
37
throw new IllegalStateException("Plugin is not set. Set it using InvUI.getInstance().setPlugin(plugin);");
@@ -60,6 +60,9 @@ public void setPlugin(@NotNull Plugin plugin) {
60
if (this.plugin != null)
61
throw new IllegalStateException("Plugin is already set");
62
63
+ if (plugin == null)
64
+ return;
65
+
66
Bukkit.getPluginManager().registerEvents(this, plugin);
67
this.plugin = plugin;
68
}
0 commit comments