Jump to content

Block render pass


Alex_hawks

Recommended Posts

I have been making a block that can take the texture of other blocks, and have run into the issue of which render pass the block needs to render in. If I set it to 0, then I have the same issue as MFFS had with ice and water a while back, and if I set it to 1, then I have dodgy rendering when the block are next to each other with different textures, particularly textures of blocks that should be rendered in pass 0. One way that I can think of to fix it is to use twice as much metadata, but I would like to retain future compatibility and would prefer to avoid using metadata for this.

I also looked at MFFS source code to see how ThunderDark dealt with it, and found out that he hard-coded for water and ice...

Is there any solution without hard-coding, or doubling my footprint?

Link to comment
Share on other sites

not sure how your doing it ,but couldn't you call get render pass in your block and have that call a get render pass in the block that has the texture you want to use?

ย 

i'm kinda doing something similar in a mod i'm working on but i dont think i will have that problem as i'm getting only the texture of solid, normal blocks. but i'm using a tile entity ,3 int arrays ( may be able to shrink rotation and meta to what ever size a hexadecimal uses later) , and a custom renderer to read the info.

Link to comment
Share on other sites

getRenderBlockPass in Block doesn't have any parameters, and you have one instance of a Block / Item, so I can't store it there... I have no way to access where I'm storing my data...

Amending the first post, I would have to use 2 Block IDs to accomplish it in the way I proposed...

Link to comment
Share on other sites

from what i'm getting from the first post is your ( probably ) storing the id of the block that you want the texture of. witch if you are it wouldnt work above block id 15. and i dont think adding a second var to the block would work so the only way i could think of is to add a tile entity and custom renderer like i'm haveing to.

ย 

the tile entity doesn't need much in the way of variables, block id, render pass, and side would be the easiest. then from the custom renderer u get the tile entity by using the IBlockAccess.getTileEntity() , cast that to your tile entity and get the data either from the variables or by reading from the nbt trough that.

ย 

AbrarSyed has a mod in github i've been using as a refrence , though its for 1.4.7 it should be adaptable enough to work for 1.5

https://github.com/AbrarSyed/SecretRoomsMod-forge

Link to comment
Share on other sites

ok so your trying to not use a custom renderer at all but the basic one with a work around to get a different blocks texture ?

also what exactly is your block gonna do?

(so i can try to figure out what u want w/o having to weed though the obscurity of what will and wont work cause of something i dont have any info on )

Link to comment
Share on other sites

Correct, I'm using Mojang's default Block renderer. All I need to do is change what one of the getTexture overloads returns, and mark the block for a render update...

The block in question is the Hidden Wires from Electric Expansion. With 1.5 and the new way of handling textures, I thought it would be easy to add blocks that can use another blocks texture, with support for Mod Blocks that aren't my own... One of the very few bugs left in the MC1.5 update is the Hidden Wires not rendering properly.

Link to comment
Share on other sites

well after a bit of thinking i have a few ideas , not all the best per say but ideas all the same :P

ย 

1) use meta to store the render pass and when u set the block type in the TE you could update the block to the block of that pass

ย 

2) the long tedious custom renderer

ย 

3) check the render pass of the block before you store it in the TE and only allow pass 0 ones and ones that are opaque cubes , as pass 1 blocks appear to only be the semi-transparent ones and something see through wouldn't exactly hide a wire very well lol

ย 

just the ones i could come up with, their are probably more ways

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.