Class CylinderGen


public class CylinderGen extends FillableShape
Class to generate Sphere related shapes the methods in this class basically stack multiple circles to generate a cylinder

- 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 wich resulted in unnecessary calculations.

this allow easy multithreading for the Block assignment done in the Shape which result in better performance;

  • Constructor Details

    • CylinderGen

      public CylinderGen(@NotNull @NotNull net.minecraft.world.StructureWorldAccess world, @NotNull @NotNull net.minecraft.util.math.BlockPos pos, Shape.PlaceMoment placeMoment, int radius, int height)
    • CylinderGen

      @Deprecated(forRemoval=true) public CylinderGen(@NotNull @NotNull net.minecraft.world.StructureWorldAccess world, @NotNull @NotNull net.minecraft.util.math.BlockPos pos, int radius, int height, Shape.PlaceMoment placeMoment)
      Deprecated, for removal: This API element is subject to removal in a future version.
  • Method Details

    • setHeight

      public void setHeight(int height)
    • getHeight

      public int getHeight()
    • setRadiusX

      public void setRadiusX(int radius)
    • getRadiusX

      public int getRadiusX()
    • setRadiusZ

      public void setRadiusZ(int radius)
    • getRadiusZ

      public int getRadiusZ()
    • 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
    • generateCylinder

      public List<Set<net.minecraft.util.math.BlockPos>> generateCylinder()
    • generateFullCylinder

      public void generateFullCylinder(Map<net.minecraft.util.math.ChunkPos,Set<net.minecraft.util.math.BlockPos>> chunkMap)
      this generates a full cylinder
    • generateEmptyCylinder

      public void generateEmptyCylinder(Map<net.minecraft.util.math.ChunkPos,Set<net.minecraft.util.math.BlockPos>> chunkMap)
      this generates a full cylinder
    • 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