Jump to content

Adding Bounding Boxes (not block bounds, more than that) [SOLVED] [1.7.10]


TheEpicTekkit

Recommended Posts

Hello everyone.

 

So I a playing with block bounds again, but this time, instead of bounds larger than 1x1x1, I am trying to add bounding boxes to a cable I am working on, so I have it rendering and connecting, but the block bounds aren't updating, and this is because I haven't made it do so yet (because I don't know how to do this, hence why I am coming here).

 

So I would like to ADD bounding boxes when it is connected, don't confuse this, I want to ADD boxes, not extend the existing box. like what Buildcraft pipes do, they add boxes, and don't just extend the box existing. Now I have come across a method called addCollisionBoxesToList(world, x, y, z, AABB, list, entity) {...} and have filled it out:

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

	float px = 1/16;

	this.setBlockBounds(px*6-2, px*6-2, px*6-2, px*6-2, px*6-2, px*6-2);
	super.addCollisionBoxesToList(world, x, y, z, block, list, entity); 

	TileEntity tileEntity = world.getTileEntity(x, y, z); 
	if (tileEntity instanceof TileEntityCable) { 
		TileEntityCable tileCable = (TileEntityCable) tileEntity; 

		if (tileCable.connections[5] != null) { 
			this.setBlockBounds(0.0F, 0.375F, 0.375F, 0.625F, 0.625F, 0.625F);
			super.addCollisionBoxesToList(world, x, y, z, block, list, entity); 
		} if (tileCable.connections[4] != null) { 
			this.setBlockBounds(0.375F, 0.375F, 0.375F, 1.0F, 0.625F, 0.625F);
			super.addCollisionBoxesToList(world, x, y, z, block, list, entity); 
		} if (tileCable.connections[1] != null) { 
			this.setBlockBounds(0.375F, 0.0F, 0.375F, 0.625F, 0.625F, 0.625F);
			super.addCollisionBoxesToList(world, x, y, z, block, list, entity); 
		} if (tileCable.connections[0] != null) { 
			this.setBlockBounds(0.375F, 0.375F, 0.375F, 0.625F, 1.0F, 0.625F);
			super.addCollisionBoxesToList(world, x, y, z, block, list, entity); 
		} if (tileCable.connections[2] != null) { 
			this.setBlockBounds(0.375F, 0.375F, 0.0F, 0.625F, 0.625F, 0.625F);
			super.addCollisionBoxesToList(world, x, y, z, block, list, entity); 
		} if (tileCable.connections[3] != null) { 
			this.setBlockBounds(0.375F, 0.375F, 0.375F, 0.625F, 1.0F, 0.625F);
			super.addCollisionBoxesToList(world, x, y, z, block, list, entity); 
		}
	}
	this.setBlockBounds(0.375F, 0.375F, 0.375F, 0.625F, 0.625F, 0.625F);
}

Now all this seems to do is set the collision boxes, not the actual bounds. so before this, I could clip through the sections of the cable without bounds, and the same with other entities, now with this, it seems to stop that, but still no bounding boxes. Also, just a little note, the "connections" is a ForgeDirection array in the tileentity used to store the connections.  (0 = UP, 1 = DOWN, 2 = NORTH, 3 = SOUTH, 4 = EAST, 5 = WEST).

 

The reason I want to do this, is because I would like to work my cables into forge multipart, so I can have a cable in the same block space as a multipart.

 

So any help on the adding block bounds bit would be appreciated, I would also appreciate help with the multipart bit, but that isn't what this topic is about, and I haven't even got to starting that yet.

 

Thanks

I ask complicated questions, and apparently like to write really long detailed posts. But I also help others when I can.

Link to comment
Share on other sites

  • 2 months later...

Hello I have been looking all over for this, I have been working with MCreator and Techne making a door.

I don't know much java hardly only the basics and jumping in to MCreator was the best thing for me to do because I can learn most of the basic block code and such that was and its all generated but for I am becoming a bit more advanced and trying to learn more things, It took me 48 hours just to find what this post, will you help me?

 

May I please ask to see the finished code, this would take a lot of stress of my solders.

If you don't want to post it here you may email it to me at [email protected]

 

Thank you for your time,

NorthWestTrees

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.



  • Recently Browsing

    • No registered users viewing this page.
  • Posts

    • The Risks of Online Crypto Investment: A Cautionary Tale EMAIL: rap iddigitalreco ve ry @ exe cs. com. WHAT SAPP: + 1 41 4 80 7 14 85 Online crypto investment can seem like a promising opportunity, but it’s crucial to recognize that there are no guarantees. My own experience serves as a stark reminder of this reality. I was drawn in by the allure of high returns and the persuasive marketing tactics employed by various brokers on platforms like Instagram. Their polished presentations and testimonials made it seem easy to profit from cryptocurrency trading. Everything appeared to be legitimate. I received enticing messages about the potential for substantial gains, and the brokers seemed knowledgeable and professional. Driven by excitement and the fear of missing out, I invested a significant amount of my savings. The promise of quick profits overshadowed the red flags I should have noticed. I trusted these brokers without conducting proper research, which was a major mistake. As time went on, I realized that the promised returns were nothing but illusions. My attempts to withdraw funds were met with endless excuses and delays. It became painfully clear that I had fallen victim to a scam. The reality hit hard: my hard-earned money was gone, and I was left feeling foolish and defeated. In my desperation, I sought help from a company called Rapid Digital Recovery. They specialize in helping individuals recover funds lost to online scams. Their expertise and guidance have been invaluable during this difficult time. While I remain cautious and skeptical, I’m hopeful that they can assist me in retrieving my funds. This has taught me an important lesson: if something seems too good to be true, it probably is. I urge anyone considering online crypto investments to be extremely cautious. Do your research, scrutinize the brokers, and avoid rushing into decisions driven by hype or pressure. The world of cryptocurrency can be volatile and unregulated, making it a breeding ground for scams. while online investments can be appealing, they come with significant risks. Protect yourself by staying informed and skeptical. Learn from my experience and prioritize due diligence over quick gains. Stay away from unverified platforms and be wary of offers that sound too good to be true. Your financial security is worth the effort to ensure you’re making safe and informed decisions.
    • This is the log for Prism launcher after I added it https://mclo.gs/uXywaR5 As for AT launcher i'm not sure where to change the JVM arguments.  
    • Please help me out! Here is the report: pastebin.com/uiJMSG5Y
    • Hello,   I am playing the Modified Cobblemon modpack and I am able to join the server, the server is also hosted on my pc, but yet no one else is able to join the server, they get an error code of fieldSize is too long yet I have triple checked to be sure that all of the mods are the same outside of the client side mods. The specific code is Internal Exception: io.netty.handler.codec.DecoderException: io.netty.handler.codec.EncoderException: Java.io.EOFException: fieldSize is too long! Length is 1638, but maximum is 38. The first number changes at random but it is always a fairly large number and I have tried looking and logs and it says that there are mismatched mods between the server and client yet they are both present so I am not sure what is creating an issue for players joining. Client Log https://pastebin.com/UxpcCXr6 https://pastebin.com/aWuHaN57 I had to split the client log because it was too large for a single pastebin, I have had all three friends try to join the server and they all get this message but the client logs provided are from the person joining from LAN. Forge version is 47.3.11. Any help or insight on what is causing the issue would be greatly appreciated.
    • it does not work another mista https://mclo.gs/U6qlkl2  I changed the directory, I switched to java 17 but it doesn't start
  • Topics

×
×
  • Create New...

Important Information

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