Java 类net.minecraft.network.packet.Packet41EntityEffect 实例源码

项目:RuneCraftery    文件:ServerConfigurationManager.java   
public void func_72356_a(EntityPlayerMP p_72356_1_, int p_72356_2_) {
   int var3 = p_72356_1_.field_71093_bK;
   WorldServer var4 = this.field_72400_f.func_71218_a(p_72356_1_.field_71093_bK);
   p_72356_1_.field_71093_bK = p_72356_2_;
   WorldServer var5 = this.field_72400_f.func_71218_a(p_72356_1_.field_71093_bK);
   p_72356_1_.field_71135_a.func_72567_b(new Packet9Respawn(p_72356_1_.field_71093_bK, (byte)p_72356_1_.field_70170_p.field_73013_u, var5.func_72912_H().func_76067_t(), var5.func_72800_K(), p_72356_1_.field_71134_c.func_73081_b()));
   var4.func_72973_f(p_72356_1_);
   p_72356_1_.field_70128_L = false;
   this.func_82448_a(p_72356_1_, var3, var4, var5);
   this.func_72375_a(p_72356_1_, var4);
   p_72356_1_.field_71135_a.func_72569_a(p_72356_1_.field_70165_t, p_72356_1_.field_70163_u, p_72356_1_.field_70161_v, p_72356_1_.field_70177_z, p_72356_1_.field_70125_A);
   p_72356_1_.field_71134_c.func_73080_a(var5);
   this.func_72354_b(p_72356_1_, var5);
   this.func_72385_f(p_72356_1_);
   Iterator var6 = p_72356_1_.func_70651_bq().iterator();

   while(var6.hasNext()) {
      PotionEffect var7 = (PotionEffect)var6.next();
      p_72356_1_.field_71135_a.func_72567_b(new Packet41EntityEffect(p_72356_1_.field_70157_k, var7));
   }

}
项目:RuneCraftery    文件:ServerConfigurationManager.java   
public void transferPlayerToDimension(EntityPlayerMP par1EntityPlayerMP, int par2, Teleporter teleporter)
{
    int j = par1EntityPlayerMP.dimension;
    WorldServer worldserver = this.mcServer.worldServerForDimension(par1EntityPlayerMP.dimension);
    par1EntityPlayerMP.dimension = par2;
    WorldServer worldserver1 = this.mcServer.worldServerForDimension(par1EntityPlayerMP.dimension);
    par1EntityPlayerMP.playerNetServerHandler.sendPacketToPlayer(new Packet9Respawn(par1EntityPlayerMP.dimension, (byte)par1EntityPlayerMP.worldObj.difficultySetting, worldserver1.getWorldInfo().getTerrainType(), worldserver1.getHeight(), par1EntityPlayerMP.theItemInWorldManager.getGameType()));
    worldserver.removePlayerEntityDangerously(par1EntityPlayerMP);
    par1EntityPlayerMP.isDead = false;
    this.transferEntityToWorld(par1EntityPlayerMP, j, worldserver, worldserver1, teleporter);
    this.func_72375_a(par1EntityPlayerMP, worldserver);
    par1EntityPlayerMP.playerNetServerHandler.setPlayerLocation(par1EntityPlayerMP.posX, par1EntityPlayerMP.posY, par1EntityPlayerMP.posZ, par1EntityPlayerMP.rotationYaw, par1EntityPlayerMP.rotationPitch);
    par1EntityPlayerMP.theItemInWorldManager.setWorld(worldserver1);
    this.updateTimeAndWeatherForPlayer(par1EntityPlayerMP, worldserver1);
    this.syncPlayerInventory(par1EntityPlayerMP);
    Iterator iterator = par1EntityPlayerMP.getActivePotionEffects().iterator();

    while (iterator.hasNext())
    {
        PotionEffect potioneffect = (PotionEffect)iterator.next();
        par1EntityPlayerMP.playerNetServerHandler.sendPacketToPlayer(new Packet41EntityEffect(par1EntityPlayerMP.entityId, potioneffect));
    }

    GameRegistry.onPlayerChangedDimension(par1EntityPlayerMP);
}
项目:BetterNutritionMod    文件:ServerConfigurationManager.java   
public void transferPlayerToDimension(EntityPlayerMP par1EntityPlayerMP, int par2, Teleporter teleporter)
{
    int j = par1EntityPlayerMP.dimension;
    WorldServer worldserver = this.mcServer.worldServerForDimension(par1EntityPlayerMP.dimension);
    par1EntityPlayerMP.dimension = par2;
    WorldServer worldserver1 = this.mcServer.worldServerForDimension(par1EntityPlayerMP.dimension);
    par1EntityPlayerMP.playerNetServerHandler.sendPacketToPlayer(new Packet9Respawn(par1EntityPlayerMP.dimension, (byte)par1EntityPlayerMP.worldObj.difficultySetting, worldserver1.getWorldInfo().getTerrainType(), worldserver1.getHeight(), par1EntityPlayerMP.theItemInWorldManager.getGameType()));
    worldserver.removePlayerEntityDangerously(par1EntityPlayerMP);
    par1EntityPlayerMP.isDead = false;
    this.transferEntityToWorld(par1EntityPlayerMP, j, worldserver, worldserver1, teleporter);
    this.func_72375_a(par1EntityPlayerMP, worldserver);
    par1EntityPlayerMP.playerNetServerHandler.setPlayerLocation(par1EntityPlayerMP.posX, par1EntityPlayerMP.posY, par1EntityPlayerMP.posZ, par1EntityPlayerMP.rotationYaw, par1EntityPlayerMP.rotationPitch);
    par1EntityPlayerMP.theItemInWorldManager.setWorld(worldserver1);
    this.updateTimeAndWeatherForPlayer(par1EntityPlayerMP, worldserver1);
    this.syncPlayerInventory(par1EntityPlayerMP);
    Iterator iterator = par1EntityPlayerMP.getActivePotionEffects().iterator();

    while (iterator.hasNext())
    {
        PotionEffect potioneffect = (PotionEffect)iterator.next();
        par1EntityPlayerMP.playerNetServerHandler.sendPacketToPlayer(new Packet41EntityEffect(par1EntityPlayerMP.entityId, potioneffect));
    }

    GameRegistry.onPlayerChangedDimension(par1EntityPlayerMP);
}
项目:RuneCraftery    文件:NetClientHandler.java   
public void func_72503_a(Packet41EntityEffect p_72503_1_) {
   Entity var2 = this.func_72545_a(p_72503_1_.field_73420_a);
   if(var2 instanceof EntityLivingBase) {
      PotionEffect var3 = new PotionEffect(p_72503_1_.field_73418_b, p_72503_1_.field_73417_d, p_72503_1_.field_73419_c);
      var3.func_100012_b(p_72503_1_.func_100008_d());
      ((EntityLivingBase)var2).func_70690_d(var3);
   }
}
项目:RuneCraftery    文件:NetClientHandler.java   
/**
 * Handle an entity effect packet.
 */
public void handleEntityEffect(Packet41EntityEffect par1Packet41EntityEffect)
{
    Entity entity = this.getEntityByID(par1Packet41EntityEffect.entityId);

    if (entity instanceof EntityLivingBase)
    {
        PotionEffect potioneffect = new PotionEffect(par1Packet41EntityEffect.effectId, par1Packet41EntityEffect.duration, par1Packet41EntityEffect.effectAmplifier);
        potioneffect.setPotionDurationMax(par1Packet41EntityEffect.isDurationMax());
        ((EntityLivingBase)entity).addPotionEffect(potioneffect);
    }
}
项目:BetterNutritionMod    文件:NetClientHandler.java   
/**
 * Handle an entity effect packet.
 */
public void handleEntityEffect(Packet41EntityEffect par1Packet41EntityEffect)
{
    Entity entity = this.getEntityByID(par1Packet41EntityEffect.entityId);

    if (entity instanceof EntityLivingBase)
    {
        PotionEffect potioneffect = new PotionEffect(par1Packet41EntityEffect.effectId, par1Packet41EntityEffect.duration, par1Packet41EntityEffect.effectAmplifier);
        potioneffect.setPotionDurationMax(par1Packet41EntityEffect.isDurationMax());
        ((EntityLivingBase)entity).addPotionEffect(potioneffect);
    }
}
项目:forge_world_downloader    文件:WDLNetClientHandler.java   
@Override
public void handleEntityEffect(Packet41EntityEffect par1Packet41EntityEffect)
{
    nch.handleEntityEffect(par1Packet41EntityEffect);       
}
项目:RuneCraftery    文件:EntityTrackerEntry.java   
public void func_73117_b(EntityPlayerMP p_73117_1_) {
   if(p_73117_1_ != this.field_73132_a) {
      double var2 = p_73117_1_.field_70165_t - (double)(this.field_73128_d / 32);
      double var4 = p_73117_1_.field_70161_v - (double)(this.field_73126_f / 32);
      if(var2 >= (double)(-this.field_73130_b) && var2 <= (double)this.field_73130_b && var4 >= (double)(-this.field_73130_b) && var4 <= (double)this.field_73130_b) {
         if(!this.field_73134_o.contains(p_73117_1_) && (this.func_73121_d(p_73117_1_) || this.field_73132_a.field_98038_p)) {
            this.field_73134_o.add(p_73117_1_);
            Packet var6 = this.func_73124_b();
            p_73117_1_.field_71135_a.func_72567_b(var6);
            if(!this.field_73132_a.func_70096_w().func_92085_d()) {
               p_73117_1_.field_71135_a.func_72567_b(new Packet40EntityMetadata(this.field_73132_a.field_70157_k, this.field_73132_a.func_70096_w(), true));
            }

            if(this.field_73132_a instanceof EntityLivingBase) {
               ServersideAttributeMap var7 = (ServersideAttributeMap)((EntityLivingBase)this.field_73132_a).func_110140_aT();
               Collection var8 = var7.func_111160_c();
               if(!var8.isEmpty()) {
                  p_73117_1_.field_71135_a.func_72567_b(new Packet44UpdateAttributes(this.field_73132_a.field_70157_k, var8));
               }
            }

            this.field_73137_j = this.field_73132_a.field_70159_w;
            this.field_73138_k = this.field_73132_a.field_70181_x;
            this.field_73135_l = this.field_73132_a.field_70179_y;
            if(this.field_73143_t && !(var6 instanceof Packet24MobSpawn)) {
               p_73117_1_.field_71135_a.func_72567_b(new Packet28EntityVelocity(this.field_73132_a.field_70157_k, this.field_73132_a.field_70159_w, this.field_73132_a.field_70181_x, this.field_73132_a.field_70179_y));
            }

            if(this.field_73132_a.field_70154_o != null) {
               p_73117_1_.field_71135_a.func_72567_b(new Packet39AttachEntity(0, this.field_73132_a, this.field_73132_a.field_70154_o));
            }

            if(this.field_73132_a instanceof EntityLiving && ((EntityLiving)this.field_73132_a).func_110166_bE() != null) {
               p_73117_1_.field_71135_a.func_72567_b(new Packet39AttachEntity(1, this.field_73132_a, ((EntityLiving)this.field_73132_a).func_110166_bE()));
            }

            if(this.field_73132_a instanceof EntityLivingBase) {
               for(int var10 = 0; var10 < 5; ++var10) {
                  ItemStack var13 = ((EntityLivingBase)this.field_73132_a).func_71124_b(var10);
                  if(var13 != null) {
                     p_73117_1_.field_71135_a.func_72567_b(new Packet5PlayerInventory(this.field_73132_a.field_70157_k, var10, var13));
                  }
               }
            }

            if(this.field_73132_a instanceof EntityPlayer) {
               EntityPlayer var11 = (EntityPlayer)this.field_73132_a;
               if(var11.func_70608_bn()) {
                  p_73117_1_.field_71135_a.func_72567_b(new Packet17Sleep(this.field_73132_a, 0, MathHelper.func_76128_c(this.field_73132_a.field_70165_t), MathHelper.func_76128_c(this.field_73132_a.field_70163_u), MathHelper.func_76128_c(this.field_73132_a.field_70161_v)));
               }
            }

            if(this.field_73132_a instanceof EntityLivingBase) {
               EntityLivingBase var14 = (EntityLivingBase)this.field_73132_a;
               Iterator var12 = var14.func_70651_bq().iterator();

               while(var12.hasNext()) {
                  PotionEffect var9 = (PotionEffect)var12.next();
                  p_73117_1_.field_71135_a.func_72567_b(new Packet41EntityEffect(this.field_73132_a.field_70157_k, var9));
               }
            }
         }
      } else if(this.field_73134_o.contains(p_73117_1_)) {
         this.field_73134_o.remove(p_73117_1_);
         p_73117_1_.field_71130_g.add(Integer.valueOf(this.field_73132_a.field_70157_k));
      }

   }
}
项目:RuneCraftery    文件:EntityPlayerMP.java   
protected void func_70670_a(PotionEffect p_70670_1_) {
   super.func_70670_a(p_70670_1_);
   this.field_71135_a.func_72567_b(new Packet41EntityEffect(this.field_70157_k, p_70670_1_));
}
项目:RuneCraftery    文件:EntityPlayerMP.java   
protected void func_70695_b(PotionEffect p_70695_1_, boolean p_70695_2_) {
   super.func_70695_b(p_70695_1_, p_70695_2_);
   this.field_71135_a.func_72567_b(new Packet41EntityEffect(this.field_70157_k, p_70695_1_));
}
项目:RuneCraftery    文件:NetHandler.java   
public void func_72503_a(Packet41EntityEffect p_72503_1_) {
   this.func_72509_a(p_72503_1_);
}
项目:RuneCraftery    文件:ServerConfigurationManager.java   
public void func_72355_a(INetworkManager p_72355_1_, EntityPlayerMP p_72355_2_) {
   NBTTagCompound var3 = this.func_72380_a(p_72355_2_);
   p_72355_2_.func_70029_a(this.field_72400_f.func_71218_a(p_72355_2_.field_71093_bK));
   p_72355_2_.field_71134_c.func_73080_a((WorldServer)p_72355_2_.field_70170_p);
   String var4 = "local";
   if(p_72355_1_.func_74430_c() != null) {
      var4 = p_72355_1_.func_74430_c().toString();
   }

   this.field_72400_f.func_98033_al().func_98233_a(p_72355_2_.func_70005_c_() + "[" + var4 + "] logged in with entity id " + p_72355_2_.field_70157_k + " at (" + p_72355_2_.field_70165_t + ", " + p_72355_2_.field_70163_u + ", " + p_72355_2_.field_70161_v + ")");
   WorldServer var5 = this.field_72400_f.func_71218_a(p_72355_2_.field_71093_bK);
   ChunkCoordinates var6 = var5.func_72861_E();
   this.func_72381_a(p_72355_2_, (EntityPlayerMP)null, var5);
   NetServerHandler var7 = new NetServerHandler(this.field_72400_f, p_72355_1_, p_72355_2_);
   var7.func_72567_b(new Packet1Login(p_72355_2_.field_70157_k, var5.func_72912_H().func_76067_t(), p_72355_2_.field_71134_c.func_73081_b(), var5.func_72912_H().func_76093_s(), var5.field_73011_w.field_76574_g, var5.field_73013_u, var5.func_72800_K(), this.func_72352_l()));
   var7.func_72567_b(new Packet250CustomPayload("MC|Brand", this.func_72365_p().getServerModName().getBytes(Charsets.UTF_8)));
   var7.func_72567_b(new Packet6SpawnPosition(var6.field_71574_a, var6.field_71572_b, var6.field_71573_c));
   var7.func_72567_b(new Packet202PlayerAbilities(p_72355_2_.field_71075_bZ));
   var7.func_72567_b(new Packet16BlockItemSwitch(p_72355_2_.field_71071_by.field_70461_c));
   this.func_96456_a((ServerScoreboard)var5.func_96441_U(), p_72355_2_);
   this.func_72354_b(p_72355_2_, var5);
   this.func_92062_k(ChatMessageComponent.func_111082_b("multiplayer.player.joined", new Object[]{p_72355_2_.func_96090_ax()}).func_111059_a(EnumChatFormatting.YELLOW));
   this.func_72377_c(p_72355_2_);
   var7.func_72569_a(p_72355_2_.field_70165_t, p_72355_2_.field_70163_u, p_72355_2_.field_70161_v, p_72355_2_.field_70177_z, p_72355_2_.field_70125_A);
   this.field_72400_f.func_71212_ac().func_71745_a(var7);
   var7.func_72567_b(new Packet4UpdateTime(var5.func_82737_E(), var5.func_72820_D(), var5.func_82736_K().func_82766_b("doDaylightCycle")));
   if(this.field_72400_f.func_71202_P().length() > 0) {
      p_72355_2_.func_71115_a(this.field_72400_f.func_71202_P(), this.field_72400_f.func_71227_R());
   }

   Iterator var8 = p_72355_2_.func_70651_bq().iterator();

   while(var8.hasNext()) {
      PotionEffect var9 = (PotionEffect)var8.next();
      var7.func_72567_b(new Packet41EntityEffect(p_72355_2_.field_70157_k, var9));
   }

   p_72355_2_.func_71116_b();
   if(var3 != null && var3.func_74764_b("Riding")) {
      Entity var10 = EntityList.func_75615_a(var3.func_74775_l("Riding"), var5);
      if(var10 != null) {
         var10.field_98038_p = true;
         var5.func_72838_d(var10);
         p_72355_2_.func_70078_a(var10);
         var10.field_98038_p = false;
      }
   }

}
项目:RuneCraftery    文件:EntityPlayerMP.java   
protected void onNewPotionEffect(PotionEffect par1PotionEffect)
{
    super.onNewPotionEffect(par1PotionEffect);
    this.playerNetServerHandler.sendPacketToPlayer(new Packet41EntityEffect(this.entityId, par1PotionEffect));
}
项目:RuneCraftery    文件:EntityPlayerMP.java   
protected void onChangedPotionEffect(PotionEffect par1PotionEffect, boolean par2)
{
    super.onChangedPotionEffect(par1PotionEffect, par2);
    this.playerNetServerHandler.sendPacketToPlayer(new Packet41EntityEffect(this.entityId, par1PotionEffect));
}
项目:RuneCraftery    文件:ServerConfigurationManager.java   
public void initializeConnectionToPlayer(INetworkManager par1INetworkManager, EntityPlayerMP par2EntityPlayerMP)
{
    NBTTagCompound nbttagcompound = this.readPlayerDataFromFile(par2EntityPlayerMP);
    par2EntityPlayerMP.setWorld(this.mcServer.worldServerForDimension(par2EntityPlayerMP.dimension));
    par2EntityPlayerMP.theItemInWorldManager.setWorld((WorldServer)par2EntityPlayerMP.worldObj);
    String s = "local";

    if (par1INetworkManager.getSocketAddress() != null)
    {
        s = par1INetworkManager.getSocketAddress().toString();
    }

    this.mcServer.getLogAgent().logInfo(par2EntityPlayerMP.getCommandSenderName() + "[" + s + "] logged in with entity id " + par2EntityPlayerMP.entityId + " at (" + par2EntityPlayerMP.posX + ", " + par2EntityPlayerMP.posY + ", " + par2EntityPlayerMP.posZ + ")");
    WorldServer worldserver = this.mcServer.worldServerForDimension(par2EntityPlayerMP.dimension);
    ChunkCoordinates chunkcoordinates = worldserver.getSpawnPoint();
    this.func_72381_a(par2EntityPlayerMP, (EntityPlayerMP)null, worldserver);
    NetServerHandler netserverhandler = new NetServerHandler(this.mcServer, par1INetworkManager, par2EntityPlayerMP);
    netserverhandler.sendPacketToPlayer(new Packet1Login(par2EntityPlayerMP.entityId, worldserver.getWorldInfo().getTerrainType(), par2EntityPlayerMP.theItemInWorldManager.getGameType(), worldserver.getWorldInfo().isHardcoreModeEnabled(), worldserver.provider.dimensionId, worldserver.difficultySetting, worldserver.getHeight(), this.getMaxPlayers()));
    netserverhandler.sendPacketToPlayer(new Packet250CustomPayload("MC|Brand", this.getServerInstance().getServerModName().getBytes(Charsets.UTF_8)));
    netserverhandler.sendPacketToPlayer(new Packet6SpawnPosition(chunkcoordinates.posX, chunkcoordinates.posY, chunkcoordinates.posZ));
    netserverhandler.sendPacketToPlayer(new Packet202PlayerAbilities(par2EntityPlayerMP.capabilities));
    netserverhandler.sendPacketToPlayer(new Packet16BlockItemSwitch(par2EntityPlayerMP.inventory.currentItem));
    this.func_96456_a((ServerScoreboard)worldserver.getScoreboard(), par2EntityPlayerMP);
    this.updateTimeAndWeatherForPlayer(par2EntityPlayerMP, worldserver);
    this.sendChatMsg(ChatMessageComponent.createFromTranslationWithSubstitutions("multiplayer.player.joined", new Object[] {par2EntityPlayerMP.getTranslatedEntityName()}).setColor(EnumChatFormatting.YELLOW));
    this.playerLoggedIn(par2EntityPlayerMP);
    netserverhandler.setPlayerLocation(par2EntityPlayerMP.posX, par2EntityPlayerMP.posY, par2EntityPlayerMP.posZ, par2EntityPlayerMP.rotationYaw, par2EntityPlayerMP.rotationPitch);
    this.mcServer.getNetworkThread().addPlayer(netserverhandler);
    netserverhandler.sendPacketToPlayer(new Packet4UpdateTime(worldserver.getTotalWorldTime(), worldserver.getWorldTime(), worldserver.getGameRules().getGameRuleBooleanValue("doDaylightCycle")));

    if (this.mcServer.getTexturePack().length() > 0)
    {
        par2EntityPlayerMP.requestTexturePackLoad(this.mcServer.getTexturePack(), this.mcServer.textureSize());
    }

    Iterator iterator = par2EntityPlayerMP.getActivePotionEffects().iterator();

    while (iterator.hasNext())
    {
        PotionEffect potioneffect = (PotionEffect)iterator.next();
        netserverhandler.sendPacketToPlayer(new Packet41EntityEffect(par2EntityPlayerMP.entityId, potioneffect));
    }

    par2EntityPlayerMP.addSelfToInternalCraftingInventory();

    FMLNetworkHandler.handlePlayerLogin(par2EntityPlayerMP, netserverhandler, par1INetworkManager);

    if (nbttagcompound != null && nbttagcompound.hasKey("Riding"))
    {
        Entity entity = EntityList.createEntityFromNBT(nbttagcompound.getCompoundTag("Riding"), worldserver);

        if (entity != null)
        {
            entity.forceSpawn = true;
            worldserver.spawnEntityInWorld(entity);
            par2EntityPlayerMP.mountEntity(entity);
            entity.forceSpawn = false;
        }
    }
}
项目:BetterNutritionMod    文件:EntityPlayerMP.java   
protected void onNewPotionEffect(PotionEffect par1PotionEffect)
{
    super.onNewPotionEffect(par1PotionEffect);
    this.playerNetServerHandler.sendPacketToPlayer(new Packet41EntityEffect(this.entityId, par1PotionEffect));
}
项目:BetterNutritionMod    文件:EntityPlayerMP.java   
protected void onChangedPotionEffect(PotionEffect par1PotionEffect, boolean par2)
{
    super.onChangedPotionEffect(par1PotionEffect, par2);
    this.playerNetServerHandler.sendPacketToPlayer(new Packet41EntityEffect(this.entityId, par1PotionEffect));
}
项目:BetterNutritionMod    文件:ServerConfigurationManager.java   
public void initializeConnectionToPlayer(INetworkManager par1INetworkManager, EntityPlayerMP par2EntityPlayerMP)
{
    NBTTagCompound nbttagcompound = this.readPlayerDataFromFile(par2EntityPlayerMP);
    par2EntityPlayerMP.setWorld(this.mcServer.worldServerForDimension(par2EntityPlayerMP.dimension));
    par2EntityPlayerMP.theItemInWorldManager.setWorld((WorldServer)par2EntityPlayerMP.worldObj);
    String s = "local";

    if (par1INetworkManager.getSocketAddress() != null)
    {
        s = par1INetworkManager.getSocketAddress().toString();
    }

    this.mcServer.getLogAgent().logInfo(par2EntityPlayerMP.getCommandSenderName() + "[" + s + "] logged in with entity id " + par2EntityPlayerMP.entityId + " at (" + par2EntityPlayerMP.posX + ", " + par2EntityPlayerMP.posY + ", " + par2EntityPlayerMP.posZ + ")");
    WorldServer worldserver = this.mcServer.worldServerForDimension(par2EntityPlayerMP.dimension);
    ChunkCoordinates chunkcoordinates = worldserver.getSpawnPoint();
    this.func_72381_a(par2EntityPlayerMP, (EntityPlayerMP)null, worldserver);
    NetServerHandler netserverhandler = new NetServerHandler(this.mcServer, par1INetworkManager, par2EntityPlayerMP);
    netserverhandler.sendPacketToPlayer(new Packet1Login(par2EntityPlayerMP.entityId, worldserver.getWorldInfo().getTerrainType(), par2EntityPlayerMP.theItemInWorldManager.getGameType(), worldserver.getWorldInfo().isHardcoreModeEnabled(), worldserver.provider.dimensionId, worldserver.difficultySetting, worldserver.getHeight(), this.getMaxPlayers()));
    netserverhandler.sendPacketToPlayer(new Packet250CustomPayload("MC|Brand", this.getServerInstance().getServerModName().getBytes(Charsets.UTF_8)));
    netserverhandler.sendPacketToPlayer(new Packet6SpawnPosition(chunkcoordinates.posX, chunkcoordinates.posY, chunkcoordinates.posZ));
    netserverhandler.sendPacketToPlayer(new Packet202PlayerAbilities(par2EntityPlayerMP.capabilities));
    netserverhandler.sendPacketToPlayer(new Packet16BlockItemSwitch(par2EntityPlayerMP.inventory.currentItem));
    this.func_96456_a((ServerScoreboard)worldserver.getScoreboard(), par2EntityPlayerMP);
    this.updateTimeAndWeatherForPlayer(par2EntityPlayerMP, worldserver);
    this.sendChatMsg(ChatMessageComponent.createFromTranslationWithSubstitutions("multiplayer.player.joined", new Object[] {par2EntityPlayerMP.getTranslatedEntityName()}).setColor(EnumChatFormatting.YELLOW));
    this.playerLoggedIn(par2EntityPlayerMP);
    netserverhandler.setPlayerLocation(par2EntityPlayerMP.posX, par2EntityPlayerMP.posY, par2EntityPlayerMP.posZ, par2EntityPlayerMP.rotationYaw, par2EntityPlayerMP.rotationPitch);
    this.mcServer.getNetworkThread().addPlayer(netserverhandler);
    netserverhandler.sendPacketToPlayer(new Packet4UpdateTime(worldserver.getTotalWorldTime(), worldserver.getWorldTime(), worldserver.getGameRules().getGameRuleBooleanValue("doDaylightCycle")));

    if (this.mcServer.getTexturePack().length() > 0)
    {
        par2EntityPlayerMP.requestTexturePackLoad(this.mcServer.getTexturePack(), this.mcServer.textureSize());
    }

    Iterator iterator = par2EntityPlayerMP.getActivePotionEffects().iterator();

    while (iterator.hasNext())
    {
        PotionEffect potioneffect = (PotionEffect)iterator.next();
        netserverhandler.sendPacketToPlayer(new Packet41EntityEffect(par2EntityPlayerMP.entityId, potioneffect));
    }

    par2EntityPlayerMP.addSelfToInternalCraftingInventory();

    FMLNetworkHandler.handlePlayerLogin(par2EntityPlayerMP, netserverhandler, par1INetworkManager);

    if (nbttagcompound != null && nbttagcompound.hasKey("Riding"))
    {
        Entity entity = EntityList.createEntityFromNBT(nbttagcompound.getCompoundTag("Riding"), worldserver);

        if (entity != null)
        {
            entity.forceSpawn = true;
            worldserver.spawnEntityInWorld(entity);
            par2EntityPlayerMP.mountEntity(entity);
            entity.forceSpawn = false;
        }
    }
}