Jump to content

[1.7.10] Custom rendering advice


Deli_SK

Recommended Posts

Hello everybody,

 

I want to ask more of an advice than an actual mod dev question.

I'm going to create a custom block, that will render as item "lying" on ground (for example sword placed on some block). I want an advice about how would it better to do it.

I was considering the ISBRH or TESR.

 

The disadvantage of using the ISRBH is that I'm not sure how exactly I want to do it (I know some basics, but nothing that complex), and as I've heard, that functionality will be oboslete in 1.8.

 

In regards to TESR, I will need to do actual TileEntity for that. That should not be bad, as then I can some "generic" solution to all items that I want to be able to place, but I'm concerned about spamming of TileEntities (Imagine WorldGen which adds sticks lying under trees).

 

So what is your advice? I won't mind when you point out another solutions, or help with one or the other solution, but quite opposite, I will be very glad.

And thank you for reading this and any potential help.

I come here to ask only after several hours of struggling, forum browsing and googling. Please be kind :)

Link to comment
Share on other sites

You can use the TESR route, as long as you override canUpdate() in your TileEntity to return false, so it doesn't tick anymore.

Don't PM me with questions. They will be ignored! Make a thread on the appropriate board for support.

 

1.12 -> 1.13 primer by williewillus.

 

1.7.10 and older versions of Minecraft are no longer supported due to it's age! Update to the latest version for support.

 

http://www.howoldisminecraft1710.today/

Link to comment
Share on other sites

Hi

 

If you want these all over the place, like grass, I would suggest using ISBRH.  It's pretty easy, easier than TESR actually, and the rendering code itself will look exactly the same.  Don't worry about the 1.8 update, that is months away and I really doubt it will be hard to adapt your render code to it.

 

Some background info here (1.6.4 but still very similar)

http://greyminecraftcoder.blogspot.com.au/2013/07/block-rendering.html

 

-TGG

Link to comment
Share on other sites

Thank you guys for your replies, especially you TGG, you've cleared more cinfusion from my head that you might thing. Anyway, I want to render an item "lying" on the ground, to be more specific it would be some sticks under trees and flint on top of gravel - distributed randomly on surface, so I can have a metadata saying which item to render and which item players get. Using TE and TESR will give me the advantage of defining *any* item to lie on the ground, but I think that the way using metadata will be sufficient for me.

 

Another quickie - I've read somewhere how to render items in TESR (I think using EntityItem). Do you happen to know any details? (as I can't seem to find the article again).

Many thanks to you.

I come here to ask only after several hours of struggling, forum browsing and googling. Please be kind :)

Link to comment
Share on other sites

Hi

 

I would suggest the method you said, i.e. create an EntityItem instance (stored in your class not spawned) then call RenderItem.doRender, should work fine.  You may need to copy parts of the code out of doRender into your own class if things like bobbing up & down or getting your sticks to "lie flat" get in the way, in which case you might be able to use just an ItemStack instead of the whole EntityItem.

 

I reckon a bit of time looking at RenderItem.doRender will get you there pretty easily.

 

-TGG

 

 

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.