Class SphereGen


public class SphereGen extends FillableShape
Class to generate Sphere related shapes

Since 2.1.0, the shape doesn't return a List<net.minecraft.util.math.BlockPos> but it returns instead a List<Set <BlockPos>> Before 2.1.0, the BlockPos list was a simple list. Starting from 2.1.0, the shapes returns a list of ChunkPos that has a set of BlockPos The change from List to Set was done to avoid duplicates BlockPos which resulted in unnecessary calculations. this allow easy multithreading for the Block assignment done in the Shape which result in better performance;

  • Constructor Details

    • SphereGen

      public SphereGen(@NotNull @NotNull net.minecraft.world.StructureWorldAccess world, @NotNull @NotNull net.minecraft.util.math.BlockPos pos, ShapeBase.PlaceMoment placeMoment, ShapePlaceType.LayerPlace layerPlace, ShapeLayer.LayersType layersType, int yRotation, int zRotation, int secondYRotation, String featureName, int radiusX, int radiusY, int radiusZ, SphereGen.SphereType halfSphere)
      init the Sphere Shape
      Parameters:
      world - the world the spiral will spawn in
      pos - the center of the spiral
      placeMoment - define the moment where the shape will be placed
      layerPlace - how the @BlockStates inside of a BlockLayer will be placed
      layersType - how the Layers will be placed
      yRotation - first rotation around the y-axis
      zRotation - second rotation around the z-axis
      secondYRotation - last rotation around the y-axis
      featureName - the name of the feature
      radiusX - the radius on the x-axis
      radiusY - the radius on the y-axis
      radiusZ - the radius on the z-axis
      halfSphere - determines if the sphere is half or not
    • SphereGen

      public SphereGen(@NotNull @NotNull net.minecraft.world.StructureWorldAccess world, @NotNull @NotNull net.minecraft.util.math.BlockPos pos, ShapeBase.PlaceMoment placeMoment, int radius)
      init the shape generation
      Parameters:
      world - the world the shape will be generated
      pos - the pos of the structure center
      placeMoment - define the moment where the shape will be placed
      radius - the radius of the sphere
  • Method Details

    • getHalfSphereDirection

      public net.minecraft.util.math.Direction getHalfSphereDirection()
    • setHalfSphereDirection

      public void setHalfSphereDirection(net.minecraft.util.math.Direction direction)
    • isHalfSphere

      public SphereGen.SphereType isHalfSphere()
    • setHalfSphere

      public void setHalfSphere(SphereGen.SphereType halfSphere)
    • getRadiusX

      public int getRadiusX()
    • setRadiusX

      public void setRadiusX(int radiusX)
    • getRadiusY

      public int getRadiusY()
    • setRadiusY

      public void setRadiusY(int radiusY)
    • getRadiusZ

      public int getRadiusZ()
    • setRadiusZ

      public void setRadiusZ(int radiusZ)
    • getBlockPos

      public List<Set<net.minecraft.util.math.BlockPos>> getBlockPos()
      Description copied from class: Shape
      method to get the coordinates that will be placed later
      Specified by:
      getBlockPos in class Shape
      Returns:
      a list of blockPos for every shape
    • getVec3d

      public List<net.minecraft.util.math.Vec3d> getVec3d()
      Description copied from class: Shape
      method to get the Vec3d that will be placed later
      Specified by:
      getVec3d in class Shape
      Returns:
      a list of Vec3d for every shape
    • getSphereCoordinates

      public List<Set<net.minecraft.util.math.BlockPos>> getSphereCoordinates()
    • generateHalfEmptyEllipsoid

      public void generateHalfEmptyEllipsoid(Map<net.minecraft.util.math.ChunkPos,Set<net.minecraft.util.math.BlockPos>> chunkMap)
    • generateEmptyEllipsoid

      public void generateEmptyEllipsoid(Map<net.minecraft.util.math.ChunkPos,Set<net.minecraft.util.math.BlockPos>> chunkMap)
    • generateEmptyEllipsoid

      public void generateEmptyEllipsoid(int minLarge, int maxLarge, int minHeight, int maxHeight, Map<net.minecraft.util.math.ChunkPos,Set<net.minecraft.util.math.BlockPos>> chunkMap)
    • generateHalfFullEllipsoid

      public void generateHalfFullEllipsoid(Map<net.minecraft.util.math.ChunkPos,Set<net.minecraft.util.math.BlockPos>> chunkMap)
    • generateFullEllipsoid

      public void generateFullEllipsoid(Map<net.minecraft.util.math.ChunkPos,Set<net.minecraft.util.math.BlockPos>> chunkMap)
    • generateFullEllipsoid

      public void generateFullEllipsoid(int minX, int maxX, int minY, int maxY, int minZ, int maxZ, Map<net.minecraft.util.math.ChunkPos,Set<net.minecraft.util.math.BlockPos>> chunkMap)
      allow you to generate a full ellipsoid
      Parameters:
      minX - the start of the circle on the x-axis
      maxX - the end of the circle on the x-axis
      minY - the start of the circle on the y-axis
      maxY - the end of the circle on the y-axis
      minZ - the start of the circle on the z-axis
      maxZ - the end of the circle on the z-axis