Posted January 7, 20169 yr 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?
January 7, 20169 yr 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.
January 7, 20169 yr 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?
January 7, 20169 yr 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.
January 7, 20169 yr 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.