Posted January 28, 201510 yr I have a wall that I've made and I want the texture on top to rotate base on the direction the wall is facing. I also want to change the texture if the wall is a post rather than a connector. How would I do this? Creator of the MyFit, MagiCraft, Tesseract gun, and Papa's Wingeria mod.
January 28, 201510 yr Author You will need a custom block renderer (using ISimpleBlockRenderingHandler). Then before you draw your Block (possibly using renderBlockWall in the RenderBlocks instance you get) you set uvRotateTop in that same RenderBlocks to a value 0-3 to rotate the top texture. Set it to 0 again afterwards. Do you know a tutorial? If not where do I register the renderer and what vanilla class could I reference? Creator of the MyFit, MagiCraft, Tesseract gun, and Papa's Wingeria mod.
January 28, 201510 yr Author I don't know of a tutorial, but all your renderWorldBlock method needs to do is set the rotation and then call the original renderBlockWall method. You register your ISBRH with FMLs RenderingRegistry class. OK, I'm not that familiar with ISBRH so how do I detect what direction the block is facing? And how would I rotate the texture after that? Creator of the MyFit, MagiCraft, Tesseract gun, and Papa's Wingeria mod.
January 28, 201510 yr OK, I'm not that familiar with ISBRH so how do I detect what direction the block is facing? And how would I rotate the texture after that? world#getBlockMetadata? 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.
January 28, 201510 yr Author Well the wall I have already has other walls with metadata. And the world param isn't actually world. It can't detect that stuff. OK, I'm not that familiar with ISBRH so how do I detect what direction the block is facing? And how would I rotate the texture after that? world#getBlockMetadata? Creator of the MyFit, MagiCraft, Tesseract gun, and Papa's Wingeria mod.
January 28, 201510 yr IBlockAccess still has getBlock and getBlockMetadata. Point is: If you want to change the rotation to a specific direction, you're going to need to figure out what defines that specific direction yourself. No one else can say "oh just do X" because you're the one who wants something specific based on parameters only you know. If its based on which direction the player was facing when they placed it down you're either going to have to save it in the metadata or use a TileEntity. There are no ifs, ands, or buts about it. The game isn't magic and can't interpret what you say into what you mean unless you are clear and unambiguous. 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.
January 28, 201510 yr Author IBlockAccess still has getBlock and getBlockMetadata. Point is: If you want to change the rotation to a specific direction, you're going to need to figure out what defines that specific direction yourself. No one else can say "oh just do X" because you're the one who wants something specific based on parameters only you know. If its based on which direction the player was facing when they placed it down you're either going to have to save it in the metadata or use a TileEntity. There are no ifs, ands, or buts about it. The game isn't magic and can't interpret what you say into what you mean unless you are clear and unambiguous. I don't want it to be determined by the way the player was facing, I want the way the wall is connected to adjacent walls to determine the rotation of the texture. Creator of the MyFit, MagiCraft, Tesseract gun, and Papa's Wingeria mod.
January 28, 201510 yr Then you're going to need to know if there's a wall at XPos, ZPos, XNeg, or ZNeg. world#getBlock 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.
January 28, 201510 yr Author Then how do I re-set the the texture of a block after i check that? Creator of the MyFit, MagiCraft, Tesseract gun, and Papa's Wingeria mod.
January 28, 201510 yr You will need a custom block renderer (using ISimpleBlockRenderingHandler). Then before you draw your Block (possibly using renderBlockWall in the RenderBlocks instance you get) you set uvRotateTop in that same RenderBlocks to a value 0-3 to rotate the top texture. Set it to 0 again afterwards. 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.
January 28, 201510 yr Author No I want to change the texture when I check it. Creator of the MyFit, MagiCraft, Tesseract gun, and Papa's Wingeria mod.
January 28, 201510 yr Author This is really pointless. Nothing works and I'm not getting anywhere Creator of the MyFit, MagiCraft, Tesseract gun, and Papa's Wingeria mod.
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.