Class RegisterMaterialAtlasesEvent

java.lang.Object
net.neoforged.bus.api.Event
net.neoforged.neoforge.client.event.RegisterMaterialAtlasesEvent
All Implemented Interfaces:
net.neoforged.fml.event.IModBusEvent

public class RegisterMaterialAtlasesEvent extends net.neoforged.bus.api.Event implements net.neoforged.fml.event.IModBusEvent
Fired for registering texture atlases that will be used with Material or other systems which retrieve the atlas via Minecraft.getTextureAtlas(ResourceLocation) or ModelManager.getAtlas(ResourceLocation).

If an atlas is registered via this event, then it must NOT be used through a TextureAtlasHolder.

This event fires during startup when the ModelManager is constructed.

This event is not cancellable.

This event is fired on the mod-specific event bus, only on the logical client.

  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private final Map<net.minecraft.resources.ResourceLocation,net.minecraft.resources.ResourceLocation>
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    RegisterMaterialAtlasesEvent(Map<net.minecraft.resources.ResourceLocation,net.minecraft.resources.ResourceLocation> atlases)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    register(net.minecraft.resources.ResourceLocation atlasLocation, net.minecraft.resources.ResourceLocation atlasInfoLocation)
    Register a texture atlas with the given name and info location

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • atlases

      private final Map<net.minecraft.resources.ResourceLocation,net.minecraft.resources.ResourceLocation> atlases
  • Constructor Details

    • RegisterMaterialAtlasesEvent

      @Internal public RegisterMaterialAtlasesEvent(Map<net.minecraft.resources.ResourceLocation,net.minecraft.resources.ResourceLocation> atlases)
  • Method Details

    • register

      public void register(net.minecraft.resources.ResourceLocation atlasLocation, net.minecraft.resources.ResourceLocation atlasInfoLocation)
      Register a texture atlas with the given name and info location
      Parameters:
      atlasLocation - The name of the texture atlas
      atlasInfoLocation - The location of the atlas info JSON relative to the atlases directory