Contents
- Description
- Constructor Summary
- Method Summary
- Constructor Details
- Method Details
- forEachBlockExact(int, int, int, double, T, TriIntObjPredicate)
- forEachBlock(int, int, int, int, T, TriIntObjPredicate)
- forEachBlock(int, int, int, int, int, int, T, TriIntObjPredicate)
- forEachBlock(int, int, int, int, int, int, boolean, boolean, T, TriIntObjPredicate)
- forEachBlock(int, int, int, int, int, T, TriIntObjPredicate)
- forEachBlock(int, int, int, int, int, int, int, T, TriIntObjPredicate)
- forEachBlock(int, int, int, int, int, int, int, boolean, boolean, T, TriIntObjPredicate)
Class BlockSphereUtil
java.lang.Object
com.hypixel.hytale.math.block.BlockSphereUtil
- Since:
- 04.02.2018
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic <T> booleanforEachBlock(int originX, int originY, int originZ, int radiusX, int radiusY, int radiusZ, boolean evenXZ, boolean evenY, T t, TriIntObjPredicate<T> consumer) Runs the specified operation on all blocks in the sphere specified by the parameters.static <T> booleanforEachBlock(int originX, int originY, int originZ, int radiusX, int radiusY, int radiusZ, int thickness, boolean evenXZ, boolean evenY, T t, TriIntObjPredicate<T> consumer) LikeforEachBlock(int, int, int, int, int, int, int, Object, TriIntObjPredicate)with hollow-shell semantics, but supports even extents viaforEachBlock(int, int, int, int, int, int, boolean, boolean, Object, TriIntObjPredicate).static <T> booleanforEachBlock(int originX, int originY, int originZ, int radiusX, int radiusY, int radiusZ, int thickness, T t, TriIntObjPredicate<T> consumer) Runs the specified operation on all blocks in the hollow sphere specified by the parameters.static <T> booleanforEachBlock(int originX, int originY, int originZ, int radiusX, int radiusY, int radiusZ, T t, TriIntObjPredicate<T> consumer) Delegates toforEachBlock(int, int, int, int, int, int, boolean, boolean, Object, TriIntObjPredicate)withevenXZ=falseandevenY=false.static <T> voidforEachBlock(int originX, int originY, int originZ, int radius, int thickness, T t, TriIntObjPredicate<T> consumer) Runs the specified operation on all blocks in the hollow sphere specified by the parameters.static <T> voidforEachBlock(int originX, int originY, int originZ, int radius, T t, TriIntObjPredicate<T> consumer) Runs the specified operation on all blocks in the sphere specified by the parameters.static <T> voidforEachBlockExact(int originX, int originY, int originZ, double radius, T t, TriIntObjPredicate<T> consumer) Runs the specified operation on all blocks in the sphere specified by the parameters.
-
Constructor Details
-
BlockSphereUtil
public BlockSphereUtil()
-
-
Method Details
-
forEachBlockExact
public static <T> void forEachBlockExact(int originX, int originY, int originZ, double radius, @Nullable T t, @Nonnull TriIntObjPredicate<T> consumer) Runs the specified operation on all blocks in the sphere specified by the parameters.- Parameters:
originX- The center of the sphere on the X axisoriginY- The center of the sphere on the Y axisoriginZ- The center of the sphere on the Z axisradius- The radius of the sphere. Must be greater than 0.consumer- The operation to execute on each of the coordinates' values
-
forEachBlock
public static <T> void forEachBlock(int originX, int originY, int originZ, int radius, @Nullable T t, @Nonnull TriIntObjPredicate<T> consumer) Runs the specified operation on all blocks in the sphere specified by the parameters.- Parameters:
originX- The center of the sphere on the X axisoriginY- The center of the sphere on the Y axisoriginZ- The center of the sphere on the Z axisradius- The radius of the sphere. Must be greater than 0.consumer- The operation to execute on each of the coordinates' values
-
forEachBlock
public static <T> boolean forEachBlock(int originX, int originY, int originZ, int radiusX, int radiusY, int radiusZ, @Nullable T t, @Nonnull TriIntObjPredicate<T> consumer) Delegates toforEachBlock(int, int, int, int, int, int, boolean, boolean, Object, TriIntObjPredicate)withevenXZ=falseandevenY=false. -
forEachBlock
public static <T> boolean forEachBlock(int originX, int originY, int originZ, int radiusX, int radiusY, int radiusZ, boolean evenXZ, boolean evenY, @Nullable T t, @Nonnull TriIntObjPredicate<T> consumer) Runs the specified operation on all blocks in the sphere specified by the parameters. The algorithm does not iterate over blocks outside the sphere. The iteration count is equal to the reported block count.When
evenXZorevenYis true, supports shapes whose extent is even along X/Z and/or Y by sampling block centers with a half-block offset whenevenXZ/evenYis true, and iterating the full coordinate range (no octant mirroring).- Parameters:
originX- The center of the sphere on the X axisoriginY- The center of the sphere on the Y axisoriginZ- The center of the sphere on the Z axisradiusX- The radius of the sphere on the X axis. Must be greater than 0.radiusY- The radius of the sphere on the Y axis. Must be greater than 0.radiusZ- The radius of the sphere on the Z axis. Must be greater than 0.evenXZ- When true, treat extent as even along X and Z (half-block offset, full range on X/Z).evenY- When true, treat extent as even along Y (half-block offset, full range on Y).consumer- The operation to execute on each of the coordinates' values
-
forEachBlock
public static <T> void forEachBlock(int originX, int originY, int originZ, int radius, int thickness, @Nullable T t, @Nonnull TriIntObjPredicate<T> consumer) Runs the specified operation on all blocks in the hollow sphere specified by the parameters.- Parameters:
originX- The center of the sphere on the X axisoriginY- The center of the sphere on the Y axisoriginZ- The center of the sphere on the Z axisradius- The radius of the sphere. Must be greater than 0.thickness- The thickness of the hollow sphere. Must be greater 0.consumer- The operation to execute on each of the coordinates' values
-
forEachBlock
public static <T> boolean forEachBlock(int originX, int originY, int originZ, int radiusX, int radiusY, int radiusZ, int thickness, @Nullable T t, @Nonnull TriIntObjPredicate<T> consumer) Runs the specified operation on all blocks in the hollow sphere specified by the parameters.- Parameters:
originX- The center of the sphere on the X axisoriginY- The center of the sphere on the Y axisoriginZ- The center of the sphere on the Z axisradiusX- The radius of the sphere on the X axis. Must be greater than 0.radiusY- The radius of the sphere on the Y axis. Must be greater than 0.radiusZ- The radius of the sphere on the Z axis. Must be greater than 0.thickness- The thickness of the hollow sphere. Must be greater 0.consumer- The operation to execute on each of the coordinates' values
-
forEachBlock
public static <T> boolean forEachBlock(int originX, int originY, int originZ, int radiusX, int radiusY, int radiusZ, int thickness, boolean evenXZ, boolean evenY, @Nullable T t, @Nonnull TriIntObjPredicate<T> consumer) LikeforEachBlock(int, int, int, int, int, int, int, Object, TriIntObjPredicate)with hollow-shell semantics, but supports even extents viaforEachBlock(int, int, int, int, int, int, boolean, boolean, Object, TriIntObjPredicate).
-