Java Code Examples for net.minecraft.client.model.ModelBiped#ArmPose

The following examples show how to use net.minecraft.client.model.ModelBiped#ArmPose . 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: 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;
}
 
Example 2
Source File: RenderGuard.java    From ToroQuest with GNU General Public License v3.0 4 votes vote down vote up
private void setModelVisibilities(EntityGuard clientPlayer) {
	ModelGuard modelplayer = (ModelGuard) this.getMainModel();

	ItemStack itemstack = clientPlayer.getHeldItemMainhand();
	ItemStack itemstack1 = clientPlayer.getHeldItemOffhand();
	modelplayer.setVisible(true);

	modelplayer.isSneak = clientPlayer.isSneaking();
	ModelBiped.ArmPose modelbiped$armpose = ModelBiped.ArmPose.EMPTY;
	ModelBiped.ArmPose modelbiped$armpose1 = ModelBiped.ArmPose.EMPTY;

	if (itemstack != null) {
		modelbiped$armpose = ModelBiped.ArmPose.ITEM;

		if (clientPlayer.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) {
		modelbiped$armpose1 = ModelBiped.ArmPose.ITEM;

		if (clientPlayer.getItemInUseCount() > 0) {
			EnumAction enumaction1 = itemstack1.getItemUseAction();

			if (enumaction1 == EnumAction.BLOCK) {
				modelbiped$armpose1 = ModelBiped.ArmPose.BLOCK;
			}
		}
	}

	if (clientPlayer.getPrimaryHand() == EnumHandSide.RIGHT) {
		modelplayer.rightArmPose = modelbiped$armpose;
		modelplayer.leftArmPose = modelbiped$armpose1;
	} else {
		modelplayer.rightArmPose = modelbiped$armpose1;
		modelplayer.leftArmPose = modelbiped$armpose;
	}

}
 
Example 3
Source File: RenderPlayerCyberware.java    From Cyberware with MIT License 4 votes vote down vote up
private void setModelVisibilities(AbstractClientPlayer clientPlayer)
{
	ModelPlayer modelplayer = this.getMainModel();

	if (clientPlayer.isSpectator())
	{
		modelplayer.setInvisible(false);
		modelplayer.bipedHead.showModel = true;
		modelplayer.bipedHeadwear.showModel = true;
	}
	else
	{
		ItemStack itemstack = clientPlayer.getHeldItemMainhand();
		ItemStack itemstack1 = clientPlayer.getHeldItemOffhand();
		modelplayer.setInvisible(true);
		modelplayer.bipedHeadwear.showModel = modelplayer.bipedHead.isHidden ? false : clientPlayer.isWearing(EnumPlayerModelParts.HAT);
		modelplayer.bipedBodyWear.showModel = modelplayer.bipedBody.isHidden ? false : clientPlayer.isWearing(EnumPlayerModelParts.JACKET);
		modelplayer.bipedLeftLegwear.showModel = modelplayer.bipedLeftLeg.isHidden ? false : clientPlayer.isWearing(EnumPlayerModelParts.LEFT_PANTS_LEG);
		modelplayer.bipedRightLegwear.showModel = modelplayer.bipedRightLeg.isHidden ? false : clientPlayer.isWearing(EnumPlayerModelParts.RIGHT_PANTS_LEG);
		modelplayer.bipedLeftArmwear.showModel = modelplayer.bipedLeftArm.isHidden ? false : clientPlayer.isWearing(EnumPlayerModelParts.LEFT_SLEEVE);
		modelplayer.bipedRightArmwear.showModel = modelplayer.bipedRightArm.isHidden ? false :clientPlayer.isWearing(EnumPlayerModelParts.RIGHT_SLEEVE);
		modelplayer.isSneak = clientPlayer.isSneaking();
		ModelBiped.ArmPose modelbiped$armpose = ModelBiped.ArmPose.EMPTY;
		ModelBiped.ArmPose modelbiped$armpose1 = ModelBiped.ArmPose.EMPTY;

		if (itemstack != null)
		{
			modelbiped$armpose = ModelBiped.ArmPose.ITEM;

			if (clientPlayer.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)
		{
			modelbiped$armpose1 = ModelBiped.ArmPose.ITEM;

			if (clientPlayer.getItemInUseCount() > 0)
			{
				EnumAction enumaction1 = itemstack1.getItemUseAction();

				if (enumaction1 == EnumAction.BLOCK)
				{
					modelbiped$armpose1 = ModelBiped.ArmPose.BLOCK;
				}
			}
		}

		if (clientPlayer.getPrimaryHand() == EnumHandSide.RIGHT)
		{
			modelplayer.rightArmPose = modelbiped$armpose;
			modelplayer.leftArmPose = modelbiped$armpose1;
		}
		else
		{
			modelplayer.rightArmPose = modelbiped$armpose1;
			modelplayer.leftArmPose = modelbiped$armpose;
		}
	}
}