Signed-off-by: 502647092 <admin@yumc.pw>

This commit is contained in:
502647092 2016-06-30 14:26:41 +08:00
parent 4ef3f38624
commit b3dea9a5e3
3 changed files with 6 additions and 2 deletions

View File

@ -3,7 +3,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>pw.yumc</groupId>
<artifactId>Yum</artifactId>
<version>2.3</version>
<version>2.4</version>
<name>Yum</name>
<description>Minecraft 服务器插件管理系统</description>
<build>
@ -60,6 +60,7 @@
<properties>
<update.description>&amp;a全新 2.X 版本 更多守护与优化</update.description>
<update.changes>
&amp;b2.4 &amp;6- &amp;c修复重载插件导致线程安全错误的问题...;
&amp;b2.3 &amp;6- &amp;a网络监控添加域名白名单功能...;
&amp;b2.2 &amp;6- &amp;b新增线程安全拦截 主线程IO拦截...;
&amp;b2.1 &amp;6- &amp;e新增网络管理 防止主线程卡IO...;

View File

@ -92,7 +92,7 @@ public class Yum extends JavaPlugin {
new PluginNetworkListener(this);
PluginKit.scp("§a网络管理系统已启用...");
}
if (ConfigManager.i().isThreadSafe()) {
if (ConfigManager.i().isThreadSafe() && Bukkit.isPrimaryThread()) {
new ThreadSafetyListener(this);
PluginKit.scp("§a线程管理系统已启用...");
}

View File

@ -73,10 +73,12 @@ public class ThreadSafetyListener implements Listener {
checkSafety(teleportEvent);
}
@EventHandler
public void onPluginDisable(final PluginDisableEvent pluginDisableEvent) {
checkSafety(pluginDisableEvent);
}
@EventHandler
public void onPluginEnable(final PluginEnableEvent pluginEnableEvent) {
checkSafety(pluginEnableEvent);
}
@ -86,6 +88,7 @@ public class ThreadSafetyListener implements Listener {
checkSafety(worldLoadEvent);
}
@EventHandler
public void onWorldSave(final WorldSaveEvent worldSaveEvent) {
checkSafety(worldSaveEvent);
}