Class HollowCubeDetector
java.lang.Object
org.cyclops.cyclopscore.block.multi.CubeDetector
org.cyclops.cyclopscore.block.multi.HollowCubeDetector
Detector of hollow cubes in a world.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.cyclops.cyclopscore.block.multi.CubeDetector
CubeDetector.BlockPosAction, CubeDetector.IDetectionListener, CubeDetector.IValidationAction
-
Constructor Summary
ConstructorDescriptionHollowCubeDetector
(AllowedBlock[] allowedBlocks, List<? extends CubeDetector.IDetectionListener> listeners) Make a new instance. -
Method Summary
Modifier and TypeMethodDescriptionprotected void
postValidate
(net.minecraft.world.level.LevelReader world, net.minecraft.core.Vec3i size, int[][] dimensionEgdes, boolean valid, net.minecraft.core.BlockPos originCorner, net.minecraft.core.BlockPos excludeLocation) protected net.minecraft.network.chat.Component
validateLocationInStructure
(net.minecraft.world.level.LevelReader world, int[][] dimensionEgdes, net.minecraft.core.BlockPos location, CubeDetector.IValidationAction action, net.minecraft.core.BlockPos excludeLocation) Check if a given location is valid, taking into account the edges of the structure, so that we know which locations should be borders, and which ones should be air.Methods inherited from class org.cyclops.cyclopscore.block.multi.CubeDetector
addAllowedBlocks, addSizeValidator, coordinateRecursion, coordinateRecursion, detect, detect, getAllowedBlocks, getListeners, getSizeValidators, isAir, isEdge, isValidLocation, isValidLocation, navigateToBorder, navigateToBorder, navigateToCorner, notifyListeners, validateAllowedBlockConditions, validateDimensionEdges
-
Constructor Details
-
HollowCubeDetector
public HollowCubeDetector(AllowedBlock[] allowedBlocks, List<? extends CubeDetector.IDetectionListener> listeners) Make a new instance.- Parameters:
allowedBlocks
- The blocks that are allowed in this cube.listeners
- Listeners for detections.
-
-
Method Details
-
postValidate
protected void postValidate(net.minecraft.world.level.LevelReader world, net.minecraft.core.Vec3i size, int[][] dimensionEgdes, boolean valid, net.minecraft.core.BlockPos originCorner, net.minecraft.core.BlockPos excludeLocation) - Overrides:
postValidate
in classCubeDetector
-
validateLocationInStructure
protected net.minecraft.network.chat.Component validateLocationInStructure(net.minecraft.world.level.LevelReader world, int[][] dimensionEgdes, net.minecraft.core.BlockPos location, CubeDetector.IValidationAction action, net.minecraft.core.BlockPos excludeLocation) Description copied from class:CubeDetector
Check if a given location is valid, taking into account the edges of the structure, so that we know which locations should be borders, and which ones should be air.- Overrides:
validateLocationInStructure
in classCubeDetector
- Parameters:
world
- The world.dimensionEgdes
- The edges per dimension. [dimension][start=0 | stop=1]location
- The location to check.action
- The action to execute when a location has been validated.excludeLocation
- The location of the block that is being removed, used for invalidating, null for validating.- Returns:
- If the location was valid.
-