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

I'm relatively new with using custom BakedQuads, but, rather than make 2^6^16 combinations of block states for rendering, I figured it was an easier method.

 

I cannot, however, get them to render the correct way. No matter what I do to the numbers, the texture is displayed facing downward.

 

I have a the following inside of IBakedModel#getQuads override.

        TextureAtlasSprite texture = ItemPanel.getTextureOf(panelUp);
        int color = Color.WHITE.getRGB();
        quads.add(new BakedQuad(Ints.concat(
            vertexToInts(1/16f , 15/16f, 1/16f , color, texture, 0 , 0 ),
            vertexToInts(15/16f, 15/16f, 1/16f , color, texture, 16, 0 ),
            vertexToInts(15/16f, 15/16f, 15/16f, color, texture, 16, 16),
            vertexToInts(1/16f , 15/16f, 15/16f, color, texture, 0  ,16)
        ), 0, EnumFacing.UP, texture, false, format));

 

vertexToInts:

public static int[] vertexToInts(float x, float y, float z, int color, TextureAtlasSprite texture, float u, float v) {
    return new int[] {
        Float.floatToRawIntBits(x),
        Float.floatToRawIntBits(y),
        Float.floatToRawIntBits(z),
        color,
        Float.floatToRawIntBits(texture.getInterpolatedU(u)),
        Float.floatToRawIntBits(texture.getInterpolatedV(v)),
        0
    };
  }

 

All other quads come from baked model components and render fine.

 

Why is this texture facing down? It seems the EnumFacing parameter in BakedQuad.<init> does nothing (I tried other values), so what am I doing wrong?

 

EDIT: This issue also happens with EAST- and NORTH-sided panels facing WEST and SOUTH respectively.

I'm relatively new with using custom BakedQuads, but, rather than make 2^6^16 combinations of block states for rendering, I figured it was an easier

 

Why the hell do you need 22,821,109,907,456 states?  That's more baked models than the game even supports.

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

  • Author

I need that many combinations.

 

2 from the possibility of a side having a panel on or off.

6 from each of the six sides.

16 possible panels (including no panel).

 

I may have done the math wrong, but it's still a ridiculous number of combinations for the block.

 

No matter the number of combinations, I do need this solved...

  • Author

That will work a whole lot better, thank you.

 

Question now is can models be parented to these forge blockstate variants, or do I have to do a lot redundant typing?

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.