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 void
addCommandBlockAndButtonToStartTest
(BlockPos structureBlockPos, BlockPos offset, Rotation rotation, ServerLevel serverLevel) private static void
clearBlock
(int structureBlockY, BlockPos pos, ServerLevel serverLevel) static void
clearSpaceForStructure
(BoundingBox boundingBox, ServerLevel level) static void
createNewEmptyStructureBlock
(String structureName, BlockPos pos, Vec3i size, Rotation rotation, ServerLevel serverLevel) private static StructureBlockEntity
createStructureBlock
(GameTestInfo gameTestInfo, BlockPos pos, Rotation rotation, ServerLevel level) private static boolean
doesStructureContain
(BlockPos structureBlockPos, BlockPos posToTest, ServerLevel serverLevel) static void
encaseStructure
(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 void
forceLoadChunks
(BoundingBox boundingBox, ServerLevel level) private static BoundingBox
getBoundingBoxAtGround
(BlockPos pos, int radius, ServerLevel level) static Rotation
getRotationForRotationSteps
(int rotationSteps) static int
getRotationStepsForRotation
(Rotation rotation) static BoundingBox
getStructureBoundingBox
(BlockPos pos, Vec3i offset, Rotation rotation) static BoundingBox
getStructureBoundingBox
(StructureBlockEntity structureBlockEntity) static AABB
getStructureBounds
(StructureBlockEntity structureBlockEntity) static BlockPos
getStructureOrigin
(StructureBlockEntity structureBlockEntity) static BlockPos
getTransformedFarCorner
(BlockPos pos, Vec3i offset, Rotation rotation) lookedAtStructureBlockPos
(BlockPos pos, Entity entity, ServerLevel level) static StructureBlockEntity
prepareTestStructure
(GameTestInfo gameTestInfo, BlockPos pos, Rotation rotation, ServerLevel level) static void
removeBarriers
(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)
-