Class DirectGrid

java.lang.Object
com.hypixel.hytale.server.worldgen.climate.DirectGrid
All Implemented Interfaces:
CellDistanceFunction

public class DirectGrid extends Object implements CellDistanceFunction
  • Field Details

    • INSTANCE

      public static final DirectGrid INSTANCE
  • Constructor Details

    • DirectGrid

      public DirectGrid()
  • Method Details

    • nearest2D

      public void nearest2D(int seed, double x, double y, int cellX, int cellY, ResultBuffer.ResultBuffer2d buffer, PointEvaluator pointEvaluator)
      Description copied from interface: CellDistanceFunction
      Calculate the distance to the nearest cell centre-point of a 2D cell neighborhood.
      Specified by:
      nearest2D in interface CellDistanceFunction
      Parameters:
      seed - The seed being sampled.
      x - The x-coordinate being sampled.
      y - The y-coordinate being sampled.
      cellX - The x-index of cell to evaluate around.
      cellY - The y-index of cell to evaluate around.
      buffer - The buffer into which the result of the evaluation is recorded.
      pointEvaluator - A function that evaluates each cell centre-point.
    • nearest3D

      public void nearest3D(int seed, double x, double y, double z, int cellX, int cellY, int cellZ, ResultBuffer.ResultBuffer3d buffer, PointEvaluator pointEvaluator)
      Description copied from interface: CellDistanceFunction
      Calculate the distance to the nearest cell centre-point of a 3D cell neighborhood.
      Specified by:
      nearest3D in interface CellDistanceFunction
      Parameters:
      seed - The seed being sampled.
      x - The x-coordinate being sampled.
      y - The y-coordinate being sampled.
      z - The y-coordinate being sampled.
      cellX - The x-index of cell to evaluate around.
      cellY - The y-index of cell to evaluate around.
      cellZ - The z-index of cell to evaluate around.
      buffer - The buffer into which the result of the evaluation is recorded.
      pointEvaluator - A function that evaluates each cell centre-point.
    • transition2D

      public void transition2D(int seed, double x, double y, int cellX, int cellY, ResultBuffer.ResultBuffer2d buffer, PointEvaluator pointEvaluator)
      Description copied from interface: CellDistanceFunction
      Calculate the distance to the nearest and second-nearest cell centre-points of a 2D cell neighborhood.
      Specified by:
      transition2D in interface CellDistanceFunction
      Parameters:
      seed - The seed being sampled.
      x - The x-coordinate being sampled.
      y - The y-coordinate being sampled.
      cellX - The x-index of cell to evaluate around.
      cellY - The y-index of cell to evaluate around.
      buffer - The buffer into which the result of the evaluation is recorded.
      pointEvaluator - A function that evaluates each cell centre-point.
    • transition3D

      public void transition3D(int seed, double x, double y, double z, int cellX, int cellY, int cellZ, ResultBuffer.ResultBuffer3d buffer, PointEvaluator pointEvaluator)
      Description copied from interface: CellDistanceFunction
      Calculate the distance to the nearest and second-nearest cell centre-points of a 2D cell neighborhood.
      Specified by:
      transition3D in interface CellDistanceFunction
      Parameters:
      seed - The seed being sampled.
      x - The x-coordinate being sampled.
      y - The y-coordinate being sampled.
      z - The y-coordinate being sampled.
      cellX - The x-index of cell to evaluate around.
      cellY - The y-index of cell to evaluate around.
      cellZ - The z-index of cell to evaluate around.
      buffer - The buffer into which the result of the evaluation is recorded.
      pointEvaluator - A function that evaluates each cell centre-point.
    • evalPoint

      public void evalPoint(int seed, double x, double y, int cellX, int cellY, ResultBuffer.ResultBuffer2d buffer, PointEvaluator pointEvaluator)
      Description copied from interface: CellDistanceFunction
      Evaluate distance to the given cell centre-point recording only the closest result.
      Specified by:
      evalPoint in interface CellDistanceFunction
      Parameters:
      seed - The seed being sampled.
      x - The x-coordinate being sampled.
      y - The y-coordinate being sampled.
      cellX - The x-index of cell being evaluated.
      cellY - The y-index of cell being evaluated.
      buffer - The buffer into which the result of the evaluation is recorded.
      pointEvaluator - A function that evaluates each cell centre-point.
    • evalPoint

      public void evalPoint(int seed, double x, double y, double z, int cellX, int cellY, int cellZ, ResultBuffer.ResultBuffer3d buffer, PointEvaluator pointEvaluator)
      Description copied from interface: CellDistanceFunction
      Evaluate distance to the given cell centre-point recording only the closest result.
      Specified by:
      evalPoint in interface CellDistanceFunction
      Parameters:
      seed - The seed being sampled.
      x - The x-coordinate being sampled.
      y - The y-coordinate being sampled.
      z - The y-coordinate being sampled.
      cellX - The x-index of cell being evaluated.
      cellY - The y-index of cell being evaluated.
      cellZ - The z-index of cell being evaluated.
      buffer - The buffer into which the result of the evaluation is recorded.
      pointEvaluator - A function that evaluates each cell centre-point.
    • evalPoint2

      public void evalPoint2(int seed, double x, double y, int cellX, int cellY, ResultBuffer.ResultBuffer2d buffer, PointEvaluator pointEvaluator)
      Description copied from interface: CellDistanceFunction
      Evaluate distance to the given cell centre-point recording the closest and second-closest result.
      Specified by:
      evalPoint2 in interface CellDistanceFunction
      Parameters:
      seed - The seed being sampled.
      x - The x-coordinate being sampled.
      y - The y-coordinate being sampled.
      cellX - The x-index of cell being evaluated.
      cellY - The y-index of cell being evaluated.
      buffer - The buffer into which the result of the evaluation is recorded.
      pointEvaluator - A function that evaluates each cell centre-point.
    • evalPoint2

      public void evalPoint2(int seed, double x, double y, double z, int cellX, int cellY, int cellZ, ResultBuffer.ResultBuffer3d buffer, PointEvaluator pointEvaluator)
      Description copied from interface: CellDistanceFunction
      Evaluate distance to the given cell centre-point recording the closest and second-closest result.
      Specified by:
      evalPoint2 in interface CellDistanceFunction
      Parameters:
      seed - The seed being sampled.
      x - The x-coordinate being sampled.
      y - The y-coordinate being sampled.
      z - The y-coordinate being sampled.
      cellX - The x-index of cell being evaluated.
      cellY - The y-index of cell being evaluated.
      cellZ - The z-index of cell being evaluated.
      buffer - The buffer into which the result of the evaluation is recorded.
      pointEvaluator - A function that evaluates each cell centre-point.
    • collect

      public <T> void collect(int originalSeed, int seed, int minX, int minY, int maxX, int maxY, ResultBuffer.Bounds2d bounds, T ctx, PointConsumer<T> collector, PointEvaluator pointEvaluator)
      Description copied from interface: CellDistanceFunction
      Iterate the cell-grid between the two provided corner coordinates and collect the cell centre-points of each cell visited.
      Specified by:
      collect in interface CellDistanceFunction
      Type Parameters:
      T - The type of the contextual information being passed to the collector.
      Parameters:
      originalSeed - A seed from which child-seeds may be offset.
      seed - The seed used to determine cell centre-points.
      minX - The x-index of the inclusive lower corner of the cell region.
      minY - The y-index of the inclusive lower corner of the cell region.
      maxX - The x-index of the inclusive upper corner of the cell region.
      maxY - The y-index of the inclusive upper corner of the cell region.
      bounds - The bounds that generated points must be limited to.
      ctx - An arbitrary piece of contextual information to pass to the collector for each point visited.
      collector - A consumer for each visited cell centre-point.
      pointEvaluator - A function that evaluates each cell centre-point.