public class TorusGen extends FillableShape
Class to generate Torus 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 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

    • TorusGen

      public TorusGen(@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 innerRadiusX, int outerRadiusX, int innerRadiusZ, int outerRadiusZ)
      init the Torus 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
      innerRadiusX - the radius of the inner circle on the x-axis
      outerRadiusX - the radius of the outer circle on the x-axis
      innerRadiusZ - the radius of the inner circle on the z-axis
      outerRadiusZ - the radius of the outer circle on the z-axis
    • TorusGen

      public TorusGen(@NotNull @NotNull net.minecraft.world.StructureWorldAccess world, @NotNull @NotNull net.minecraft.util.math.BlockPos pos, ShapeBase.PlaceMoment placeMoment, int innerRadius, int outerRadius)
      init the Torus 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
      innerRadius - the radius of the inner circle
      outerRadius - the radius of the outer circle
  • Method Details

    • getInnerRadiusX

      public int getInnerRadiusX()
    • setInnerRadiusX

      public void setInnerRadiusX(int innerRadiusX)
    • getOuterRadiusX

      public int getOuterRadiusX()
    • setOuterRadiusX

      public void setOuterRadiusX(int outerRadiusX)
    • getInnerRadiusZ

      public int getInnerRadiusZ()
    • setInnerRadiusZ

      public void setInnerRadiusZ(int innerRadiusZ)
    • getOuterRadiusZ

      public int getOuterRadiusZ()
    • setOuterRadiusZ

      public void setOuterRadiusZ(int outerRadiusZ)
    • getTorusType

      public TorusGen.TorusType getTorusType()
    • setTorusType

      public void setTorusType(TorusGen.TorusType torusType)
    • getVerticalTorus

      public float getVerticalTorus()
    • setVerticalTorus

      public void setVerticalTorus(float verticalTorus)
    • getHorizontalTorus

      public float getHorizontalTorus()
    • setHorizontalTorus

      public void setHorizontalTorus(float horizontalTorus)
    • 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
    • generateFullTore

      public void generateFullTore(Map<net.minecraft.util.math.ChunkPos,Set<net.minecraft.util.math.BlockPos>> chunkMap)
      generates a full torus / tore with custom filling the shape with the torus might be different from the empty one if you're using custom torus filling
    • generateEmptyTore

      public void generateEmptyTore(Map<net.minecraft.util.math.ChunkPos,Set<net.minecraft.util.math.BlockPos>> chunkMap)
      generates an empty torus the shape with the torus might be different from the full one if you're using custom torus filling
    • getEllipsoidalToreCoordinates

      public net.minecraft.util.math.Vec3d getEllipsoidalToreCoordinates(int u, int v)
    • getInnerRadius

      public double getInnerRadius(int angle)
    • getOuterRadius

      public double getOuterRadius(int angle)