mirror of
https://e.coding.net/circlecloud/YumCore.git
synced 2024-11-22 01:48:50 +00:00
feat: 自动初始化调试输出
Signed-off-by: 502647092 <admin@yumc.pw>
This commit is contained in:
parent
fbe19de5db
commit
b307dcbb62
@ -33,12 +33,12 @@ public class P {
|
|||||||
field.setAccessible(true);
|
field.setAccessible(true);
|
||||||
instance = (JavaPlugin) field.get(pluginClassLoader);
|
instance = (JavaPlugin) field.get(pluginClassLoader);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
Log.d(e);
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
getInjectConfigMethod = instance.getClass().getMethod("get" + instance.getName() + "Config");
|
getInjectConfigMethod = instance.getClass().getMethod("get" + instance.getName() + "Config");
|
||||||
} catch (NoSuchMethodException e) {
|
} catch (NoSuchMethodException e) {
|
||||||
e.printStackTrace();
|
Log.d(e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -57,7 +57,6 @@ public class P {
|
|||||||
* 配置源类型
|
* 配置源类型
|
||||||
* @return 获得插件配置文件
|
* @return 获得插件配置文件
|
||||||
*/
|
*/
|
||||||
@SuppressWarnings("unchecked")
|
|
||||||
public static <FC> FC getConfig() {
|
public static <FC> FC getConfig() {
|
||||||
return (FC) instance.getConfig();
|
return (FC) instance.getConfig();
|
||||||
}
|
}
|
||||||
@ -67,7 +66,6 @@ public class P {
|
|||||||
* 注入配置源类型
|
* 注入配置源类型
|
||||||
* @return 获得插件注入配置
|
* @return 获得插件注入配置
|
||||||
*/
|
*/
|
||||||
@SuppressWarnings("unchecked")
|
|
||||||
public static <FC> FC getInjectConfig() {
|
public static <FC> FC getInjectConfig() {
|
||||||
try {
|
try {
|
||||||
return (FC) getInjectConfigMethod.invoke(instance);
|
return (FC) getInjectConfigMethod.invoke(instance);
|
||||||
@ -109,7 +107,6 @@ public class P {
|
|||||||
* 插件源类型
|
* 插件源类型
|
||||||
* @return 获得插件
|
* @return 获得插件
|
||||||
*/
|
*/
|
||||||
@SuppressWarnings("unchecked")
|
|
||||||
public static <PI> PI getPlugin() {
|
public static <PI> PI getPlugin() {
|
||||||
return (PI) instance;
|
return (PI) instance;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user