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 Dynamic2CommandExceptionTypeprivate static final SimpleCommandExceptionTypeprivate static final DynamicCommandExceptionTypestatic final Dynamic2CommandExceptionTypeprivate static final org.slf4j.Loggerprivate static final int -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static ArgumentBuilder<CommandSourceStack, ?> addConditional(CommandNode<CommandSourceStack> root, ArgumentBuilder<CommandSourceStack, ?> argument, boolean expected, ExecuteCommand.CommandPredicate predicate) private static ArgumentBuilder<CommandSourceStack, ?> addConditionals(CommandNode<CommandSourceStack> execute, LiteralArgumentBuilder<CommandSourceStack> parent, boolean expected, CommandBuildContext context) private static ArgumentBuilder<CommandSourceStack, ?> addIfBlocksConditional(CommandNode<CommandSourceStack> root, ArgumentBuilder<CommandSourceStack, ?> argument, boolean expected, boolean skipAir) private static booleancheckCustomPredicate(CommandSourceStack source, Holder<LootItemCondition> predicate) private static intcheckIfRegions(CommandContext<CommandSourceStack> context, boolean skipAir) private static intcheckMatchingData(DataAccessor accessor, NbtPathArgument.NbtPath path) private static OptionalIntcheckRegions(CommandContext<CommandSourceStack> context, boolean skipAir) private static OptionalIntcheckRegions(ServerLevel level, BlockPos startPos, BlockPos endPos, BlockPos destPos, boolean skipAir) private static booleancheckScore(CommandContext<CommandSourceStack> context, MinMaxBounds.Ints range) private static booleancheckScore(CommandContext<CommandSourceStack> context, ExecuteCommand.IntBiPredicate operation) private static booleancheckStopwatch(CommandContext<CommandSourceStack> context, MinMaxBounds.Doubles range) private static intcheckUnlessRegions(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 Command<CommandSourceStack> createNumericConditionalHandler(boolean expected, ExecuteCommand.CommandNumericPredicate condition) private static LiteralArgumentBuilder<CommandSourceStack> createRelationOperations(CommandNode<CommandSourceStack> execute, LiteralArgumentBuilder<CommandSourceStack> on) private static RedirectModifier<CommandSourceStack> expandOneToManyEntityRelation(Function<Entity, Stream<Entity>> unpacker) private static RedirectModifier<CommandSourceStack> expandOneToOneEntityRelation(Function<Entity, Optional<Entity>> unpacker) private static Collection<CommandSourceStack> expect(CommandContext<CommandSourceStack> context, boolean expected, boolean result) private static booleanisChunkLoaded(ServerLevel level, BlockPos pos) static voidregister(CommandDispatcher<CommandSourceStack> dispatcher, CommandBuildContext context) static <T extends ExecutionCommandSource<T>>
voidscheduleFunctionConditionsAndTest(T originalSource, List<T> currentSources, Function<T, T> functionContextModifier, IntPredicate check, ContextChain<T> currentStep, @Nullable CompoundTag parameters, ExecutionControl<T> output, InCommandFunction<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 ArgumentBuilder<CommandSourceStack, ?> wrapStores(LiteralCommandNode<CommandSourceStack> execute, 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
-
ERROR_CONDITIONAL_FAILED
-
ERROR_CONDITIONAL_FAILED_COUNT
-
ERROR_FUNCTION_CONDITION_INSTANTATION_FAILURE
-
-
Constructor Details
-
ExecuteCommand
public ExecuteCommand()
-
-
Method Details
-
register
public static void register(CommandDispatcher<CommandSourceStack> dispatcher, CommandBuildContext context) -
wrapStores
private static ArgumentBuilder<CommandSourceStack, ?> wrapStores(LiteralCommandNode<CommandSourceStack> execute, 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 ArgumentBuilder<CommandSourceStack, ?> addConditionals(CommandNode<CommandSourceStack> execute, 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 CommandSyntaxException - Throws:
CommandSyntaxException
-
createNumericConditionalHandler
private static Command<CommandSourceStack> createNumericConditionalHandler(boolean expected, ExecuteCommand.CommandNumericPredicate condition) -
checkMatchingData
private static int checkMatchingData(DataAccessor accessor, NbtPathArgument.NbtPath path) throws CommandSyntaxException - Throws:
CommandSyntaxException
-
checkScore
private static boolean checkScore(CommandContext<CommandSourceStack> context, ExecuteCommand.IntBiPredicate operation) throws CommandSyntaxException - Throws:
CommandSyntaxException
-
checkScore
private static boolean checkScore(CommandContext<CommandSourceStack> context, MinMaxBounds.Ints range) throws CommandSyntaxException - Throws:
CommandSyntaxException
-
checkStopwatch
private static boolean checkStopwatch(CommandContext<CommandSourceStack> context, MinMaxBounds.Doubles range) throws CommandSyntaxException - Throws:
CommandSyntaxException
-
checkCustomPredicate
private static boolean checkCustomPredicate(CommandSourceStack source, Holder<LootItemCondition> predicate) -
expect
private static Collection<CommandSourceStack> expect(CommandContext<CommandSourceStack> context, boolean expected, boolean result) -
addConditional
private static ArgumentBuilder<CommandSourceStack, ?> addConditional(CommandNode<CommandSourceStack> root, ArgumentBuilder<CommandSourceStack, ?> argument, boolean expected, ExecuteCommand.CommandPredicate predicate) -
addIfBlocksConditional
private static ArgumentBuilder<CommandSourceStack, ?> addIfBlocksConditional(CommandNode<CommandSourceStack> root, ArgumentBuilder<CommandSourceStack, ?> argument, boolean expected, boolean skipAir) -
checkIfRegions
private static int checkIfRegions(CommandContext<CommandSourceStack> context, boolean skipAir) throws CommandSyntaxException - Throws:
CommandSyntaxException
-
checkUnlessRegions
private static int checkUnlessRegions(CommandContext<CommandSourceStack> context, boolean skipAir) throws CommandSyntaxException - Throws:
CommandSyntaxException
-
checkRegions
private static OptionalInt checkRegions(CommandContext<CommandSourceStack> context, boolean skipAir) throws CommandSyntaxException - Throws:
CommandSyntaxException
-
checkRegions
private static OptionalInt checkRegions(ServerLevel level, BlockPos startPos, BlockPos endPos, BlockPos destPos, boolean skipAir) throws CommandSyntaxException - Throws:
CommandSyntaxException
-
expandOneToOneEntityRelation
private static RedirectModifier<CommandSourceStack> expandOneToOneEntityRelation(Function<Entity, Optional<Entity>> unpacker) -
expandOneToManyEntityRelation
private static RedirectModifier<CommandSourceStack> expandOneToManyEntityRelation(Function<Entity, Stream<Entity>> unpacker) -
createRelationOperations
private static LiteralArgumentBuilder<CommandSourceStack> createRelationOperations(CommandNode<CommandSourceStack> execute, LiteralArgumentBuilder<CommandSourceStack> on) -
spawnEntityAndRedirect
private static CommandSourceStack spawnEntityAndRedirect(CommandSourceStack source, Holder.Reference<EntityType<?>> type) throws CommandSyntaxException - Throws:
CommandSyntaxException
-
scheduleFunctionConditionsAndTest
public static <T extends ExecutionCommandSource<T>> void scheduleFunctionConditionsAndTest(T originalSource, List<T> currentSources, Function<T, T> functionContextModifier, IntPredicate check, ContextChain<T> currentStep, @Nullable CompoundTag parameters, ExecutionControl<T> output, InCommandFunction<CommandContext<T>, Collection<CommandFunction<T>>> functionGetter, ChainModifiers modifiers)
-