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 return 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

    • CylinderGen

      public CylinderGen(@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 radiusZ, int height)
      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 of the cylinder on the x-axis
      radiusZ - the radius of the cylinder on the z-axis
      height - the height of the cylinder
    • CylinderGen

      public CylinderGen(@NotNull @NotNull net.minecraft.world.StructureWorldAccess world, @NotNull @NotNull net.minecraft.util.math.BlockPos pos, ShapeBase.PlaceMoment placeMoment, int radius, int height)
      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
      radius - the radius of the cylinder
      height - the height of the cylinder
  • 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