Class QuestJsonListener
java.lang.Object
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 ClassesNested classes/interfaces inherited from interface net.minecraft.server.packs.resources.PreparableReloadListener
net.minecraft.server.packs.resources.PreparableReloadListener.PreparationBarrier -
Constructor Summary
ConstructorsConstructorDescriptionSet up the core loading, with the directory in the datapack that contains this data Directory is:/colony/quests/ -
Method Summary
Modifier and TypeMethodDescriptionprotected voidapply(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) static IQuestTemplateloadDataFromJson(net.minecraft.resources.ResourceLocation questId, com.google.gson.JsonObject jsonObject) static voidreadGlobalQuestPackets(net.minecraft.network.FriendlyByteBuf byteBuf) Read the data from the packet and parse it.static voidsendGlobalQuestPackets(net.minecraft.server.level.ServerPlayer player) Sync to client.Methods inherited from class net.minecraft.server.packs.resources.SimpleJsonResourceReloadListener
getPreparedPath, prepare, scanDirectoryMethods inherited from class net.minecraft.server.packs.resources.SimplePreparableReloadListener
reloadMethods 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
-
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.FriendlyByteBuf 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:
applyin classnet.minecraft.server.packs.resources.SimplePreparableReloadListener<Map<net.minecraft.resources.ResourceLocation,com.google.gson.JsonElement>>
-
loadDataFromJson
public static IQuestTemplate loadDataFromJson(net.minecraft.resources.ResourceLocation questId, com.google.gson.JsonObject jsonObject) throws Exception - Throws:
Exception
-