Class JsonCodecReloadListener<T>

java.lang.Object
net.neoforged.neoforge.resource.ContextAwareReloadListener
net.minecraft.server.packs.resources.SimplePreparableReloadListener<Map<net.minecraft.resources.Identifier, com.google.gson.JsonElement>>
dev.latvian.mods.klib.util.JsonReloadListener
dev.latvian.mods.klib.util.JsonCodecReloadListener<T>
All Implemented Interfaces:
net.minecraft.server.packs.resources.PreparableReloadListener
Direct Known Subclasses:
JsonCodecReloadListener.Dummy, JsonRegistryReloadListener

public abstract class JsonCodecReloadListener<T> extends JsonReloadListener
  • 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, net.minecraft.server.packs.resources.PreparableReloadListener.SharedState, net.minecraft.server.packs.resources.PreparableReloadListener.StateKey<T>
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    final com.mojang.serialization.Codec<T>
     
    final com.google.gson.JsonObject
     
     

    Fields inherited from class JsonReloadListener

    rootPath, rootPathOffset
  • Constructor Summary

    Constructors
    Constructor
    Description
    JsonCodecReloadListener(String rootPath, com.mojang.serialization.Codec<T> codec)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected void
    apply(Map<net.minecraft.resources.Identifier, com.google.gson.JsonElement> from, net.minecraft.server.packs.resources.ResourceManager resourceManager, net.minecraft.util.profiling.ProfilerFiller profiler)
     
    protected abstract void
    apply(net.minecraft.server.packs.resources.ResourceManager resourceManager, Map<net.minecraft.resources.Identifier, T> map)
     
    protected T
     
    net.neoforged.neoforge.common.conditions.ConditionalOps<com.google.gson.JsonElement>
    wrapOps(net.minecraft.resources.Identifier id, net.neoforged.neoforge.common.conditions.ConditionalOps<com.google.gson.JsonElement> ops, com.google.gson.JsonElement json)
     

    Methods inherited from class JsonReloadListener

    onlyRoot, prepare

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

    reload

    Methods inherited from class net.neoforged.neoforge.resource.ContextAwareReloadListener

    getContext, getRegistryLookup, injectContext, makeConditionalOps, makeConditionalOps

    Methods inherited from class Object

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

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

    getName, prepareSharedState
  • Field Details

    • codec

      public final com.mojang.serialization.Codec<T> codec
    • includeId

      public String includeId
    • defaultProperties

      public final com.google.gson.JsonObject defaultProperties
  • Constructor Details

    • JsonCodecReloadListener

      public JsonCodecReloadListener(String rootPath, com.mojang.serialization.Codec<T> codec)
  • Method Details

    • finalize

      @Nullable protected T finalize(T t)
    • wrapOps

      public net.neoforged.neoforge.common.conditions.ConditionalOps<com.google.gson.JsonElement> wrapOps(net.minecraft.resources.Identifier id, net.neoforged.neoforge.common.conditions.ConditionalOps<com.google.gson.JsonElement> ops, com.google.gson.JsonElement json)
    • apply

      protected void apply(Map<net.minecraft.resources.Identifier, com.google.gson.JsonElement> from, net.minecraft.server.packs.resources.ResourceManager resourceManager, net.minecraft.util.profiling.ProfilerFiller profiler)
      Specified by:
      apply in class net.minecraft.server.packs.resources.SimplePreparableReloadListener<Map<net.minecraft.resources.Identifier, com.google.gson.JsonElement>>
    • apply

      protected abstract void apply(net.minecraft.server.packs.resources.ResourceManager resourceManager, Map<net.minecraft.resources.Identifier, T> map)