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<net.minecraft.util.math.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 wich 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, int radiusx, List<BlockLayer> layers, int radiusy, int radiusz, int xrotation, int yrotation, int seconxrotation, boolean force, List<net.minecraft.block.Block> blockToForce, boolean halfSphere, net.minecraft.util.math.Direction direction, Shape.PlaceMoment placeMoment)
      init the shape generation
      Parameters:
      world - the world the shape will be generated
      pos - the pos of the structure center
      radiusx - the radius along the x-axis
      radiusy - the radius along the y-axis
      radiusz - the radius along the z axis
      xrotation - the rotation along the x-axis
      yrotation - the rotation along the y-axis
    • SphereGen

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

    • 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()
      Specified by:
      getBlockPos in class Shape
    • getVec3d

      public List<net.minecraft.util.math.Vec3d> getVec3d()
      Specified by:
      getVec3d in class Shape
    • getCircleCoordinates

      public List<Set<net.minecraft.util.math.BlockPos>> getCircleCoordinates()
    • generateHalfEmptyElipsoid

      public void generateHalfEmptyElipsoid(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)
    • generateHalfFullElipsoid

      public void generateHalfFullElipsoid(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 elipsoid
      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