Posted August 28, 201411 yr So I was wanting a block that I can place and have it's top surface face me wherever I place it, but I was using the source code from logs, and that wasn't working out too well, so I decided to base my block code off of the piston's code. Well, that worked, but some of the sides of the block(especially the bottom) were flipped/textured incorrectly or just looked weird, so I decided to learn how to make my own renderer based on the vanilla source code for pistons, and I found out that the minecraft source code has a feature that you can use to flip textures called "renderer.flipTexture". So great, I thought, now I can manually edit the block's sides based off of the block's metadata, right? Nope, only some of the sides would even listen to the renderer.flipTexture boolean, and I wanted to find out why(There's even a block rendering tutorial that tells you that renderFaceYNeg/Pos ignores renderer.flipTexture!). So, I dug deep into the minecraft code and found those renderFace**** methods and then I looked through them and, after hours of tinkering, I was able to reproduce working copies of those methods! And better yet, I was also able to add another kind of texture flipping: VERTICAL flipping! So I re-named the original texture flip boolean to "flipTextureHorizontally" and named the new one "flipTextureVertically" so that others can use it. I then tested those booleans out and MAN, did they work! I think it's so awesome that it would be selfish of me NOT to share this with others and see what they think, so here you go, here is the rendering class where all the magic is, and the block class that I used to test the rendering class: Rendering class: http://redsandbox.no-ip.org/Files/Minecraft/My_Mods/MINERSCROLLS/Java_Files/RenderCustomBlock.java Block class: http://redsandbox.no-ip.org/Files/Minecraft/My_Mods/MINERSCROLLS/Java_Files/MultiTexturedBlock.java I hope you guys find this useful! A lot of work and time went into this! P.S. Here's a link to that tutorial I mentioned: http://greyminecraftcoder.blogspot.com.au/2013/07/rendering-non-standard-blocks.html EDIT: I've just finished changing and updating these two classes and have managed to create this so far: (Almost)Completely rotatable blocks: http://redsandbox.no-ip.org/FTP_Files/Pictures/2014-08-29_19.38.32.png Can only rotate vertical facing blocks so far: http://redsandbox.no-ip.org/FTP_Files/Pictures/2014-08-29_19.38.32_1.png
August 29, 201411 yr FYI, there's something called pastebin. Would you like me to move your thread to modder support? Read the EAQ before posting! OR ELSE! This isn't building better software, its trying to grab a place in the commit list of a highly visible github project. www.forgeessentials.com Don't PM me, I don't check this account unless I have to.
August 30, 201411 yr Author Okay, I'll set up the text in pastebin or just leave the link to the text document version on there. Would modder support be a better suited forum? If so, then yes please!
August 30, 201411 yr It is always good feeling of accomplishment when you've really worked through this stuff and achieved full understanding and useful result. Thanks for sharing! Check out my tutorials here: http://jabelarminecraft.blogspot.com/
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.