Package net.minecraft.commands.functions
Class MacroFunction<T extends ExecutionCommandSource<T>>
java.lang.Object
net.minecraft.commands.functions.MacroFunction<T>
- All Implemented Interfaces:
CommandFunction<T>
public class MacroFunction<T extends ExecutionCommandSource<T>>
extends Object
implements CommandFunction<T>
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescription(package private) static interface
(package private) static class
MacroFunction.MacroEntry<T extends ExecutionCommandSource<T>>
(package private) static class
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final it.unimi.dsi.fastutil.objects.Object2ObjectLinkedOpenHashMap
<List<String>, InstantiatedFunction<T>> private static final DecimalFormat
private final List
<MacroFunction.Entry<T>> private final ResourceLocation
private static final int
-
Constructor Summary
ConstructorsConstructorDescriptionMacroFunction
(ResourceLocation id, List<MacroFunction.Entry<T>> entries, List<String> parameters) -
Method Summary
Modifier and TypeMethodDescriptionid()
instantiate
(CompoundTag arguments, com.mojang.brigadier.CommandDispatcher<T> dispatcher) private static void
lookupValues
(List<String> arguments, it.unimi.dsi.fastutil.ints.IntList parameters, List<String> output) private static String
private InstantiatedFunction
<T> substituteAndParse
(List<String> argumentNames, List<String> argumentValues, com.mojang.brigadier.CommandDispatcher<T> dispatcher)
-
Field Details
-
DECIMAL_FORMAT
-
MAX_CACHE_ENTRIES
private static final int MAX_CACHE_ENTRIES- See Also:
-
parameters
-
cache
private final it.unimi.dsi.fastutil.objects.Object2ObjectLinkedOpenHashMap<List<String>,InstantiatedFunction<T extends ExecutionCommandSource<T>>> cache -
id
-
entries
-
-
Constructor Details
-
MacroFunction
public MacroFunction(ResourceLocation id, List<MacroFunction.Entry<T>> entries, List<String> parameters)
-
-
Method Details
-
id
- Specified by:
id
in interfaceCommandFunction<T extends ExecutionCommandSource<T>>
-
instantiate
public InstantiatedFunction<T> instantiate(@Nullable CompoundTag arguments, com.mojang.brigadier.CommandDispatcher<T> dispatcher) throws FunctionInstantiationException - Specified by:
instantiate
in interfaceCommandFunction<T extends ExecutionCommandSource<T>>
- Throws:
FunctionInstantiationException
-
stringify
-
lookupValues
-
substituteAndParse
private InstantiatedFunction<T> substituteAndParse(List<String> argumentNames, List<String> argumentValues, com.mojang.brigadier.CommandDispatcher<T> dispatcher) throws FunctionInstantiationException - Throws:
FunctionInstantiationException
-