Naiten Posted April 25, 2013 Posted April 25, 2013 Only easy way for is too make tileentity and rotate it's renderer... Hope there are more easy ways. Quote If i helped you, don't forget pressing "Thank You" button. Thanks for your time.
Darknesschaos Posted April 25, 2013 Posted April 25, 2013 Only easy way for is too make tileentity and rotate it's renderer... Hope there are more easy ways. Please do not do this, it isn't worth the extra save file size cost. I would rather see you make a texture for the two separate possible directions and use the metadata to store the direction. Here is how I would do it: when deciding the icon for the face: if nbt (metadata) = 0 > choose north/south icon if nbt = 1 > choose east/west icon when placing the block: use the code above to tell if the player is facing north or south, if they are set the metadata to 0, otherwise set it to 1. From what you have said so far, I would assume this block is strictly visual and has no intended functionality other than being a block. There appears to be some code in the Minecraft source that handles icon face rotation, but I haven't played with that yet. maybe later, as I do see myself hitting a similar problem in the future. Quote
Darknesschaos Posted April 25, 2013 Posted April 25, 2013 Only easy way for is too make tileentity and rotate it's renderer... Hope there are more easy ways. Please do not do this, it isn't worth the extra save file size cost. I would rather see you make a texture for the two separate possible directions and use the metadata to store the direction. Here is how I would do it: when deciding the icon for the face: if nbt (metadata) = 0 > choose north/south icon if nbt = 1 > choose east/west icon when placing the block: use the code above to tell if the player is facing north or south, if they are set the metadata to 0, otherwise set it to 1. From what you have said so far, I would assume this block is strictly visual and has no intended functionality other than being a block. There appears to be some code in the Minecraft source that handles icon face rotation, but I haven't played with that yet. maybe later, as I do see myself hitting a similar problem in the future. Quote
Flenix Posted April 26, 2013 Author Posted April 26, 2013 Only easy way for is too make tileentity and rotate it's renderer... Hope there are more easy ways. Please do not do this, it isn't worth the extra save file size cost. I would rather see you make a texture for the two separate possible directions and use the metadata to store the direction. Do you mean the world size? The mod is mainly designed for my server, which we have a 500gb drive dedicated just for minecraft (and a few small things like Jenkins.. if it ever bloody works.), so that's not an issue. The only reason I avoided tile entity at all was because I heard it was more RAM-consuming. However I eventually wanted to make some of the blocks a custom shape, and from what I've seen if I did that, there's no avoiding a tile entity. Maybe I should look into that, but I'll try your NBT thing first. The blocks are entirely cosmetic. It's just a set of road blocks like you'd see in the street; we have a modern server, and we have Flans, it was a huge gap and I'm learning Java to fill it Quote http://s13.postimg.org/z9mlly2av/siglogo.png[/img] My mods (Links coming soon) Cities | Roads | Remula | SilvaniaMod | MoreStats
skore13 Posted April 26, 2013 Posted April 26, 2013 There is way to avoid TileEntities in custom renderes. I've coded a library that does. I have example code for it too. But it still have one bug: It won't render if there is no full block in chunk section which shouldn't be issue for you since it's road block. Take a look in here: https://github.com/skore13/renderLib Quote Creator of easy custom renderer library without tile entity. https://github.com/skore13/renderLib
Darknesschaos Posted April 26, 2013 Posted April 26, 2013 You should always strive to use the least space possible when it comes to saves/ram usage and minimize the footprint of these blocks as much as possible. To me, that is just good practice. And seeing that these blocks are strictly cosmetic, I highly suggest looking into the log code more, as it seems that the log code is closes to what you are trying to achieve (save leaf support and vertical axis alignment). I will try to look into icon rotation later to see if it is easy to rotate the texture face on a block (just don't hold me to this please). Quote
Flenix Posted April 27, 2013 Author Posted April 27, 2013 There is way to avoid TileEntities in custom renderes. I've coded a library that does. I have example code for it too. But it still have one bug: It won't render if there is no full block in chunk section which shouldn't be issue for you since it's road block. Take a look in here: https://github.com/skore13/renderLib Looks pretty useful! How exactly would I go about using this? You should always strive to use the least space possible when it comes to saves/ram usage and minimize the footprint of these blocks as much as possible. To me, that is just good practice. And seeing that these blocks are strictly cosmetic, I highly suggest looking into the log code more, as it seems that the log code is closes to what you are trying to achieve (save leaf support and vertical axis alignment). I know that in general it's good practice. However, I'm sure I mentioned earlier that eventually, these blocks are custom rendered anyway and I was just trying to get something basic together first to help me learn. However, if it's easier to just go tile entity (or the thing Skore mentioned) then that's probably for the best. When the mod is done, the roads would look like this (The blocks are from Redpower as an example) I'm also making road signs which obviously are more important to have rendered. Quote http://s13.postimg.org/z9mlly2av/siglogo.png[/img] My mods (Links coming soon) Cities | Roads | Remula | SilvaniaMod | MoreStats
Flenix Posted April 27, 2013 Author Posted April 27, 2013 This is all irrelevant; I just realized that custom rendered tile entities (for example, a chest) don't get rendered after about 32 blocks. Which makes it totally useless for a road... So unless anyone has an idea of how to force it to be rendered, it's impossible? Quote http://s13.postimg.org/z9mlly2av/siglogo.png[/img] My mods (Links coming soon) Cities | Roads | Remula | SilvaniaMod | MoreStats
skore13 Posted May 1, 2013 Posted May 1, 2013 How exactly would I go about using this? Here is wiki I created: https://github.com/skore13/renderLib/wiki Now I'm working on rotation. But for your roads it's irrelevant. Also if you are missing anything rendering-related please tell me Road signs: It's gonna be hard to create round signs... But I've idea (from vanilla code for rendering item in player's hand) Also you have to override hitboxes for your road blocks but that's not as hard as custom renderers and I also want it in my library. Quote Creator of easy custom renderer library without tile entity. https://github.com/skore13/renderLib
Recommended Posts
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.