File tree Expand file tree Collapse file tree 6 files changed +12
-6
lines changed
bukkit/src/main/java/crypticlib
bungee/src/main/java/crypticlib
common/src/main/java/crypticlib
velocity/src/main/java/crypticlib Expand file tree Collapse file tree 6 files changed +12
-6
lines changed Original file line number Diff line number Diff line change 11java.sourceCompatibility = JavaVersion .VERSION_1_8
22java.targetCompatibility = JavaVersion .VERSION_1_8
33rootProject.group = " com.crypticlib"
4- rootProject.version = " 1.13.13.0 "
4+ rootProject.version = " 1.13.13.1 "
55// 全项目重构时更新大版本号
66// 添加模块或有较大更改时更新次版本号
77// 有API变动(新增/删除/更改声明)时更新修订号
Original file line number Diff line number Diff line change @@ -58,6 +58,7 @@ public final void onLoad() {
5858 BukkitConfigContainer configContainer = new BukkitConfigContainer (configClass , configWrapper );
5959 configContainerMap .put (configClass , configContainer );
6060 configContainer .reload ();
61+ IOHelper .debug ("Loaded config file: " + path );
6162 }
6263 );
6364 whenLoad ();
@@ -74,6 +75,7 @@ public final void onEnable() {
7475 }
7576 Listener listener = (Listener ) ReflectionHelper .getSingletonClassInstance (listenerClass );
7677 Bukkit .getPluginManager ().registerEvents (listener , this );
78+ IOHelper .debug ("Registered listener for class: " + listenerClass .getName ());
7779 } catch (ClassNotFoundException | NoClassDefFoundError e ) {
7880 EventListener annotation = listenerClass .getAnnotation (EventListener .class );
7981 if (!annotation .ignoreClassNotFound ()) {
@@ -96,6 +98,7 @@ public final void onEnable() {
9698 }
9799 CommandTree commandTree = (CommandTree ) ReflectionHelper .getSingletonClassInstance (commandClass );
98100 commandTree .register ();
101+ IOHelper .debug ("Registered command `" + commandTree .commandInfo ().name () + "`, handler class: " + commandTree .getClass ().getName ());
99102 } catch (ClassNotFoundException | NoClassDefFoundError e ) {
100103 if (!annotation .ignoreClassNotFound ()) {
101104 e .printStackTrace ();
Original file line number Diff line number Diff line change @@ -57,6 +57,7 @@ public final void onLoad() {
5757 BungeeConfigContainer configContainer = new BungeeConfigContainer (configClass , configWrapper );
5858 configContainerMap .put (configClass , configContainer );
5959 configContainer .reload ();
60+ IOHelper .debug ("Loaded config file: " + path );
6061 }
6162 );
6263 whenLoad ();
@@ -73,6 +74,7 @@ public final void onEnable() {
7374 }
7475 Listener listener = (Listener ) ReflectionHelper .getSingletonClassInstance (listenerClass );
7576 getProxy ().getPluginManager ().registerListener (this , listener );
77+ IOHelper .debug ("Registered listener for class: " + listenerClass .getName ());
7678 } catch (ClassNotFoundException | NoClassDefFoundError e ) {
7779 EventListener annotation = listenerClass .getAnnotation (EventListener .class );
7880 if (!annotation .ignoreClassNotFound ()) {
@@ -95,6 +97,7 @@ public final void onEnable() {
9597 }
9698 CommandTree commandTree = (CommandTree ) ReflectionHelper .getSingletonClassInstance (commandClass );
9799 commandTree .register ();
100+ IOHelper .debug ("Registered command `" + commandTree .commandInfo ().name () + "`, handler class: " + commandTree .getClass ().getName ());
98101 } catch (ClassNotFoundException | NoClassDefFoundError e ) {
99102 if (!annotation .ignoreClassNotFound ()) {
100103 e .printStackTrace ();
Original file line number Diff line number Diff line change 1212 */
1313public class CommandTree extends CommandNode {
1414
15- private boolean registered = false ;
16-
1715 public CommandTree (@ NotNull CommandInfo commandInfo ) {
1816 super (commandInfo );
1917 }
@@ -40,12 +38,9 @@ public CommandTree regSub(@NotNull CommandNode commandNode) {
4038 }
4139
4240 public final void register () {
43- if (registered )
44- throw new UnsupportedOperationException ("Cannot register a command repeatedly" );
4541 scanSubCommands ();
4642 registerPerms ();
4743 CrypticLib .commandManager ().register (this );
48- registered = true ;
4944 }
5045
5146}
Original file line number Diff line number Diff line change 11package crypticlib .internal ;
22
3+ import crypticlib .util .IOHelper ;
34import org .jetbrains .annotations .NotNull ;
45
56import java .io .File ;
@@ -47,6 +48,7 @@ public void scanJar(@NotNull JarFile jarFile) {
4748 .replace ('/' , '.' )
4849 .substring (0 , entry .getName ().length () - 6 );
4950 Class <?> clazz = classLoader .loadClass (className );
51+ IOHelper .debug ("Loaded class: " + className );
5052 pluginClassMap .put (className , clazz );
5153 //添加注解缓存
5254 for (Annotation annotation : clazz .getAnnotations ()) {
Original file line number Diff line number Diff line change @@ -73,6 +73,7 @@ public final void onProxyInitialization(ProxyInitializeEvent event) {
7373 VelocityConfigContainer configContainer = new VelocityConfigContainer (configClass , configWrapper );
7474 configContainerMap .put (configClass , configContainer );
7575 configContainer .reload ();
76+ IOHelper .debug ("Loaded config file: " + path );
7677 }
7778 );
7879 whenLoad ();
@@ -84,6 +85,7 @@ public final void onProxyInitialization(ProxyInitializeEvent event) {
8485 try {
8586 Object listener = ReflectionHelper .getSingletonClassInstance (listenerClass );
8687 proxyServer .getEventManager ().register (this , listener );
88+ IOHelper .debug ("Registered listener for class: " + listenerClass .getName ());
8789 } catch (ClassNotFoundException | NoClassDefFoundError e ) {
8890 EventListener annotation = listenerClass .getAnnotation (EventListener .class );
8991 if (!annotation .ignoreClassNotFound ()) {
@@ -107,6 +109,7 @@ public final void onProxyInitialization(ProxyInitializeEvent event) {
107109 }
108110 CommandTree commandTree = (CommandTree ) ReflectionHelper .getSingletonClassInstance (commandClass );
109111 commandTree .register ();
112+ IOHelper .debug ("Registered command `" + commandTree .commandInfo ().name () + "`, handler class: " + commandTree .getClass ().getName ());
110113 } catch (ClassNotFoundException | NoClassDefFoundError e ) {
111114 if (!annotation .ignoreClassNotFound ()) {
112115 e .printStackTrace ();
You can’t perform that action at this time.
0 commit comments