在boom的边缘悬崖勒马,太刺激了
某个类现在跑的更溜了 画了个假的饼
This commit is contained in:
@@ -101,11 +101,11 @@ public class Ref {
|
||||
|
||||
public static JavaPlugin getCallerPlugin(Class<?> callerClass) {
|
||||
try {
|
||||
Field pluginField = callerClass.getClassLoader().getClass().getDeclaredField("plugin");
|
||||
pluginField.setAccessible(true);
|
||||
return (JavaPlugin) pluginField.get(callerClass.getClassLoader());
|
||||
} catch (Exception ignored) {
|
||||
return JavaPlugin.getProvidingPlugin(callerClass);
|
||||
} catch (IllegalArgumentException ignored) {
|
||||
TLocale.Logger.error("LOCALE.CALLER-PLUGIN-NOT-FOUND", callerClass.getName());
|
||||
} catch (IllegalStateException e) {
|
||||
TLocale.Logger.error("LOCALE.STATIC-CLASS-LOADER", callerClass.getName());
|
||||
}
|
||||
return (JavaPlugin) Main.getInst();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user