Jump to content

[1.19.2] Shapes net.minecraft.world.phys.shapes.BooleanOp.class, make cubic shape whit a hole inside


Recommended Posts

Posted (edited)

hi good nights 
im doing a custome toilet block and i need to set the collition boxes for it in four direction but for the explanatory process i only talking about facing nort 

toilet-edit.gif

i have two main collition boxes
one for the chair and one for the tank 

    protected static final VoxelShape NB_0 = Block.box( 3.0D, 0.0D, 4.0D, 10.0D, 8.0D, 12.0D); //base chair
    protected static final VoxelShape NT_0 = Block.box( 1.0D, 7.0D, 0.0D, 14.0D, 9.0D, 4.0D); //water tank
	

i need the base chair part to have a hole in the center

soo i made the hole a shape   hopping to find a way to just sustract the hole area form the base box and later just joint the tank part 

diferencia-edit.gif

 

	like 
	
	 
	    protected static final VoxelShape HOLE = Block.box( 6.0D, 0.0D, 6.0D, 10.0D, 8.0D, 10.0D);
   //base whit a hole =>  Shapes.join( NB_0, HOLE, BooleanOp.? )
	    
    protected static final VoxelShape caja_n = Shapes.join( Shapes.join( NB_0, HOLE, BooleanOp.? )  ,NT_0 , BooleanOp.OR);
                                               //Shapes.join(caja, Y_5_AABB, BooleanOp.OR);

 

soo iwas looking inside the BooleanOp.class

net.minecraft.world.phys.shapes.BooleanOp.class

an don't get a thing 
i guest is coze im not a english speaker soo this things dont make sense for me 
is like here im joining too forms using BooleanOp.OR   but that dont make sense, 
in mi languague  that must be a BooleanOp.AND operation 

soo how i cut the small hole shape from the  bigger base chair part ? 

 

thanks for you time 

 

 

 

 

 









 

Edited by perromercenary00
Posted

Look at what the AbstractCauldron or HopperBlock does. Or in general:

Shapes.join(original, cutout, ONLY_FIRST);

i.e. start with "original" and only takes the parts that are in that shape but not in "cutout". 

Boilerplate:

If you don't post your logs/debug.log we can't help you. For curseforge you need to enable the forge debug.log in its minecraft settings. You should also post your crash report if you have one.

If there is no error in the log file and you don't have a crash report then post the launcher_log.txt from the minecraft folder. Again for curseforge this will be in your curseforge/minecraft/Install

Large files should be posted to a file sharing site like https://gist.github.com  You should also read the support forum sticky post.

Posted
On 12/29/2022 at 6:06 PM, warjort said:

ya thanks that makes the tric works 

				
			    protected static final VoxelShape HOLE = Block.box(6.0D, 0.0D, 6.0D, 10.0D, 8.0D, 10.0D);				
			    protected static final VoxelShape caja_n = Shapes.join(Shapes.join(NB_0, HOLE, BooleanOp.ONLY_FIRST), NT_0,
		            BooleanOp.OR);				
			

i have curiosity is somewhere explained how to use the other options, 

some of it just breaks the code and makes minecraft fails saying mi toilet block is null

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.