Jump to content

[1.10.2] Fast way to get a unique identifier for a TileEntity and a related Qs


Recommended Posts

Posted

Hi all

 

I have created a TileEntity with a TESR, similar to an Aura node from Thaumcraft, but with the big difference being it has no need for meta or NBT data. At the moment it has a small 15 frame animation rendered onto a facing quad, and this is where the problem comes in. All of them render the same frame at the same time, and I would like to offset their animations somehow. Is there some sort of unique/per-TE ID I can use? If so, how do I access it?

 

First related question: I would also like some input on how heavily TE's with TESRs might impact performance. This TE does no processing, contains no data, its basically just a decorative block, however I would expect several thousand to be spawned or places throughout a server. Would this be a problem? Assuming, of course, that my rendering code is not the code equivalent of a dumpster fire.

 

Second related question, in the Block class for the above-mentioned TileEntity, I setAir to true, as I do not want my entities interfering with any multiblocks or other things I havent thought of yet. However when I setAir to true, I am no longer able to break them. How do I deal with this?

 

Third question, also in the above mentioned block class, I have isOpaqueBlock returning false, I did this because leaving it as true creates 'windows' through which you can see 'into' the world. However the function is deprecated, and I am having a hard time figuring out what it should be replaced with?

 

Fourth question, much like the previous one, getBoundingBox is also deprecated, what should THAT be replaced with?

 

Thanks for your help

Posted

Regarding the TESR, is it actually possible to render a plain block as a facing quad? I would really prefer to do this as my object has no model, no motion, nothing, its just a 15 frame animated texture rendered onto a facing quad and acts just like a TC node. If not, I will just dig into FastTESR (thanks for that, I have never heard of it before).

 

And thanks a bunch for all the other answers Diesieben07, they definitely help! I have already implemented the isReplaceable part, I guess Ill just see what happens when I stick on of these things in a TiCon smeltery or a RC tank or something.

Posted

Regarding the TESR, is it actually possible to render a plain block as a facing quad? I would really prefer to do this as my object has no model, no motion, nothing, its just a 15 frame animated texture rendered onto a facing quad and acts just like a TC node. If not, I will just dig into FastTESR (thanks for that, I have never heard of it before).

Yes, it's possible - I think you're talking about blocks with animated textures, which are used by the likes of flowing water or fire.  Basically, the quad stays the same but the texture is changed every few frames, so it is very fast.  Check out the vanilla for water, fire, lava for more clues.

 

-TGG

 

 

 

 

 

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.