Class TestCommand
java.lang.Object
net.minecraft.gametest.framework.TestCommand
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static final recordstatic final record -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final SimpleCommandExceptionTypeprivate static final intprivate static final intprivate static final intprivate static final intprivate static final intprivate static final SimpleCommandExceptionTypeprivate static final Dynamic3CommandExceptionTypeprivate static final SimpleCommandExceptionTypeprivate static final SimpleCommandExceptionTypestatic final intprivate static final SimpleCommandExceptionTypestatic final intprivate static final intprivate static final DynamicCommandExceptionTypestatic final intstatic final int -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static intclear(TestFinder finder) private static Optional<GameTestInfo> createGameTestInfo(BlockPos testBlockPos, CommandSourceStack source, RetryOptions retryOptions) private static intcreateNewStructure(CommandSourceStack source, Identifier id, int xSize, int ySize, int zSize) private static BlockPosprivate static intexport(TestFinder finder) private static intexportTestStructure(CommandSourceStack source, Holder<GameTestInstance> test) private static intlocate(TestFinder finder) static voidregister(CommandDispatcher<CommandSourceStack> dispatcher, CommandBuildContext context) private static intreset(TestFinder finder) private static intresetGameTestInfo(CommandSourceStack source, GameTestInfo testInfo) private static intrun(TestFinder finder, RetryOptions retryOptions, int extraRotationSteps, int testsPerRow) private static ArgumentBuilder<CommandSourceStack, ?> runWithRetryOptions(ArgumentBuilder<CommandSourceStack, ?> runArgument, InCommandFunction<CommandContext<CommandSourceStack>, TestFinder> finder) private static ArgumentBuilder<CommandSourceStack, ?> runWithRetryOptions(ArgumentBuilder<CommandSourceStack, ?> runArgument, InCommandFunction<CommandContext<CommandSourceStack>, TestFinder> finder, Function<ArgumentBuilder<CommandSourceStack, ?>, ArgumentBuilder<CommandSourceStack, ?>> then) private static ArgumentBuilder<CommandSourceStack, ?> runWithRetryOptionsAndBuildInfo(ArgumentBuilder<CommandSourceStack, ?> runArgument, InCommandFunction<CommandContext<CommandSourceStack>, TestFinder> finder) private static intshowPos(CommandSourceStack source, String varName) private static intstatic CompletableFuture<Suggestions> suggestTestFunction(CommandContext<CommandSourceStack> context, SuggestionsBuilder builder) private static Stream<GameTestInfo> toGameTestInfo(CommandSourceStack source, RetryOptions retryOptions, TestInstanceFinder finder, int rotationSteps) private static Stream<GameTestInfo> toGameTestInfos(CommandSourceStack source, RetryOptions retryOptions, TestPosFinder finder) static inttrackAndStartRunner(CommandSourceStack source, GameTestRunner runner) private static intverify(TestFinder finder) private static booleanverifyStructureExists(CommandSourceStack source, Identifier structure)
-
Field Details
-
TEST_NEARBY_SEARCH_RADIUS
public static final int TEST_NEARBY_SEARCH_RADIUS- See Also:
-
TEST_FULL_SEARCH_RADIUS
public static final int TEST_FULL_SEARCH_RADIUS- See Also:
-
VERIFY_TEST_GRID_AXIS_SIZE
public static final int VERIFY_TEST_GRID_AXIS_SIZE- See Also:
-
VERIFY_TEST_BATCH_SIZE
public static final int VERIFY_TEST_BATCH_SIZE- See Also:
-
DEFAULT_CLEAR_RADIUS
private static final int DEFAULT_CLEAR_RADIUS- See Also:
-
MAX_CLEAR_RADIUS
private static final int MAX_CLEAR_RADIUS- See Also:
-
TEST_POS_Z_OFFSET_FROM_PLAYER
private static final int TEST_POS_Z_OFFSET_FROM_PLAYER- See Also:
-
DEFAULT_X_SIZE
private static final int DEFAULT_X_SIZE- See Also:
-
DEFAULT_Y_SIZE
private static final int DEFAULT_Y_SIZE- See Also:
-
DEFAULT_Z_SIZE
private static final int DEFAULT_Z_SIZE- See Also:
-
CLEAR_NO_TESTS
-
RESET_NO_TESTS
-
TEST_INSTANCE_COULD_NOT_BE_FOUND
-
NO_STRUCTURES_TO_EXPORT
-
NO_TEST_INSTANCES
-
NO_TEST_CONTAINING
-
TOO_LARGE
-
-
Constructor Details
-
TestCommand
public TestCommand()
-
-
Method Details
-
reset
- Throws:
CommandSyntaxException
-
clear
- Throws:
CommandSyntaxException
-
export
- Throws:
CommandSyntaxException
-
verify
-
run
private static int run(TestFinder finder, RetryOptions retryOptions, int extraRotationSteps, int testsPerRow) -
locate
- Throws:
CommandSyntaxException
-
runWithRetryOptions
private static ArgumentBuilder<CommandSourceStack, ?> runWithRetryOptions(ArgumentBuilder<CommandSourceStack, ?> runArgument, InCommandFunction<CommandContext<CommandSourceStack>, TestFinder> finder, Function<ArgumentBuilder<CommandSourceStack, ?>, ArgumentBuilder<CommandSourceStack, ?>> then) -
runWithRetryOptions
private static ArgumentBuilder<CommandSourceStack, ?> runWithRetryOptions(ArgumentBuilder<CommandSourceStack, ?> runArgument, InCommandFunction<CommandContext<CommandSourceStack>, TestFinder> finder) -
runWithRetryOptionsAndBuildInfo
private static ArgumentBuilder<CommandSourceStack, ?> runWithRetryOptionsAndBuildInfo(ArgumentBuilder<CommandSourceStack, ?> runArgument, InCommandFunction<CommandContext<CommandSourceStack>, TestFinder> finder) -
register
public static void register(CommandDispatcher<CommandSourceStack> dispatcher, CommandBuildContext context) -
suggestTestFunction
public static CompletableFuture<Suggestions> suggestTestFunction(CommandContext<CommandSourceStack> context, SuggestionsBuilder builder) -
resetGameTestInfo
-
toGameTestInfos
private static Stream<GameTestInfo> toGameTestInfos(CommandSourceStack source, RetryOptions retryOptions, TestPosFinder finder) -
toGameTestInfo
private static Stream<GameTestInfo> toGameTestInfo(CommandSourceStack source, RetryOptions retryOptions, TestInstanceFinder finder, int rotationSteps) -
createGameTestInfo
private static Optional<GameTestInfo> createGameTestInfo(BlockPos testBlockPos, CommandSourceStack source, RetryOptions retryOptions) -
createNewStructure
private static int createNewStructure(CommandSourceStack source, Identifier id, int xSize, int ySize, int zSize) throws CommandSyntaxException - Throws:
CommandSyntaxException
-
showPos
- Throws:
CommandSyntaxException
-
stopTests
private static int stopTests() -
trackAndStartRunner
-
exportTestStructure
-
verifyStructureExists
-
createTestPositionAround
-