Posted April 30, 201312 yr I am making a machine that needs to fundamentally change the way the world is rendered, from the normal textured quads to my own system. All of it is done except one last part - I need to disable the default system on demand, without editing base classes. Digging through Minecraft, WorldRenderer, RenderGlobal, and RenderBlocks provide no insight. How would I go about disabling the rendering of blocks on command? Clarification: I want absolute, total nothingness in terms of block rendering, but still want entity, particle, and sky rendering. I need it to look like this (white points are my own): Follow my mod(s) here: http://www.minecraftforum.net/topic/1969694-
April 30, 201312 yr Use ASM - insert "if(MyMod.doRenderBlocks)" to wrap "flag1 |= renderblocks.renderBlockByRenderType(block, k2, i2, j2);" in WorldRenderer (to be precise, it won't be "if" but instruction, I used it just for sake of simplicity). Then change static boolean field in your mod class whenever you want to turn it on/off and you're done. Test of hook's position: mnn.getNativeLang() != English If I helped you please click on the "thank you" button.
April 30, 201312 yr just appending to mmn's solution (he did all the work), you should subscirbe to the net.minecraftforge.client.event.DrawBlockHighlightEvent and set it to cancelled to remove the outlining of blocks, will give the illusion that they aren't there I think its my java of the variables.
May 1, 201312 yr Author Use ASM - insert "if(MyMod.doRenderBlocks)" to wrap "flag1 |= renderblocks.renderBlockByRenderType(block, k2, i2, j2);" in WorldRenderer (to be precise, it won't be "if" but instruction, I used it just for sake of simplicity). Then change static boolean field in your mod class whenever you want to turn it on/off and you're done. You will need to explain that in more depth - what is ASM? And you say "insert "if(MyMod.doRenderBlocks)" to wrap ... in WorldRenderer" - does that not mean editing base classes? Also, what if I need it done non-statically, i.e., controlled by object variables? you should subscirbe to the net.minecraftforge.client.event.DrawBlockHighlightEvent and set it to cancelled to remove the outlining of blocks, will give the illusion that they aren't there Like the above, I need elaboration. What do you mean by "subscribe to"? Follow my mod(s) here: http://www.minecraftforum.net/topic/1969694-
May 1, 201312 yr No ASM is not editing base classes per say, it is manipulating the bytecode at run time, injecting, removing, chaging values and whatnot... I've had little to no use for it, and default to reflection when i could use it, so mnn would have to help you with the how- and by subscribe I mean boolean shouldBlocksRender = true; @ForgeSubscribe public void renderCanceler(DrawBlockHighlightEvent e){ e.setCanceled(shouldBlocksRender); } and then register the class to the Event Bus I think its my java of the variables.
May 2, 201312 yr Author No ASM is not editing base classes per say, it is manipulating the bytecode at run time, injecting, removing, chaging values and whatnot... I've had little to no use for it, and default to reflection when i could use it, so mnn would have to help you with the how- and by subscribe I mean boolean shouldBlocksRender = true; @ForgeSubscribe public void renderCanceler(DrawBlockHighlightEvent e){ e.setCanceled(shouldBlocksRender); } and then register the class to the Event Bus Again both of these seem beyond my capability. Are these very advanced topics? Follow my mod(s) here: http://www.minecraftforum.net/topic/1969694-
May 2, 201312 yr It's quite advanced stuff (and I'm still noob at it myself ). If you use asmifier tool you don't even need to know too much about java bytecode. If you go the ASM way expect a lot of time spent reading and experimenting. I honestly don't think you have much choices left - IMO it's either editing directly base classes or in a runtime... some links: http://asm.ow2.org/ http://download.forge.objectweb.org/asm/asm4-guide.pdf mnn.getNativeLang() != English If I helped you please click on the "thank you" button.
May 2, 201312 yr Author It's quite advanced stuff (and I'm still noob at it myself ). If you use asmifier tool you don't even need to know too much about java bytecode. If you go the ASM way expect a lot of time spent reading and experimenting. I honestly don't think you have much choices left - IMO it's either editing directly base classes or in a runtime... some links: http://asm.ow2.org/ http://download.forge.objectweb.org/asm/asm4-guide.pdf Or I may just say "Screw it" and decide to render through the terrain instead... Follow my mod(s) here: http://www.minecraftforum.net/topic/1969694-
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.