Jump to content

Dynamic textures (1.4 compass-style) in 1.5?


Kinniken

Recommended Posts

Hi guys,

 

Anyone knows if it is still possible to use "calculated" textures for items in 1.5? Like you could in 1.4 by extending TextureFX and filling imageData[] manually? I saw that Mojang has switched to pre-calculated sprites for the clock and compass textures.

 

It would be great if it was still possible...

 

K.

Link to comment
Share on other sites

Its possible, but the downsides arr enormks, and 99% of the time the modder does it wrong causing massive performance issues on the clients and pains cor texture pack makers, so i advise you think of following mojangs lead and making animation files instead of runtime generation.

I do Forge for free, however the servers to run it arn't free, so anything is appreciated.
Consider supporting the team on Patreon

Link to comment
Share on other sites

Well, mine worked fine in MC 1.4, with no significant CPU issue ;) But switching to pre-generated sprites is also possible and if that's the recommended way it works for me too.

 

However, how do I declare my animation now? There are no addAnimation methods anymore. (I can't just use a text file - I need custom logic to select the proper frame to use, like the compass and the watch do. For instance one my texture changes depending on the proximity of mobs).

Link to comment
Share on other sites

https://github.com/MinecraftForge/MinecraftForge/blob/master/patches/minecraft/net/minecraft/client/renderer/texture/TextureMap.java.patch#L66

In your compass's texture register callback, create your TextureStitched and register it using setTextureEntry

See TextureClock/TextureCompass for examples on how to pragmatically choose the animation frame.

I do Forge for free, however the servers to run it arn't free, so anything is appreciated.
Consider supporting the team on Patreon

Link to comment
Share on other sites

Sadly no, you'd have tio make sure its a safe cast and cast it.

However the only thing that implements IconRegister is TextureMap so you should be good.

I do Forge for free, however the servers to run it arn't free, so anything is appreciated.
Consider supporting the team on Patreon

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.



×
×
  • Create New...

Important Information

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