fix: delay 5 seconds before thinking that the server is vanilla (this is confirmed to still work on actual vanilla servers and on kaboom too)
5 seconds because the server sends out the commands packet a bit later after login, but it seems like the player left packet (which is used to detect vanish) is sent before that
This commit is contained in:
@@ -1 +1 @@
|
||||
3447
|
||||
3450
|
||||
@@ -75,7 +75,7 @@ public class Bot extends SessionAdapter {
|
||||
public int connectAttempts = 0;
|
||||
|
||||
public boolean loggedIn = false;
|
||||
public long loginTime;
|
||||
public long loginTime = System.currentTimeMillis();
|
||||
|
||||
public final ExecutorService executorService = Main.EXECUTOR_SERVICE;
|
||||
public final ScheduledExecutorService executor = Main.EXECUTOR;
|
||||
|
||||
@@ -368,7 +368,10 @@ public class PlayersPlugin implements Listener {
|
||||
|
||||
if (target == null) return;
|
||||
|
||||
if (!bot.serverFeatures.hasNamespaces || target.profile.getName().isEmpty() /* LoL empty string username lazy fix */) {
|
||||
if (
|
||||
(System.currentTimeMillis() - bot.loginTime > 5 * 1000 && !bot.serverFeatures.hasNamespaces)
|
||||
|| target.profile.getName().isEmpty() // LoL empty string username lazy fix
|
||||
) {
|
||||
final boolean removed = list.remove(target);
|
||||
|
||||
if (removed) {
|
||||
|
||||
Reference in New Issue
Block a user