Skip to content

Commit 4414175

Browse files
[1.13.12.0]更改load/enable/reload/disable方法命名,添加when前缀,避免混淆方法作用
1 parent 9e35c9b commit 4414175

File tree

4 files changed

+25
-25
lines changed

4 files changed

+25
-25
lines changed

build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
java.sourceCompatibility = JavaVersion.VERSION_1_8
22
java.targetCompatibility = JavaVersion.VERSION_1_8
33
rootProject.group = "com.crypticlib"
4-
rootProject.version = "1.13.11.0"
4+
rootProject.version = "1.13.12.0"
55
//全项目重构时更新大版本号
66
//添加模块或有较大更改时更新次版本号
77
//有API变动(新增/删除/更改声明)时更新修订号

platform/bukkit/src/main/java/crypticlib/BukkitPlugin.java

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ public final void onLoad() {
6060
configContainer.reload();
6161
}
6262
);
63-
load();
63+
whenLoad();
6464
runLifeCycleTasks(LifeCycle.LOAD);
6565
}
6666

@@ -105,7 +105,7 @@ public final void onEnable() {
105105
}
106106
}
107107
);
108-
enable();
108+
whenEnable();
109109
runLifeCycleTasks(LifeCycle.ENABLE);
110110
CrypticLibBukkit.scheduler().sync(() -> {
111111
runLifeCycleTasks(LifeCycle.ACTIVE);
@@ -118,36 +118,36 @@ public final void onDisable() {
118118
configContainerMap.clear();
119119
BukkitCommandManager.INSTANCE.unregisterAll();
120120
CrypticLibBukkit.scheduler().cancelTasks();
121-
disable();
121+
whenDisable();
122122
}
123123

124124
/**
125125
* 插件开始加载时执行的方法
126126
*/
127-
public void load() {
127+
public void whenLoad() {
128128

129129
}
130130

131131
/**
132132
* 插件开始启用时执行的方法
133133
*/
134-
public void enable() {
134+
public void whenEnable() {
135135
}
136136

137137
/**
138138
* 插件卸载时执行的方法
139139
*/
140-
public void disable() {
140+
public void whenDisable() {
141141
}
142142

143143
/**
144144
* 插件重载时执行的方法,会在LifecycleTask之前执行
145145
*/
146-
public void reload() {}
146+
public void whenReload() {}
147147

148148
public final void reloadPlugin() {
149149
reloadConfig();
150-
reload();
150+
whenReload();
151151
runLifeCycleTasks(LifeCycle.RELOAD);
152152
}
153153

platform/bungee/src/main/java/crypticlib/BungeePlugin.java

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ public final void onLoad() {
5959
configContainer.reload();
6060
}
6161
);
62-
load();
62+
whenLoad();
6363
runLifeCycleTasks(LifeCycle.LOAD);
6464
}
6565

@@ -104,7 +104,7 @@ public final void onEnable() {
104104
}
105105
}
106106
);
107-
enable();
107+
whenEnable();
108108
runLifeCycleTasks(LifeCycle.ENABLE);
109109
getProxy().getScheduler().runAsync(this, () -> runLifeCycleTasks(LifeCycle.ACTIVE));
110110
}
@@ -115,36 +115,36 @@ public final void onDisable() {
115115
configContainerMap.clear();
116116
BungeeCommandManager.INSTANCE.unregisterAll();
117117
getProxy().getScheduler().cancel(this);
118-
disable();
118+
whenDisable();
119119
}
120120

121121
/**
122122
* 插件开始加载时执行的方法
123123
*/
124-
public void load() {
124+
public void whenLoad() {
125125

126126
}
127127

128128
/**
129129
* 插件开始启用时执行的方法
130130
*/
131-
public void enable() {
131+
public void whenEnable() {
132132
}
133133

134134
/**
135135
* 插件卸载时执行的方法
136136
*/
137-
public void disable() {
137+
public void whenDisable() {
138138
}
139139

140140
/**
141141
* 插件重载时执行的方法,会在LifecycleTask之前执行
142142
*/
143-
public void reload() {}
143+
public void whenReload() {}
144144

145145
public final void reloadPlugin() {
146146
reloadConfig();
147-
reload();
147+
whenReload();
148148
runLifeCycleTasks(LifeCycle.RELOAD);
149149
}
150150

platform/velocity/src/main/java/crypticlib/VelocityPlugin.java

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ public final void onProxyInitialization(ProxyInitializeEvent event) {
7575
configContainer.reload();
7676
}
7777
);
78-
load();
78+
whenLoad();
7979
runLifeCycleTasks(LifeCycle.LOAD);
8080

8181
//Enable 阶段
@@ -116,7 +116,7 @@ public final void onProxyInitialization(ProxyInitializeEvent event) {
116116
}
117117
}
118118
);
119-
enable();
119+
whenEnable();
120120
runLifeCycleTasks(LifeCycle.ENABLE);
121121
proxyServer.getScheduler().buildTask(this, () -> runLifeCycleTasks(LifeCycle.ACTIVE)).schedule();
122122
}
@@ -129,23 +129,23 @@ public final void onProxyShutdown(ProxyShutdownEvent event) {
129129
for (ScheduledTask scheduledTask : proxyServer.getScheduler().tasksByPlugin(this)) {
130130
scheduledTask.cancel();
131131
}
132-
disable();
132+
whenDisable();
133133
}
134134

135-
public void load() {}
135+
public void whenLoad() {}
136136

137-
public void enable() {}
137+
public void whenEnable() {}
138138

139-
public void disable() {}
139+
public void whenDisable() {}
140140

141141
/**
142142
* 插件重载时执行的方法,会在LifecycleTask之前执行
143143
*/
144-
public void reload() {}
144+
public void whenReload() {}
145145

146146
public final void reloadPlugin() {
147147
reloadConfig();
148-
reload();
148+
whenReload();
149149
runLifeCycleTasks(LifeCycle.RELOAD);
150150
}
151151

0 commit comments

Comments
 (0)