Class QuestJsonListener

java.lang.Object
net.neoforged.neoforge.resource.ContextAwareReloadListener
net.minecraft.server.packs.resources.SimplePreparableReloadListener<Map<net.minecraft.resources.ResourceLocation,com.google.gson.JsonElement>>
net.minecraft.server.packs.resources.SimpleJsonResourceReloadListener
com.minecolonies.core.datalistener.QuestJsonListener
All Implemented Interfaces:
net.minecraft.server.packs.resources.PreparableReloadListener

public class QuestJsonListener extends net.minecraft.server.packs.resources.SimpleJsonResourceReloadListener
Loader for Json based quest data.
  • 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
    Set up the core loading, with the directory in the datapack that contains this data Directory is: /colony/quests/
  • Method Summary

    Modifier and Type
    Method
    Description
    protected void
    apply(Map<net.minecraft.resources.ResourceLocation,com.google.gson.JsonElement> jsonElementMap, @NotNull net.minecraft.server.packs.resources.ResourceManager resourceManager, @NotNull net.minecraft.util.profiling.ProfilerFiller profiler)
     
    loadDataFromJson(net.minecraft.core.HolderLookup.Provider provider, net.minecraft.resources.ResourceLocation questId, com.google.gson.JsonObject jsonObject)
     
    static void
    readGlobalQuestPackets(net.minecraft.network.RegistryFriendlyByteBuf byteBuf)
    Read the data from the packet and parse it.
    static void
    sendGlobalQuestPackets(net.minecraft.server.level.ServerPlayer player)
    Sync to client.

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

    getPreparedPath, prepare, scanDirectory

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

    reload

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

    getContext, getRegistryLookup, injectContext, makeConditionalOps

    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

    • QuestJsonListener

      public QuestJsonListener()
      Set up the core loading, with the directory in the datapack that contains this data Directory is: /colony/quests/
  • Method Details

    • sendGlobalQuestPackets

      public static void sendGlobalQuestPackets(net.minecraft.server.level.ServerPlayer player)
      Sync to client.
      Parameters:
      player - to send it to.
    • readGlobalQuestPackets

      public static void readGlobalQuestPackets(net.minecraft.network.RegistryFriendlyByteBuf byteBuf)
      Read the data from the packet and parse it.
      Parameters:
      byteBuf - pck.
    • apply

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

      public static IQuestTemplate loadDataFromJson(@NotNull net.minecraft.core.HolderLookup.Provider provider, net.minecraft.resources.ResourceLocation questId, com.google.gson.JsonObject jsonObject) throws Exception
      Throws:
      Exception