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

项目:RuneCraftery    文件:NetClientHandler.java   
public void func_72471_a(Packet202PlayerAbilities p_72471_1_) {
   EntityClientPlayerMP var2 = this.field_72563_h.field_71439_g;
   var2.field_71075_bZ.field_75100_b = p_72471_1_.func_73350_f();
   var2.field_71075_bZ.field_75098_d = p_72471_1_.func_73346_h();
   var2.field_71075_bZ.field_75102_a = p_72471_1_.func_73352_d();
   var2.field_71075_bZ.field_75101_c = p_72471_1_.func_73348_g();
   var2.field_71075_bZ.func_75092_a(p_72471_1_.func_73347_i());
   var2.field_71075_bZ.func_82877_b(p_72471_1_.func_82558_j());
}
项目:RuneCraftery    文件:EntityPlayerMP.java   
/**
 * Sends the player's abilities to the server (if there is one).
 */
public void sendPlayerAbilities()
{
    if (this.playerNetServerHandler != null)
    {
        this.playerNetServerHandler.sendPacketToPlayer(new Packet202PlayerAbilities(this.capabilities));
    }
}
项目:RuneCraftery    文件:NetClientHandler.java   
/**
 * Handle a player abilities packet.
 */
public void handlePlayerAbilities(Packet202PlayerAbilities par1Packet202PlayerAbilities)
{
    EntityClientPlayerMP entityclientplayermp = this.mc.thePlayer;
    entityclientplayermp.capabilities.isFlying = par1Packet202PlayerAbilities.getFlying();
    entityclientplayermp.capabilities.isCreativeMode = par1Packet202PlayerAbilities.isCreativeMode();
    entityclientplayermp.capabilities.disableDamage = par1Packet202PlayerAbilities.getDisableDamage();
    entityclientplayermp.capabilities.allowFlying = par1Packet202PlayerAbilities.getAllowFlying();
    entityclientplayermp.capabilities.setFlySpeed(par1Packet202PlayerAbilities.getFlySpeed());
    entityclientplayermp.capabilities.setPlayerWalkSpeed(par1Packet202PlayerAbilities.getWalkSpeed());
}
项目:BetterNutritionMod    文件:EntityPlayerMP.java   
/**
 * Sends the player's abilities to the server (if there is one).
 */
public void sendPlayerAbilities()
{
    if (this.playerNetServerHandler != null)
    {
        this.playerNetServerHandler.sendPacketToPlayer(new Packet202PlayerAbilities(this.capabilities));
    }
}
项目:BetterNutritionMod    文件:NetClientHandler.java   
/**
 * Handle a player abilities packet.
 */
public void handlePlayerAbilities(Packet202PlayerAbilities par1Packet202PlayerAbilities)
{
    EntityClientPlayerMP entityclientplayermp = this.mc.thePlayer;
    entityclientplayermp.capabilities.isFlying = par1Packet202PlayerAbilities.getFlying();
    entityclientplayermp.capabilities.isCreativeMode = par1Packet202PlayerAbilities.isCreativeMode();
    entityclientplayermp.capabilities.disableDamage = par1Packet202PlayerAbilities.getDisableDamage();
    entityclientplayermp.capabilities.allowFlying = par1Packet202PlayerAbilities.getAllowFlying();
    entityclientplayermp.capabilities.setFlySpeed(par1Packet202PlayerAbilities.getFlySpeed());
    entityclientplayermp.capabilities.setPlayerWalkSpeed(par1Packet202PlayerAbilities.getWalkSpeed());
}
项目:forge_world_downloader    文件:WDLNetClientHandler.java   
@Override
public void handlePlayerAbilities(Packet202PlayerAbilities par1Packet202PlayerAbilities)
{
    nch.handlePlayerAbilities(par1Packet202PlayerAbilities);        
}
项目:RuneCraftery    文件:EntityPlayerMP.java   
public void func_71016_p() {
   if(this.field_71135_a != null) {
      this.field_71135_a.func_72567_b(new Packet202PlayerAbilities(this.field_71075_bZ));
   }
}
项目:RuneCraftery    文件:NetHandler.java   
public void func_72471_a(Packet202PlayerAbilities p_72471_1_) {
   this.func_72509_a(p_72471_1_);
}
项目:RuneCraftery    文件:NetServerHandler.java   
public void func_72471_a(Packet202PlayerAbilities p_72471_1_) {
   this.field_72574_e.field_71075_bZ.field_75100_b = p_72471_1_.func_73350_f() && this.field_72574_e.field_71075_bZ.field_75101_c;
}
项目:RuneCraftery    文件:EntityClientPlayerMP.java   
public void func_71016_p() {
   this.field_71174_a.func_72552_c(new Packet202PlayerAbilities(this.field_71075_bZ));
}
项目: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    文件:NetServerHandler.java   
/**
 * Handle a player abilities packet.
 */
public void handlePlayerAbilities(Packet202PlayerAbilities par1Packet202PlayerAbilities)
{
    this.playerEntity.capabilities.isFlying = par1Packet202PlayerAbilities.getFlying() && this.playerEntity.capabilities.allowFlying;
}
项目:RuneCraftery    文件:EntityClientPlayerMP.java   
/**
 * Sends the player's abilities to the server (if there is one).
 */
public void sendPlayerAbilities()
{
    this.sendQueue.addToSendQueue(new Packet202PlayerAbilities(this.capabilities));
}
项目: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    文件:NetServerHandler.java   
/**
 * Handle a player abilities packet.
 */
public void handlePlayerAbilities(Packet202PlayerAbilities par1Packet202PlayerAbilities)
{
    this.playerEntity.capabilities.isFlying = par1Packet202PlayerAbilities.getFlying() && this.playerEntity.capabilities.allowFlying;
}
项目:BetterNutritionMod    文件:EntityClientPlayerMP.java   
/**
 * Sends the player's abilities to the server (if there is one).
 */
public void sendPlayerAbilities()
{
    this.sendQueue.addToSendQueue(new Packet202PlayerAbilities(this.capabilities));
}
项目: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;
        }
    }
}