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

项目:CliffiesDecor    文件:EntityDude.java   
public void swingItem()
{
    //System.out.println("SwingItem()");
    if (!this.isSwingInProgress || this.swingProgressInt >= this.getArmSwingAnimationEnd() / 2 || this.swingProgressInt < 0)
    {
        //System.out.println("SWINGING HAND");
        this.swingProgressInt = -2;
        this.isSwingInProgress = true;

        if (this.worldObj instanceof WorldServer)
        {
            //System.out.println("SWINGING HAND-2");
            ((WorldServer)this.worldObj).getEntityTracker().sendPacketToAllPlayersTrackingEntity(this, new Packet18Animation(this, 1));
        }
    }
}
项目:RuneCraftery    文件:NetClientHandler.java   
public void func_72524_a(Packet18Animation p_72524_1_) {
   Entity var2 = this.func_72545_a(p_72524_1_.field_73470_a);
   if(var2 != null) {
      if(p_72524_1_.field_73469_b == 1) {
         EntityLivingBase var3 = (EntityLivingBase)var2;
         var3.func_71038_i();
      } else if(p_72524_1_.field_73469_b == 2) {
         var2.func_70057_ab();
      } else if(p_72524_1_.field_73469_b == 3) {
         EntityPlayer var4 = (EntityPlayer)var2;
         var4.func_70999_a(false, false, false);
      } else if(p_72524_1_.field_73469_b != 4) {
         if(p_72524_1_.field_73469_b == 6) {
            this.field_72563_h.field_71452_i.func_78873_a(new EntityCrit2FX(this.field_72563_h.field_71441_e, var2));
         } else if(p_72524_1_.field_73469_b == 7) {
            EntityCrit2FX var5 = new EntityCrit2FX(this.field_72563_h.field_71441_e, var2, "magicCrit");
            this.field_72563_h.field_71452_i.func_78873_a(var5);
         } else if(p_72524_1_.field_73469_b == 5 && var2 instanceof EntityOtherPlayerMP) {
            ;
         }
      }

   }
}
项目:RuneCraftery    文件:EntityLivingBase.java   
/**
 * Swings the item the player is holding.
 */
public void swingItem()
{
    ItemStack stack = this.getHeldItem();

    if (stack != null && stack.getItem() != null)
    {
        Item item = stack.getItem();
        if (item.onEntitySwing(this, stack))
        {
            return;
        }
    }

    if (!this.isSwingInProgress || this.swingProgressInt >= this.getArmSwingAnimationEnd() / 2 || this.swingProgressInt < 0)
    {
        this.swingProgressInt = -1;
        this.isSwingInProgress = true;

        if (this.worldObj instanceof WorldServer)
        {
            ((WorldServer)this.worldObj).getEntityTracker().sendPacketToAllPlayersTrackingEntity(this, new Packet18Animation(this, 1));
        }
    }
}
项目:BetterNutritionMod    文件:EntityLivingBase.java   
/**
 * Swings the item the player is holding.
 */
public void swingItem()
{
    ItemStack stack = this.getHeldItem();

    if (stack != null && stack.getItem() != null)
    {
        Item item = stack.getItem();
        if (item.onEntitySwing(this, stack))
        {
            return;
        }
    }

    if (!this.isSwingInProgress || this.swingProgressInt >= this.getArmSwingAnimationEnd() / 2 || this.swingProgressInt < 0)
    {
        this.swingProgressInt = -1;
        this.isSwingInProgress = true;

        if (this.worldObj instanceof WorldServer)
        {
            ((WorldServer)this.worldObj).getEntityTracker().sendPacketToAllPlayersTrackingEntity(this, new Packet18Animation(this, 1));
        }
    }
}
项目:RuneCraftery    文件:EntityLivingBase.java   
public void func_71038_i() {
   if(!this.field_82175_bq || this.field_110158_av >= this.func_82166_i() / 2 || this.field_110158_av < 0) {
      this.field_110158_av = -1;
      this.field_82175_bq = true;
      if(this.field_70170_p instanceof WorldServer) {
         ((WorldServer)this.field_70170_p).func_73039_n().func_72784_a(this, new Packet18Animation(this, 1));
      }
   }

}
项目:RuneCraftery    文件:EntityPlayerMP.java   
public void func_70999_a(boolean p_70999_1_, boolean p_70999_2_, boolean p_70999_3_) {
   if(this.func_70608_bn()) {
      this.func_71121_q().func_73039_n().func_72789_b(this, new Packet18Animation(this, 3));
   }

   super.func_70999_a(p_70999_1_, p_70999_2_, p_70999_3_);
   if(this.field_71135_a != null) {
      this.field_71135_a.func_72569_a(this.field_70165_t, this.field_70163_u, this.field_70161_v, this.field_70177_z, this.field_70125_A);
   }

}
项目:RuneCraftery    文件:EntityPlayerMP.java   
public void func_71008_a(ItemStack p_71008_1_, int p_71008_2_) {
   super.func_71008_a(p_71008_1_, p_71008_2_);
   if(p_71008_1_ != null && p_71008_1_.func_77973_b() != null && p_71008_1_.func_77973_b().func_77661_b(p_71008_1_) == EnumAction.eat) {
      this.func_71121_q().func_73039_n().func_72789_b(this, new Packet18Animation(this, 5));
   }

}
项目:RuneCraftery    文件:NetServerHandler.java   
public void func_72524_a(Packet18Animation p_72524_1_) {
   this.field_72574_e.func_143004_u();
   if(p_72524_1_.field_73469_b == 1) {
      this.field_72574_e.func_71038_i();
   }

}
项目:RuneCraftery    文件:EntityPlayerMP.java   
/**
 * Wake up the player if they're sleeping.
 */
public void wakeUpPlayer(boolean par1, boolean par2, boolean par3)
{
    if (this.isPlayerSleeping())
    {
        this.getServerForPlayer().getEntityTracker().sendPacketToAllAssociatedPlayers(this, new Packet18Animation(this, 3));
    }

    super.wakeUpPlayer(par1, par2, par3);

    if (this.playerNetServerHandler != null)
    {
        this.playerNetServerHandler.setPlayerLocation(this.posX, this.posY, this.posZ, this.rotationYaw, this.rotationPitch);
    }
}
项目:RuneCraftery    文件:EntityPlayerMP.java   
/**
 * sets the itemInUse when the use item button is clicked. Args: itemstack, int maxItemUseDuration
 */
public void setItemInUse(ItemStack par1ItemStack, int par2)
{
    super.setItemInUse(par1ItemStack, par2);

    if (par1ItemStack != null && par1ItemStack.getItem() != null && par1ItemStack.getItem().getItemUseAction(par1ItemStack) == EnumAction.eat)
    {
        this.getServerForPlayer().getEntityTracker().sendPacketToAllAssociatedPlayers(this, new Packet18Animation(this, 5));
    }
}
项目:RuneCraftery    文件:NetServerHandler.java   
public void handleAnimation(Packet18Animation par1Packet18Animation)
{
    this.playerEntity.func_143004_u();

    if (par1Packet18Animation.animate == 1)
    {
        this.playerEntity.swingItem();
    }
}
项目:RuneCraftery    文件:NetClientHandler.java   
public void handleAnimation(Packet18Animation par1Packet18Animation)
{
    Entity entity = this.getEntityByID(par1Packet18Animation.entityId);

    if (entity != null)
    {
        if (par1Packet18Animation.animate == 1)
        {
            EntityLivingBase entitylivingbase = (EntityLivingBase)entity;
            entitylivingbase.swingItem();
        }
        else if (par1Packet18Animation.animate == 2)
        {
            entity.performHurtAnimation();
        }
        else if (par1Packet18Animation.animate == 3)
        {
            EntityPlayer entityplayer = (EntityPlayer)entity;
            entityplayer.wakeUpPlayer(false, false, false);
        }
        else if (par1Packet18Animation.animate != 4)
        {
            if (par1Packet18Animation.animate == 6)
            {
                this.mc.effectRenderer.addEffect(new EntityCrit2FX(this.mc.theWorld, entity));
            }
            else if (par1Packet18Animation.animate == 7)
            {
                EntityCrit2FX entitycrit2fx = new EntityCrit2FX(this.mc.theWorld, entity, "magicCrit");
                this.mc.effectRenderer.addEffect(entitycrit2fx);
            }
            else if (par1Packet18Animation.animate == 5 && entity instanceof EntityOtherPlayerMP)
            {
                ;
            }
        }
    }
}
项目:BetterNutritionMod    文件:EntityPlayerMP.java   
/**
 * Wake up the player if they're sleeping.
 */
public void wakeUpPlayer(boolean par1, boolean par2, boolean par3)
{
    if (this.isPlayerSleeping())
    {
        this.getServerForPlayer().getEntityTracker().sendPacketToAllAssociatedPlayers(this, new Packet18Animation(this, 3));
    }

    super.wakeUpPlayer(par1, par2, par3);

    if (this.playerNetServerHandler != null)
    {
        this.playerNetServerHandler.setPlayerLocation(this.posX, this.posY, this.posZ, this.rotationYaw, this.rotationPitch);
    }
}
项目:BetterNutritionMod    文件:EntityPlayerMP.java   
/**
 * sets the itemInUse when the use item button is clicked. Args: itemstack, int maxItemUseDuration
 */
public void setItemInUse(ItemStack par1ItemStack, int par2)
{
    super.setItemInUse(par1ItemStack, par2);

    if (par1ItemStack != null && par1ItemStack.getItem() != null && par1ItemStack.getItem().getItemUseAction(par1ItemStack) == EnumAction.eat)
    {
        this.getServerForPlayer().getEntityTracker().sendPacketToAllAssociatedPlayers(this, new Packet18Animation(this, 5));
    }
}
项目:BetterNutritionMod    文件:NetServerHandler.java   
public void handleAnimation(Packet18Animation par1Packet18Animation)
{
    this.playerEntity.func_143004_u();

    if (par1Packet18Animation.animate == 1)
    {
        this.playerEntity.swingItem();
    }
}
项目:BetterNutritionMod    文件:NetClientHandler.java   
public void handleAnimation(Packet18Animation par1Packet18Animation)
{
    Entity entity = this.getEntityByID(par1Packet18Animation.entityId);

    if (entity != null)
    {
        if (par1Packet18Animation.animate == 1)
        {
            EntityLivingBase entitylivingbase = (EntityLivingBase)entity;
            entitylivingbase.swingItem();
        }
        else if (par1Packet18Animation.animate == 2)
        {
            entity.performHurtAnimation();
        }
        else if (par1Packet18Animation.animate == 3)
        {
            EntityPlayer entityplayer = (EntityPlayer)entity;
            entityplayer.wakeUpPlayer(false, false, false);
        }
        else if (par1Packet18Animation.animate != 4)
        {
            if (par1Packet18Animation.animate == 6)
            {
                this.mc.effectRenderer.addEffect(new EntityCrit2FX(this.mc.theWorld, entity));
            }
            else if (par1Packet18Animation.animate == 7)
            {
                EntityCrit2FX entitycrit2fx = new EntityCrit2FX(this.mc.theWorld, entity, "magicCrit");
                this.mc.effectRenderer.addEffect(entitycrit2fx);
            }
            else if (par1Packet18Animation.animate == 5 && entity instanceof EntityOtherPlayerMP)
            {
                ;
            }
        }
    }
}
项目:forge_world_downloader    文件:WDLNetClientHandler.java   
@Override
public void handleAnimation(Packet18Animation par1Packet18Animation)
{
    nch.handleAnimation(par1Packet18Animation);     
}
项目:RuneCraftery    文件:EntityPlayerMP.java   
public void func_71009_b(Entity p_71009_1_) {
   this.func_71121_q().func_73039_n().func_72789_b(this, new Packet18Animation(p_71009_1_, 6));
}
项目:RuneCraftery    文件:EntityPlayerMP.java   
public void func_71047_c(Entity p_71047_1_) {
   this.func_71121_q().func_73039_n().func_72789_b(this, new Packet18Animation(p_71047_1_, 7));
}
项目:RuneCraftery    文件:NetHandler.java   
public void func_72524_a(Packet18Animation p_72524_1_) {
   this.func_72509_a(p_72524_1_);
}
项目:RuneCraftery    文件:EntityClientPlayerMP.java   
public void func_71038_i() {
   super.func_71038_i();
   this.field_71174_a.func_72552_c(new Packet18Animation(this, 1));
}
项目:RuneCraftery    文件:EntityPlayerMP.java   
/**
 * Called when the player performs a critical hit on the Entity. Args: entity that was hit critically
 */
public void onCriticalHit(Entity par1Entity)
{
    this.getServerForPlayer().getEntityTracker().sendPacketToAllAssociatedPlayers(this, new Packet18Animation(par1Entity, 6));
}
项目:RuneCraftery    文件:EntityPlayerMP.java   
public void onEnchantmentCritical(Entity par1Entity)
{
    this.getServerForPlayer().getEntityTracker().sendPacketToAllAssociatedPlayers(this, new Packet18Animation(par1Entity, 7));
}
项目:RuneCraftery    文件:EntityClientPlayerMP.java   
/**
 * Swings the item the player is holding.
 */
public void swingItem()
{
    super.swingItem();
    this.sendQueue.addToSendQueue(new Packet18Animation(this, 1));
}
项目:BetterNutritionMod    文件:EntityPlayerMP.java   
/**
 * Called when the player performs a critical hit on the Entity. Args: entity that was hit critically
 */
public void onCriticalHit(Entity par1Entity)
{
    this.getServerForPlayer().getEntityTracker().sendPacketToAllAssociatedPlayers(this, new Packet18Animation(par1Entity, 6));
}
项目:BetterNutritionMod    文件:EntityPlayerMP.java   
public void onEnchantmentCritical(Entity par1Entity)
{
    this.getServerForPlayer().getEntityTracker().sendPacketToAllAssociatedPlayers(this, new Packet18Animation(par1Entity, 7));
}
项目:BetterNutritionMod    文件:EntityClientPlayerMP.java   
/**
 * Swings the item the player is holding.
 */
public void swingItem()
{
    super.swingItem();
    this.sendQueue.addToSendQueue(new Packet18Animation(this, 1));
}