Class BlockSorter

java.lang.Object
fr.rodofire.ewc.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.core.BlockPos getCenterPoint()
      Returns the central point of the structure.
      Returns:
      the center point as a BlockPos object.
    • setCenterPoint

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

      public net.minecraft.world.phys.Vec3 getAxisDirection()
      Returns the axis direction used in the animation.
      Returns:
      the axis direction as a Vec3 object.
    • setAxisDirection

      public void setAxisDirection(net.minecraft.world.phys.Vec3 axisDirection)
      Sets the axis direction used in the animation.
      Parameters:
      axisDirection - the axis direction as a Vec3 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.core.BlockPos> sortBlockPos(List<net.minecraft.core.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
    • sortBlockPos

      public it.unimi.dsi.fastutil.longs.LongArrayList sortBlockPos(it.unimi.dsi.fastutil.longs.LongArrayList 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 void sortInsideBlockList(BlockListManager manager)
      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()
      Parameters:
      manager - the manager that will sort the BlockPos of the blockList
    • sortOrderedBlockList

      public OrderedBlockListManager sortOrderedBlockList(OrderedBlockListManager orderedBlockList)
      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
      Parameters:
      orderedBlockList - the list of BlockList that will be sorted