Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

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

Featured Replies

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

  • Author

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.

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...

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.