Package net.minecraft.gametest.framework
Class StructureUtils
java.lang.Object
net.minecraft.gametest.framework.StructureUtils
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidaddCommandBlockAndButtonToStartTest(BlockPos structureBlockPos, BlockPos offset, Rotation rotation, ServerLevel serverLevel) private static voidclearBlock(int structureBlockY, BlockPos pos, ServerLevel serverLevel) static voidclearSpaceForStructure(BoundingBox boundingBox, ServerLevel level) static voidcreateNewEmptyStructureBlock(String structureName, BlockPos pos, Vec3i size, Rotation rotation, ServerLevel serverLevel) private static StructureBlockEntitycreateStructureBlock(GameTestInfo gameTestInfo, BlockPos pos, Rotation rotation, ServerLevel level) private static booleandoesStructureContain(BlockPos structureBlockPos, BlockPos posToTest, ServerLevel serverLevel) static voidencaseStructure(AABB bounds, ServerLevel level, boolean placeBarriers) findNearestStructureBlock(BlockPos pos, int radius, ServerLevel level) findStructureBlockContainingPos(BlockPos pos, int radius, ServerLevel serverLevel) findStructureBlocks(BlockPos pos, int radius, ServerLevel level) findStructureByTestFunction(BlockPos pos, int radius, ServerLevel level, String testName) private static voidforceLoadChunks(BoundingBox boundingBox, ServerLevel level) private static BoundingBoxgetBoundingBoxAtGround(BlockPos pos, int radius, ServerLevel level) static RotationgetRotationForRotationSteps(int rotationSteps) static intgetRotationStepsForRotation(Rotation rotation) static BoundingBoxgetStructureBoundingBox(BlockPos pos, Vec3i offset, Rotation rotation) static BoundingBoxgetStructureBoundingBox(StructureBlockEntity structureBlockEntity) static AABBgetStructureBounds(StructureBlockEntity structureBlockEntity) static BlockPosgetStructureOrigin(StructureBlockEntity structureBlockEntity) static BlockPosgetTransformedFarCorner(BlockPos pos, Vec3i offset, Rotation rotation) lookedAtStructureBlockPos(BlockPos pos, Entity entity, ServerLevel level) static StructureBlockEntityprepareTestStructure(GameTestInfo gameTestInfo, BlockPos pos, Rotation rotation, ServerLevel level) static voidremoveBarriers(AABB bounds, ServerLevel level)
-
Field Details
-
LOGGER
private static final org.slf4j.Logger LOGGER -
DEFAULT_Y_SEARCH_RADIUS
public static final int DEFAULT_Y_SEARCH_RADIUS- See Also:
-
DEFAULT_TEST_STRUCTURES_DIR
- See Also:
-
testStructuresDir
-
-
Constructor Details
-
StructureUtils
public StructureUtils()
-
-
Method Details
-
getRotationForRotationSteps
-
getRotationStepsForRotation
-
getStructureBounds
-
getStructureBoundingBox
-
getStructureOrigin
-
addCommandBlockAndButtonToStartTest
public static void addCommandBlockAndButtonToStartTest(BlockPos structureBlockPos, BlockPos offset, Rotation rotation, ServerLevel serverLevel) -
createNewEmptyStructureBlock
public static void createNewEmptyStructureBlock(String structureName, BlockPos pos, Vec3i size, Rotation rotation, ServerLevel serverLevel) -
prepareTestStructure
public static StructureBlockEntity prepareTestStructure(GameTestInfo gameTestInfo, BlockPos pos, Rotation rotation, ServerLevel level) -
encaseStructure
-
removeBarriers
-
forceLoadChunks
-
clearSpaceForStructure
-
getTransformedFarCorner
-
getStructureBoundingBox
-
findStructureBlockContainingPos
public static Optional<BlockPos> findStructureBlockContainingPos(BlockPos pos, int radius, ServerLevel serverLevel) -
findNearestStructureBlock
public static Optional<BlockPos> findNearestStructureBlock(BlockPos pos, int radius, ServerLevel level) -
findStructureByTestFunction
public static Stream<BlockPos> findStructureByTestFunction(BlockPos pos, int radius, ServerLevel level, String testName) -
findStructureBlocks
-
createStructureBlock
private static StructureBlockEntity createStructureBlock(GameTestInfo gameTestInfo, BlockPos pos, Rotation rotation, ServerLevel level) -
getBoundingBoxAtGround
-
lookedAtStructureBlockPos
public static Stream<BlockPos> lookedAtStructureBlockPos(BlockPos pos, Entity entity, ServerLevel level) -
clearBlock
-
doesStructureContain
private static boolean doesStructureContain(BlockPos structureBlockPos, BlockPos posToTest, ServerLevel serverLevel)
-