Class BlockDomeUtil

java.lang.Object
com.hypixel.hytale.math.block.BlockDomeUtil

public class BlockDomeUtil extends Object
Utility for iterating over blocks in a dome shape (top half of a sphere).
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static <T> boolean
    forEachBlock(int originX, int originY, int originZ, int radiusX, int radiusY, int radiusZ, boolean evenXZ, boolean evenH, T t, TriIntObjPredicate<T> consumer)
    Runs the specified operation on all blocks in the dome (top half of sphere) specified by the parameters.
    static <T> boolean
    forEachBlock(int originX, int originY, int originZ, int radiusX, int radiusY, int radiusZ, int thickness, boolean capped, boolean evenXZ, boolean evenH, T t, TriIntObjPredicate<T> consumer)
     
    static <T> boolean
    forEachBlock(int originX, int originY, int originZ, int radiusX, int radiusY, int radiusZ, int thickness, boolean capped, T t, TriIntObjPredicate<T> consumer)
    Runs the specified operation on all blocks in the hollow dome specified by the parameters.
    static <T> boolean
    forEachBlock(int originX, int originY, int originZ, int radiusX, int radiusY, int radiusZ, T t, TriIntObjPredicate<T> consumer)
    Runs the specified operation on all blocks in the dome (top half of sphere) specified by the parameters.

    Methods inherited from class Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • BlockDomeUtil

      public BlockDomeUtil()
  • Method Details

    • 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)
      Runs the specified operation on all blocks in the dome (top half of sphere) specified by the parameters.
      Parameters:
      originX - The center of the dome on the X axis
      originY - The base of the dome on the Y axis
      originZ - The center of the dome on the Z axis
      radiusX - The radius of the dome on the X axis. Must be greater than 0.
      radiusY - The radius of the dome on the Y axis (height). Must be greater than 0.
      radiusZ - The radius of the dome on the Z axis. 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, boolean evenXZ, boolean evenH, @Nullable T t, @Nonnull TriIntObjPredicate<T> consumer)
      Runs the specified operation on all blocks in the dome (top half of sphere) specified by the parameters. When evenXZ/evenH are true, shifts sampling by 0.5 to produce even-width shapes.
      Parameters:
      originX - The center of the dome on the X axis
      originY - The base of the dome on the Y axis
      originZ - The center of the dome on the Z axis
      radiusX - The radius of the dome on the X axis. Must be greater than 0.
      radiusY - The radius of the dome on the Y axis (height). Must be greater than 0.
      radiusZ - The radius of the dome on the Z axis. Must be greater than 0.
      evenXZ - Whether the horizontal size is even (shifts sampling by 0.5)
      evenH - Whether the vertical size is even (shifts sampling by 0.5)
      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 capped, @Nullable T t, @Nonnull TriIntObjPredicate<T> consumer)
      Runs the specified operation on all blocks in the hollow dome specified by the parameters.
      Parameters:
      originX - The center of the dome on the X axis
      originY - The base of the dome on the Y axis
      originZ - The center of the dome on the Z axis
      radiusX - The radius of the dome on the X axis. Must be greater than 0.
      radiusY - The radius of the dome on the Y axis (height). Must be greater than 0.
      radiusZ - The radius of the dome on the Z axis. Must be greater than 0.
      thickness - The thickness of the hollow dome. Must be greater 0.
      capped - Whether to cap the bottom of the hollow dome
      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 capped, boolean evenXZ, boolean evenH, @Nullable T t, @Nonnull TriIntObjPredicate<T> consumer)