Skip to content

Commit

Permalink
Use correct scheduler for tasks
Browse files Browse the repository at this point in the history
In some rare cases, player may be teleported during join and kick will fail
  • Loading branch information
HaHaWTH committed Dec 22, 2024
1 parent f603b49 commit 3a3f8c4
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,9 @@ public void onJoin(PlayerJoinEvent e) {
//Check if it is a fake connection...
if (!FakeChannelUtil.isFakeChannel(channel) && (!PacketEvents.getAPI().isTerminated() || PacketEvents.getAPI().getSettings().isKickIfTerminated())) {
//Kick them, if they are not a fake player.
FoliaScheduler.getRegionScheduler().runDelayed(plugin, player.getLocation(), (o) -> {
FoliaScheduler.getEntityScheduler().runDelayed(player, plugin, (o) -> {
player.kickPlayer("PacketEvents 2.0 failed to inject");
}, 0);
}, null, 0);
}
return;
}
Expand Down

0 comments on commit 3a3f8c4

Please sign in to comment.