content: package net.minecraft.client.network;
  
  import com.google.common.util.concurrent.FutureCallback;
  import com.google.common.util.concurrent.Futures;
  import com.mojang.authlib.GameProfile;
  import de.florianmichael.vialoadingbase.ViaLoadingBase;
  import lombok.extern.log4j.Log4j2;
  import moe.ichinomiya.naven.Naven;
  import moe.ichinomiya.naven.events.api.types.EventType;
  import moe.ichinomiya.naven.events.impl.EventRespawn;
  import moe.ichinomiya.naven.events.impl.EventSpawnPlayer;
  import net.minecraft.block.Block;
  import net.minecraft.client.Minecraft;
  import net.minecraft.client.audio.GuardianSound;
  import net.minecraft.client.entity.EntityOtherPlayerMP;
  import net.minecraft.client.entity.EntityPlayerSP;
  import net.minecraft.client.gui.*;
  import net.minecraft.client.gui.inventory.GuiContainerCreative;
  import net.minecraft.client.multiplayer.PlayerControllerMP;
  import net.minecraft.client.multiplayer.ServerData;
  import net.minecraft.client.multiplayer.ServerList;
  import net.minecraft.client.multiplayer.WorldClient;
  import net.minecraft.client.particle.EntityPickupFX;
  import net.minecraft.client.player.inventory.ContainerLocalMenu;
  import net.minecraft.client.player.inventory.LocalBlockIntercommunication;
  import net.minecraft.client.resources.I18n;
  import net.minecraft.client.settings.GameSettings;
  import net.minecraft.creativetab.CreativeTabs;
  import net.minecraft.entity.*;
  import net.minecraft.entity.ai.attributes.*;
  import net.minecraft.entity.effect.EntityLightningBolt;
  import net.minecraft.entity.item.*;
  import net.minecraft.entity.monster.EntityGuardian;
  import net.minecraft.entity.passive.EntityHorse;
  import net.minecraft.entity.player.EntityPlayer;
  import net.minecraft.entity.player.InventoryPlayer;
  import net.minecraft.entity.projectile.*;
  import net.minecraft.init.Items;
  import net.minecraft.inventory.AnimalChest;
  import net.minecraft.inventory.Container;
  import net.minecraft.inventory.InventoryBasic;
  import net.minecraft.item.Item;
  import net.minecraft.item.ItemMap;
  import net.minecraft.item.ItemStack;
  import net.minecraft.network.NetworkManager;
  import net.minecraft.network.Packet;
  import net.minecraft.network.PacketBuffer;
  import net.minecraft.network.PacketThreadUtil;
  import net.minecraft.network.play.INetHandlerPlayClient;
  import net.minecraft.network.play.client.*;
  import net.minecraft.network.play.server.*;
  import net.minecraft.potion.PotionEffect;
  import net.minecraft.scoreboard.*;
  import net.minecraft.stats.Achievement;
  import net.minecraft.stats.AchievementList;
  import net.minecraft.stats.StatBase;
  import net.minecraft.tileentity.*;
  import net.minecraft.util.*;
  import net.minecraft.village.MerchantRecipeList;
  import net.minecraft.world.Explosion;
  import net.minecraft.world.WorldProviderSurface;
  import net.minecraft.world.WorldSettings;
  import net.minecraft.world.chunk.Chunk;
  import net.minecraft.world.storage.MapData;
  import org.apache.logging.log4j.LogManager;
  import org.apache.logging.log4j.Logger;
  
  import java.io.File;
  import java.io.IOException;
  import java.util.*;
  import java.util.Map.Entry;
  import java.util.concurrent.ConcurrentHashMap;
  
  @Log4j2
  public class NetHandlerPlayClient implements INetHandlerPlayClient {
      private static final Logger logger = LogManager.getLogger();
      private final NetworkManager netManager;
      private final GameProfile profile;
      private final GuiScreen guiScreenServer;
      private Minecraft gameController;
      private WorldClient clientWorldController;
      private boolean doneLoadingTerrain;
      public final Map<UUID, NetworkPlayerInfo> playerInfoMap = new ConcurrentHashMap<>();
      public int currentServerMaxPlayers = 20;
      private boolean field_147308_k = false;
      private final Random avRandomizer = new Random();
  
      public NetHandlerPlayClient(Minecraft mcIn, GuiScreen p_i46300_2_, NetworkManager p_i46300_3_, GameProfile p_i46300_4_) {
          this.gameController = mcIn;
          this.guiScreenServer = p_i46300_2_;
          this.netManager = p_i46300_3_;
          this.profile = p_i46300_4_;
      }
  
      public void cleanup() {
          this.clientWorldController = null;
      }
  
      public void handleJoinGame(S01PacketJoinGame packetIn) {
          PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController);
          this.gameController.playerController = new PlayerControllerMP(this.gameController, this);
          this.clientWorldController = new WorldClient(this, new WorldSettings(0L, packetIn.getGameType(), false, packetIn.isHardcoreMode(), packetIn.getWorldType()), packetIn.getDimension(), packetIn.getDifficulty(), this.gameController.mcProfiler);
          this.gameController.gameSettings.difficulty = packetIn.getDifficulty();
          this.gameController.loadWorld(this.clientWorldController);
          this.gameController.thePlayer.dimension = packetIn.getDimension();
  
          // Patcher
          this.gameController.displayGuiScreen(null);
          // this.gameController.displayGuiScreen(new GuiDownloadTerrain(this));
  
          this.gameController.thePlayer.setEntityId(packetIn.getEntityId());
          this.currentServerMaxPlayers = packetIn.getMaxPlayers();
          this.gameController.thePlayer.setReducedDebug(packetIn.isReducedDebugInfo());
          this.gameController.playerController.setGameType(packetIn.getGameType());
          this.gameController.gameSettings.sendSettingsToServer();
  
          // Client
          Naven.getInstance().getEventManager().call(new EventRespawn(EventType.JOIN_GAME));
      }
  
      public void handleSpawnObject(S0EPacketSpawnObject packetIn) {
          PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController);
          double d0 = (double) packetIn.getX() / 32.0D;
          double d1 = (double) packetIn.getY() / 32.0D;
          double d2 = (double) packetIn.getZ() / 32.0D;
          Entity entity = null;
  
          if (packetIn.getType() == 10) {
              entity = EntityMinecart.getMinecart(this.clientWorldController, d0, d1, d2, EntityMinecart.EnumMinecartType.byNetworkID(packetIn.func_149009_m()));
          } else if (packetIn.getType() == 90) {
              Entity entity1 = this.clientWorldController.getEntityByID(packetIn.func_149009_m());
  
              if (entity1 instanceof EntityPlayer) {
                  entity = new EntityFishHook(this.clientWorldController, d0, d1, d2, (EntityPlayer) entity1);
              }
  
              packetIn.func_149002_g(0);
          } else if (packetIn.getType() == 60) {
              entity = new EntityArrow(this.clientWorldController, d0, d1, d2);
          } else if (packetIn.getType() == 61) {
              entity = new EntitySnowball(this.clientWorldController, d0, d1, d2);
          } else if (packetIn.getType() == 71) {
              entity = new EntityItemFrame(this.clientWorldController, new BlockPos(MathHelper.floor_double(d0), MathHelper.floor_double(d1), MathHelper.floor_double(d2)), EnumFacing.getHorizontal(packetIn.func_149009_m()));
              packetIn.func_149002_g(0);
          } else if (packetIn.getType() == 77) {
              entity = new EntityLeashKnot(this.clientWorldController, new BlockPos(MathHelper.floor_double(d0), MathHelper.floor_double(d1), MathHelper.floor_double(d2)));
              packetIn.func_149002_g(0);
          } else if (packetIn.getType() == 65) {
              entity = new EntityEnderPearl(this.clientWorldController, d0, d1, d2);
          } else if (packetIn.getType() == 72) {
              entity = new EntityEnderEye(this.clientWorldController, d0, d1, d2);
          } else if (packetIn.getType() == 76) {
              entity = new EntityFireworkRocket(this.clientWorldController, d0, d1, d2, null);
          } else if (packetIn.getType() == 63) {
              entity = new EntityLargeFireball(this.clientWorldController, d0, d1, d2, (double) packetIn.getSpeedX() / 8000.0D, (double) packetIn.getSpeedY() / 8000.0D, (double) packetIn.getSpeedZ() / 8000.0D);
              packetIn.func_149002_g(0);
          } else if (packetIn.getType() == 64) {
              entity = new EntitySmallFireball(this.clientWorldController, d0, d1, d2, (double) packetIn.getSpeedX() / 8000.0D, (double) packetIn.getSpeedY() / 8000.0D, (double) packetIn.getSpeedZ() / 8000.0D);
              packetIn.func_149002_g(0);
          } else if (packetIn.getType() == 66) {
              entity = new EntityWitherSkull(this.clientWorldController, d0, d1, d2, (double) packetIn.getSpeedX() / 8000.0D, (double) packetIn.getSpeedY() / 8000.0D, (double) packetIn.getSpeedZ() / 8000.0D);
              packetIn.func_149002_g(0);
          } else if (packetIn.getType() == 62) {
              entity = new EntityEgg(this.clientWorldController, d0, d1, d2);
          } else if (packetIn.getType() == 73) {
              entity = new EntityPotion(this.clientWorldController, d0, d1, d2, packetIn.func_149009_m());
              packetIn.func_149002_g(0);
          } else if (packetIn.getType() == 75) {
              entity = new EntityExpBottle(this.clientWorldController, d0, d1, d2);
              packetIn.func_149002_g(0);
          } else if (packetIn.getType() == 1) {
              entity = new EntityBoat(this.clientWorldController, d0, d1, d2);
          } else if (packetIn.getType() == 50) {
              entity = new EntityTNTPrimed(this.clientWorldController, d0, d1, d2, null);
          } else if (packetIn.getType() == 78) {
              entity = new EntityArmorStand(this.clientWorldController, d0, d1, d2);
          } else if (packetIn.getType() == 51) {
              entity = new EntityEnderCrystal(this.clientWorldController, d0, d1, d2);
          } else if (packetIn.getType() == 2) {
              entity = new EntityItem(this.clientWorldController, d0, d1, d2);
          } else if (packetIn.getType() == 70) {
              entity = new EntityFallingBlock(this.clientWorldController, d0, d1, d2, Block.getStateById(packetIn.func_149009_m() & 65535));
              packetIn.func_149002_g(0);
          }
  
          if (entity != null) {
              entity.serverPosX = packetIn.getX();
              entity.serverPosY = packetIn.getY();
              entity.serverPosZ = packetIn.getZ();
              entity.rotationPitch = (float) (packetIn.getPitch() * 360) / 256.0F;
              entity.rotationYaw = (float) (packetIn.getYaw() * 360) / 256.0F;
              Entity[] aentity = entity.getParts();
  
              if (aentity != null) {
                  int i = packetIn.getEntityID() - entity.getEntityId();
  
                  for (int j = 0; j < aentity.length; ++j) {
                      aentity[j].setEntityId(aentity[j].getEntityId() + i);
                  }
              }
  
              entity.setEntityId(packetIn.getEntityID());
              this.clientWorldController.addEntityToWorld(packetIn.getEntityID(), entity);
  
              if (packetIn.func_149009_m() > 0) {
                  if (packetIn.getType() == 60) {
                      Entity entity2 = this.clientWorldController.getEntityByID(packetIn.func_149009_m());
  
                      if (entity2 instanceof EntityLivingBase && entity instanceof EntityArrow) {
                          ((EntityArrow) entity).shootingEntity = entity2;
                      }
                  }
  
                  entity.setVelocity((double) packetIn.getSpeedX() / 8000.0D, (double) packetIn.getSpeedY() / 8000.0D, (double) packetIn.getSpeedZ() / 8000.0D);
              }
          }
      }
  
      public void handleSpawnExperienceOrb(S11PacketSpawnExperienceOrb packetIn) {
          PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController);
          Entity entity = new EntityXPOrb(this.clientWorldController, (double) packetIn.getX() / 32.0D, (double) packetIn.getY() / 32.0D, (double) packetIn.getZ() / 32.0D, packetIn.getXPValue());
          entity.serverPosX = packetIn.getX();
          entity.serverPosY = packetIn.getY();
          entity.serverPosZ = packetIn.getZ();
          entity.rotationYaw = 0.0F;
          entity.rotationPitch = 0.0F;
          entity.setEntityId(packetIn.getEntityID());
          this.clientWorldController.addEntityToWorld(packetIn.getEntityID(), entity);
      }
  
      public void handleSpawnGlobalEntity(S2CPacketSpawnGlobalEntity packetIn) {
          PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController);
          double d0 = (double) packetIn.func_149051_d() / 32.0D;
          double d1 = (double) packetIn.func_149050_e() / 32.0D;
          double d2 = (double) packetIn.func_149049_f() / 32.0D;
          Entity entity = null;
  
          if (packetIn.func_149053_g() == 1) {
              entity = new EntityLightningBolt(this.clientWorldController, d0, d1, d2);
          }
  
          if (entity != null) {
              entity.serverPosX = packetIn.func_149051_d();
              entity.serverPosY = packetIn.func_149050_e();
              entity.serverPosZ = packetIn.func_149049_f();
              entity.rotationYaw = 0.0F;
              entity.rotationPitch = 0.0F;
              entity.setEntityId(packetIn.func_149052_c());
              this.clientWorldController.addWeatherEffect(entity);
          }
      }
  
      public void handleSpawnPainting(S10PacketSpawnPainting packetIn) {
          PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController);
          EntityPainting entitypainting = new EntityPainting(this.clientWorldController, packetIn.getPosition(), packetIn.getFacing(), packetIn.getTitle());
          this.clientWorldController.addEntityToWorld(packetIn.getEntityID(), entitypainting);
      }
  
      public void handleEntityVelocity(S12PacketEntityVelocity packetIn) {
          PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController);
          Entity entity = this.clientWorldController.getEntityByID(packetIn.getEntityID());
  
          if (entity != null) {
              entity.setVelocity((double) packetIn.getMotionX() / 8000.0D, (double) packetIn.getMotionY() / 8000.0D, (double) packetIn.getMotionZ() / 8000.0D);
          }
      }
  
      public void handleEntityMetadata(S1CPacketEntityMetadata packetIn) {
          PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController);
          Entity entity = this.clientWorldController.getEntityByID(packetIn.getEntityId());
  
          if (entity != null && packetIn.getWatchableObjects() != null) {
              entity.getDataWatcher().updateWatchedObjectsFromList(packetIn.getWatchableObjects());
          }
      }
  
      public void handleSpawnPlayer(S0CPacketSpawnPlayer packetIn) {
          PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController);
          double d0 = (double) packetIn.getX() / 32.0D;
          double d1 = (double) packetIn.getY() / 32.0D;
          double d2 = (double) packetIn.getZ() / 32.0D;
          float f = (float) (packetIn.getYaw() * 360) / 256.0F;
          float f1 = (float) (packetIn.getPitch() * 360) / 256.0F;
          EntityOtherPlayerMP entityotherplayermp = new EntityOtherPlayerMP(this.gameController.theWorld, this.getPlayerInfo(packetIn.getPlayer()).getGameProfile());
          entityotherplayermp.prevPosX = entityotherplayermp.lastTickPosX = entityotherplayermp.serverPosX = packetIn.getX();
          entityotherplayermp.prevPosY = entityotherplayermp.lastTickPosY = entityotherplayermp.serverPosY = packetIn.getY();
          entityotherplayermp.prevPosZ = entityotherplayermp.lastTickPosZ = entityotherplayermp.serverPosZ = packetIn.getZ();
          int i = packetIn.getCurrentItemID();
  
          if (i == 0) {
              entityotherplayermp.inventory.mainInventory[entityotherplayermp.inventory.currentItem] = null;
          } else {
              entityotherplayermp.inventory.mainInventory[entityotherplayermp.inventory.currentItem] = new ItemStack(Item.getItemById(i), 1, 0);
          }
  
          entityotherplayermp.setPositionAndRotation(d0, d1, d2, f, f1);
          this.clientWorldController.addEntityToWorld(packetIn.getEntityID(), entityotherplayermp);
  
          List<DataWatcher.WatchableObject> list = packetIn.func_148944_c();
  
          if (list != null) {
              entityotherplayermp.getDataWatcher().updateWatchedObjectsFromList(list);
          }
  
          Naven.getInstance().getEventManager().call(new EventSpawnPlayer(entityotherplayermp));
      }
  
      public void handleEntityTeleport(S18PacketEntityTeleport packetIn) {
          PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController);
          Entity entity = this.clientWorldController.getEntityByID(packetIn.getEntityId());
  
          if (entity != null) {
              entity.serverPosX = packetIn.getX();
              entity.serverPosY = packetIn.getY();
              entity.serverPosZ = packetIn.getZ();
              double d0 = (double) entity.serverPosX / 32.0D;
              double d1 = (double) entity.serverPosY / 32.0D;
              double d2 = (double) entity.serverPosZ / 32.0D;
              float f = (float) (packetIn.getYaw() * 360) / 256.0F;
              float f1 = (float) (packetIn.getPitch() * 360) / 256.0F;
  
              if (Math.abs(entity.posX - d0) < 0.03125D && Math.abs(entity.posY - d1) < 0.015625D && Math.abs(entity.posZ - d2) < 0.03125D) {
                  entity.setPositionAndRotation2(entity.posX, entity.posY, entity.posZ, f, f1, 3, true);
              } else {
                  entity.setPositionAndRotation2(d0, d1, d2, f, f1, 3, true);
              }
  
              entity.onGround = packetIn.getOnGround();
          }
      }
  
      public void handleHeldItemChange(S09PacketHeldItemChange packetIn) {
          PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController);
  
          if (packetIn.getHeldItemHotbarIndex() >= 0 && packetIn.getHeldItemHotbarIndex() < InventoryPlayer.getHotbarSize()) {
              this.gameController.thePlayer.inventory.currentItem = packetIn.getHeldItemHotbarIndex();
          }
      }
  
      public void handleEntityMovement(S14PacketEntity packetIn) {
          PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController);
          Entity entity = packetIn.getEntity(this.clientWorldController);
  
          if (entity != null) {
              entity.serverPosX += packetIn.func_149062_c();
              entity.serverPosY += packetIn.func_149061_d();
              entity.serverPosZ += packetIn.func_149064_e();
              double d0 = (double) entity.serverPosX / 32.0D;
              double d1 = (double) entity.serverPosY / 32.0D;
              double d2 = (double) entity.serverPosZ / 32.0D;
              float f = packetIn.func_149060_h() ? (float) (packetIn.func_149066_f() * 360) / 256.0F : entity.rotationYaw;
              float f1 = packetIn.func_149060_h() ? (float) (packetIn.func_149063_g() * 360) / 256.0F : entity.rotationPitch;
              entity.setPositionAndRotation2(d0, d1, d2, f, f1, 3, false);
              entity.onGround = packetIn.getOnGround();
          }
      }
  
      public void handleEntityHeadLook(S19PacketEntityHeadLook packetIn) {
          PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController);
          Entity entity = packetIn.getEntity(this.clientWorldController);
  
          if (entity != null) {
              float f = (float) (packetIn.getYaw() * 360) / 256.0F;
              entity.setRotationYawHead(f);
          }
      }
  
      public void handleDestroyEntities(S13PacketDestroyEntities packetIn) {
          PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController);
  
          for (int i = 0; i < packetIn.getEntityIDs().length; ++i) {
              this.clientWorldController.removeEntityFromWorld(packetIn.getEntityIDs()[i]);
          }
      }
  
      public void handlePlayerPosLook(S08PacketPlayerPosLook packetIn) {
          PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController);
          EntityPlayer entityplayer = this.gameController.thePlayer;
          double d0 = packetIn.getX();
          double d1 = packetIn.getY();
          double d2 = packetIn.getZ();
          float f = packetIn.getYaw();
          float f1 = packetIn.getPitch();
  
          if (packetIn.func_179834_f().contains(S08PacketPlayerPosLook.EnumFlags.X)) {
              d0 += entityplayer.posX;
          } else {
              entityplayer.motionX = 0.0D;
          }
  
          if (packetIn.func_179834_f().contains(S08PacketPlayerPosLook.EnumFlags.Y)) {
              d1 += entityplayer.posY;
          } else {
              entityplayer.motionY = 0.0D;
          }
  
          if (packetIn.func_179834_f().contains(S08PacketPlayerPosLook.EnumFlags.Z)) {
              d2 += entityplayer.posZ;
          } else {
              entityplayer.motionZ = 0.0D;
          }
  
          if (packetIn.func_179834_f().contains(S08PacketPlayerPosLook.EnumFlags.X_ROT)) {
              f1 += entityplayer.rotationPitch;
          }
  
          if (packetIn.func_179834_f().contains(S08PacketPlayerPosLook.EnumFlags.Y_ROT)) {
              f += entityplayer.rotationYaw;
          }
  
          entityplayer.setPositionAndRotation(d0, d1, d2, f, f1);
  
          C03PacketPlayer.C06PacketPlayerPosLook packetIn1 = new C03PacketPlayer.C06PacketPlayerPosLook(entityplayer.posX, entityplayer.getEntityBoundingBox().minY, entityplayer.posZ, entityplayer.rotationYaw, entityplayer.rotationPitch, false);
          packetIn1.setback = true;
          this.netManager.sendPacket(packetIn1);
  
          if (!this.doneLoadingTerrain) {
              this.gameController.thePlayer.prevPosX = this.gameController.thePlayer.posX;
              this.gameController.thePlayer.prevPosY = this.gameController.thePlayer.posY;
              this.gameController.thePlayer.prevPosZ = this.gameController.thePlayer.posZ;
              this.doneLoadingTerrain = true;
              this.gameController.displayGuiScreen(null);
          }
      }
  
      public void handleMultiBlockChange(S22PacketMultiBlockChange packetIn) {
          PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController);
  
          for (S22PacketMultiBlockChange.BlockUpdateData s22packetmultiblockchange$blockupdatedata : packetIn.getChangedBlocks()) {
              this.clientWorldController.invalidateRegionAndSetBlock(s22packetmultiblockchange$blockupdatedata.getPos(), s22packetmultiblockchange$blockupdatedata.getBlockState());
          }
      }
  
      public void handleChunkData(S21PacketChunkData packetIn) {
          PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController);
  
          if (packetIn.func_149274_i()) {
              if (packetIn.getExtractedSize() == 0) {
                  this.clientWorldController.doPreChunk(packetIn.getChunkX(), packetIn.getChunkZ(), false);
                  return;
              }
  
              this.clientWorldController.doPreChunk(packetIn.getChunkX(), packetIn.getChunkZ(), true);
          }
  
          this.clientWorldController.invalidateBlockReceiveRegion(packetIn.getChunkX() << 4, 0, packetIn.getChunkZ() << 4, (packetIn.getChunkX() << 4) + 15, 256, (packetIn.getChunkZ() << 4) + 15);
          Chunk chunk = this.clientWorldController.getChunkFromChunkCoords(packetIn.getChunkX(), packetIn.getChunkZ());
          chunk.fillChunk(packetIn.getExtractedDataBytes(), packetIn.getExtractedSize(), packetIn.func_149274_i());
          this.clientWorldController.markBlockRangeForRenderUpdate(packetIn.getChunkX() << 4, 0, packetIn.getChunkZ() << 4, (packetIn.getChunkX() << 4) + 15, 256, (packetIn.getChunkZ() << 4) + 15);
  
          if (!packetIn.func_149274_i() || !(this.clientWorldController.provider instanceof WorldProviderSurface)) {
              chunk.resetRelightChecks();
          }
      }
  
      public void handleBlockChange(S23PacketBlockChange packetIn) {
          PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController);
          this.clientWorldController.invalidateRegionAndSetBlock(packetIn.getBlockPosition(), packetIn.getBlockState());
      }
  
      public void handleDisconnect(S40PacketDisconnect packetIn) {
          this.netManager.closeChannel(packetIn.getReason());
      }
  
      public void onDisconnect(IChatComponent reason) {
          this.gameController.loadWorld(null);
  
          if (this.guiScreenServer != null) {
              this.gameController.displayGuiScreen(new GuiDisconnected(this.guiScreenServer, "disconnect.lost", reason));
          } else {
              this.gameController.displayGuiScreen(new GuiDisconnected(new GuiMultiplayer(new GuiMainMenu()), "disconnect.lost", reason));
          }
      }
  
      public void addToSendQueue(Packet p_147297_1_) {
          this.netManager.sendPacket(p_147297_1_);
      }
  
      public void handleCollectItem(S0DPacketCollectItem packetIn) {
          PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController);
          Entity entity = this.clientWorldController.getEntityByID(packetIn.getCollectedItemEntityID());
          EntityLivingBase entitylivingbase = (EntityLivingBase) this.clientWorldController.getEntityByID(packetIn.getEntityID());
  
          if (entitylivingbase == null) {
              entitylivingbase = this.gameController.thePlayer;
          }
  
          if (entity != null) {
              if (entity instanceof EntityXPOrb) {
                  this.clientWorldController.playSoundAtEntity(entity, "random.orb", 0.2F, ((this.avRandomizer.nextFloat() - this.avRandomizer.nextFloat()) * 0.7F + 1.0F) * 2.0F);
              } else {
                  this.clientWorldController.playSoundAtEntity(entity, "random.pop", 0.2F, ((this.avRandomizer.nextFloat() - this.avRandomizer.nextFloat()) * 0.7F + 1.0F) * 2.0F);
              }
  
              this.gameController.effectRenderer.addEffect(new EntityPickupFX(this.clientWorldController, entity, entitylivingbase, 0.5F));
              this.clientWorldController.removeEntityFromWorld(packetIn.getCollectedItemEntityID());
          }
      }
  
      public void handleChat(S02PacketChat packetIn) {
          PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController);
  
          if (packetIn.getType() == 2) {
              this.gameController.ingameGUI.setRecordPlaying(packetIn.getChatComponent(), false);
          } else {
              this.gameController.ingameGUI.getChatGUI().printChatMessage(packetIn.getChatComponent());
          }
      }
  
      public void handleAnimation(S0BPacketAnimation packetIn) {
          PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController);
          Entity entity = this.clientWorldController.getEntityByID(packetIn.getEntityID());
  
          if (entity != null) {
              if (packetIn.getAnimationType() == 0) {
                  EntityLivingBase entitylivingbase = (EntityLivingBase) entity;
                  entitylivingbase.swingItem();
              } else if (packetIn.getAnimationType() == 1) {
                  entity.performHurtAnimation();
              } else if (packetIn.getAnimationType() == 2) {
                  EntityPlayer entityplayer = (EntityPlayer) entity;
                  entityplayer.wakeUpPlayer(false, false, false);
              } else if (packetIn.getAnimationType() == 4) {
                  this.gameController.effectRenderer.emitParticleAtEntity(entity, EnumParticleTypes.CRIT);
              } else if (packetIn.getAnimationType() == 5) {
                  this.gameController.effectRenderer.emitParticleAtEntity(entity, EnumParticleTypes.CRIT_MAGIC);
              }
          }
      }
  
      public void handleUseBed(S0APacketUseBed packetIn) {
          PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController);
          packetIn.getPlayer(this.clientWorldController).trySleep(packetIn.getBedPosition());
      }
  
      public void handleSpawnMob(S0FPacketSpawnMob packetIn) {
          PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController);
          double d0 = (double) packetIn.getX() / 32.0D;
          double d1 = (double) packetIn.getY() / 32.0D;
          double d2 = (double) packetIn.getZ() / 32.0D;
          float f = (float) (packetIn.getYaw() * 360) / 256.0F;
          float f1 = (float) (packetIn.getPitch() * 360) / 256.0F;
          EntityLivingBase entitylivingbase = (EntityLivingBase) EntityList.createEntityByID(packetIn.getEntityType(), this.gameController.theWorld);
          entitylivingbase.serverPosX = packetIn.getX();
          entitylivingbase.serverPosY = packetIn.getY();
          entitylivingbase.serverPosZ = packetIn.getZ();
          entitylivingbase.renderYawOffset = entitylivingbase.rotationYawHead = (float) (packetIn.getHeadPitch() * 360) / 256.0F;
          Entity[] aentity = entitylivingbase.getParts();
  
          if (aentity != null) {
              int i = packetIn.getEntityID() - entitylivingbase.getEntityId();
  
              for (int j = 0; j < aentity.length; ++j) {
                  aentity[j].setEntityId(aentity[j].getEntityId() + i);
              }
          }
  
          entitylivingbase.setEntityId(packetIn.getEntityID());
          entitylivingbase.setPositionAndRotation(d0, d1, d2, f, f1);
          entitylivingbase.motionX = (float) packetIn.getVelocityX() / 8000.0F;
          entitylivingbase.motionY = (float) packetIn.getVelocityY() / 8000.0F;
          entitylivingbase.motionZ = (float) packetIn.getVelocityZ() / 8000.0F;
          this.clientWorldController.addEntityToWorld(packetIn.getEntityID(), entitylivingbase);
          List<DataWatcher.WatchableObject> list = packetIn.func_149027_c();
  
          if (list != null) {
              entitylivingbase.getDataWatcher().updateWatchedObjectsFromList(list);
          }
      }
  
      public void handleTimeUpdate(S03PacketTimeUpdate packetIn) {
          PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController);
          this.gameController.theWorld.setTotalWorldTime(packetIn.getTotalWorldTime());
          this.gameController.theWorld.setWorldTime(packetIn.getWorldTime());
      }
  
      public void handleSpawnPosition(S05PacketSpawnPosition packetIn) {
          PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController);
          this.gameController.thePlayer.setSpawnPoint(packetIn.getSpawnPos(), true);
          this.gameController.theWorld.getWorldInfo().setSpawn(packetIn.getSpawnPos());
      }
  
      public void handleEntityAttach(S1BPacketEntityAttach packetIn) {
          PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController);
          Entity entity = this.clientWorldController.getEntityByID(packetIn.getEntityId());
          Entity entity1 = this.clientWorldController.getEntityByID(packetIn.getVehicleEntityId());
  
          if (packetIn.getLeash() == 0) {
              boolean flag = false;
  
              if (packetIn.getEntityId() == this.gameController.thePlayer.getEntityId()) {
                  entity = this.gameController.thePlayer;
  
                  if (entity1 instanceof EntityBoat) {
                      ((EntityBoat) entity1).setIsBoatEmpty(false);
                  }
  
                  flag = entity.ridingEntity == null && entity1 != null;
              } else if (entity1 instanceof EntityBoat) {
                  ((EntityBoat) entity1).setIsBoatEmpty(true);
              }
  
              if (entity == null) {
                  return;
              }
  
              entity.mountEntity(entity1);
  
              if (flag) {
                  GameSettings gamesettings = this.gameController.gameSettings;
                  this.gameController.ingameGUI.setRecordPlaying(I18n.format("mount.onboard", GameSettings.getKeyDisplayString(gamesettings.keyBindSneak.getKeyCode())), false);
              }
          } else if (packetIn.getLeash() == 1 && entity instanceof EntityLiving) {
              if (entity1 != null) {
                  ((EntityLiving) entity).setLeashedToEntity(entity1, false);
              } else {
                  ((EntityLiving) entity).clearLeashed(false, false);
              }
          }
      }
  
      public void handleEntityStatus(S19PacketEntityStatus packetIn) {
          PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController);
          Entity entity = packetIn.getEntity(this.clientWorldController);
  
          if (entity != null) {
              if (packetIn.getOpCode() == 21) {
                  this.gameController.getSoundHandler().playSound(new GuardianSound((EntityGuardian) entity));
              } else {
                  entity.handleStatusUpdate(packetIn.getOpCode());
              }
          }
      }
  
      public void handleUpdateHealth(S06PacketUpdateHealth packetIn) {
          PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController);
          this.gameController.thePlayer.setPlayerSPHealth(packetIn.getHealth());
          this.gameController.thePlayer.getFoodStats().setFoodLevel(packetIn.getFoodLevel());
          this.gameController.thePlayer.getFoodStats().setFoodSaturationLevel(packetIn.getSaturationLevel());
      }
  
      public void handleSetExperience(S1FPacketSetExperience packetIn) {
          PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController);
          this.gameController.thePlayer.setXPStats(packetIn.func_149397_c(), packetIn.getTotalExperience(), packetIn.getLevel());
      }
  
      public void handleRespawn(S07PacketRespawn packetIn) {
          PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController);
  
          if (packetIn.getDimensionID() != this.gameController.thePlayer.dimension) {
              this.doneLoadingTerrain = false;
              Scoreboard scoreboard = this.clientWorldController.getScoreboard();
              this.clientWorldController = new WorldClient(this, new WorldSettings(0L, packetIn.getGameType(), false, this.gameController.theWorld.getWorldInfo().isHardcoreModeEnabled(), packetIn.getWorldType()), packetIn.getDimensionID(), packetIn.getDifficulty(), this.gameController.mcProfiler);
              this.clientWorldController.setWorldScoreboard(scoreboard);
              this.gameController.loadWorld(this.clientWorldController);
              this.gameController.thePlayer.dimension = packetIn.getDimensionID();
  
              // Patcher
              this.gameController.displayGuiScreen(null);
              // this.gameController.displayGuiScreen(new GuiDownloadTerrain(this));
          }
  
          this.gameController.setDimensionAndSpawnPlayer(packetIn.getDimensionID());
          this.gameController.playerController.setGameType(packetIn.getGameType());
  
          // Client
          Naven.getInstance().getEventManager().call(new EventRespawn(EventType.RESPAWN));
      }
  
      public void handleExplosion(S27PacketExplosion packetIn) {
          PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController);
          Explosion explosion = new Explosion(this.gameController.theWorld, null, packetIn.getX(), packetIn.getY(), packetIn.getZ(), packetIn.getStrength(), packetIn.getAffectedBlockPositions());
          explosion.doExplosionB(true);
          this.gameController.thePlayer.motionX += packetIn.func_149149_c();
          this.gameController.thePlayer.motionY += packetIn.func_149144_d();
          this.gameController.thePlayer.motionZ += packetIn.func_149147_e();
      }
  
      public void handleOpenWindow(S2DPacketOpenWindow packetIn) {
          PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController);
          EntityPlayerSP entityplayersp = this.gameController.thePlayer;
  
          if ("minecraft:container".equals(packetIn.getGuiId())) {
              entityplayersp.displayGUIChest(new InventoryBasic(packetIn.getWindowTitle(), packetIn.getSlotCount()));
              entityplayersp.openContainer.windowId = packetIn.getWindowId();
          } else if ("minecraft:villager".equals(packetIn.getGuiId())) {
              entityplayersp.displayVillagerTradeGui(new NpcMerchant(entityplayersp, packetIn.getWindowTitle()));
              entityplayersp.openContainer.windowId = packetIn.getWindowId();
          } else if ("EntityHorse".equals(packetIn.getGuiId())) {
              Entity entity = this.clientWorldController.getEntityByID(packetIn.getEntityId());
  
              if (entity instanceof EntityHorse) {
                  entityplayersp.displayGUIHorse((EntityHorse) entity, new AnimalChest(packetIn.getWindowTitle(), packetIn.getSlotCount()));
                  entityplayersp.openContainer.windowId = packetIn.getWindowId();
              }
          } else if (!packetIn.hasSlots()) {
              entityplayersp.displayGui(new LocalBlockIntercommunication(packetIn.getGuiId(), packetIn.getWindowTitle()));
              entityplayersp.openContainer.windowId = packetIn.getWindowId();
          } else {
              ContainerLocalMenu containerlocalmenu = new ContainerLocalMenu(packetIn.getGuiId(), packetIn.getWindowTitle(), packetIn.getSlotCount());
              entityplayersp.displayGUIChest(containerlocalmenu);
              entityplayersp.openContainer.windowId = packetIn.getWindowId();
          }
      }
  
      private final static Random rand = new Random();
  
      public void handleSetSlot(S2FPacketSetSlot packetIn) {
          PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController);
          EntityPlayer entityplayer = this.gameController.thePlayer;
  
          if (packetIn.getWindowId() == 0 && packetIn.getSlot() == 45) {
              return;
          }
  
          if (packetIn.getWindowId() == 0) {
              ItemStack itemstack = entityplayer.inventoryContainer.getSlot(packetIn.getSlot()).getStack();
  
              if (ViaLoadingBase.getInstance().getTargetVersion().getVersion() >= 757 && itemstack == null && packetIn.getItemStack() != null) {
                  gameController.thePlayer.playSound("random.pop", 0.2F, ((rand.nextFloat() - rand.nextFloat()) * 0.7F + 1.0F) * 2.0F);
              }
          }
  
          if (packetIn.getWindowId() == -1) {
              entityplayer.inventory.setItemStack(packetIn.getItemStack());
          } else {
              boolean flag = false;
  
              if (this.gameController.currentScreen instanceof GuiContainerCreative) {
                  GuiContainerCreative guicontainercreative = (GuiContainerCreative) this.gameController.currentScreen;
                  flag = guicontainercreative.getSelectedTabIndex() != CreativeTabs.tabInventory.getTabIndex();
              }
  
              if (packetIn.getWindowId() == 0 && packetIn.getSlot() >= 36 && packetIn.getSlot() < 45) {
                  ItemStack itemstack = entityplayer.inventoryContainer.getSlot(packetIn.getSlot()).getStack();
  
                  if (packetIn.getItemStack() != null && (itemstack == null || itemstack.stackSize < packetIn.getItemStack().stackSize)) {
                      packetIn.getItemStack().animationsToGo = 5;
                  }
  
                  entityplayer.inventoryContainer.putStackInSlot(packetIn.getSlot(), packetIn.getItemStack());
              } else if (packetIn.getWindowId() == entityplayer.openContainer.windowId && (packetIn.getWindowId() != 0 || !flag)) {
                  entityplayer.openContainer.putStackInSlot(packetIn.getSlot(), packetIn.getItemStack());
              }
          }
      }
  
      public void handleConfirmTransaction(S32PacketConfirmTransaction packetIn) {
          PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController);
          Container container = null;
          EntityPlayer entityplayer = this.gameController.thePlayer;
  
          if (packetIn.getWindowId() == 0) {
              container = entityplayer.inventoryContainer;
          } else if (packetIn.getWindowId() == entityplayer.openContainer.windowId) {
              container = entityplayer.openContainer;
          }
  
          if (container != null && !packetIn.func_148888_e()) {
              this.addToSendQueue(new C0FPacketConfirmTransaction(packetIn.getWindowId(), packetIn.getActionNumber(), true));
          }
      }
  
      public void handleWindowItems(S30PacketWindowItems packetIn) {
          PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController);
          EntityPlayer entityplayer = this.gameController.thePlayer;
  
          if (packetIn.getWindowId() == 0) {
              if (packetIn.getItemStacks().length == 46) {
                  ItemStack[] old = packetIn.getItemStacks();
                  ItemStack[] items = new ItemStack[45];
                  System.arraycopy(old, 0, items, 0, 45);
  
                  packetIn.setItemStacks(items);
              }
  
              entityplayer.inventoryContainer.putStacksInSlots(packetIn.getItemStacks());
          } else if (packetIn.getWindowId() == entityplayer.openContainer.windowId) {
              entityplayer.openContainer.putStacksInSlots(packetIn.getItemStacks());
          }
      }
  
      public void handleSignEditorOpen(S36PacketSignEditorOpen packetIn) {
          PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController);
          TileEntity tileentity = this.clientWorldController.getTileEntity(packetIn.getSignPosition());
  
          if (!(tileentity instanceof TileEntitySign)) {
              tileentity = new TileEntitySign();
              tileentity.setWorldObj(this.clientWorldController);
              tileentity.setPos(packetIn.getSignPosition());
          }
  
          this.gameController.thePlayer.openEditSign((TileEntitySign) tileentity);
      }
  
      public void handleUpdateSign(S33PacketUpdateSign packetIn) {
          PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController);
          boolean flag = false;
  
          if (this.gameController.theWorld.isBlockLoaded(packetIn.getPos())) {
              TileEntity tileentity = this.gameController.theWorld.getTileEntity(packetIn.getPos());
  
              if (tileentity instanceof TileEntitySign) {
                  TileEntitySign tileentitysign = (TileEntitySign) tileentity;
  
                  if (tileentitysign.getIsEditable()) {
                      System.arraycopy(packetIn.getLines(), 0, tileentitysign.signText, 0, 4);
                      tileentitysign.markDirty();
                  }
  
                  flag = true;
              }
          }
  
          if (!flag && this.gameController.thePlayer != null) {
              this.gameController.thePlayer.addChatMessage(new ChatComponentText("Unable to locate sign at " + packetIn.getPos().getX() + ", " + packetIn.getPos().getY() + ", " + packetIn.getPos().getZ()));
          }
      }
  
      public void handleUpdateTileEntity(S35PacketUpdateTileEntity packetIn) {
          PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController);
  
          if (this.gameController.theWorld.isBlockLoaded(packetIn.getPos())) {
              TileEntity tileentity = this.gameController.theWorld.getTileEntity(packetIn.getPos());
              int i = packetIn.getTileEntityType();
  
              if (i == 1 && tileentity instanceof TileEntityMobSpawner || i == 2 && tileentity instanceof TileEntityCommandBlock || i == 3 && tileentity instanceof TileEntityBeacon || i == 4 && tileentity instanceof TileEntitySkull || i == 5 && tileentity instanceof TileEntityFlowerPot || i == 6 && tileentity instanceof TileEntityBanner) {
                  tileentity.readFromNBT(packetIn.getNbtCompound());
              }
          }
      }
  
      public void handleWindowProperty(S31PacketWindowProperty packetIn) {
          PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController);
          EntityPlayer entityplayer = this.gameController.thePlayer;
  
          if (entityplayer.openContainer != null && entityplayer.openContainer.windowId == packetIn.getWindowId()) {
              entityplayer.openContainer.updateProgressBar(packetIn.getVarIndex(), packetIn.getVarValue());
          }
      }
  
      public void handleEntityEquipment(S04PacketEntityEquipment packetIn) {
          PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController);
          Entity entity = this.clientWorldController.getEntityByID(packetIn.getEntityID());
  
          if (entity != null) {
              entity.setCurrentItemOrArmor(packetIn.getEquipmentSlot(), packetIn.getItemStack());
          }
      }
  
      public void handleCloseWindow(S2EPacketCloseWindow packetIn) {
          PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController);
          this.gameController.thePlayer.closeScreenAndDropStack();
      }
  
      public void handleBlockAction(S24PacketBlockAction packetIn) {
          PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController);
          this.gameController.theWorld.addBlockEvent(packetIn.getBlockPosition(), packetIn.getBlockType(), packetIn.getData1(), packetIn.getData2());
      }
  
      public void handleBlockBreakAnim(S25PacketBlockBreakAnim packetIn) {
          PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController);
          this.gameController.theWorld.sendBlockBreakProgress(packetIn.getBreakerId(), packetIn.getPosition(), packetIn.getProgress());
      }
  
      public void handleMapChunkBulk(S26PacketMapChunkBulk packetIn) {
          PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController);
  
          for (int i = 0; i < packetIn.getChunkCount(); ++i) {
              int j = packetIn.getChunkX(i);
              int k = packetIn.getChunkZ(i);
              this.clientWorldController.doPreChunk(j, k, true);
              this.clientWorldController.invalidateBlockReceiveRegion(j << 4, 0, k << 4, (j << 4) + 15, 256, (k << 4) + 15);
              Chunk chunk = this.clientWorldController.getChunkFromChunkCoords(j, k);
              chunk.fillChunk(packetIn.getChunkBytes(i), packetIn.getChunkSize(i), true);
              this.clientWorldController.markBlockRangeForRenderUpdate(j << 4, 0, k << 4, (j << 4) + 15, 256, (k << 4) + 15);
  
              if (!(this.clientWorldController.provider instanceof WorldProviderSurface)) {
                  chunk.resetRelightChecks();
              }
          }
      }
  
      public void handleChangeGameState(S2BPacketChangeGameState packetIn) {
          PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController);
          EntityPlayer entityplayer = this.gameController.thePlayer;
          int i = packetIn.getGameState();
          float f = packetIn.func_149137_d();
          int j = MathHelper.floor_float(f + 0.5F);
  
          if (i >= 0 && i < S2BPacketChangeGameState.MESSAGE_NAMES.length && S2BPacketChangeGameState.MESSAGE_NAMES[i] != null) {
              entityplayer.addChatComponentMessage(new ChatComponentTranslation(S2BPacketChangeGameState.MESSAGE_NAMES[i]));
          }
  
          if (i == 1) {
              this.clientWorldController.getWorldInfo().setRaining(true);
              this.clientWorldController.setRainStrength(0.0F);
          } else if (i == 2) {
              this.clientWorldController.getWorldInfo().setRaining(false);
              this.clientWorldController.setRainStrength(1.0F);
          } else if (i == 3) {
              this.gameController.playerController.setGameType(WorldSettings.GameType.getByID(j));
          } else if (i == 4) {
              this.gameController.displayGuiScreen(new GuiWinGame());
          } else if (i == 6) {
              this.clientWorldController.playSound(entityplayer.posX, entityplayer.posY + (double) entityplayer.getEyeHeight(), entityplayer.posZ, "random.successful_hit", 0.18F, 0.45F, false);
          } else if (i == 7) {
              this.clientWorldController.setRainStrength(f);
          } else if (i == 8) {
              this.clientWorldController.setThunderStrength(f);
          } else if (i == 10) {
              this.clientWorldController.spawnParticle(EnumParticleTypes.MOB_APPEARANCE, entityplayer.posX, entityplayer.posY, entityplayer.posZ, 0.0D, 0.0D, 0.0D);
              this.clientWorldController.playSound(entityplayer.posX, entityplayer.posY, entityplayer.posZ, "mob.guardian.curse", 1.0F, 1.0F, false);
          }
      }
  
      public void handleMaps(S34PacketMaps packetIn) {
          PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController);
          MapData mapdata = ItemMap.loadMapData(packetIn.getMapId(), this.gameController.theWorld);
          packetIn.setMapdataTo(mapdata);
          this.gameController.entityRenderer.getMapItemRenderer().updateMapTexture(mapdata);
      }
  
      public void handleEffect(S28PacketEffect packetIn) {
          PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController);
  
          if (packetIn.isSoundServerwide()) {
              this.gameController.theWorld.playBroadcastSound(packetIn.getSoundType(), packetIn.getSoundPos(), packetIn.getSoundData());
          } else {
              this.gameController.theWorld.playAuxSFX(packetIn.getSoundType(), packetIn.getSoundPos(), packetIn.getSoundData());
          }
      }
  
      public void handleStatistics(S37PacketStatistics packetIn) {
          PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController);
          boolean flag = false;
  
          for (Entry<StatBase, Integer> entry : packetIn.func_148974_c().entrySet()) {
              StatBase statbase = entry.getKey();
              int i = entry.getValue().intValue();
  
              if (statbase.isAchievement() && i > 0) {
                  if (this.field_147308_k && this.gameController.thePlayer.getStatFileWriter().readStat(statbase) == 0) {
                      Achievement achievement = (Achievement) statbase;
                      this.gameController.guiAchievement.displayAchievement(achievement);
  
                      if (statbase == AchievementList.openInventory) {
                          this.gameController.gameSettings.showInventoryAchievementHint = false;
                          this.gameController.gameSettings.saveOptions();
                      }
                  }
  
                  flag = true;
              }
  
              this.gameController.thePlayer.getStatFileWriter().unlockAchievement(this.gameController.thePlayer, statbase, i);
          }
  
          if (!this.field_147308_k && !flag && this.gameController.gameSettings.showInventoryAchievementHint) {
              this.gameController.guiAchievement.displayUnformattedAchievement(AchievementList.openInventory);
          }
  
          this.field_147308_k = true;
  
          if (this.gameController.currentScreen instanceof IProgressMeter) {
              ((IProgressMeter) this.gameController.currentScreen).doneLoading();
          }
      }
  
      public void handleEntityEffect(S1DPacketEntityEffect packetIn) {
          PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController);
          Entity entity = this.clientWorldController.getEntityByID(packetIn.getEntityId());
  
          if (entity instanceof EntityLivingBase) {
              PotionEffect potioneffect = new PotionEffect(packetIn.getEffectId(), packetIn.getDuration(), packetIn.getAmplifier(), false, packetIn.func_179707_f());
              potioneffect.setPotionDurationMax(packetIn.func_149429_c());
              ((EntityLivingBase) entity).addPotionEffect(potioneffect);
          }
      }
  
      public void handleCombatEvent(S42PacketCombatEvent packetIn) {
          PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController);
          Entity entity = this.clientWorldController.getEntityByID(packetIn.field_179775_c);
          EntityLivingBase entitylivingbase = entity instanceof EntityLivingBase ? (EntityLivingBase) entity : null;
  
          if (packetIn.eventType == S42PacketCombatEvent.Event.END_COMBAT) {
              long i = 1000L * packetIn.field_179772_d / 20;
              //TODO investigate
              if (entitylivingbase != null) {
                  log.info("Combat ended between " + this.gameController.thePlayer.getName() + " and " + entitylivingbase.getName());
              } else {
                  log.info("Combat ended between " + this.gameController.thePlayer.getName() + " and others");
              }
              log.info("END COMBAT - " + i);
          }
      }
  
      public void handleServerDifficulty(S41PacketServerDifficulty packetIn) {
          PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController);
          this.gameController.theWorld.getWorldInfo().setDifficulty(packetIn.getDifficulty());
          this.gameController.theWorld.getWorldInfo().setDifficultyLocked(packetIn.isDifficultyLocked());
      }
  
      public void handleCamera(S43PacketCamera packetIn) {
          PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController);
          Entity entity = packetIn.getEntity(this.clientWorldController);
  
          if (entity != null) {
              this.gameController.setRenderViewEntity(entity);
          }
      }
  
      public void handleWorldBorder(S44PacketWorldBorder packetIn) {
          PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController);
          packetIn.func_179788_a(this.clientWorldController.getWorldBorder());
      }
  
      @SuppressWarnings("incomplete-switch")
      public void handleTitle(S45PacketTitle packetIn) {
          PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController);
          S45PacketTitle.Type s45packettitle$type = packetIn.getType();
          String s = null;
          String s1 = null;
          String s2 = packetIn.getMessage() != null ? packetIn.getMessage().getFormattedText() : "";
  
          switch (s45packettitle$type) {
              case TITLE:
                  s = s2;
                  break;
  
              case SUBTITLE:
                  s1 = s2;
                  break;
  
              case RESET:
                  this.gameController.ingameGUI.displayTitle("", "", -1, -1, -1);
                  this.gameController.ingameGUI.setDefaultTitlesTimes();
                  return;
          }
  
          this.gameController.ingameGUI.displayTitle(s, s1, packetIn.getFadeInTime(), packetIn.getDisplayTime(), packetIn.getFadeOutTime());
      }
  
      public void handleSetCompressionLevel(S46PacketSetCompressionLevel packetIn) {
          if (!this.netManager.isLocalChannel()) {
              this.netManager.setCompressionTreshold(packetIn.getThreshold());
          }
      }
  
      public void handlePlayerListHeaderFooter(S47PacketPlayerListHeaderFooter packetIn) {
          this.gameController.ingameGUI.getTabList().setHeader(packetIn.getHeader().getFormattedText().length() == 0 ? null : packetIn.getHeader());
          this.gameController.ingameGUI.getTabList().setFooter(packetIn.getFooter().getFormattedText().length() == 0 ? null : packetIn.getFooter());
      }
  
      public void handleRemoveEntityEffect(S1EPacketRemoveEntityEffect packetIn) {
          PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController);
          Entity entity = this.clientWorldController.getEntityByID(packetIn.getEntityId());
  
          if (entity instanceof EntityLivingBase) {
              ((EntityLivingBase) entity).removePotionEffectClient(packetIn.getEffectId());
          }
      }
  
      @SuppressWarnings("incomplete-switch")
      public void handlePlayerListItem(S38PacketPlayerListItem packetIn) {
          PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController);
  
          for (S38PacketPlayerListItem.AddPlayerData s38packetplayerlistitem$addplayerdata : packetIn.getEntries()) {
              if (packetIn.getAction() == S38PacketPlayerListItem.Action.REMOVE_PLAYER) {
                  this.playerInfoMap.remove(s38packetplayerlistitem$addplayerdata.getProfile().getId());
              } else {
                  NetworkPlayerInfo networkplayerinfo = this.playerInfoMap.get(s38packetplayerlistitem$addplayerdata.getProfile().getId());
  
                  if (packetIn.getAction() == S38PacketPlayerListItem.Action.ADD_PLAYER) {
                      networkplayerinfo = new NetworkPlayerInfo(s38packetplayerlistitem$addplayerdata);
                      this.playerInfoMap.put(networkplayerinfo.getGameProfile().getId(), networkplayerinfo);
                  }
  
                  if (networkplayerinfo != null) {
                      switch (packetIn.getAction()) {
                          case ADD_PLAYER:
                              networkplayerinfo.setGameType(s38packetplayerlistitem$addplayerdata.getGameMode());
                              networkplayerinfo.setResponseTime(s38packetplayerlistitem$addplayerdata.getPing());
                              break;
  
                          case UPDATE_GAME_MODE:
                              networkplayerinfo.setGameType(s38packetplayerlistitem$addplayerdata.getGameMode());
                              break;
  
                          case UPDATE_LATENCY:
                              networkplayerinfo.setResponseTime(s38packetplayerlistitem$addplayerdata.getPing());
                              break;
  
                          case UPDATE_DISPLAY_NAME:
                              networkplayerinfo.setDisplayName(s38packetplayerlistitem$addplayerdata.getDisplayName());
                      }
                  }
              }
          }
      }
  
      public void handleKeepAlive(S00PacketKeepAlive packetIn) {
          this.addToSendQueue(new C00PacketKeepAlive(packetIn.func_149134_c()));
      }
  
      public void handlePlayerAbilities(S39PacketPlayerAbilities packetIn) {
          PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController);
          EntityPlayer entityplayer = this.gameController.thePlayer;
          entityplayer.capabilities.isFlying = packetIn.isFlying();
          entityplayer.capabilities.isCreativeMode = packetIn.isCreativeMode();
          entityplayer.capabilities.disableDamage = packetIn.isInvulnerable();
          entityplayer.capabilities.allowFlying = packetIn.isAllowFlying();
          entityplayer.capabilities.setFlySpeed(packetIn.getFlySpeed());
          entityplayer.capabilities.setPlayerWalkSpeed(packetIn.getWalkSpeed());
      }
  
      public void handleTabComplete(S3APacketTabComplete packetIn) {
          PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController);
          String[] astring = packetIn.func_149630_c();
  
          if (this.gameController.currentScreen instanceof GuiChat) {
              GuiChat guichat = (GuiChat) this.gameController.currentScreen;
              guichat.onAutocompleteResponse(astring);
          }
      }
  
      public void handleSoundEffect(S29PacketSoundEffect packetIn) {
          PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController);
          this.gameController.theWorld.playSound(packetIn.getX(), packetIn.getY(), packetIn.getZ(), packetIn.getSoundName(), packetIn.getVolume(), packetIn.getPitch(), false);
      }
  
      public void handleResourcePack(S48PacketResourcePackSend packetIn) {
          final String s = packetIn.getURL();
          final String s1 = packetIn.getHash();
  
          if (s.startsWith("level://")) {
              String s2 = s.substring("level://".length());
              File file1 = new File(this.gameController.mcDataDir, "saves");
              File file2 = new File(file1, s2);
  
              if (file2.isFile()) {
                  this.netManager.sendPacket(new C19PacketResourcePackStatus(s1, C19PacketResourcePackStatus.Action.ACCEPTED));
                  Futures.addCallback(this.gameController.getResourcePackRepository().setResourcePackInstance(file2), new FutureCallback<Object>() {
                      public void onSuccess(Object p_onSuccess_1_) {
                          NetHandlerPlayClient.this.netManager.sendPacket(new C19PacketResourcePackStatus(s1, C19PacketResourcePackStatus.Action.SUCCESSFULLY_LOADED));
                      }
  
                      public void onFailure(Throwable p_onFailure_1_) {
                          NetHandlerPlayClient.this.netManager.sendPacket(new C19PacketResourcePackStatus(s1, C19PacketResourcePackStatus.Action.FAILED_DOWNLOAD));
                      }
                  });
              } else {
                  this.netManager.sendPacket(new C19PacketResourcePackStatus(s1, C19PacketResourcePackStatus.Action.FAILED_DOWNLOAD));
              }
          } else {
              if (this.gameController.getCurrentServerData() != null && this.gameController.getCurrentServerData().getResourceMode() == ServerData.ServerResourceMode.ENABLED) {
                  this.netManager.sendPacket(new C19PacketResourcePackStatus(s1, C19PacketResourcePackStatus.Action.ACCEPTED));
                  Futures.addCallback(this.gameController.getResourcePackRepository().downloadResourcePack(s, s1), new FutureCallback<Object>() {
                      public void onSuccess(Object p_onSuccess_1_) {
                          NetHandlerPlayClient.this.netManager.sendPacket(new C19PacketResourcePackStatus(s1, C19PacketResourcePackStatus.Action.SUCCESSFULLY_LOADED));
                      }
  
                      public void onFailure(Throwable p_onFailure_1_) {
                          NetHandlerPlayClient.this.netManager.sendPacket(new C19PacketResourcePackStatus(s1, C19PacketResourcePackStatus.Action.FAILED_DOWNLOAD));
                      }
                  });
              } else if (this.gameController.getCurrentServerData() != null && this.gameController.getCurrentServerData().getResourceMode() != ServerData.ServerResourceMode.PROMPT) {
                  this.netManager.sendPacket(new C19PacketResourcePackStatus(s1, C19PacketResourcePackStatus.Action.DECLINED));
              } else {
                  this.gameController.addScheduledTask(new Runnable() {
                      public void run() {
                          NetHandlerPlayClient.this.gameController.displayGuiScreen(new GuiYesNo(new GuiYesNoCallback() {
                              public void confirmClicked(boolean result, int id) {
                                  NetHandlerPlayClient.this.gameController = Minecraft.getMinecraft();
  
                                  if (result) {
                                      if (NetHandlerPlayClient.this.gameController.getCurrentServerData() != null) {
                                          NetHandlerPlayClient.this.gameController.getCurrentServerData().setResourceMode(ServerData.ServerResourceMode.ENABLED);
                                      }
  
                                      NetHandlerPlayClient.this.netManager.sendPacket(new C19PacketResourcePackStatus(s1, C19PacketResourcePackStatus.Action.ACCEPTED));
                                      Futures.addCallback(NetHandlerPlayClient.this.gameController.getResourcePackRepository().downloadResourcePack(s, s1), new FutureCallback<Object>() {
                                          public void onSuccess(Object p_onSuccess_1_) {
                                              NetHandlerPlayClient.this.netManager.sendPacket(new C19PacketResourcePackStatus(s1, C19PacketResourcePackStatus.Action.SUCCESSFULLY_LOADED));
                                          }
  
                                          public void onFailure(Throwable p_onFailure_1_) {
                                              NetHandlerPlayClient.this.netManager.sendPacket(new C19PacketResourcePackStatus(s1, C19PacketResourcePackStatus.Action.FAILED_DOWNLOAD));
                                          }
                                      });
                                  } else {
                                      if (NetHandlerPlayClient.this.gameController.getCurrentServerData() != null) {
                                          NetHandlerPlayClient.this.gameController.getCurrentServerData().setResourceMode(ServerData.ServerResourceMode.DISABLED);
                                      }
  
                                      NetHandlerPlayClient.this.netManager.sendPacket(new C19PacketResourcePackStatus(s1, C19PacketResourcePackStatus.Action.DECLINED));
                                  }
  
                                  ServerList.func_147414_b(NetHandlerPlayClient.this.gameController.getCurrentServerData());
                                  NetHandlerPlayClient.this.gameController.displayGuiScreen(null);
                              }
                          }, I18n.format("multiplayer.texturePrompt.line1"), I18n.format("multiplayer.texturePrompt.line2"), 0));
                      }
                  });
              }
          }
      }
  
      public void handleEntityNBT(S49PacketUpdateEntityNBT packetIn) {
          PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController);
          Entity entity = packetIn.getEntity(this.clientWorldController);
  
          if (entity != null) {
              entity.clientUpdateEntityNBT(packetIn.getTagCompound());
          }
      }
  
      public void handleCustomPayload(S3FPacketCustomPayload packetIn) {
          PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController);
  
          if ("MC|TrList".equals(packetIn.getChannelName())) {
              PacketBuffer packetbuffer = packetIn.getBufferData();
  
              try {
                  int i = packetbuffer.readInt();
                  GuiScreen guiscreen = this.gameController.currentScreen;
  
                  if (guiscreen != null && guiscreen instanceof GuiMerchant && i == this.gameController.thePlayer.openContainer.windowId) {
                      IMerchant imerchant = ((GuiMerchant) guiscreen).getMerchant();
                      MerchantRecipeList merchantrecipelist = MerchantRecipeList.readFromBuf(packetbuffer);
                      imerchant.setRecipes(merchantrecipelist);
                  }
              } catch (IOException ioexception) {
                  logger.error("Couldn't load trade info", ioexception);
              } finally {
                  packetbuffer.release();
              }
          } else if ("MC|Brand".equals(packetIn.getChannelName())) {
              this.gameController.thePlayer.setClientBrand(packetIn.getBufferData().readStringFromBuffer(32767));
          } else if ("MC|BOpen".equals(packetIn.getChannelName())) {
              ItemStack itemstack = this.gameController.thePlayer.getCurrentEquippedItem();
  
              if (itemstack != null && itemstack.getItem() == Items.written_book) {
                  this.gameController.displayGuiScreen(new GuiScreenBook(this.gameController.thePlayer, itemstack, false));
              }
          }
      }
  
      public void handleScoreboardObjective(S3BPacketScoreboardObjective packetIn) {
          PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController);
          Scoreboard scoreboard = this.clientWorldController.getScoreboard();
  
          if (packetIn.func_149338_e() == 0) {
              ScoreObjective scoreobjective = scoreboard.addScoreObjective(packetIn.func_149339_c(), IScoreObjectiveCriteria.DUMMY);
              scoreobjective.setDisplayName(packetIn.func_149337_d());
              scoreobjective.setRenderType(packetIn.func_179817_d());
          } else {
              ScoreObjective scoreobjective1 = scoreboard.getObjective(packetIn.func_149339_c());
  
              if (packetIn.func_149338_e() == 1) {
                  scoreboard.removeObjective(scoreobjective1);
              } else if (packetIn.func_149338_e() == 2) {
                  scoreobjective1.setDisplayName(packetIn.func_149337_d());
                  scoreobjective1.setRenderType(packetIn.func_179817_d());
              }
          }
      }
  
      public void handleUpdateScore(S3CPacketUpdateScore packetIn) {
          PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController);
          Scoreboard scoreboard = this.clientWorldController.getScoreboard();
          ScoreObjective scoreobjective = scoreboard.getObjective(packetIn.getObjectiveName());
  
          if (packetIn.getScoreAction() == S3CPacketUpdateScore.Action.CHANGE) {
              Score score = scoreboard.getValueFromObjective(packetIn.getPlayerName(), scoreobjective);
              score.setScorePoints(packetIn.getScoreValue());
          } else if (packetIn.getScoreAction() == S3CPacketUpdateScore.Action.REMOVE) {
              if (StringUtils.isNullOrEmpty(packetIn.getObjectiveName())) {
                  scoreboard.removeObjectiveFromEntity(packetIn.getPlayerName(), null);
              } else if (scoreobjective != null) {
                  scoreboard.removeObjectiveFromEntity(packetIn.getPlayerName(), scoreobjective);
              }
          }
      }
  
      public void handleDisplayScoreboard(S3DPacketDisplayScoreboard packetIn) {
          PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController);
          Scoreboard scoreboard = this.clientWorldController.getScoreboard();
  
          if (packetIn.func_149370_d().length() == 0) {
              scoreboard.setObjectiveInDisplaySlot(packetIn.func_149371_c(), null);
          } else {
              ScoreObjective scoreobjective = scoreboard.getObjective(packetIn.func_149370_d());
              scoreboard.setObjectiveInDisplaySlot(packetIn.func_149371_c(), scoreobjective);
          }
      }
  
      public void handleTeams(S3EPacketTeams packetIn) {
          PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController);
          Scoreboard scoreboard = this.clientWorldController.getScoreboard();
          ScorePlayerTeam scoreplayerteam;
  
          if (packetIn.getAction() == 0) {
              scoreplayerteam = scoreboard.createTeam(packetIn.getName());
          } else {
              scoreplayerteam = scoreboard.getTeam(packetIn.getName());
          }
  
          if (packetIn.getAction() == 0 || packetIn.getAction() == 2) {
              scoreplayerteam.setTeamName(packetIn.getDisplayName());
              scoreplayerteam.setNamePrefix(packetIn.getPrefix());
              scoreplayerteam.setNameSuffix(packetIn.getSuffix());
              scoreplayerteam.setChatFormat(EnumChatFormatting.func_175744_a(packetIn.getColor()));
              scoreplayerteam.func_98298_a(packetIn.getFriendlyFlags());
              Team.EnumVisible team$enumvisible = Team.EnumVisible.func_178824_a(packetIn.getNameTagVisibility());
  
              if (team$enumvisible != null) {
                  scoreplayerteam.setNameTagVisibility(team$enumvisible);
              }
          }
  
          if (packetIn.getAction() == 0 || packetIn.getAction() == 3) {
              for (String s : packetIn.getPlayers()) {
                  scoreboard.addPlayerToTeam(s, packetIn.getName());
              }
          }
  
          if (packetIn.getAction() == 4) {
              for (String s1 : packetIn.getPlayers()) {
                  scoreboard.removePlayerFromTeam(s1, scoreplayerteam);
              }
          }
  
          if (packetIn.getAction() == 1) {
              scoreboard.removeTeam(scoreplayerteam);
          }
      }
  
      public void handleParticles(S2APacketParticles packetIn) {
          PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController);
  
          if (packetIn.getParticleCount() == 0) {
              double d0 = packetIn.getParticleSpeed() * packetIn.getXOffset();
              double d2 = packetIn.getParticleSpeed() * packetIn.getYOffset();
              double d4 = packetIn.getParticleSpeed() * packetIn.getZOffset();
  
              try {
                  this.clientWorldController.spawnParticle(packetIn.getParticleType(), packetIn.isLongDistance(), packetIn.getXCoordinate(), packetIn.getYCoordinate(), packetIn.getZCoordinate(), d0, d2, d4, packetIn.getParticleArgs());
              } catch (Throwable var17) {
                  logger.warn("Could not spawn particle effect " + packetIn.getParticleType());
              }
          } else {
              for (int i = 0; i < packetIn.getParticleCount(); ++i) {
                  double d1 = this.avRandomizer.nextGaussian() * (double) packetIn.getXOffset();
                  double d3 = this.avRandomizer.nextGaussian() * (double) packetIn.getYOffset();
                  double d5 = this.avRandomizer.nextGaussian() * (double) packetIn.getZOffset();
                  double d6 = this.avRandomizer.nextGaussian() * (double) packetIn.getParticleSpeed();
                  double d7 = this.avRandomizer.nextGaussian() * (double) packetIn.getParticleSpeed();
                  double d8 = this.avRandomizer.nextGaussian() * (double) packetIn.getParticleSpeed();
  
                  try {
                      this.clientWorldController.spawnParticle(packetIn.getParticleType(), packetIn.isLongDistance(), packetIn.getXCoordinate() + d1, packetIn.getYCoordinate() + d3, packetIn.getZCoordinate() + d5, d6, d7, d8, packetIn.getParticleArgs());
                  } catch (Throwable var16) {
                      logger.warn("Could not spawn particle effect " + packetIn.getParticleType());
                      return;
                  }
              }
          }
      }
  
      public void handleEntityProperties(S20PacketEntityProperties packetIn) {
          PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController);
          Entity entity = this.clientWorldController.getEntityByID(packetIn.getEntityId());
  
          if (entity != null) {
              if (!(entity instanceof EntityLivingBase)) {
                  throw new IllegalStateException("Server tried to update attributes of a non-living entity (actually: " + entity + ")");
              } else {
                  BaseAttributeMap baseattributemap = ((EntityLivingBase) entity).getAttributeMap();
  
                  for (S20PacketEntityProperties.Snapshot s20packetentityproperties$snapshot : packetIn.func_149441_d()) {
                      IAttributeInstance iattributeinstance = baseattributemap.getAttributeInstanceByName(s20packetentityproperties$snapshot.func_151409_a());
  
                      if (iattributeinstance == null) {
                          iattributeinstance = baseattributemap.registerAttribute(new RangedAttribute(null, s20packetentityproperties$snapshot.func_151409_a(), 0.0D, 2.2250738585072014E-308D, Double.MAX_VALUE));
                      }
  
                      iattributeinstance.setBaseValue(s20packetentityproperties$snapshot.func_151410_b());
                      iattributeinstance.removeAllModifiers();
  
                      for (AttributeModifier attributemodifier : s20packetentityproperties$snapshot.func_151408_c()) {
                          iattributeinstance.applyModifier(attributemodifier);
                      }
                  }
              }
          }
      }
  
      public NetworkManager getNetworkManager() {
          return this.netManager;
      }
  
      public Collection<NetworkPlayerInfo> getPlayerInfoMap() {
          return this.playerInfoMap.values();
      }
  
      public NetworkPlayerInfo getPlayerInfo(UUID p_175102_1_) {
          return this.playerInfoMap.get(p_175102_1_);
      }
  
      public NetworkPlayerInfo getPlayerInfo(String p_175104_1_) {
          for (NetworkPlayerInfo networkplayerinfo : this.playerInfoMap.values()) {
              if (networkplayerinfo.getGameProfile().getName().equals(p_175104_1_)) {
                  return networkplayerinfo;
              }
          }
  
          return null;
      }
  
      public GameProfile getGameProfile() {
          return this.profile;
      }
  }
  