0

GhastTools: change scope getPlugin method

This commit is contained in:
2021-01-01 18:59:13 +03:00
parent fa0159e7c7
commit 603aec8e45

View File

@@ -23,6 +23,20 @@ public class GhastTools {
}
}
@SuppressWarnings("java:S112")
public Plugin getPlugin() {
if (refPlugin == null) {
throw new RuntimeException("Plugin not set.");
}
Plugin plugin = refPlugin.get();
if (plugin == null) {
throw new RuntimeException("Plugin not set.");
}
return plugin;
}
@SuppressWarnings("java:S112")
public YamlConfiguration loadConfig(boolean saveDefault) {
if (saveDefault) {
@@ -39,18 +53,4 @@ public class GhastTools {
public YamlConfiguration loadConfig() {
return loadConfig(true);
}
@SuppressWarnings("java:S112")
Plugin getPlugin() {
if (refPlugin == null) {
throw new RuntimeException("Plugin not set.");
}
Plugin plugin = refPlugin.get();
if (plugin == null) {
throw new RuntimeException("Plugin not set.");
}
return plugin;
}
}