java.lang.Object
net.rodofire.easierworldcreator.blockdata.sorter.BlockSorter

public class BlockSorter extends Object
method to sort BlockPos depending on a parameter
  • Constructor Details

    • BlockSorter

      public BlockSorter(BlockSorter.BlockSorterType type)
      Constructor of the object
      Parameters:
      type - the type enum that decide how the List will get sorted
  • Method Details

    • getCenterPoint

      public net.minecraft.util.math.BlockPos getCenterPoint()
      Returns the central point of the structure.
      Returns:
      the center point as a BlockPos object.
    • setCenterPoint

      public void setCenterPoint(net.minecraft.util.math.BlockPos centerPoint)
      Sets the central point of the structure.
      Parameters:
      centerPoint - the center point as a BlockPos object.
    • getAxisDirection

      public net.minecraft.util.math.Vec3d getAxisDirection()
      Returns the axis direction used in the animation.
      Returns:
      the axis direction as a Vec3d object.
    • setAxisDirection

      public void setAxisDirection(net.minecraft.util.math.Vec3d axisDirection)
      Sets the axis direction used in the animation.
      Parameters:
      axisDirection - the axis direction as a Vec3d object.
    • getType

      public BlockSorter.BlockSorterType getType()
      method to get the type of sorter
      Returns:
      the type enum of the sorter
    • setType

      public void setType(BlockSorter.BlockSorterType type)
      Method to set the type of the sorter
      Parameters:
      type - the type of the sorter
    • setRandomSorter

      public void setRandomSorter()
      method to set a random sorter type
    • sortBlockPos

      public List<net.minecraft.util.math.BlockPos> sortBlockPos(List<net.minecraft.util.math.BlockPos> posList)
      Method to sort the list depending on the animatorType.
      Parameters:
      posList - the list of BlockPos that will be sorted
      Returns:
      the sorted list
    • sortInsideBlockList

      public <T extends DefaultBlockList> void sortInsideBlockList(List<T> blockListShapeManager)
      Method to sort the list depending on the animatorType. The method will only modify each List<BLockPos> in every BlockList. If you want to force the method so that every blockPos getSorted, see sortInsideBlockList()
      Type Parameters:
      T - the object extending defaultBlockList
      Parameters:
      blockListShapeManager - the list of BlockList that will be sorted
    • sortBlockList

      public <W extends OrderedBlockListComparator<U>, U> W sortBlockList(W defaultBlockList)
      Method to sort the list depending on the animatorType. The method will sort every blockPos of the BlockList and will return the related class to
      Type Parameters:
      W - the object related to the orderedBlockListComparator
      U - the data of the block, for example, the blockState or the NbtCompounds
      Parameters:
      defaultBlockList - the list of BlockList that will be sorted
      Returns:
      a list of W of BlockStates and BlockPos