Jump to content

Recommended Posts

Posted

So, I've been using the

 

public void addCollisionBoxesToList(World world, int x, int y, int z, AxisAlignedBB axis, List list, Entity entity)

 

method to make a chair and changing where the collision boxes are based on metadata to move the direction

it worked fine for 2 of them (each having 1 base collision box that doesn't change and 3 that do) facing in 2 directions

but I'm onto the third one and now the collision boxes aren't... well... colliding anymore

 

I can mouse over them and they highlight, but I'm just walking straight through them

 

so, is there a limit to how many you can add in?

because the ones I can walk through are literally the same as the others that actually collide

 

full method is

 

public void addCollisionBoxesToList(World p_149743_1_, int p_149743_2_, int p_149743_3_, int p_149743_4_, AxisAlignedBB p_149743_5_, List p_149743_6_, Entity p_149743_7_)
    {	
	int i = p_149743_1_.getBlockMetadata(p_149743_2_, p_149743_3_, p_149743_4_);
	this.setBlockBounds(0.0625F, 0.0F, 0.0625F, 0.9375F, 0.625F, 0.9375F);
	super.addCollisionBoxesToList(p_149743_1_, p_149743_2_, p_149743_3_, p_149743_4_, p_149743_5_, p_149743_6_, p_149743_7_);

	//DONE
	if(i == 4)
	{
		this.setBlockBounds(0.9375F, 0.0F, 0.0625F, 0.875F, 1.625F, 0.9375F);
		super.addCollisionBoxesToList(p_149743_1_, p_149743_2_, p_149743_3_, p_149743_4_, p_149743_5_, p_149743_6_, p_149743_7_);
		this.setBlockBounds(0.0625F, 0.0F, 0.0625F, 0.875F, 1.0625F, 0.1875F);
		super.addCollisionBoxesToList(p_149743_1_, p_149743_2_, p_149743_3_, p_149743_4_, p_149743_5_, p_149743_6_, p_149743_7_);
		this.setBlockBounds(0.0625F, 0.0F, 0.9375F, 0.875F, 1.0625F, 0.8125F);
		super.addCollisionBoxesToList(p_149743_1_, p_149743_2_, p_149743_3_, p_149743_4_, p_149743_5_, p_149743_6_, p_149743_7_);
	}
	//DONE
	if(i == 3)
	{
		this.setBlockBounds(0.0625F, 0.0F, 0.0625F, 0.9375F, 1.625F, 0.125F);
		super.addCollisionBoxesToList(p_149743_1_, p_149743_2_, p_149743_3_, p_149743_4_, p_149743_5_, p_149743_6_, p_149743_7_);
		this.setBlockBounds(0.8125F, 0.0F, 0.125F, 0.9375F, 1.0625F, 0.9375F);
		super.addCollisionBoxesToList(p_149743_1_, p_149743_2_, p_149743_3_, p_149743_4_, p_149743_5_, p_149743_6_, p_149743_7_);
		this.setBlockBounds(0.0625F, 0.0F, 0.125F, 0.1875F, 1.0625F, 0.9375F);
		super.addCollisionBoxesToList(p_149743_1_, p_149743_2_, p_149743_3_, p_149743_4_, p_149743_5_, p_149743_6_, p_149743_7_);
	}

	if(i == 5)
	{
		this.setBlockBounds(0.0625F, 0.0F, 0.0625F, 0.125F, 1.625F, 0.9375F);
		super.addCollisionBoxesToList(p_149743_1_, p_149743_2_, p_149743_3_, p_149743_4_, p_149743_5_, p_149743_6_, p_149743_7_);
		this.setBlockBounds(0.9375F, 0.0F, 0.0625F, 0.125F, 2.0625F, 0.1875F);
		super.addCollisionBoxesToList(p_149743_1_, p_149743_2_, p_149743_3_, p_149743_4_, p_149743_5_, p_149743_6_, p_149743_7_);
	}


	if(i == 2)
	{
		this.setBlockBounds(0.125F, 0.0F, 0.750F, 0.8125F, 1.625F, 0.875F);
		super.addCollisionBoxesToList(p_149743_1_, p_149743_2_, p_149743_3_, p_149743_4_, p_149743_5_, p_149743_6_, p_149743_7_);
	}



        this.setBlockBoundsForItemRender();
    }

 

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.