Java Code Examples for net.minecraft.entity.EntityLivingBase#isRiding()

The following examples show how to use net.minecraft.entity.EntityLivingBase#isRiding() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: RenderUtils.java    From SimplyJetpacks with MIT License 6 votes vote down vote up
public static ModelBiped getArmorModel(PackBase pack, EntityLivingBase entity) {
    ModelBiped model = null;
    switch (pack.armorModel) {
    case JETPACK:
        model = ModelJetpack.INSTANCE;
        break;
    case FLUX_PACK:
        model = ModelFluxPack.INSTANCE;
    default:
    }
    if (model == null) {
        return null;
    }
    model.isSneak = entity.isSneaking();
    model.isRiding = entity.isRiding();
    model.isChild = entity.isChild();
    model.heldItemRight = entity.getEquipmentInSlot(0) != null ? 1 : 0;
    if (entity instanceof EntityPlayer) {
        model.aimedBow = ((EntityPlayer) entity).getItemInUseDuration() > 2;
    }
    return model;
}
 
Example 2
Source File: ItemKimono.java    From Sakura_mod with MIT License 4 votes vote down vote up
@SideOnly(Side.CLIENT)
public static ModelBiped getKimonoModel(EntityLivingBase entityLiving, ItemStack itemStack,ModelBiped model)
{
  if (model != null)
  {
    model.setVisible(true);
    
    model.isSneak = entityLiving.isSneaking();
    
    model.isRiding = entityLiving.isRiding();
    model.isChild = entityLiving.isChild();
    ItemStack itemstack = entityLiving.getHeldItemMainhand();
    ItemStack itemstack1 = entityLiving.getHeldItemOffhand();
    ModelBiped.ArmPose modelbiped$armpose = ModelBiped.ArmPose.EMPTY;
    ModelBiped.ArmPose modelbiped$armpose1 = ModelBiped.ArmPose.EMPTY;
    if ((itemstack != null) && (!itemstack.isEmpty()))
    {
      modelbiped$armpose = ModelBiped.ArmPose.ITEM;
      if (entityLiving.getItemInUseCount() > 0)
      {
        EnumAction enumaction = itemstack.getItemUseAction();
        if (enumaction == EnumAction.BLOCK) {
          modelbiped$armpose = ModelBiped.ArmPose.BLOCK;
        } else if (enumaction == EnumAction.BOW) {
          modelbiped$armpose = ModelBiped.ArmPose.BOW_AND_ARROW;
        }
      }
    }
    if ((itemstack1 != null) && (!itemstack1.isEmpty()))
    {
      modelbiped$armpose1 = ModelBiped.ArmPose.ITEM;
      if (entityLiving.getItemInUseCount() > 0)
      {
        EnumAction enumaction1 = itemstack1.getItemUseAction();
        if (enumaction1 == EnumAction.BLOCK) {
          modelbiped$armpose1 = ModelBiped.ArmPose.BLOCK;
        }
      }
    }
    if (entityLiving.getPrimaryHand() == EnumHandSide.RIGHT)
    {
      model.rightArmPose = modelbiped$armpose;
      model.leftArmPose = modelbiped$armpose1;
    }
    else
    {
      model.rightArmPose = modelbiped$armpose1;
      model.leftArmPose = modelbiped$armpose;
    }
  }
  return model;
}