当前位置: 首页>>代码示例>>Java>>正文


Java EntitySelectorArmoredMob类代码示例

本文整理汇总了Java中net.minecraft.entity.EntitySelectorArmoredMob的典型用法代码示例。如果您正苦于以下问题:Java EntitySelectorArmoredMob类的具体用法?Java EntitySelectorArmoredMob怎么用?Java EntitySelectorArmoredMob使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


EntitySelectorArmoredMob类属于net.minecraft.entity包,在下文中一共展示了EntitySelectorArmoredMob类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: func_82487_b

import net.minecraft.entity.EntitySelectorArmoredMob; //导入依赖的package包/类
protected ItemStack func_82487_b(IBlockSource p_82487_1_, ItemStack p_82487_2_) {
   EnumFacing var3 = BlockDispenser.func_100009_j_(p_82487_1_.func_82620_h());
   int var4 = p_82487_1_.func_82623_d() + var3.func_82601_c();
   int var5 = p_82487_1_.func_82622_e() + var3.func_96559_d();
   int var6 = p_82487_1_.func_82621_f() + var3.func_82599_e();
   AxisAlignedBB var7 = AxisAlignedBB.func_72332_a().func_72299_a((double)var4, (double)var5, (double)var6, (double)(var4 + 1), (double)(var5 + 1), (double)(var6 + 1));
   List var8 = p_82487_1_.func_82618_k().func_82733_a(EntityLivingBase.class, var7, new EntitySelectorArmoredMob(p_82487_2_));
   if(var8.size() > 0) {
      EntityLivingBase var9 = (EntityLivingBase)var8.get(0);
      int var10 = var9 instanceof EntityPlayer?1:0;
      int var11 = EntityLiving.func_82159_b(p_82487_2_);
      ItemStack var12 = p_82487_2_.func_77946_l();
      var12.field_77994_a = 1;
      var9.func_70062_b(var11 - var10, var12);
      if(var9 instanceof EntityLiving) {
         ((EntityLiving)var9).func_96120_a(var11, 2.0F);
      }

      --p_82487_2_.field_77994_a;
      return p_82487_2_;
   } else {
      return super.func_82487_b(p_82487_1_, p_82487_2_);
   }
}
 
开发者ID:HATB0T,项目名称:RuneCraftery,代码行数:25,代码来源:BehaviorDispenseArmor.java

示例2: dispenseStack

import net.minecraft.entity.EntitySelectorArmoredMob; //导入依赖的package包/类
/**
 * Dispense the specified stack, play the dispense sound and spawn particles.
 */
protected ItemStack dispenseStack(IBlockSource par1IBlockSource, ItemStack par2ItemStack)
{
    EnumFacing enumfacing = BlockDispenser.getFacing(par1IBlockSource.getBlockMetadata());
    int i = par1IBlockSource.getXInt() + enumfacing.getFrontOffsetX();
    int j = par1IBlockSource.getYInt() + enumfacing.getFrontOffsetY();
    int k = par1IBlockSource.getZInt() + enumfacing.getFrontOffsetZ();
    AxisAlignedBB axisalignedbb = AxisAlignedBB.getAABBPool().getAABB((double)i, (double)j, (double)k, (double)(i + 1), (double)(j + 1), (double)(k + 1));
    List list = par1IBlockSource.getWorld().selectEntitiesWithinAABB(EntityLivingBase.class, axisalignedbb, new EntitySelectorArmoredMob(par2ItemStack));

    if (list.size() > 0)
    {
        EntityLivingBase entitylivingbase = (EntityLivingBase)list.get(0);
        int l = entitylivingbase instanceof EntityPlayer ? 1 : 0;
        int i1 = EntityLiving.getArmorPosition(par2ItemStack);
        ItemStack itemstack1 = par2ItemStack.copy();
        itemstack1.stackSize = 1;
        entitylivingbase.setCurrentItemOrArmor(i1, itemstack1);  //BUGFIX Forge: Vanilla bug fix associated with fixed setCurrentItemOrArmor indexs for players.

        if (entitylivingbase instanceof EntityLiving)
        {
            ((EntityLiving)entitylivingbase).setEquipmentDropChance(i1, 2.0F);
        }

        --par2ItemStack.stackSize;
        return par2ItemStack;
    }
    else
    {
        return super.dispenseStack(par1IBlockSource, par2ItemStack);
    }
}
 
开发者ID:HATB0T,项目名称:RuneCraftery,代码行数:35,代码来源:BehaviorDispenseArmor.java

示例3: dispenseStack

import net.minecraft.entity.EntitySelectorArmoredMob; //导入依赖的package包/类
/**
 * Dispense the specified stack, play the dispense sound and spawn particles.
 */
protected ItemStack dispenseStack(IBlockSource par1IBlockSource, ItemStack par2ItemStack)
{
    EnumFacing enumfacing = BlockDispenser.getFacing(par1IBlockSource.getBlockMetadata());
    int i = par1IBlockSource.getXInt() + enumfacing.getFrontOffsetX();
    int j = par1IBlockSource.getYInt() + enumfacing.getFrontOffsetY();
    int k = par1IBlockSource.getZInt() + enumfacing.getFrontOffsetZ();
    AxisAlignedBB axisalignedbb = AxisAlignedBB.getAABBPool().getAABB((double)i, (double)j, (double)k, (double)(i + 1), (double)(j + 1), (double)(k + 1));
    @SuppressWarnings("rawtypes")
    List list = par1IBlockSource.getWorld().selectEntitiesWithinAABB(EntityLiving.class, axisalignedbb, new EntitySelectorArmoredMob(par2ItemStack));

    if (list.size() > 0)
    {
        EntityLiving entityliving = (EntityLiving)list.get(0);
        int l = entityliving instanceof EntityPlayer ? 1 : 0;
        int i1 = EntityLiving.getArmorPosition(par2ItemStack);
        ItemStack itemstack1 = par2ItemStack.copy();
        itemstack1.stackSize = 1;
        entityliving.setCurrentItemOrArmor(i1, itemstack1); //Forge: Vanilla bug fix associated with fixed setCurrentItemOrArmor indexs for players.
        entityliving.func_96120_a(i1, 2.0F);
        --par2ItemStack.stackSize;
        return par2ItemStack;
    }
    else
    {
        return super.dispenseStack(par1IBlockSource, par2ItemStack);
    }
}
 
开发者ID:beats16,项目名称:ObsidiCraft,代码行数:31,代码来源:BehaviorDispenseArmorObsidian.java


注:本文中的net.minecraft.entity.EntitySelectorArmoredMob类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。