GhastTools: change scope getPlugin method
This commit is contained in:
@@ -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")
|
@SuppressWarnings("java:S112")
|
||||||
public YamlConfiguration loadConfig(boolean saveDefault) {
|
public YamlConfiguration loadConfig(boolean saveDefault) {
|
||||||
if (saveDefault) {
|
if (saveDefault) {
|
||||||
@@ -39,18 +53,4 @@ public class GhastTools {
|
|||||||
public YamlConfiguration loadConfig() {
|
public YamlConfiguration loadConfig() {
|
||||||
return loadConfig(true);
|
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;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user