Class FoliosSourceData
java.lang.Object
net.minecraft.server.packs.resources.SimplePreparableReloadListener<Map<net.minecraft.resources.Identifier, com.google.gson.JsonElement>>
net.minecraft.server.packs.resources.SimpleJsonResourceReloadListener<com.google.gson.JsonElement>
net.ixdarklord.folios.internal.FoliosSourceData
- All Implemented Interfaces:
net.minecraft.server.packs.resources.PreparableReloadListener
public final class FoliosSourceData
extends net.minecraft.server.packs.resources.SimpleJsonResourceReloadListener<com.google.gson.JsonElement>
The rows of
FoliosSources: on the server, those data packs add (data/<namespace>/folios/sources/*.json)
and the sending of every server source to players; on the client, what the server sent.-
Nested Class Summary
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 -
Method Summary
Modifier and TypeMethodDescriptionprotected voidapply(Map<net.minecraft.resources.Identifier, com.google.gson.JsonElement> files, net.minecraft.server.packs.resources.ResourceManager manager, net.minecraft.util.profiling.ProfilerFiller profiler) static voidforget()Forgets what a server sent, as the client leaves it.static booleanhasReceived(net.minecraft.resources.Identifier source) packRemoved(net.minecraft.resources.Identifier source) The ids data packs took out of a source.static List<FoliosSources.Row> packRows(net.minecraft.resources.Identifier source) The rows data packs give a source.static List<net.minecraft.resources.Identifier> static voidreceive(FoliosPayloads.Source payload) A source the server sent: kept, and books written again if its rows changed.static List<FoliosSources.Row> received(net.minecraft.resources.Identifier source) removed(net.minecraft.resources.Identifier source) The ids the server's data packs took out of a source, to take out of the client's rows too.static voidsend(net.minecraft.server.MinecraftServer server, net.minecraft.resources.Identifier source) Sends a server source to every player.static voidsendAll(net.minecraft.server.level.ServerPlayer player) Sends every server source to a player, as they join.static voidtick(net.minecraft.server.MinecraftServer server) At the end of a tick: after data packs reloaded, every source is sent again.Methods inherited from class net.minecraft.server.packs.resources.SimpleJsonResourceReloadListener
prepare, scanDirectory, scanDirectoryMethods inherited from class net.minecraft.server.packs.resources.SimplePreparableReloadListener
reloadMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.minecraft.server.packs.resources.PreparableReloadListener
getName, prepareSharedState
-
Field Details
-
INSTANCE
-
-
Method Details
-
apply
protected void apply(Map<net.minecraft.resources.Identifier, com.google.gson.JsonElement> files, net.minecraft.server.packs.resources.ResourceManager manager, net.minecraft.util.profiling.ProfilerFiller profiler) - Specified by:
applyin classnet.minecraft.server.packs.resources.SimplePreparableReloadListener<Map<net.minecraft.resources.Identifier, com.google.gson.JsonElement>>
-
packRows
The rows data packs give a source. -
packRemoved
-
packSources
-
sendAll
public static void sendAll(net.minecraft.server.level.ServerPlayer player) Sends every server source to a player, as they join. -
send
public static void send(net.minecraft.server.MinecraftServer server, net.minecraft.resources.Identifier source) Sends a server source to every player. -
tick
public static void tick(net.minecraft.server.MinecraftServer server) At the end of a tick: after data packs reloaded, every source is sent again. -
receive
A source the server sent: kept, and books written again if its rows changed. -
received
-
removed
-
hasReceived
public static boolean hasReceived(net.minecraft.resources.Identifier source) -
forget
public static void forget()Forgets what a server sent, as the client leaves it.
-