Class FunctionLoader
- All Implemented Interfaces:
- ResourceReloader
CommandFunctionManager to use. In the reloads, it loads the tags in one
 completable future and each function in a completable future for all functions.
 The functions are stored in .mcfunction files; each line is one
 Minecraft command, with blank lines and contents starting with a trailing hash
 # sign ignored.
 
The function tags are ordered, unlike other tags. Each function's order in the collection of functions from the tag is determined by the order it is listed in the JSON files; if it appears multiple times through tag nesting, only its first appearance will be considered.
- See Also:
- Mappings:
- Namespace - Name - named - net/minecraft/server/function/FunctionLoader- intermediary - net/minecraft/class_5349- official - alj
- 
Nested Class SummaryNested classes/interfaces inherited from interface net.minecraft.resource.ResourceReloaderResourceReloader.Synchronizer
- 
Field SummaryFieldsModifier and TypeFieldDescriptionprivate final com.mojang.brigadier.CommandDispatcher<ServerCommandSource> private static final ResourceFinderstatic final RegistryKey<Registry<CommandFunction<ServerCommandSource>>> private Map<Identifier, CommandFunction<ServerCommandSource>> private final intprivate static final Loggerprivate final TagGroupLoader<CommandFunction<ServerCommandSource>> private Map<Identifier, List<CommandFunction<ServerCommandSource>>> 
- 
Constructor SummaryConstructorsConstructorDescriptionFunctionLoader(int level, com.mojang.brigadier.CommandDispatcher<ServerCommandSource> commandDispatcher) 
- 
Method SummaryModifier and TypeMethodDescriptionget(Identifier id) getTags()reload(ResourceReloader.Synchronizer synchronizer, ResourceManager manager, Executor prepareExecutor, Executor applyExecutor) Performs a reload.Methods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.minecraft.resource.ResourceReloadergetName
- 
Field Details- 
LOGGER- Mappings:
- Namespace - Name - Mixin selector - named - LOGGER- Lnet/minecraft/server/function/FunctionLoader;LOGGER:Lorg/slf4j/Logger;- intermediary - field_25326- Lnet/minecraft/class_5349;field_25326:Lorg/slf4j/Logger;- official - b- Lalj;b:Lorg/slf4j/Logger;
 
- 
FUNCTION_REGISTRY_KEYpublic static final RegistryKey<Registry<CommandFunction<ServerCommandSource>>> FUNCTION_REGISTRY_KEY- Mappings:
- Namespace - Name - Mixin selector - named - FUNCTION_REGISTRY_KEY- Lnet/minecraft/server/function/FunctionLoader;FUNCTION_REGISTRY_KEY:Lnet/minecraft/registry/RegistryKey;- intermediary - field_51976- Lnet/minecraft/class_5349;field_51976:Lnet/minecraft/class_5321;- official - a- Lalj;a:Laku;
 
- 
FINDER- Mappings:
- Namespace - Name - Mixin selector - named - FINDER- Lnet/minecraft/server/function/FunctionLoader;FINDER:Lnet/minecraft/resource/ResourceFinder;- intermediary - field_39978- Lnet/minecraft/class_5349;field_39978:Lnet/minecraft/class_7654;- official - c- Lalj;c:Lako;
 
- 
functions- Mappings:
- Namespace - Name - Mixin selector - named - functions- Lnet/minecraft/server/function/FunctionLoader;functions:Ljava/util/Map;- intermediary - field_25329- Lnet/minecraft/class_5349;field_25329:Ljava/util/Map;- official - d- Lalj;d:Ljava/util/Map;
 
- 
tagLoader- Mappings:
- Namespace - Name - Mixin selector - named - tagLoader- Lnet/minecraft/server/function/FunctionLoader;tagLoader:Lnet/minecraft/registry/tag/TagGroupLoader;- intermediary - field_25330- Lnet/minecraft/class_5349;field_25330:Lnet/minecraft/class_3503;- official - e- Lalj;e:Laxg;
 
- 
tags- Mappings:
- Namespace - Name - Mixin selector - named - tags- Lnet/minecraft/server/function/FunctionLoader;tags:Ljava/util/Map;- intermediary - field_25801- Lnet/minecraft/class_5349;field_25801:Ljava/util/Map;- official - f- Lalj;f:Ljava/util/Map;
 
- 
levelprivate final int level- Mappings:
- Namespace - Name - Mixin selector - named - level- Lnet/minecraft/server/function/FunctionLoader;level:I- intermediary - field_25331- Lnet/minecraft/class_5349;field_25331:I- official - g- Lalj;g:I
 
- 
commandDispatcher- Mappings:
- Namespace - Name - Mixin selector - named - commandDispatcher- Lnet/minecraft/server/function/FunctionLoader;commandDispatcher:Lcom/mojang/brigadier/CommandDispatcher;- intermediary - field_25332- Lnet/minecraft/class_5349;field_25332:Lcom/mojang/brigadier/CommandDispatcher;- official - h- Lalj;h:Lcom/mojang/brigadier/CommandDispatcher;
 
 
- 
- 
Constructor Details- 
FunctionLoaderpublic FunctionLoader(int level, com.mojang.brigadier.CommandDispatcher<ServerCommandSource> commandDispatcher) - Mappings:
- Namespace - Name - Mixin selector - named - <init>- Lnet/minecraft/server/function/FunctionLoader;<init>(ILcom/mojang/brigadier/CommandDispatcher;)V- intermediary - <init>- Lnet/minecraft/class_5349;<init>(ILcom/mojang/brigadier/CommandDispatcher;)V- official - <init>- Lalj;<init>(ILcom/mojang/brigadier/CommandDispatcher;)V
 
 
- 
- 
Method Details- 
get- Mappings:
- Namespace - Name - Mixin selector - named - get- Lnet/minecraft/server/function/FunctionLoader;get(Lnet/minecraft/util/Identifier;)Ljava/util/Optional;- intermediary - method_29456- Lnet/minecraft/class_5349;method_29456(Lnet/minecraft/class_2960;)Ljava/util/Optional;- official - a- Lalj;a(Lakv;)Ljava/util/Optional;
 
- 
getFunctions- Mappings:
- Namespace - Name - Mixin selector - named - getFunctions- Lnet/minecraft/server/function/FunctionLoader;getFunctions()Ljava/util/Map;- intermediary - method_29447- Lnet/minecraft/class_5349;method_29447()Ljava/util/Map;- official - a- Lalj;a()Ljava/util/Map;
 
- 
getTagOrEmpty- Mappings:
- Namespace - Name - Mixin selector - named - getTagOrEmpty- Lnet/minecraft/server/function/FunctionLoader;getTagOrEmpty(Lnet/minecraft/util/Identifier;)Ljava/util/List;- intermediary - method_29459- Lnet/minecraft/class_5349;method_29459(Lnet/minecraft/class_2960;)Ljava/util/List;- official - b- Lalj;b(Lakv;)Ljava/util/List;
 
- 
getTags- Mappings:
- Namespace - Name - Mixin selector - named - getTags- Lnet/minecraft/server/function/FunctionLoader;getTags()Ljava/lang/Iterable;- intermediary - method_29458- Lnet/minecraft/class_5349;method_29458()Ljava/lang/Iterable;- official - b- Lalj;b()Ljava/lang/Iterable;
 
- 
reloadpublic CompletableFuture<Void> reload(ResourceReloader.Synchronizer synchronizer, ResourceManager manager, Executor prepareExecutor, Executor applyExecutor) Performs a reload. Returns a future that is completed when the reload is completed.In a reload, there is a prepare stage and an apply stage. For the prepare stage, you should create completable futures with CompletableFuture.supplyAsync(..., prepareExecutor) to ensure the prepare actions are done with the prepare executor. Then, you should have a completable future for all the prepared actions, and call combinedPrepare.thenCompose(synchronizer::waitFor) to notify the synchronizer. Finally, you should run CompletableFuture.thenAcceptAsync(..., applyExecutor) for apply actions. In the end, returns the result ofthenAcceptAsync.- Specified by:
- reloadin interface- ResourceReloader
- Parameters:
- synchronizer- the synchronizer
- manager- the resource manager
- Returns:
- a future for the reload
- See Also:
- Mappings:
- Namespace - Name - Mixin selector - named - reload- Lnet/minecraft/resource/ResourceReloader;reload(Lnet/minecraft/resource/ResourceReloader$Synchronizer;Lnet/minecraft/resource/ResourceManager;Ljava/util/concurrent/Executor;Ljava/util/concurrent/Executor;)Ljava/util/concurrent/CompletableFuture;- intermediary - method_25931- Lnet/minecraft/class_3302;method_25931(Lnet/minecraft/class_3302$class_4045;Lnet/minecraft/class_3300;Ljava/util/concurrent/Executor;Ljava/util/concurrent/Executor;)Ljava/util/concurrent/CompletableFuture;- official - a- Lauj;a(Lauj$a;Laup;Ljava/util/concurrent/Executor;Ljava/util/concurrent/Executor;)Ljava/util/concurrent/CompletableFuture;
 
- 
readLines- Mappings:
- Namespace - Name - Mixin selector - named - readLines- Lnet/minecraft/server/function/FunctionLoader;readLines(Lnet/minecraft/resource/Resource;)Ljava/util/List;- intermediary - method_29450- Lnet/minecraft/class_5349;method_29450(Lnet/minecraft/class_3298;)Ljava/util/List;- official - a- Lalj;a(Laun;)Ljava/util/List;
 
 
-