TabooLib v4.27
+ 修复 TFunction 注解会因为 onEnable/onDisable 方法不存在而报错的问题。 + 优化 TabooLibServer 模块,现在可以在服务器内启动终端,不需要另外运行插件。 + 优化 PacketParser 模块,现在会自动注册含有 @PacketType 注解的类,和 @TListener 一样方便。 + 增加 @PacketValue 注解,使用该直接的成员变量会被自动序列化。 “最近开发的机器人用到了通讯网,所以本次更新对该模块进行了反复测试和优化”
This commit is contained in:
@@ -40,14 +40,10 @@ public class TFunctionLoader implements Listener {
|
||||
TFunction function = (TFunction) pluginClass.getAnnotation(TFunction.class);
|
||||
try {
|
||||
Method method = pluginClass.getDeclaredMethod(function.enable());
|
||||
if (method == null) {
|
||||
continue;
|
||||
}
|
||||
method.setAccessible(true);
|
||||
method.invoke(pluginClass.newInstance());
|
||||
pluginFunction.computeIfAbsent(plugin.getName(), name -> new ArrayList<>()).add(pluginClass);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
} catch (Exception ignored) {
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -65,13 +61,9 @@ public class TFunctionLoader implements Listener {
|
||||
TFunction function = (TFunction) pluginClass.getAnnotation(TFunction.class);
|
||||
try {
|
||||
Method method = pluginClass.getDeclaredMethod(function.disable());
|
||||
if (method == null) {
|
||||
continue;
|
||||
}
|
||||
method.setAccessible(true);
|
||||
method.invoke(pluginClass.newInstance());
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
} catch (Exception ignored) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user