Jump to content

[1.19.2] How do i implement a texture atlas in my mod?


IroPlisk

Recommended Posts

Pardon my errors in this post, as not only am i new (and thus ignorant) to forge modding in general, but i'm even newer to these forums.

 

So i want to create a texture atlas for my mod, and with it assign to each block its own index of the atlas.

I found a way to create the ResourceLocation from a post with a similiar interest, thus prompting me to insert this in my CustomBlock class:
 

Spoiler

TextureManager textureManager = Minecraft.getInstance().getTextureManager();

TextureAtlas textureAtlas = (TextureAtlas) textureManager.getTexture(new ResourceLocation("textures/atlas/blocks.png"));

Problem is now, how do i tell in my BlockInit (Block initializer class) to assign said textureAtlas and its respective index block per block?

The forge docs are rather scarce, and are (imho) not very beginner friendly, as i had to watch a youtube tutorial series in order to even create my first item. However there is no example anywhere i searched for how to use a texture atlas instead of the easy method of "1 png = 1 object"...

 

If anyone were so kind as to pour a little of its knowledge and time for my issue, i'd be much, much grateful...

Thanks in advance!

Link to comment
Share on other sites

well i'm doing "workplace danger signs" which all use the same model, but each sign uses a different index of the texture atlas. My friend who gave me the model says that it works only with the latter atlas, and not with a simple 16x16 texture png, because it would be tedious both for me and him to do something so repetitive.

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.