public class SphereGen extends AbstractFillableBlockShape
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 AbstractBlockShape 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, AbstractBlockShapeBase.PlaceMoment placeMoment, AbstractBlockShapePlaceType.LayerPlace layerPlace, AbstractBlockShapeLayer.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, AbstractBlockShapeBase.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()
      Gets the direction of the half-sphere. * * @return The direction of the half-sphere.
    • setHalfSphereDirection

      public void setHalfSphereDirection(net.minecraft.util.math.Direction direction)
      Sets the direction of the half-sphere. * * @param direction The direction to set.
    • isHalfSphere

      public SphereGen.SphereType isHalfSphere()
      Checks if it is a half sphere. * * @return The type of the half-sphere.
    • setHalfSphere

      public void setHalfSphere(SphereGen.SphereType halfSphere)
      Sets the half-sphere type. * * @param halfSphere The half-sphere type to set.
    • getRadiusX

      public int getRadiusX()
      Gets the X radius of the sphere. * * @return The X radius.
    • setRadiusX

      public void setRadiusX(int radiusX)
      Sets the X radius of the sphere. * * @param radiusX The X radius to set.
    • getRadiusY

      public int getRadiusY()
      Gets the Y radius of the sphere. * * @return The Y radius.
    • setRadiusY

      public void setRadiusY(int radiusY)
      Sets the Y radius of the sphere. * * @param radiusY The Y radius to set.
    • getRadiusZ

      public int getRadiusZ()
      Gets the Z radius of the sphere. * * @return The Z radius.
    • setRadiusZ

      public void setRadiusZ(int radiusZ)
      Sets the Z radius of the sphere. * * @param radiusZ The Z radius to set.
    • getBlockPos

      public Map<net.minecraft.util.math.ChunkPos,Set<net.minecraft.util.math.BlockPos>> getBlockPos()
      Description copied from class: AbstractBlockShape
      method to get the coordinates that will be placed later
      Specified by:
      getBlockPos in class AbstractBlockShape
      Returns:
      a map of ChunkPos of blockPos for every shape
    • getSphereCoordinates

      public Map<net.minecraft.util.math.ChunkPos,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