Class ExecuteCommand
java.lang.Object
net.minecraft.server.commands.ExecuteCommand
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static interfaceprivate static interfaceprivate static classprivate static interface -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final com.mojang.brigadier.exceptions.Dynamic2CommandExceptionTypeprivate static final com.mojang.brigadier.exceptions.SimpleCommandExceptionTypeprivate static final com.mojang.brigadier.exceptions.DynamicCommandExceptionTypestatic final com.mojang.brigadier.exceptions.Dynamic2CommandExceptionTypeprivate static final org.slf4j.Loggerprivate static final int -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static com.mojang.brigadier.builder.ArgumentBuilder<CommandSourceStack, ?> addConditional(com.mojang.brigadier.tree.CommandNode<CommandSourceStack> root, com.mojang.brigadier.builder.ArgumentBuilder<CommandSourceStack, ?> argument, boolean expected, ExecuteCommand.CommandPredicate predicate) private static com.mojang.brigadier.builder.ArgumentBuilder<CommandSourceStack, ?> addConditionals(com.mojang.brigadier.tree.CommandNode<CommandSourceStack> execute, com.mojang.brigadier.builder.LiteralArgumentBuilder<CommandSourceStack> parent, boolean expected, CommandBuildContext context) private static com.mojang.brigadier.builder.ArgumentBuilder<CommandSourceStack, ?> addIfBlocksConditional(com.mojang.brigadier.tree.CommandNode<CommandSourceStack> root, com.mojang.brigadier.builder.ArgumentBuilder<CommandSourceStack, ?> argument, boolean expected, boolean skipAir) private static booleancheckCustomPredicate(CommandSourceStack source, Holder<LootItemCondition> predicate) private static intcheckIfRegions(com.mojang.brigadier.context.CommandContext<CommandSourceStack> context, boolean skipAir) private static intcheckMatchingData(DataAccessor accessor, NbtPathArgument.NbtPath path) private static OptionalIntcheckRegions(com.mojang.brigadier.context.CommandContext<CommandSourceStack> context, boolean skipAir) private static OptionalIntcheckRegions(ServerLevel level, BlockPos startPos, BlockPos endPos, BlockPos destPos, boolean skipAir) private static booleancheckScore(com.mojang.brigadier.context.CommandContext<CommandSourceStack> context, MinMaxBounds.Ints range) private static booleancheckScore(com.mojang.brigadier.context.CommandContext<CommandSourceStack> context, ExecuteCommand.IntBiPredicate operation) private static booleancheckStopwatch(com.mojang.brigadier.context.CommandContext<CommandSourceStack> context, MinMaxBounds.Doubles range) private static intcheckUnlessRegions(com.mojang.brigadier.context.CommandContext<CommandSourceStack> context, boolean skipAir) private static intcountItems(Iterable<? extends SlotProvider> sources, SlotRange slotRange, Predicate<ItemStack> predicate) private static intcountItems(CommandSourceStack source, BlockPos pos, SlotRange slotRange, Predicate<ItemStack> predicate) private static com.mojang.brigadier.Command<CommandSourceStack> createNumericConditionalHandler(boolean expected, ExecuteCommand.CommandNumericPredicate condition) private static com.mojang.brigadier.builder.LiteralArgumentBuilder<CommandSourceStack> createRelationOperations(com.mojang.brigadier.tree.CommandNode<CommandSourceStack> execute, com.mojang.brigadier.builder.LiteralArgumentBuilder<CommandSourceStack> on) private static com.mojang.brigadier.RedirectModifier<CommandSourceStack> expandOneToManyEntityRelation(Function<Entity, Stream<Entity>> unpacker) private static com.mojang.brigadier.RedirectModifier<CommandSourceStack> expandOneToOneEntityRelation(Function<Entity, Optional<Entity>> unpacker) private static Collection<CommandSourceStack> expect(com.mojang.brigadier.context.CommandContext<CommandSourceStack> context, boolean expected, boolean result) If actual and expected match, returns a collection containing only the source player.private static booleanisChunkLoaded(ServerLevel level, BlockPos pos) static voidregister(com.mojang.brigadier.CommandDispatcher<CommandSourceStack> dispatcher, CommandBuildContext context) static <T extends ExecutionCommandSource<T>>
voidscheduleFunctionConditionsAndTest(T originalSource, List<T> currentSources, Function<T, T> functionContextModifier, IntPredicate check, com.mojang.brigadier.context.ContextChain<T> currentStep, @Nullable CompoundTag parameters, ExecutionControl<T> output, InCommandFunction<com.mojang.brigadier.context.CommandContext<T>, Collection<CommandFunction<T>>> functionGetter, ChainModifiers modifiers) private static CommandSourceStackspawnEntityAndRedirect(CommandSourceStack source, Holder.Reference<EntityType<?>> type) private static CommandSourceStackstoreData(CommandSourceStack source, DataAccessor accessor, NbtPathArgument.NbtPath path, IntFunction<Tag> constructor, boolean storeResult) private static CommandSourceStackstoreValue(CommandSourceStack source, Collection<ScoreHolder> names, Objective objective, boolean storeResult) private static CommandSourceStackstoreValue(CommandSourceStack source, CustomBossEvent event, boolean storeIntoValue, boolean storeResult) private static com.mojang.brigadier.builder.ArgumentBuilder<CommandSourceStack, ?> wrapStores(com.mojang.brigadier.tree.LiteralCommandNode<CommandSourceStack> execute, com.mojang.brigadier.builder.LiteralArgumentBuilder<CommandSourceStack> literal, boolean storeResult)
-
Field Details
-
LOGGER
private static final org.slf4j.Logger LOGGER -
MAX_TEST_AREA
private static final int MAX_TEST_AREA- See Also:
-
ERROR_AREA_TOO_LARGE
private static final com.mojang.brigadier.exceptions.Dynamic2CommandExceptionType ERROR_AREA_TOO_LARGE -
ERROR_CONDITIONAL_FAILED
private static final com.mojang.brigadier.exceptions.SimpleCommandExceptionType ERROR_CONDITIONAL_FAILED -
ERROR_CONDITIONAL_FAILED_COUNT
private static final com.mojang.brigadier.exceptions.DynamicCommandExceptionType ERROR_CONDITIONAL_FAILED_COUNT -
ERROR_FUNCTION_CONDITION_INSTANTATION_FAILURE
public static final com.mojang.brigadier.exceptions.Dynamic2CommandExceptionType ERROR_FUNCTION_CONDITION_INSTANTATION_FAILURE
-
-
Constructor Details
-
ExecuteCommand
public ExecuteCommand()
-
-
Method Details
-
register
public static void register(com.mojang.brigadier.CommandDispatcher<CommandSourceStack> dispatcher, CommandBuildContext context) -
wrapStores
private static com.mojang.brigadier.builder.ArgumentBuilder<CommandSourceStack, ?> wrapStores(com.mojang.brigadier.tree.LiteralCommandNode<CommandSourceStack> execute, com.mojang.brigadier.builder.LiteralArgumentBuilder<CommandSourceStack> literal, boolean storeResult) -
storeValue
private static CommandSourceStack storeValue(CommandSourceStack source, Collection<ScoreHolder> names, Objective objective, boolean storeResult) -
storeValue
private static CommandSourceStack storeValue(CommandSourceStack source, CustomBossEvent event, boolean storeIntoValue, boolean storeResult) -
storeData
private static CommandSourceStack storeData(CommandSourceStack source, DataAccessor accessor, NbtPathArgument.NbtPath path, IntFunction<Tag> constructor, boolean storeResult) -
isChunkLoaded
-
addConditionals
private static com.mojang.brigadier.builder.ArgumentBuilder<CommandSourceStack, ?> addConditionals(com.mojang.brigadier.tree.CommandNode<CommandSourceStack> execute, com.mojang.brigadier.builder.LiteralArgumentBuilder<CommandSourceStack> parent, boolean expected, CommandBuildContext context) -
countItems
private static int countItems(Iterable<? extends SlotProvider> sources, SlotRange slotRange, Predicate<ItemStack> predicate) -
countItems
private static int countItems(CommandSourceStack source, BlockPos pos, SlotRange slotRange, Predicate<ItemStack> predicate) throws com.mojang.brigadier.exceptions.CommandSyntaxException - Throws:
com.mojang.brigadier.exceptions.CommandSyntaxException
-
createNumericConditionalHandler
private static com.mojang.brigadier.Command<CommandSourceStack> createNumericConditionalHandler(boolean expected, ExecuteCommand.CommandNumericPredicate condition) -
checkMatchingData
private static int checkMatchingData(DataAccessor accessor, NbtPathArgument.NbtPath path) throws com.mojang.brigadier.exceptions.CommandSyntaxException - Throws:
com.mojang.brigadier.exceptions.CommandSyntaxException
-
checkScore
private static boolean checkScore(com.mojang.brigadier.context.CommandContext<CommandSourceStack> context, ExecuteCommand.IntBiPredicate operation) throws com.mojang.brigadier.exceptions.CommandSyntaxException - Throws:
com.mojang.brigadier.exceptions.CommandSyntaxException
-
checkScore
private static boolean checkScore(com.mojang.brigadier.context.CommandContext<CommandSourceStack> context, MinMaxBounds.Ints range) throws com.mojang.brigadier.exceptions.CommandSyntaxException - Throws:
com.mojang.brigadier.exceptions.CommandSyntaxException
-
checkStopwatch
private static boolean checkStopwatch(com.mojang.brigadier.context.CommandContext<CommandSourceStack> context, MinMaxBounds.Doubles range) throws com.mojang.brigadier.exceptions.CommandSyntaxException - Throws:
com.mojang.brigadier.exceptions.CommandSyntaxException
-
checkCustomPredicate
private static boolean checkCustomPredicate(CommandSourceStack source, Holder<LootItemCondition> predicate) -
expect
private static Collection<CommandSourceStack> expect(com.mojang.brigadier.context.CommandContext<CommandSourceStack> context, boolean expected, boolean result) If actual and expected match, returns a collection containing only the source player. -
addConditional
private static com.mojang.brigadier.builder.ArgumentBuilder<CommandSourceStack, ?> addConditional(com.mojang.brigadier.tree.CommandNode<CommandSourceStack> root, com.mojang.brigadier.builder.ArgumentBuilder<CommandSourceStack, ?> argument, boolean expected, ExecuteCommand.CommandPredicate predicate) -
addIfBlocksConditional
private static com.mojang.brigadier.builder.ArgumentBuilder<CommandSourceStack, ?> addIfBlocksConditional(com.mojang.brigadier.tree.CommandNode<CommandSourceStack> root, com.mojang.brigadier.builder.ArgumentBuilder<CommandSourceStack, ?> argument, boolean expected, boolean skipAir) -
checkIfRegions
private static int checkIfRegions(com.mojang.brigadier.context.CommandContext<CommandSourceStack> context, boolean skipAir) throws com.mojang.brigadier.exceptions.CommandSyntaxException - Throws:
com.mojang.brigadier.exceptions.CommandSyntaxException
-
checkUnlessRegions
private static int checkUnlessRegions(com.mojang.brigadier.context.CommandContext<CommandSourceStack> context, boolean skipAir) throws com.mojang.brigadier.exceptions.CommandSyntaxException - Throws:
com.mojang.brigadier.exceptions.CommandSyntaxException
-
checkRegions
private static OptionalInt checkRegions(com.mojang.brigadier.context.CommandContext<CommandSourceStack> context, boolean skipAir) throws com.mojang.brigadier.exceptions.CommandSyntaxException - Throws:
com.mojang.brigadier.exceptions.CommandSyntaxException
-
checkRegions
private static OptionalInt checkRegions(ServerLevel level, BlockPos startPos, BlockPos endPos, BlockPos destPos, boolean skipAir) throws com.mojang.brigadier.exceptions.CommandSyntaxException - Throws:
com.mojang.brigadier.exceptions.CommandSyntaxException
-
expandOneToOneEntityRelation
private static com.mojang.brigadier.RedirectModifier<CommandSourceStack> expandOneToOneEntityRelation(Function<Entity, Optional<Entity>> unpacker) -
expandOneToManyEntityRelation
private static com.mojang.brigadier.RedirectModifier<CommandSourceStack> expandOneToManyEntityRelation(Function<Entity, Stream<Entity>> unpacker) -
createRelationOperations
private static com.mojang.brigadier.builder.LiteralArgumentBuilder<CommandSourceStack> createRelationOperations(com.mojang.brigadier.tree.CommandNode<CommandSourceStack> execute, com.mojang.brigadier.builder.LiteralArgumentBuilder<CommandSourceStack> on) -
spawnEntityAndRedirect
private static CommandSourceStack spawnEntityAndRedirect(CommandSourceStack source, Holder.Reference<EntityType<?>> type) throws com.mojang.brigadier.exceptions.CommandSyntaxException - Throws:
com.mojang.brigadier.exceptions.CommandSyntaxException
-
scheduleFunctionConditionsAndTest
public static <T extends ExecutionCommandSource<T>> void scheduleFunctionConditionsAndTest(T originalSource, List<T> currentSources, Function<T, T> functionContextModifier, IntPredicate check, com.mojang.brigadier.context.ContextChain<T> currentStep, @Nullable CompoundTag parameters, ExecutionControl<T> output, InCommandFunction<com.mojang.brigadier.context.CommandContext<T>, Collection<CommandFunction<T>>> functionGetter, ChainModifiers modifiers)
-