Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Posted

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

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

  • Author

Thank, I already know your tutorials ;)

I just want to make the 6 faces for a simple block, not a complex one like this chessboard.

 

The coordinates origin is at the center of the block ? Or at a corner ?

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

  • Author

The texture i'm trying to add as an overlay is partially transparent. Is there something in particular to do in this case ?

Because I get the "missingno" texture even if the overlay is correctly registered !

Hi

 

Partially transparent texture makes no difference, it gets stitched into the blocks + items texture sheet and acts the same as any other texture.

 

The missing texture indicates you haven't properly registered your texture.  Show your code + error log?

 

-TGG

  • Author

This is very very weird ! When I comment some code which normally affect nothing (log), it changes the overlays which works.

And if I decomment, other overlays that did not works, works ...

  • Author

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);
		}
	});
}
}

  • Author

Now the items works, and the blocks in the world have the overlay but on a white background ... Any ideas ?

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...

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.