Jump to content

What is a BakedQuad and how to create one


DBLouis

Recommended Posts

Hi !

 

Everything is in the title. I think a BakedQuad is a "face" of a cube but I'm not sure.

I looked into Minecraft code and I found a method makeBakedQuad() in FaceBakery class. Should I use this or just "new BakedQuad()" ?

If yes, what do I put as arguments, because there is a lot of them.

 

Thanks in advance

Link to comment
Share on other sites

Hi

 

This link has a lot more info on block models

http://greyminecraftcoder.blogspot.com.au/p/list-of-topics.html  (see the Blocks sections)

 

also this tutorial project has a section showing how to generate BakedQuads

https://github.com/TheGreyGhost/MinecraftByExample

specifically

https://github.com/TheGreyGhost/MinecraftByExample/blob/master/src/main/java/minecraftbyexample/mbe15_item_smartitemmodel/ChessboardSmartItemModel.java

 

-TGG

Link to comment
Share on other sites

Hi

 

/**

  // Creates a baked quad for the given face.

  // When you are directly looking at the face, the quad is centred at [centreLR, centreUD]

  // The left<->right "width" of the face is width, the bottom<-->top "height" is height.

  // The amount that the quad is displaced towards the viewer i.e. (perpendicular to the flat face you can see) is forwardDisplacement

  //  - for example, for an EAST face, a value of 0.00 lies directly on the EAST face of the cube.  a value of 0.01 lies

  //    slightly to the east of the EAST face (at x=1.01).  a value of -0.01 lies slightly to the west of the EAST face (at x=0.99).

  // The orientation of the faces is as per the diagram on this page

  //  http://greyminecraftcoder.blogspot.com.au/2014/12/block-models-texturing-quads-faces.html

  // Read this page to learn more about how to draw a textured quad

  //  http://greyminecraftcoder.blogspot.co.at/2014/12/the-tessellator-and-worldrenderer-18.html

 

-TGG

Link to comment
Share on other sites

I found it !

 

@SideOnly(Side.CLIENT)
final class TexturesRegistrationHandler {

@SubscribeEvent
public void registerOverlays(TextureStitchEvent.Pre e) {

	assert !OresTexturizer.overlaysLocations.isEmpty() : "overlaysLocations is empty !";

	OresTexturizer.overlaysLocations.forEach(new BiConsumer<String, ResourceLocation>() {
		@Override
		public void accept(String srt, ResourceLocation location) {
                // I need only this :
			e.map.registerSprite(location);

                // I removed this :
			TextureSprite tx = new TextureSprite(location);
			boolean done = e.map.setTextureEntry(srt, tx);
		}
	});
}
}

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.

Announcements



×
×
  • Create New...

Important Information

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