Class SpiralGen

java.lang.Object
net.rodofire.easierworldcreator.shapeutil.Shape
net.rodofire.easierworldcreator.shapegen.SpiralGen

public class SpiralGen extends Shape
Class to generate Spiral related shapes

Since 2.1.0, the shape doesn't return a List<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

    • SpiralGen

      public SpiralGen(@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, net.minecraft.util.Pair<Integer,Integer> radiusx, net.minecraft.util.Pair<Integer,Integer> radiusz, int height, float turnNumber)
      Parameters:
      world - the world the spiral will spawn in
      pos - the center of the spiral
      layers - a list of layers that will be used for the structure
      force - boolean to force the pos of the blocks
      blocksToForce - a list of blocks that the blocks of the spiral can still force if force = false
      xrotation - first rotation around the x-axis
      yrotation - second rotation around the y-axis
      secondxrotation - last rotation around the x-axis
      radiusx - the radius of the x-axis
      radiusz - the radius of the z-axis
      height - the height of the spiral
      turnNumber - the number of turns that the structure will do before reaching the top
    • SpiralGen

      public SpiralGen(@NotNull @NotNull net.minecraft.world.StructureWorldAccess world, @NotNull @NotNull net.minecraft.util.math.BlockPos pos, Shape.PlaceMoment placeMoment, int radius, int height)
      Parameters:
      world - the world the spiral will spawn in
      pos - the center of the spiral
      radius - the radius of the spiral
      height - the height of the spiral
  • Method Details

    • getOutlineRadiusz

      public int getOutlineRadiusz()
    • setOutlineRadiusz

      public void setOutlineRadiusz(int outlineRadiusz)
    • getOutlineRadiusx

      public int getOutlineRadiusx()
    • setOutlineRadiusx

      public void setOutlineRadiusx(int outlineRadiusx)
    • getSpiralFilling

      public float getSpiralFilling()
    • setSpiralFilling

      public void setSpiralFilling(float spiralFilling)
    • getSpiralType

      public SpiralGen.SpiralType getSpiralType()
    • setSpiralType

      public void setSpiralType(SpiralGen.SpiralType spiralType)
    • getHeight

      public int getHeight()
    • setHeight

      public void setHeight(int height)
    • getRadiusz

      public net.minecraft.util.Pair<Integer,Integer> getRadiusz()
    • getStartRadiusZ

      public int getStartRadiusZ()
    • getStartRadiusX

      public int getStartRadiusX()
    • getEndRadiusZ

      public int getEndRadiusZ()
    • getEndRadiusX

      public int getEndRadiusX()
    • setRadiusz

      public void setRadiusz(net.minecraft.util.Pair<Integer,Integer> radiusz)
    • getRadiusx

      public net.minecraft.util.Pair<Integer,Integer> getRadiusx()
    • setRadiusx

      public void setRadiusx(net.minecraft.util.Pair<Integer,Integer> radiusx)
    • setEndRadiusX

      public void setEndRadiusX(int endRadiusX)
    • setEndRadiusZ

      public void setEndRadiusZ(int endRadiusZ)
    • setStartRadiusX

      public void setStartRadiusX(int startRadiusX)
    • setStartRadiusZ

      public void setStartRadiusZ(int startRadiusZ)
    • getTurnNumber

      public float getTurnNumber()
    • setTurnNumber

      public void setTurnNumber(float turnNumber)
    • getOffset

      public int getOffset()
    • setOffset

      public void setOffset(int offset)
      Parameters:
      offset - the offset of the start of the spiral
    • getHelicoidAngle

      public net.minecraft.util.Pair<Integer,Integer> getHelicoidAngle()
    • setHelicoidAngle

      public void setHelicoidAngle(net.minecraft.util.Pair<Integer,Integer> helicoidAngle)
      Parameters:
      helicoidAngle - the start and the end angle of the blocks on the side
    • 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
    • generateElipsoidSpiral

      public void generateElipsoidSpiral(net.minecraft.util.math.BlockPos pos, Map<net.minecraft.util.math.ChunkPos,Set<net.minecraft.util.math.BlockPos>> chunkMap)
      generates a simple spiral
      Parameters:
      pos - the center of the spiral. This can be changed to match certain needing like when generating a large outline
    • generateLargeOutlineSpiral

      public void generateLargeOutlineSpiral(Map<net.minecraft.util.math.ChunkPos,Set<net.minecraft.util.math.BlockPos>> chunkMap)
      this allow the generation of a large outline spiral.
    • generateHelicoid

      public void generateHelicoid(Map<net.minecraft.util.math.ChunkPos,Set<net.minecraft.util.math.BlockPos>> chunkMap)
      generates an helicoid if the SpiralGen.SpiralType is set to HELICOID or DOUBLE_HELICOID with their variants
    • getXradius

      public float getXradius(float percentage)
      this method returns the xradius depending of the height we are at
      Parameters:
      percentage - the percentage of the height we are at
      Returns:
      the x radius of the spiral
    • getZradius

      public float getZradius(float percentage)
      this method returns the zradius depending of the height we are at
      Parameters:
      percentage - the percentage of the height we are at
      Returns:
      the x radius of the spiral
    • getAngle

      public int getAngle(float percentage)
      this method returns the helicoidAngle depending of the height we are at
      Parameters:
      percentage - the percentage of the height we are at
      Returns:
      the angle of the spiral