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 pStructureBlockPos, BlockPos pOffset, Rotation pRotation, ServerLevel pServerLevel) private static voidclearBlock(int pStructureBlockY, BlockPos pPos, ServerLevel pServerLevel) static voidclearSpaceForStructure(BoundingBox pBoundingBox, ServerLevel pLevel) static voidcreateNewEmptyStructureBlock(String pStructureName, BlockPos pPos, Vec3i pSize, Rotation pRotation, ServerLevel pServerLevel) private static StructureBlockEntitycreateStructureBlock(GameTestInfo pGameTestInfo, BlockPos pPos, Rotation pRotation, ServerLevel pLevel) private static booleandoesStructureContain(BlockPos pStructureBlockPos, BlockPos pPosToTest, ServerLevel pServerLevel) static voidencaseStructure(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 voidforceLoadChunks(BoundingBox pBoundingBox, ServerLevel pLevel) private static BoundingBoxgetBoundingBoxAtGround(BlockPos pPos, int pRadius, ServerLevel pLevel) static RotationgetRotationForRotationSteps(int pRotationSteps) static intgetRotationStepsForRotation(Rotation pRotation) static BoundingBoxgetStructureBoundingBox(BlockPos pPos, Vec3i pOffset, Rotation pRotation) static BoundingBoxgetStructureBoundingBox(StructureBlockEntity pStructureBlockEntity) static AABBgetStructureBounds(StructureBlockEntity pStructureBlockEntity) static BlockPosgetStructureOrigin(StructureBlockEntity pStructureBlockEntity) static BlockPosgetTransformedFarCorner(BlockPos pPos, Vec3i pOffset, Rotation pRotation) lookedAtStructureBlockPos(BlockPos pPos, Entity pEntity, ServerLevel pLevel) static StructureBlockEntityprepareTestStructure(GameTestInfo pGameTestInfo, BlockPos pPos, Rotation pRotation, ServerLevel pLevel) static voidremoveBarriers(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)
-