Fix Hologram & TFunction Injector

This commit is contained in:
sky 2020-03-17 00:03:29 +08:00
parent 0899a6bad7
commit 345c8db233
2 changed files with 5 additions and 6 deletions

View File

@ -70,10 +70,10 @@ public abstract class PluginLoader {
// 保存数据 // 保存数据
Local.saveFiles(plugin.getName()); Local.saveFiles(plugin.getName());
Local.clearFiles(plugin.getName()); Local.clearFiles(plugin.getName());
// 注销监听器
TListenerHandler.cancelListener(plugin);
// 注销插件类 // 注销插件类
TabooLibLoader.unloadClass(plugin, TabooLibLoader.getPluginClassSafely(plugin)); TabooLibLoader.unloadClass(plugin, TabooLibLoader.getPluginClassSafely(plugin));
// 注销监听器
TListenerHandler.cancelListener(plugin);
// 释放文检读取 // 释放文检读取
Optional.ofNullable(TConfig.getFiles().remove(plugin.getName())).ifPresent(files -> files.forEach(file -> TConfigWatcher.getInst().removeListener(file))); Optional.ofNullable(TConfig.getFiles().remove(plugin.getName())).ifPresent(files -> files.forEach(file -> TConfigWatcher.getInst().removeListener(file)));
// 注销数据库连接 // 注销数据库连接

View File

@ -5,6 +5,7 @@ import com.google.common.collect.Queues;
import io.izzel.taboolib.TabooLib; import io.izzel.taboolib.TabooLib;
import io.izzel.taboolib.Version; import io.izzel.taboolib.Version;
import io.izzel.taboolib.module.inject.TListener; import io.izzel.taboolib.module.inject.TListener;
import io.izzel.taboolib.module.inject.TSchedule;
import io.izzel.taboolib.module.lite.SimpleReflection; import io.izzel.taboolib.module.lite.SimpleReflection;
import io.izzel.taboolib.module.nms.NMS; import io.izzel.taboolib.module.nms.NMS;
import io.izzel.taboolib.module.packet.Packet; import io.izzel.taboolib.module.packet.Packet;
@ -210,11 +211,9 @@ class THologramHandler implements Listener {
THologram.refresh(e.getPlayer()); THologram.refresh(e.getPlayer());
} }
@EventHandler @TSchedule(period = 200, async = true)
public void e(PlayerMoveEvent e) { public void e(PlayerMoveEvent e) {
if (!e.getFrom().getBlock().equals(e.getTo().getBlock())) { Bukkit.getOnlinePlayers().forEach(THologram::refresh);
Bukkit.getScheduler().runTaskAsynchronously(TabooLib.getPlugin(), () -> THologram.refresh(e.getPlayer()));
}
} }
// ********************************* // *********************************