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

项目:RuneCraftery    文件:EntityLivingBase.java   
public void func_71001_a(Entity p_71001_1_, int p_71001_2_) {
   if(!p_71001_1_.field_70128_L && !this.field_70170_p.field_72995_K) {
      EntityTracker var3 = ((WorldServer)this.field_70170_p).func_73039_n();
      if(p_71001_1_ instanceof EntityItem) {
         var3.func_72784_a(p_71001_1_, new Packet22Collect(p_71001_1_.field_70157_k, this.field_70157_k));
      }

      if(p_71001_1_ instanceof EntityArrow) {
         var3.func_72784_a(p_71001_1_, new Packet22Collect(p_71001_1_.field_70157_k, this.field_70157_k));
      }

      if(p_71001_1_ instanceof EntityXPOrb) {
         var3.func_72784_a(p_71001_1_, new Packet22Collect(p_71001_1_.field_70157_k, this.field_70157_k));
      }
   }

}
项目:RuneCraftery    文件:NetClientHandler.java   
public void func_72475_a(Packet22Collect p_72475_1_) {
   Entity var2 = this.func_72545_a(p_72475_1_.field_73313_a);
   Object var3 = (EntityLivingBase)this.func_72545_a(p_72475_1_.field_73312_b);
   if(var3 == null) {
      var3 = this.field_72563_h.field_71439_g;
   }

   if(var2 != null) {
      if(var2 instanceof EntityXPOrb) {
         this.field_72564_i.func_72956_a(var2, "random.orb", 0.2F, ((this.field_72557_e.nextFloat() - this.field_72557_e.nextFloat()) * 0.7F + 1.0F) * 2.0F);
      } else {
         this.field_72564_i.func_72956_a(var2, "random.pop", 0.2F, ((this.field_72557_e.nextFloat() - this.field_72557_e.nextFloat()) * 0.7F + 1.0F) * 2.0F);
      }

      this.field_72563_h.field_71452_i.func_78873_a(new EntityPickupFX(this.field_72563_h.field_71441_e, var2, (Entity)var3, -0.5F));
      this.field_72564_i.func_73028_b(p_72475_1_.field_73313_a);
   }

}
项目:RuneCraftery    文件:EntityLivingBase.java   
/**
 * Called whenever an item is picked up from walking over it. Args: pickedUpEntity, stackSize
 */
public void onItemPickup(Entity par1Entity, int par2)
{
    if (!par1Entity.isDead && !this.worldObj.isRemote)
    {
        EntityTracker entitytracker = ((WorldServer)this.worldObj).getEntityTracker();

        if (par1Entity instanceof EntityItem)
        {
            entitytracker.sendPacketToAllPlayersTrackingEntity(par1Entity, new Packet22Collect(par1Entity.entityId, this.entityId));
        }

        if (par1Entity instanceof EntityArrow)
        {
            entitytracker.sendPacketToAllPlayersTrackingEntity(par1Entity, new Packet22Collect(par1Entity.entityId, this.entityId));
        }

        if (par1Entity instanceof EntityXPOrb)
        {
            entitytracker.sendPacketToAllPlayersTrackingEntity(par1Entity, new Packet22Collect(par1Entity.entityId, this.entityId));
        }
    }
}
项目:RuneCraftery    文件:NetClientHandler.java   
public void handleCollect(Packet22Collect par1Packet22Collect)
{
    Entity entity = this.getEntityByID(par1Packet22Collect.collectedEntityId);
    Object object = (EntityLivingBase)this.getEntityByID(par1Packet22Collect.collectorEntityId);

    if (object == null)
    {
        object = this.mc.thePlayer;
    }

    if (entity != null)
    {
        if (entity instanceof EntityXPOrb)
        {
            this.worldClient.playSoundAtEntity(entity, "random.orb", 0.2F, ((this.rand.nextFloat() - this.rand.nextFloat()) * 0.7F + 1.0F) * 2.0F);
        }
        else
        {
            this.worldClient.playSoundAtEntity(entity, "random.pop", 0.2F, ((this.rand.nextFloat() - this.rand.nextFloat()) * 0.7F + 1.0F) * 2.0F);
        }

        this.mc.effectRenderer.addEffect(new EntityPickupFX(this.mc.theWorld, entity, (Entity)object, -0.5F));
        this.worldClient.removeEntityFromWorld(par1Packet22Collect.collectedEntityId);
    }
}
项目:BetterNutritionMod    文件:EntityLivingBase.java   
/**
 * Called whenever an item is picked up from walking over it. Args: pickedUpEntity, stackSize
 */
public void onItemPickup(Entity par1Entity, int par2)
{
    if (!par1Entity.isDead && !this.worldObj.isRemote)
    {
        EntityTracker entitytracker = ((WorldServer)this.worldObj).getEntityTracker();

        if (par1Entity instanceof EntityItem)
        {
            entitytracker.sendPacketToAllPlayersTrackingEntity(par1Entity, new Packet22Collect(par1Entity.entityId, this.entityId));
        }

        if (par1Entity instanceof EntityArrow)
        {
            entitytracker.sendPacketToAllPlayersTrackingEntity(par1Entity, new Packet22Collect(par1Entity.entityId, this.entityId));
        }

        if (par1Entity instanceof EntityXPOrb)
        {
            entitytracker.sendPacketToAllPlayersTrackingEntity(par1Entity, new Packet22Collect(par1Entity.entityId, this.entityId));
        }
    }
}
项目:BetterNutritionMod    文件:NetClientHandler.java   
public void handleCollect(Packet22Collect par1Packet22Collect)
{
    Entity entity = this.getEntityByID(par1Packet22Collect.collectedEntityId);
    Object object = (EntityLivingBase)this.getEntityByID(par1Packet22Collect.collectorEntityId);

    if (object == null)
    {
        object = this.mc.thePlayer;
    }

    if (entity != null)
    {
        if (entity instanceof EntityXPOrb)
        {
            this.worldClient.playSoundAtEntity(entity, "random.orb", 0.2F, ((this.rand.nextFloat() - this.rand.nextFloat()) * 0.7F + 1.0F) * 2.0F);
        }
        else
        {
            this.worldClient.playSoundAtEntity(entity, "random.pop", 0.2F, ((this.rand.nextFloat() - this.rand.nextFloat()) * 0.7F + 1.0F) * 2.0F);
        }

        this.mc.effectRenderer.addEffect(new EntityPickupFX(this.mc.theWorld, entity, (Entity)object, -0.5F));
        this.worldClient.removeEntityFromWorld(par1Packet22Collect.collectedEntityId);
    }
}
项目:forge_world_downloader    文件:WDLNetClientHandler.java   
@Override
public void handleCollect(Packet22Collect par1Packet22Collect)
{
    nch.handleCollect(par1Packet22Collect);     
}
项目:RuneCraftery    文件:NetHandler.java   
public void func_72475_a(Packet22Collect p_72475_1_) {
   this.func_72509_a(p_72475_1_);
}