Class RegisterSpriteSourcesEvent

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

public class RegisterSpriteSourcesEvent extends net.neoforged.bus.api.Event implements net.neoforged.fml.event.IModBusEvent
Fired to allow mods to register their own SpriteSource codecs. This event is fired once during the construction of the Minecraft instance or before datagen when client datagen is enabled.

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 net.minecraft.util.ExtraCodecs.LateBoundIdMapper<net.minecraft.resources.ResourceLocation,com.mojang.serialization.MapCodec<? extends net.minecraft.client.renderer.texture.atlas.SpriteSource>>
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    RegisterSpriteSourcesEvent(net.minecraft.util.ExtraCodecs.LateBoundIdMapper<net.minecraft.resources.ResourceLocation,com.mojang.serialization.MapCodec<? extends net.minecraft.client.renderer.texture.atlas.SpriteSource>> idMapper)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    register(net.minecraft.resources.ResourceLocation id, com.mojang.serialization.MapCodec<? extends net.minecraft.client.renderer.texture.atlas.SpriteSource> codec)
     

    Methods inherited from class java.lang.Object

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

    • idMapper

      private final net.minecraft.util.ExtraCodecs.LateBoundIdMapper<net.minecraft.resources.ResourceLocation,com.mojang.serialization.MapCodec<? extends net.minecraft.client.renderer.texture.atlas.SpriteSource>> idMapper
  • Constructor Details

    • RegisterSpriteSourcesEvent

      @Internal public RegisterSpriteSourcesEvent(net.minecraft.util.ExtraCodecs.LateBoundIdMapper<net.minecraft.resources.ResourceLocation,com.mojang.serialization.MapCodec<? extends net.minecraft.client.renderer.texture.atlas.SpriteSource>> idMapper)
  • Method Details

    • register

      public void register(net.minecraft.resources.ResourceLocation id, com.mojang.serialization.MapCodec<? extends net.minecraft.client.renderer.texture.atlas.SpriteSource> codec)