diff --git a/src/main/java/net/elytrium/limbofilter/event/CheckFinishedEvent.java b/src/main/java/net/elytrium/limbofilter/event/CheckFinishedEvent.java new file mode 100644 index 0000000..f861485 --- /dev/null +++ b/src/main/java/net/elytrium/limbofilter/event/CheckFinishedEvent.java @@ -0,0 +1,12 @@ +package net.elytrium.limbofilter.event; + +import net.elytrium.limboapi.api.player.LimboPlayer; + +public class CheckFinishedEvent { + + public final LimboPlayer player; + + public CheckFinishedEvent(LimboPlayer player) { + this.player = player; + } +} diff --git a/src/main/java/net/elytrium/limbofilter/handler/BotFilterSessionHandler.java b/src/main/java/net/elytrium/limbofilter/handler/BotFilterSessionHandler.java index 627c450..3df7d80 100644 --- a/src/main/java/net/elytrium/limbofilter/handler/BotFilterSessionHandler.java +++ b/src/main/java/net/elytrium/limbofilter/handler/BotFilterSessionHandler.java @@ -17,6 +17,7 @@ package net.elytrium.limbofilter.handler; +import com.velocitypowered.api.event.EventManager; import com.velocitypowered.api.network.ProtocolVersion; import com.velocitypowered.api.proxy.Player; import com.velocitypowered.proxy.protocol.packet.ClientSettings; @@ -33,6 +34,7 @@ import net.elytrium.limbofilter.LimboFilter; import net.elytrium.limbofilter.Settings; import net.elytrium.limbofilter.captcha.CaptchaHolder; +import net.elytrium.limbofilter.event.CheckFinishedEvent; import net.elytrium.limbofilter.listener.TcpListener; import net.elytrium.limbofilter.protocol.data.EntityMetadata; import net.elytrium.limbofilter.protocol.data.ItemFrame; @@ -336,6 +338,9 @@ private void finishCheck() { this.state = CheckState.SUCCESSFUL; this.plugin.cacheFilterUser(this.proxyPlayer); + EventManager eventManager = this.plugin.getServer().getEventManager(); + eventManager.fireAndForget(new CheckFinishedEvent(player)); + if (this.plugin.checkCpsLimit(Settings.IMP.MAIN.FILTER_AUTO_TOGGLE.NEED_TO_RECONNECT)) { this.disconnect(this.plugin.getPackets().getSuccessfulBotFilterDisconnect(), false); } else {