Class ModAtlasHolder

java.lang.Object
codechicken.lib.gui.modular.sprite.ModAtlasHolder
All Implemented Interfaces:
AutoCloseable, net.minecraft.server.packs.resources.PreparableReloadListener

public class ModAtlasHolder extends Object implements net.minecraft.server.packs.resources.PreparableReloadListener, AutoCloseable
Created by brandon3055 on 20/08/2023
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static class 
     

    Nested classes/interfaces inherited from interface net.minecraft.server.packs.resources.PreparableReloadListener

    net.minecraft.server.packs.resources.PreparableReloadListener.PreparationBarrier
  • Constructor Summary

    Constructors
    Constructor
    Description
    ModAtlasHolder(String modid, String atlasLocation, String atlasInfoLocation)
    Defines a mod texture atlas.
  • Method Summary

    Modifier and Type
    Method
    Description
    net.minecraft.resources.ResourceLocation
     
    void
     
    net.minecraft.client.renderer.texture.TextureAtlasSprite
    getSprite(net.minecraft.resources.ResourceLocation resourceLocation)
     
    void
     
    final @NotNull CompletableFuture<Void>
    reload(net.minecraft.server.packs.resources.PreparableReloadListener.PreparationBarrier prepBarrier, net.minecraft.server.packs.resources.ResourceManager resourceManager, net.minecraft.util.profiling.ProfilerFiller profiler, net.minecraft.util.profiling.ProfilerFiller profiler2, Executor executor, Executor executor2)
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface net.minecraft.server.packs.resources.PreparableReloadListener

    getName
  • Constructor Details

    • ModAtlasHolder

      public ModAtlasHolder(String modid, String atlasLocation, String atlasInfoLocation)
      Defines a mod texture atlas. Must be registered as a resource reload listener via RegisterClientReloadListenersEvent This is all that is needed to create a custom texture atlas.
      Parameters:
      modid - The mod id of the mod registering this atlas.
      atlasLocation - The texture atlas location. e.g. "textures/atlas/gui.png" (Will have the modid: prefix added automatically)
      atlasInfoLocation - The path to the atlas json file relative to modid:atlases/ e.g. "gui" will point to modid:atlases/gui.json
  • Method Details

    • init

      public void init()
    • atlasLocation

      public net.minecraft.resources.ResourceLocation atlasLocation()
    • getSprite

      public net.minecraft.client.renderer.texture.TextureAtlasSprite getSprite(net.minecraft.resources.ResourceLocation resourceLocation)
    • reload

      @NotNull public final @NotNull CompletableFuture<Void> reload(net.minecraft.server.packs.resources.PreparableReloadListener.PreparationBarrier prepBarrier, net.minecraft.server.packs.resources.ResourceManager resourceManager, net.minecraft.util.profiling.ProfilerFiller profiler, net.minecraft.util.profiling.ProfilerFiller profiler2, Executor executor, Executor executor2)
      Specified by:
      reload in interface net.minecraft.server.packs.resources.PreparableReloadListener
    • close

      public void close()
      Specified by:
      close in interface AutoCloseable