Class TestCommand
java.lang.Object
net.minecraft.gametest.framework.TestCommand
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static final recordprivate static final recordstatic final class -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final com.mojang.brigadier.exceptions.SimpleCommandExceptionTypeprivate static final intprivate static final intprivate static final intprivate static final intprivate static final intprivate static final com.mojang.brigadier.exceptions.SimpleCommandExceptionTypeprivate static final com.mojang.brigadier.exceptions.Dynamic3CommandExceptionTypeprivate static final com.mojang.brigadier.exceptions.SimpleCommandExceptionTypeprivate static final com.mojang.brigadier.exceptions.SimpleCommandExceptionTypestatic final intprivate static final com.mojang.brigadier.exceptions.SimpleCommandExceptionTypestatic final intprivate static final intprivate static final com.mojang.brigadier.exceptions.DynamicCommandExceptionTypestatic final intstatic final int -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static intclear(TestFinder finder) private static Optional<GameTestInfo> createGameTestInfo(GlobalPos testBlockPos, CommandSourceStack source, RetryOptions retryOptions) private static intcreateNewStructure(CommandSourceStack source, Identifier id, int xSize, int ySize, int zSize) private static BlockPoscreateTestPositionAround(CommandSourceStack source, ResourceKey<Level> dimension) private static Stringprivate static intexport(TestFinder finder) private static intexportTestStructure(CommandSourceStack source, Holder<GameTestInstance> test) private static booleanisPlayerInCurrentTestDimension(TestCommand.Info playerInfo, Set<ResourceKey<Level>> testDimensions) private static intlocate(TestFinder finder) private static voidoutputPlayerCoordinates(CommandSourceStack source, Set<ResourceKey<Level>> testDimensions) private static voidoutputTestCoordinates(CommandSourceStack source, Set<ResourceKey<Level>> testDimensions) private static TestCommand.InfoplayerAndTestInfo(CommandSourceStack source, ResourceKey<Level> dimension) static voidregister(com.mojang.brigadier.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 com.mojang.brigadier.builder.ArgumentBuilder<CommandSourceStack, ?> runWithRetryOptions(com.mojang.brigadier.builder.ArgumentBuilder<CommandSourceStack, ?> runArgument, InCommandFunction<com.mojang.brigadier.context.CommandContext<CommandSourceStack>, TestFinder> finder) private static com.mojang.brigadier.builder.ArgumentBuilder<CommandSourceStack, ?> runWithRetryOptions(com.mojang.brigadier.builder.ArgumentBuilder<CommandSourceStack, ?> runArgument, InCommandFunction<com.mojang.brigadier.context.CommandContext<CommandSourceStack>, TestFinder> finder, Function<com.mojang.brigadier.builder.ArgumentBuilder<CommandSourceStack, ?>, com.mojang.brigadier.builder.ArgumentBuilder<CommandSourceStack, ?>> then) private static com.mojang.brigadier.builder.ArgumentBuilder<CommandSourceStack, ?> runWithRetryOptionsAndBuildInfo(com.mojang.brigadier.builder.ArgumentBuilder<CommandSourceStack, ?> runArgument, InCommandFunction<com.mojang.brigadier.context.CommandContext<CommandSourceStack>, TestFinder> finder) private static intshowPos(CommandSourceStack source, String varName) private static intstatic CompletableFuture<com.mojang.brigadier.suggestion.Suggestions> suggestTestFunction(com.mojang.brigadier.context.CommandContext<CommandSourceStack> context, com.mojang.brigadier.suggestion.SuggestionsBuilder builder) private static CompletableFuture<com.mojang.brigadier.suggestion.Suggestions> suggestTestInstanceIds(com.mojang.brigadier.context.CommandContext<CommandSourceStack> context, com.mojang.brigadier.suggestion.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
private static final com.mojang.brigadier.exceptions.SimpleCommandExceptionType CLEAR_NO_TESTS -
RESET_NO_TESTS
private static final com.mojang.brigadier.exceptions.SimpleCommandExceptionType RESET_NO_TESTS -
TEST_INSTANCE_COULD_NOT_BE_FOUND
private static final com.mojang.brigadier.exceptions.SimpleCommandExceptionType TEST_INSTANCE_COULD_NOT_BE_FOUND -
NO_STRUCTURES_TO_EXPORT
private static final com.mojang.brigadier.exceptions.SimpleCommandExceptionType NO_STRUCTURES_TO_EXPORT -
NO_TEST_INSTANCES
private static final com.mojang.brigadier.exceptions.SimpleCommandExceptionType NO_TEST_INSTANCES -
NO_TEST_CONTAINING
private static final com.mojang.brigadier.exceptions.Dynamic3CommandExceptionType NO_TEST_CONTAINING -
TOO_LARGE
private static final com.mojang.brigadier.exceptions.DynamicCommandExceptionType TOO_LARGE
-
-
Constructor Details
-
TestCommand
public TestCommand()
-
-
Method Details
-
reset
private static int reset(TestFinder finder) throws com.mojang.brigadier.exceptions.CommandSyntaxException - Throws:
com.mojang.brigadier.exceptions.CommandSyntaxException
-
clear
private static int clear(TestFinder finder) throws com.mojang.brigadier.exceptions.CommandSyntaxException - Throws:
com.mojang.brigadier.exceptions.CommandSyntaxException
-
export
private static int export(TestFinder finder) throws com.mojang.brigadier.exceptions.CommandSyntaxException - Throws:
com.mojang.brigadier.exceptions.CommandSyntaxException
-
verify
-
run
private static int run(TestFinder finder, RetryOptions retryOptions, int extraRotationSteps, int testsPerRow) -
findSelectedTestPositionsAcrossDimensions
-
locate
private static int locate(TestFinder finder) throws com.mojang.brigadier.exceptions.CommandSyntaxException - Throws:
com.mojang.brigadier.exceptions.CommandSyntaxException
-
runWithRetryOptions
private static com.mojang.brigadier.builder.ArgumentBuilder<CommandSourceStack, ?> runWithRetryOptions(com.mojang.brigadier.builder.ArgumentBuilder<CommandSourceStack, ?> runArgument, InCommandFunction<com.mojang.brigadier.context.CommandContext<CommandSourceStack>, TestFinder> finder, Function<com.mojang.brigadier.builder.ArgumentBuilder<CommandSourceStack, ?>, com.mojang.brigadier.builder.ArgumentBuilder<CommandSourceStack, ?>> then) -
runWithRetryOptions
private static com.mojang.brigadier.builder.ArgumentBuilder<CommandSourceStack, ?> runWithRetryOptions(com.mojang.brigadier.builder.ArgumentBuilder<CommandSourceStack, ?> runArgument, InCommandFunction<com.mojang.brigadier.context.CommandContext<CommandSourceStack>, TestFinder> finder) -
runWithRetryOptionsAndBuildInfo
private static com.mojang.brigadier.builder.ArgumentBuilder<CommandSourceStack, ?> runWithRetryOptionsAndBuildInfo(com.mojang.brigadier.builder.ArgumentBuilder<CommandSourceStack, ?> runArgument, InCommandFunction<com.mojang.brigadier.context.CommandContext<CommandSourceStack>, TestFinder> finder) -
register
public static void register(com.mojang.brigadier.CommandDispatcher<CommandSourceStack> dispatcher, CommandBuildContext context) -
suggestTestFunction
public static CompletableFuture<com.mojang.brigadier.suggestion.Suggestions> suggestTestFunction(com.mojang.brigadier.context.CommandContext<CommandSourceStack> context, com.mojang.brigadier.suggestion.SuggestionsBuilder builder) -
displayTestId
-
suggestTestInstanceIds
private static CompletableFuture<com.mojang.brigadier.suggestion.Suggestions> suggestTestInstanceIds(com.mojang.brigadier.context.CommandContext<CommandSourceStack> context, com.mojang.brigadier.suggestion.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(GlobalPos testBlockPos, CommandSourceStack source, RetryOptions retryOptions) -
createNewStructure
private static int createNewStructure(CommandSourceStack source, Identifier id, int xSize, int ySize, int zSize) throws com.mojang.brigadier.exceptions.CommandSyntaxException - Throws:
com.mojang.brigadier.exceptions.CommandSyntaxException
-
showPos
private static int showPos(CommandSourceStack source, String varName) throws com.mojang.brigadier.exceptions.CommandSyntaxException - Throws:
com.mojang.brigadier.exceptions.CommandSyntaxException
-
stopTests
private static int stopTests() -
trackAndStartRunner
-
exportTestStructure
-
verifyStructureExists
-
createTestPositionAround
private static BlockPos createTestPositionAround(CommandSourceStack source, ResourceKey<Level> dimension) -
playerAndTestInfo
private static TestCommand.Info playerAndTestInfo(CommandSourceStack source, ResourceKey<Level> dimension) -
outputTestCoordinates
private static void outputTestCoordinates(CommandSourceStack source, Set<ResourceKey<Level>> testDimensions) -
outputPlayerCoordinates
private static void outputPlayerCoordinates(CommandSourceStack source, Set<ResourceKey<Level>> testDimensions) -
isPlayerInCurrentTestDimension
private static boolean isPlayerInCurrentTestDimension(TestCommand.Info playerInfo, Set<ResourceKey<Level>> testDimensions)
-