public class LineGen extends AbstractBlockShape
Class to generate Line 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 which resulted in unnecessary calculations. This allow easy multithreading for the Block assignment done in the AbstractBlockShape which result in better performance;

  • Constructor Details

    • LineGen

      public LineGen(@NotNull @NotNull net.minecraft.world.StructureWorldAccess world, @NotNull @NotNull net.minecraft.util.math.BlockPos pos, @NotNull @NotNull AbstractBlockShapeBase.PlaceMoment placeMoment, AbstractBlockShapePlaceType.LayerPlace layerPlace, AbstractBlockShapeLayer.LayersType layersType, int yRotation, int zRotation, int secondYRotation, String featureName, net.minecraft.util.math.BlockPos secondPos)
      init the Line 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
      secondPos - the second pos on which the line has to go
    • LineGen

      public LineGen(@NotNull @NotNull net.minecraft.world.StructureWorldAccess world, @NotNull @NotNull net.minecraft.util.math.BlockPos pos, @NotNull @NotNull AbstractBlockShapeBase.PlaceMoment placeMoment, net.minecraft.util.math.BlockPos secondPos)
      init the Line 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
      secondPos - the second pos on which the line has to go
  • Method Details

    • getSecondPos

      public net.minecraft.util.math.BlockPos getSecondPos()
    • setSecondPos

      public void setSecondPos(net.minecraft.util.math.BlockPos secondPos)
    • getBlockPos

      public List<Set<net.minecraft.util.math.BlockPos>> getBlockPos()
      Description copied from class: AbstractBlockShape
      method to get the coordinates that will be placed later
      Specified by:
      getBlockPos in class AbstractBlockShape
      Returns:
      a list of blockPos for every shape
    • generateAxisLine

      public void generateAxisLine(net.minecraft.util.math.Direction dir, Map<net.minecraft.util.math.ChunkPos,Set<net.minecraft.util.math.BlockPos>> chunkMap)
      this method generates the coordinates
      Parameters:
      dir - the direction of the line
      chunkMap - the map used to get the coordinates
    • drawLine

      public void drawLine(Map<net.minecraft.util.math.ChunkPos,Set<net.minecraft.util.math.BlockPos>> chunkMap)