Add messages to exception
This commit is contained in:
parent
8b4a334873
commit
01a4ce3496
@ -97,9 +97,11 @@ public class ServerUtils {
|
|||||||
Class<?> clClass = classLoader.getClass();
|
Class<?> clClass = classLoader.getClass();
|
||||||
try {
|
try {
|
||||||
Class<?> pluginClassLoader = checkNotNull(Reflect.getClass(
|
Class<?> pluginClassLoader = checkNotNull(Reflect.getClass(
|
||||||
"org.bukkit.plugin.java.PluginClassLoader"));
|
"org.bukkit.plugin.java.PluginClassLoader"),
|
||||||
|
"Couldn't find org.bukkit.plugin.java.PluginClassLoader class");
|
||||||
if(pluginClassLoader.isAssignableFrom(clClass)){
|
if(pluginClassLoader.isAssignableFrom(clClass)){
|
||||||
Field classesField = checkNotNull(Reflect.getField(clClass, "classes"));
|
Field classesField = checkNotNull(Reflect.getField(clClass, "classes"),
|
||||||
|
"Failed to get classes field");
|
||||||
return (Map<String, Class<?>>) checkNotNull(Reflect.readField(classesField, classLoader));
|
return (Map<String, Class<?>>) checkNotNull(Reflect.readField(classesField, classLoader));
|
||||||
} else {
|
} else {
|
||||||
throw new RuntimeException(
|
throw new RuntimeException(
|
||||||
|
Loading…
Reference in New Issue
Block a user