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.

Featured Replies

Posted

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!

if wanna do some custome blocks and items you dont need to create a parallel texture atlas you just made some json files and left that atlas part to forge to manage 
are you trying to do something especial ? 
 

  • Author

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.

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.