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

项目:RuneCraftery    文件:ServerConfigurationManager.java   
/**
 * Called when a player disconnects from the game. Writes player data to disk and removes them from the world.
 */
public void playerLoggedOut(EntityPlayerMP par1EntityPlayerMP)
{
    GameRegistry.onPlayerLogout(par1EntityPlayerMP);
    this.writePlayerData(par1EntityPlayerMP);
    WorldServer worldserver = par1EntityPlayerMP.getServerForPlayer();

    if (par1EntityPlayerMP.ridingEntity != null)
    {
        worldserver.removePlayerEntityDangerously(par1EntityPlayerMP.ridingEntity);
        System.out.println("removing player mount");
    }

    worldserver.removeEntity(par1EntityPlayerMP);
    worldserver.getPlayerManager().removePlayer(par1EntityPlayerMP);
    this.playerEntityList.remove(par1EntityPlayerMP);
    this.sendPacketToAllPlayers(new Packet201PlayerInfo(par1EntityPlayerMP.getCommandSenderName(), false, 9999));
}
项目:BetterNutritionMod    文件:ServerConfigurationManager.java   
/**
 * Called when a player disconnects from the game. Writes player data to disk and removes them from the world.
 */
public void playerLoggedOut(EntityPlayerMP par1EntityPlayerMP)
{
    GameRegistry.onPlayerLogout(par1EntityPlayerMP);
    this.writePlayerData(par1EntityPlayerMP);
    WorldServer worldserver = par1EntityPlayerMP.getServerForPlayer();

    if (par1EntityPlayerMP.ridingEntity != null)
    {
        worldserver.removePlayerEntityDangerously(par1EntityPlayerMP.ridingEntity);
        System.out.println("removing player mount");
    }

    worldserver.removeEntity(par1EntityPlayerMP);
    worldserver.getPlayerManager().removePlayer(par1EntityPlayerMP);
    this.playerEntityList.remove(par1EntityPlayerMP);
    this.sendPacketToAllPlayers(new Packet201PlayerInfo(par1EntityPlayerMP.getCommandSenderName(), false, 9999));
}
项目:RuneCraftery    文件:ServerConfigurationManager.java   
public void func_72377_c(EntityPlayerMP p_72377_1_) {
   this.func_72384_a(new Packet201PlayerInfo(p_72377_1_.func_70005_c_(), true, 1000));
   this.field_72404_b.add(p_72377_1_);
   WorldServer var2 = this.field_72400_f.func_71218_a(p_72377_1_.field_71093_bK);
   var2.func_72838_d(p_72377_1_);
   this.func_72375_a(p_72377_1_, (WorldServer)null);

   for(int var3 = 0; var3 < this.field_72404_b.size(); ++var3) {
      EntityPlayerMP var4 = (EntityPlayerMP)this.field_72404_b.get(var3);
      p_72377_1_.field_71135_a.func_72567_b(new Packet201PlayerInfo(var4.func_70005_c_(), true, var4.field_71138_i));
   }

}
项目:RuneCraftery    文件:ServerConfigurationManager.java   
public void func_72367_e(EntityPlayerMP p_72367_1_) {
   this.func_72391_b(p_72367_1_);
   WorldServer var2 = p_72367_1_.func_71121_q();
   if(p_72367_1_.field_70154_o != null) {
      var2.func_72973_f(p_72367_1_.field_70154_o);
      System.out.println("removing player mount");
   }

   var2.func_72900_e(p_72367_1_);
   var2.func_73040_p().func_72695_c(p_72367_1_);
   this.field_72404_b.remove(p_72367_1_);
   this.func_72384_a(new Packet201PlayerInfo(p_72367_1_.func_70005_c_(), false, 9999));
}
项目:RuneCraftery    文件:ServerConfigurationManager.java   
public void func_72374_b() {
   if(++this.field_72408_o > 600) {
      this.field_72408_o = 0;
   }

   if(this.field_72408_o < this.field_72404_b.size()) {
      EntityPlayerMP var1 = (EntityPlayerMP)this.field_72404_b.get(this.field_72408_o);
      this.func_72384_a(new Packet201PlayerInfo(var1.func_70005_c_(), true, var1.field_71138_i));
   }

}
项目:RuneCraftery    文件:ServerConfigurationManager.java   
/**
 * Called when a player successfully logs in. Reads player data from disk and inserts the player into the world.
 */
public void playerLoggedIn(EntityPlayerMP par1EntityPlayerMP)
{
    this.sendPacketToAllPlayers(new Packet201PlayerInfo(par1EntityPlayerMP.getCommandSenderName(), true, 1000));
    this.playerEntityList.add(par1EntityPlayerMP);
    WorldServer worldserver = this.mcServer.worldServerForDimension(par1EntityPlayerMP.dimension);
    worldserver.spawnEntityInWorld(par1EntityPlayerMP);
    this.func_72375_a(par1EntityPlayerMP, (WorldServer)null);

    for (int i = 0; i < this.playerEntityList.size(); ++i)
    {
        EntityPlayerMP entityplayermp1 = (EntityPlayerMP)this.playerEntityList.get(i);
        par1EntityPlayerMP.playerNetServerHandler.sendPacketToPlayer(new Packet201PlayerInfo(entityplayermp1.getCommandSenderName(), true, entityplayermp1.ping));
    }
}
项目:RuneCraftery    文件:ServerConfigurationManager.java   
/**
 * sends 1 player per tick, but only sends a player once every 600 ticks
 */
public void sendPlayerInfoToAllPlayers()
{
    if (++this.playerPingIndex > 600)
    {
        this.playerPingIndex = 0;
    }

    if (this.playerPingIndex < this.playerEntityList.size())
    {
        EntityPlayerMP entityplayermp = (EntityPlayerMP)this.playerEntityList.get(this.playerPingIndex);
        this.sendPacketToAllPlayers(new Packet201PlayerInfo(entityplayermp.getCommandSenderName(), true, entityplayermp.ping));
    }
}
项目:BetterNutritionMod    文件:ServerConfigurationManager.java   
/**
 * Called when a player successfully logs in. Reads player data from disk and inserts the player into the world.
 */
public void playerLoggedIn(EntityPlayerMP par1EntityPlayerMP)
{
    this.sendPacketToAllPlayers(new Packet201PlayerInfo(par1EntityPlayerMP.getCommandSenderName(), true, 1000));
    this.playerEntityList.add(par1EntityPlayerMP);
    WorldServer worldserver = this.mcServer.worldServerForDimension(par1EntityPlayerMP.dimension);
    worldserver.spawnEntityInWorld(par1EntityPlayerMP);
    this.func_72375_a(par1EntityPlayerMP, (WorldServer)null);

    for (int i = 0; i < this.playerEntityList.size(); ++i)
    {
        EntityPlayerMP entityplayermp1 = (EntityPlayerMP)this.playerEntityList.get(i);
        par1EntityPlayerMP.playerNetServerHandler.sendPacketToPlayer(new Packet201PlayerInfo(entityplayermp1.getCommandSenderName(), true, entityplayermp1.ping));
    }
}
项目:BetterNutritionMod    文件:ServerConfigurationManager.java   
/**
 * sends 1 player per tick, but only sends a player once every 600 ticks
 */
public void sendPlayerInfoToAllPlayers()
{
    if (++this.playerPingIndex > 600)
    {
        this.playerPingIndex = 0;
    }

    if (this.playerPingIndex < this.playerEntityList.size())
    {
        EntityPlayerMP entityplayermp = (EntityPlayerMP)this.playerEntityList.get(this.playerPingIndex);
        this.sendPacketToAllPlayers(new Packet201PlayerInfo(entityplayermp.getCommandSenderName(), true, entityplayermp.ping));
    }
}
项目:forge_world_downloader    文件:WDLNetClientHandler.java   
@Override
public void handlePlayerInfo(Packet201PlayerInfo par1Packet201PlayerInfo)
{
    nch.handlePlayerInfo(par1Packet201PlayerInfo);      
}
项目:RuneCraftery    文件:NetHandler.java   
public void func_72480_a(Packet201PlayerInfo p_72480_1_) {
   this.func_72509_a(p_72480_1_);
}