Jump to content

Recommended Posts

Posted

Do you mean dynamically generating textures? Or are you changing the texture based on data in the item?

This is my Forum Signature, I am currently attempting to transform it into a small guide for fixing easier issues using spoiler blocks to keep things tidy.

 

As the most common issue I feel I should put this outside the main bulk:

The only official source for Forge is https://files.minecraftforge.net, and the only site I trust for getting mods is CurseForge.

If you use any site other than these, please take a look at the StopModReposts project and install their browser extension, I would also advise running a virus scan.

 

For players asking for assistance with Forge please expand the spoiler below and read the appropriate section(s) in its/their entirety.

  Reveal hidden contents

 

Posted

I don't think that's possible

This is my Forum Signature, I am currently attempting to transform it into a small guide for fixing easier issues using spoiler blocks to keep things tidy.

 

As the most common issue I feel I should put this outside the main bulk:

The only official source for Forge is https://files.minecraftforge.net, and the only site I trust for getting mods is CurseForge.

If you use any site other than these, please take a look at the StopModReposts project and install their browser extension, I would also advise running a virus scan.

 

For players asking for assistance with Forge please expand the spoiler below and read the appropriate section(s) in its/their entirety.

  Reveal hidden contents

 

Posted
  On 12/27/2018 at 8:38 PM, DaemonUmbra said:

I don't think that's possible

Expand  

It might be, but it isn't easy.

 

  On 12/27/2018 at 4:37 PM, BeardlessBrady said:

I want players to be able to create the item texture in game. So Dynamically generating textures.

Expand  

The fact that it's item textures complicates things a lot. 

First you would need to work with a BufferedImage to have the image that is later converted into a sprite. Presumably you would serialize them into a folder of sorts on the user's hard drive. The problem here is that you also need them to exist on the server if you want other players to see the texture.

Once the user has done the image in-game you would send it to the server, and the server would then send it to all other players.

The image recieved would be stored on the user's hard drive. Then you trigger a resources reload.

You would need to store a TextureAtlasSprite per image somewhere. You can create TextureAtlasSprite objects using TextureMap#registerSprite. Alternatively you might just instantinate one and use TextureMap#setTextureEntry to add it to the map. You need to do this in the TextureStitchEvent.Pre.

Then you would either need a custom IResourcePack associated with your mod to load the images from the folder or you can use custom TextureAtlasSprite implementations that override TextureAtlasSprite#hasCustomLoader and TextureAtlasSprite#load.

Finally you would need a custom IBakedModel for your item that returns a custom list of quads with your custom texture - you can use BakedQuadRetextured to easily change the textures on existing BakedQuads.

The hard part here is making sure all clients are aware of the new textures. Also the fact that the resources need to be reloaded every time the user joins a server or every time a new texture is generated will upset people since reloading resources takes a while, especially on big modpacks.

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.