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

Hello,

 

I'm currently porting a mod from 1.7.10 to 1.8.8 and I'm having trouble with a tree.

I would like the leaves to be transparent if and only if the "Fancy Graphics" game setting is set, just like vanilla leaves. In 1.7.10 this was possible by checking this setting in Block.getIcon() and return the according icon. Obviously this isn't possible in 1.8.

 

Unfortuntately Minecraft hardcoded the setting to only affect its own leaves: In loadRenderers() we have:

Blocks.leaves.setGraphicsLevel(this.mc.gameSettings.fancyGraphics);
Blocks.leaves2.setGraphicsLevel(this.mc.gameSettings.fancyGraphics);

 

Is there any way to get Minecraft to call setGraphicsLevel() on my leaves as well, or some other method to get fast and fancy graphics working for leaves?

You could call

BlockLeaves#setGraphicsLevel

with the return value of

Minecraft.isFancyGraphicsEnabled

every time the fields set by it are queried. I don't think there's any other way to do this apart from inserting a callback/event using ASM.

Please don't PM me to ask for help. Asking your question in a public thread preserves it for people who are having the same problem in the future.

  • Author

Thanks, that worked! I hoped I could utilize setGraphicsLevel() but seems like I have to live with that.

 

It seems like Minecraft is using the same textures for opaque and transparent leaves, but I am having slightly different ones. I guess now I can use getActualState() to select between the textures. Or is there a better way?

It seems like Minecraft is using the same textures for opaque and transparent leaves, but I am having slightly different ones. I guess now I can use getActualState() to select between the textures. Or is there a better way?

 

You could do that, but do you need to? If your block renders in

EnumWorldBlockLayer.SOLID

(i.e. it returns that from

Block#getBlockLayer

), transparent pixels will be rendered as black. This is how vanilla handles it.

Please don't PM me to ask for help. Asking your question in a public thread preserves it for people who are having the same problem in the future.

  • Author
transparent pixels will be rendered as black. This is how vanilla handles it.

Actually seems like that's not what happens. If the alpha value of a pixel is 0 that doesn't mean the pixel can't have a color. So the transparent pixels of my texture are still rendered in color.

But well, I guess when I do want to use different textures for both getActualState() is a way.

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.