diff --git a/pom.xml b/pom.xml index 248476d..824dc5c 100644 --- a/pom.xml +++ b/pom.xml @@ -101,14 +101,14 @@ com.github.cryptomorin XSeries 11.3.0 - compile + provided xyz.refinedev.api SkinAPI 1.0 - compile + provided diff --git a/src/main/java/xyz/refinedev/api/tablist/listener/TeamsPacketListener.java b/src/main/java/xyz/refinedev/api/tablist/listener/TeamsPacketListener.java index b61af13..4a4dea8 100644 --- a/src/main/java/xyz/refinedev/api/tablist/listener/TeamsPacketListener.java +++ b/src/main/java/xyz/refinedev/api/tablist/listener/TeamsPacketListener.java @@ -124,7 +124,7 @@ private void preventGlitch(Player player, UserProfile userProfile) { GlitchFixEvent glitchFixEvent = new GlitchFixEvent(player); if (TablistHandler.getInstance().getPlugin().isEnabled()) { - Bukkit.getScheduler().runTask(TablistHandler.getInstance().getPlugin(), () -> Bukkit.getPluginManager().callEvent(glitchFixEvent)); + Bukkit.getPluginManager().callEvent(glitchFixEvent); } } } diff --git a/src/main/java/xyz/refinedev/api/tablist/util/GlitchFixEvent.java b/src/main/java/xyz/refinedev/api/tablist/util/GlitchFixEvent.java index a21e1ca..c1dcdfc 100644 --- a/src/main/java/xyz/refinedev/api/tablist/util/GlitchFixEvent.java +++ b/src/main/java/xyz/refinedev/api/tablist/util/GlitchFixEvent.java @@ -20,13 +20,17 @@ */ @Getter -@RequiredArgsConstructor public class GlitchFixEvent extends Event implements Cancellable { + private static final HandlerList handlers = new HandlerList(); + private final Player player; private boolean cancelled; - private static final HandlerList handlers = new HandlerList(); + public GlitchFixEvent(Player player) { + super(true); + this.player = player; + } public static HandlerList getHandlerList() { return handlers;