Jump to content

Recommended Posts

Posted

Hey,

I wanted to create a fire.

That's my code:

 

  Reveal hidden contents

 

When I tried destroying it (without my hitbox code) it destroyed the block below. With the hitbox code (this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.05F, 1.0F)) it is not rendered as I want it to...

Thanks for help.  :)

Posted

Add this to your block class

@SideOnly(Side.CLIENT)
public AxisAlignedBB getSelectedBoundingBoxFromPool(World world, int posX, int posY, int posZ)
{
    return AxisAlignedBB.getAABBPool().getAABB(posX+0.0D, posY+0.0D, posZ+0.0D, posX+1.0D, posY+0.05D, posZ+1.0D);
}

Posted

I mean with 'hitbox' the normal black borderd cube..

e.g.

2wn5hz4.jpg

 

I'm using getSelectedBoundingBoxFromPool is this wrong?

 

EDIT: If I now use getCollisionBoundingBoxFromPool and extend BlockFire there's still no hitbox

 

Code:

 

  Reveal hidden contents

 

Posted

I understood, but didn't know the correct name of the method..

 

    @SideOnly(Side.CLIENT)
    public AxisAlignedBB getSelectedBoundingBoxFromPool(World world, int posX, int posY, int posZ)
    {
        return AxisAlignedBB.getAABBPool().getAABB(posX+0.0D, posY+0.0D, posZ+0.0D, posX+1.0D, posY+0.05D, posZ+1.0D);
    }

 

Thanks! All works fine.

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.