From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Spottedleaf <Spottedleaf@users.noreply.github.com>
Date: Wed, 27 Jan 2021 15:15:01 -0800
Subject: [PATCH] Fix incorrect isRealPlayer init

Some plugins, namely ProtocolSupport, don't route to where
paper placed their logic. So it wont correctly set in this case.

Fix by moving it to a different place.

diff --git a/src/main/java/net/minecraft/server/PlayerList.java b/src/main/java/net/minecraft/server/PlayerList.java
index 184a0d30f4a1d4a6a07449fdd1375a8582da9332..d03d0c13cca1762078617744253a9757b388958f 100644
--- a/src/main/java/net/minecraft/server/PlayerList.java
+++ b/src/main/java/net/minecraft/server/PlayerList.java
@@ -96,6 +96,7 @@ public abstract class PlayerList {
     abstract public void loadAndSaveFiles(); // Paper - moved from DedicatedPlayerList constructor
 
     public void a(NetworkManager networkmanager, EntityPlayer entityplayer) {
+        entityplayer.isRealPlayer = true; // Paper // Tuinity - this is a better place to write this that works and isn't overriden by plugins
         EntityPlayer prev = pendingPlayers.put(entityplayer.getUniqueID(), entityplayer);// Paper
         if (prev != null) {
             disconnectPendingPlayer(prev);
@@ -636,7 +637,7 @@ public abstract class PlayerList {
         SocketAddress socketaddress = loginlistener.networkManager.getSocketAddress();
 
         EntityPlayer entity = new EntityPlayer(this.server, this.server.getWorldServer(World.OVERWORLD), gameprofile, new PlayerInteractManager(this.server.getWorldServer(World.OVERWORLD)));
-        entity.isRealPlayer = true; // Paper
+        // Tuinity - some plugins (namely protocolsupport) bypass this logic completely! So this needs to be moved.
         Player player = entity.getBukkitEntity();
         PlayerLoginEvent event = new PlayerLoginEvent(player, hostname, ((java.net.InetSocketAddress) socketaddress).getAddress(), ((java.net.InetSocketAddress) loginlistener.networkManager.getRawAddress()).getAddress());
 
