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 pStructureBlockPos, BlockPos pOffset, Rotation pRotation, ServerLevel pServerLevel) private static void
clearBlock
(int pStructureBlockY, BlockPos pPos, ServerLevel pServerLevel) static void
clearSpaceForStructure
(BoundingBox pBoundingBox, ServerLevel pLevel) static void
createNewEmptyStructureBlock
(String pStructureName, BlockPos pPos, Vec3i pSize, Rotation pRotation, ServerLevel pServerLevel) private static StructureBlockEntity
createStructureBlock
(GameTestInfo pGameTestInfo, BlockPos pPos, Rotation pRotation, ServerLevel pLevel) private static boolean
doesStructureContain
(BlockPos pStructureBlockPos, BlockPos pPosToTest, ServerLevel pServerLevel) static void
encaseStructure
(AABB pBounds, ServerLevel pLevel, boolean pPlaceBarriers) findNearestStructureBlock
(BlockPos pPos, int pRadius, ServerLevel pLevel) findStructureBlockContainingPos
(BlockPos pPos, int pRadius, ServerLevel pServerLevel) findStructureBlocks
(BlockPos pPos, int pRadius, ServerLevel pLevel) findStructureByTestFunction
(BlockPos pPos, int pRadius, ServerLevel pLevel, String pTestName) private static void
forceLoadChunks
(BoundingBox pBoundingBox, ServerLevel pLevel) private static BoundingBox
getBoundingBoxAtGround
(BlockPos pPos, int pRadius, ServerLevel pLevel) static Rotation
getRotationForRotationSteps
(int pRotationSteps) static int
getRotationStepsForRotation
(Rotation pRotation) static BoundingBox
getStructureBoundingBox
(BlockPos pPos, Vec3i pOffset, Rotation pRotation) static BoundingBox
getStructureBoundingBox
(StructureBlockEntity pStructureBlockEntity) static AABB
getStructureBounds
(StructureBlockEntity pStructureBlockEntity) static BlockPos
getStructureOrigin
(StructureBlockEntity pStructureBlockEntity) static BlockPos
getTransformedFarCorner
(BlockPos pPos, Vec3i pOffset, Rotation pRotation) lookedAtStructureBlockPos
(BlockPos pPos, Entity pEntity, ServerLevel pLevel) static StructureBlockEntity
prepareTestStructure
(GameTestInfo pGameTestInfo, BlockPos pPos, Rotation pRotation, ServerLevel pLevel) static void
removeBarriers
(AABB pBounds, ServerLevel pLevel)
-
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 pStructureBlockPos, BlockPos pOffset, Rotation pRotation, ServerLevel pServerLevel) -
createNewEmptyStructureBlock
public static void createNewEmptyStructureBlock(String pStructureName, BlockPos pPos, Vec3i pSize, Rotation pRotation, ServerLevel pServerLevel) -
prepareTestStructure
public static StructureBlockEntity prepareTestStructure(GameTestInfo pGameTestInfo, BlockPos pPos, Rotation pRotation, ServerLevel pLevel) -
encaseStructure
-
removeBarriers
-
forceLoadChunks
-
clearSpaceForStructure
-
getTransformedFarCorner
-
getStructureBoundingBox
-
findStructureBlockContainingPos
public static Optional<BlockPos> findStructureBlockContainingPos(BlockPos pPos, int pRadius, ServerLevel pServerLevel) -
findNearestStructureBlock
public static Optional<BlockPos> findNearestStructureBlock(BlockPos pPos, int pRadius, ServerLevel pLevel) -
findStructureByTestFunction
public static Stream<BlockPos> findStructureByTestFunction(BlockPos pPos, int pRadius, ServerLevel pLevel, String pTestName) -
findStructureBlocks
-
createStructureBlock
private static StructureBlockEntity createStructureBlock(GameTestInfo pGameTestInfo, BlockPos pPos, Rotation pRotation, ServerLevel pLevel) -
getBoundingBoxAtGround
-
lookedAtStructureBlockPos
public static Stream<BlockPos> lookedAtStructureBlockPos(BlockPos pPos, Entity pEntity, ServerLevel pLevel) -
clearBlock
-
doesStructureContain
private static boolean doesStructureContain(BlockPos pStructureBlockPos, BlockPos pPosToTest, ServerLevel pServerLevel)
-