Class CodecReloadListener<T>

java.lang.Object
net.minecraft.server.packs.resources.SimplePreparableReloadListener<Map<net.minecraft.resources.ResourceLocation,T>>
foundry.veil.api.CodecReloadListener<T>
Type Parameters:
T - The type of mapped data to return
All Implemented Interfaces:
net.minecraft.server.packs.resources.PreparableReloadListener
Direct Known Subclasses:
FramebufferManager, PostProcessingManager

public abstract class CodecReloadListener<T> extends net.minecraft.server.packs.resources.SimplePreparableReloadListener<Map<net.minecraft.resources.ResourceLocation,T>>
Loads files similarly to SimpleJsonResourceReloadListener, but also decodes them using the provided codec.
See Also:
  • Codec
  • Nested Class Summary

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

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

    Fields
    Modifier and Type
    Field
    Description
    protected final com.mojang.serialization.Codec<T>
     
    protected final net.minecraft.resources.FileToIdConverter
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    CodecReloadListener(com.mojang.serialization.Codec<T> codec, net.minecraft.resources.FileToIdConverter converter)
    Creates a new codec reload listener.
  • Method Summary

    Modifier and Type
    Method
    Description
    protected @NotNull Map<net.minecraft.resources.ResourceLocation,T>
    prepare(@NotNull net.minecraft.server.packs.resources.ResourceManager resourceManager, @NotNull net.minecraft.util.profiling.ProfilerFiller profilerFiller)
     

    Methods inherited from class net.minecraft.server.packs.resources.SimplePreparableReloadListener

    apply, reload

    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
  • Field Details

    • codec

      protected final com.mojang.serialization.Codec<T> codec
    • converter

      protected final net.minecraft.resources.FileToIdConverter converter
  • Constructor Details

    • CodecReloadListener

      public CodecReloadListener(com.mojang.serialization.Codec<T> codec, net.minecraft.resources.FileToIdConverter converter)
      Creates a new codec reload listener.
      Parameters:
      codec - The codec to use when deserializing files
      converter - The converter to use for listing files
  • Method Details

    • prepare

      @NotNull protected @NotNull Map<net.minecraft.resources.ResourceLocation,T> prepare(@NotNull @NotNull net.minecraft.server.packs.resources.ResourceManager resourceManager, @NotNull @NotNull net.minecraft.util.profiling.ProfilerFiller profilerFiller)
      Specified by:
      prepare in class net.minecraft.server.packs.resources.SimplePreparableReloadListener<Map<net.minecraft.resources.ResourceLocation,T>>