Jump to content

[1.7.2] Obfuscated name for Block.canRenderInPass ??


heaton84

Recommended Posts

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!

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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?

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

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