@@ -46,6 +46,7 @@ public InternalBukkitListener(Plugin plugin) {
46
46
// finished logging in and has a channel reference set, for 1.20.2+
47
47
@ EventHandler (priority = EventPriority .LOWEST )
48
48
public void onLogin (PlayerSpawnLocationEvent event ) {
49
+ System .out .println ("First factual: " + event .getPlayer ().getName ());
49
50
if (PacketEvents .getAPI ().getServerManager ().getVersion ().isNewerThanOrEquals (ServerVersion .V_1_20_2 )) {
50
51
this .onLogin (event .getPlayer ());
51
52
}
@@ -56,12 +57,14 @@ public void onLogin(PlayerSpawnLocationEvent event) {
56
57
// (and according to tests this doesn't really happen much in versions older than 1.20.2)
57
58
@ EventHandler (priority = EventPriority .HIGH )
58
59
public void onJoin (PlayerJoinEvent event ) {
60
+ System .out .println ("Second factual: " + event .getPlayer ().getName ());
59
61
if (PacketEvents .getAPI ().getServerManager ().getVersion ().isOlderThan (ServerVersion .V_1_20_2 )) {
60
62
this .onLogin (event .getPlayer ());
61
63
}
62
64
}
63
65
64
66
private void onLogin (Player player ) {
67
+ System .out .println ("PLAYER LOGGED ON: " + player .getName ());
65
68
SpigotChannelInjector injector = (SpigotChannelInjector ) PacketEvents .getAPI ().getInjector ();
66
69
67
70
User user = PacketEvents .getAPI ().getPlayerManager ().getUser (player );
@@ -71,9 +74,9 @@ private void onLogin(Player player) {
71
74
//Check if it is a fake connection...
72
75
if (channel == null || !FakeChannelUtil .isFakeChannel (channel ) && (!PacketEvents .getAPI ().isTerminated () || PacketEvents .getAPI ().getSettings ().isKickIfTerminated ())) {
73
76
//Kick them, if they are not a fake player.
74
- FoliaScheduler .getRegionScheduler ().runDelayed (plugin , player . getLocation () , (o ) -> {
77
+ FoliaScheduler .getEntityScheduler ().runDelayed (player , plugin , (o ) -> {
75
78
player .kickPlayer ("PacketEvents 2.0 failed to inject" );
76
- }, 0 );
79
+ }, null , 0 );
77
80
}
78
81
return ;
79
82
}
0 commit comments