Jump to content

[1.7.10] Rotating a texture on a face [Solved]


KillerMapper

Recommended Posts

Hi,

 

First, sorry if this topic has been already mentioned here, but I couldn't find any solution...

 

I'm making some road blocks with orientations. But only the top face has a different texture with a specific orientation:

gPdzEmi.png

 

I can't find how to rotate the texture on the top without having to make a second texture with the line turned 90°. And I really want to avoid making additional textures just because I can't rotate them in the game... Especially since I have a lot of blocks in this case. I tried some IconFlipped but it can't rotate, it can only mirrors the texture (will be useful for my arrows and corners, but not for my lines).

 

I tried to look at the code for logs or pistons, but I stuck when it goes into the render part.

I found this but I don't understand how to use it (I don't even know if it's still up to date, considering one of the pages shows the old terrain.png):

http://greyminecraftcoder.blogspot.com.au/2013/07/rendering-non-standard-blocks.html

http://greyminecraftcoder.blogspot.com.au/2013/08/the-tessellator.html

 

Any ideas how I could achieve this?

 

Thanks.

Link to comment
Share on other sites

Why not just rotate the entire block like the furnace, just look at BlockFurnace#onBlockAdded

 

That's not how the furnace works. The furnace doesn't ACTUALLY rotate, it just displays a different texture (the "front") on a different side (NSEW).

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, ISBRH seems to be the good way. I successfully made a block using ISBRH and rotated the texture on the top. Now I just need to adapt the uvRotateTop to the metadata, I hope I'll succeed :)

 

About the furnace: like Draco18s said, the only thing this block does is putting the front texture at the right place. The top texture never rotates (you can verify on the pumpkin block which works exactly the same way, the stem drawn on the texture doesn't rotate).

 

EDIT: Done! Thanks for you help! If you want to check the sources, go ahead: https://github.com/KillerMapper/roadstuff

Note: I just set the git earlier, and I still have lot of test files in. I need to clean the mod. Check TestRotateBlock.class, which uses RenderAsphaltLines.class to see how I did the rotating texture.

 

Thanks for your help!

 

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.