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

    • TorusGen

      public TorusGen(@NotNull @NotNull net.minecraft.world.StructureWorldAccess world, @NotNull @NotNull net.minecraft.util.math.BlockPos pos, Shape.PlaceMoment placeMoment, int innerRadius, int outerRadius)
    • TorusGen

      public TorusGen(@NotNull @NotNull net.minecraft.world.StructureWorldAccess world, @NotNull @NotNull net.minecraft.util.math.BlockPos pos, Shape.PlaceMoment placeMoment, List<BlockLayer> layers, boolean force, List<net.minecraft.block.Block> blocksToForce, int xrotation, int yrotation, int secondxrotation, int innerRadius, int outerRadius)
  • 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()
      Specified by:
      getBlockPos in class Shape
    • getVec3d

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

      public void generateFullTore(Map<net.minecraft.util.math.ChunkPos,Set<net.minecraft.util.math.BlockPos>> chunkMap)
      generates a full tore / 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)