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 ClassesNested classes/interfaces inherited from interface net.minecraft.server.packs.resources.PreparableReloadListener
net.minecraft.server.packs.resources.PreparableReloadListener.PreparationBarrier -
Constructor Summary
ConstructorsConstructorDescriptionModAtlasHolder(String modid, String atlasLocation, String atlasInfoLocation) Defines a mod texture atlas. -
Method Summary
Modifier and TypeMethodDescriptionnet.minecraft.resources.ResourceLocationvoidclose()net.minecraft.client.renderer.texture.TextureAtlasSpritegetSprite(net.minecraft.resources.ResourceLocation resourceLocation) voidinit()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, waitMethods inherited from interface net.minecraft.server.packs.resources.PreparableReloadListener
getName
-
Constructor Details
-
ModAtlasHolder
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:
reloadin interfacenet.minecraft.server.packs.resources.PreparableReloadListener
-
close
public void close()- Specified by:
closein interfaceAutoCloseable
-