diff --git a/src/main/scala/io/izzel/taboolib/util/lite/Catchers.java b/src/main/scala/io/izzel/taboolib/util/lite/Catchers.java index ff04a86..d95120d 100644 --- a/src/main/scala/io/izzel/taboolib/util/lite/Catchers.java +++ b/src/main/scala/io/izzel/taboolib/util/lite/Catchers.java @@ -1,18 +1,21 @@ package io.izzel.taboolib.util.lite; import io.izzel.taboolib.TabooLib; +import io.izzel.taboolib.module.inject.PlayerContainer; +import io.izzel.taboolib.module.inject.TListener; import org.bukkit.Bukkit; import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; import org.bukkit.event.Listener; import org.bukkit.event.player.AsyncPlayerChatEvent; -import org.bukkit.event.player.PlayerQuitEvent; import java.util.HashMap; import java.util.LinkedList; +@TListener public class Catchers implements Listener { + @PlayerContainer private static HashMap> playerdata = new HashMap<>(); public static HashMap> getPlayerdata() { @@ -30,11 +33,6 @@ public class Catchers implements Listener { playerdata.get(player.getName()).add(catcher.before()); } - @EventHandler - public void quit(PlayerQuitEvent e) { - playerdata.remove(e.getPlayer().getName()); - } - @EventHandler public void chat(AsyncPlayerChatEvent e) { if (playerdata.containsKey(e.getPlayer().getName()) && contains(e.getPlayer())) {