Jump to content

Updating to 1.9.4, altering the animation order of a bow.


salvestrom

Recommended Posts

if anyone has any idea how to do the below in 1.9.4 it would be appreciated.

 

Just to clarify, the below code is part of an entity file. The entity, when aggro'd would display a fully drawn bow. Once fired, the animation would cycle back to fully drawn. When the entity had no target, the bow animation was the default(undrawn). It was largely a reversal of animation order, tied to the entity animation counter.

 

I can see how the bow files getIcon method was update to the addPropertyOverride method, but have no idea how to tap into that from the entity file. I'm not really sure where to go from there.

 

 

 

//from EntityLizardmanStalker

 

@Override

    @SideOnly(Side.CLIENT)

    public IIcon getItemIcon(ItemStack p_70620_1_, int p_70620_2_)

    {

        IIcon iicon = super.getItemIcon(p_70620_1_, p_70620_2_);

 

        if(this.getHasTarget() == 2 && p_70620_1_.getItem() instanceof ItemBow)

          {

                int j = 0 + this.animationTimer;

 

                if (j >= 15)

                {

                    return ((ItemBow)p_70620_1_.getItem()).getIcon(p_70620_1_, 0);

                }

 

                if (j > 10)

                {

                return ((ItemBow)p_70620_1_.getItem()).getItemIconForUseDuration(0);

                }

 

                if (j > 5)

                {

                return ((ItemBow)p_70620_1_.getItem()).getItemIconForUseDuration(1);

 

                }

                if (j >= 0)

                {

                return ((ItemBow)p_70620_1_.getItem()).getItemIconForUseDuration(2);

                }

          }

        else

            //

        if(this.getHasTarget() != 2) {

        iicon = //p_70620_1_.getItem() == Items.bow ?

            ((ItemBow)p_70620_1_.getItem()).getIcon(p_70620_1_, 0);// :

            //((boneGripBow)w2theJungle.boneGripBow).getIcon2(p_70620_1_, p_70620_2_, (EntityLivingBase)this, this.attackStatus, this.attackTime);

        }

        return iicon;

    }

 

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.