Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -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;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand Down Expand Up @@ -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 {
Expand Down