Java 类net.minecraft.entity.passive.EntityZombieHorse 实例源码

项目:Cyclic    文件:ItemAppleLapis.java   
@SubscribeEvent
public void onEntityInteractEvent(EntityInteract event) {
  if (event.getEntity() instanceof EntityPlayer == false) {
    return;
  }
  EntityPlayer player = (EntityPlayer) event.getEntity();
  //    ItemStack held = player.getHeldItemMainhand();
  ItemStack itemstack = event.getItemStack();
  if (itemstack != null && itemstack.getItem() instanceof ItemAppleLapis && itemstack.getCount() > 0) {
    if (event.getTarget() instanceof EntityZombieHorse || event.getTarget() instanceof EntitySkeletonHorse) {
      AbstractHorse h = (AbstractHorse) event.getTarget();
      if (h.isTame() == false) {
        h.setTamedBy(player);
        h.setEatingHaystack(true);
        //        UtilChat.addChatMessage(player, UtilChat.lang("item.apple_emerald.merchant"));
        itemstack.shrink(1);
        if (itemstack.getCount() == 0) {
          itemstack = ItemStack.EMPTY;
        }
        event.setCanceled(true);// stop the GUI inventory opening && horse mounting
      }
    }
  }
}
项目:Gravestone-mod-Extended    文件:EntityAINearestAttackableHorse.java   
public boolean shouldExecute() {
    EntityLivingBase entity = this.attacker.getAttackTarget();
    if (entity != null && !(entity instanceof EntityUndeadHorse) && !(entity instanceof EntityZombieHorse) && !(entity instanceof EntitySkeletonHorse)) {
        return super.shouldExecute();
    }
    return false;
}
项目:Backmemed    文件:ModelAdapterSkeletonHorse.java   
public ModelAdapterSkeletonHorse()
{
    super(EntityZombieHorse.class, "zombie_horse", 0.75F);
}