Posted March 1, 201411 yr I've checked mcp-notch.srg, mcp-srg.srg, notch-mcp.srg and packaged.srg, and cannot find a reference to net/minecraft/block/Block/canRenderInPass anywhere. I need this to publish my mod. That is, unless anyone has a better solution for getting the current renderpass that doesn't involve class transformation!
March 2, 201411 yr What are you trying to do? getting the current renderpass ...!? The hell? What are you trying to do? 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.
March 2, 201411 yr https://github.com/MinecraftForge/MinecraftForge/blob/master/src/main/java/net/minecraftforge/client/MinecraftForgeClient.java#L44 I do Forge for free, however the servers to run it arn't free, so anything is appreciated. Consider supporting the team on Patreon
March 2, 201411 yr Author Thanks Lex, I'll give that a go. Is that set before even the vanilla blocks are rendered? I'm overridding the rendering of stairs. If there's a glass pane on the step face, I'm rendering a quarter glass-pane so it seamlessly attaches to the stairs. Basically this: http://imgur.com/SwgO8O7 EDIT: I should have tested that before I posted, sorry. Looks like it is not set before vanilla objects get rendered, as my glass panes disappear when I use that method. Currently, I'm patching into Block.canRenderInPass (ala ASM framework and transformation... I know.... but it appears to be the only way) to push the render pass into a static variable in my mod before resuming execution.
March 2, 201411 yr Author Ok, I must be doing something wrong here. MinecraftForgeClient.getRenderPass is always returning -1. Here's what I'm doing now. I decided to implement a renderer via RenderingRegistry.registerBlockHandler. I pulled in a new render type via RenderingRegistry.getNextAvailableRenderId(), and stored that in a static. I then overwrote BlockStairs.getRenderType to return that static field... basically hijacking vanilla stair rendering with my renderer. I suppose it's *slightly* cleaner then also modifying RenderBlocks as well. For each pass through renderWorldBlock in my renderer, I'm dumping MinecraftForgeClient.getRenderPass via System.out.println, thus verifying it's always -1. Did I miss another hook?
March 3, 201411 yr Author Just wanted to post that this issue for me has been closed. I couldn't get MinecraftForgeClient.getRenderPass to work, and I found a more efficient method than hooking into canRenderInPass. I dynamically inserted a PUTSTATIC as the first line of WorldRenderer.preRenderBlocks. Now my static is only updated once per render pass, rather than once for each block.
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.