Jump to content

Recommended Posts

Posted

Well, i've used setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.375F, 1.0F); to set my collision box, and, as 0.375 < 0.5 i expected to walk upon those blocks, but i can't. Why?

If i helped you, don't forget pressing "Thank You" button. Thanks for your time.

Posted

Because that's not its collision model.  It's collision model is still a full cube.

 

public AxisAlignedBB getCollisionBoundingBoxFromPool(World par1World, int par2, int par3, int par4)
{
	return AxisAlignedBB.getAABBPool().addOrModifyAABBInPool((double)par2 + this.minX, (double)par3 + this.minY, (double)par4 + this.minZ, (double)par2 + this.maxX, (double)((float)par3 + 0.125F * var5 - 0.005F), (double)par4 + this.maxZ);
}

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Posted

Sure? My block extends BlockContainer that in it's turn extends Block that has next code:

 

public AxisAlignedBB getCollisionBoundingBoxFromPool(World par1World, int par2, int par3, int par4)
    {
        return AxisAlignedBB.getAABBPool().getAABB((double)par2 + this.minX, (double)par3 + this.minY, (double)par4 + this.minZ, (double)par2 + this.maxX, (double)par3 + this.maxY, (double)par4 + this.maxZ);
    }

 

And min/max x/y/z are set in setBlockBounds:

    public final void setBlockBounds(float par1, float par2, float par3, float par4, float par5, float par6)
    {
        this.minX = (double)par1;
        this.minY = (double)par2;
        this.minZ = (double)par3;
        this.maxX = (double)par4;
        this.maxY = (double)par5;
        this.maxZ = (double)par6;
    }

---

And please, use spoiler for code like that for it not to fuck the whole topic up...

If i helped you, don't forget pressing "Thank You" button. Thanks for your time.

Posted

Solution was just weird. This thing made the trick:

public boolean renderAsNormalBlock(){
     return false;
}

If i helped you, don't forget pressing "Thank You" button. Thanks for your time.

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.