Package fr.rodofire.ewc.blockdata.sorter
Class BlockSorter
java.lang.Object
fr.rodofire.ewc.blockdata.sorter.BlockSorter
method to sort BlockPos depending on a parameter
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumenum to decide how the order of the blocks -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionnet.minecraft.world.phys.Vec3Returns the axis direction used in the animation.net.minecraft.core.BlockPosReturns the central point of the structure.getType()method to get the type of sortervoidsetAxisDirection(net.minecraft.world.phys.Vec3 axisDirection) Sets the axis direction used in the animation.voidsetCenterPoint(net.minecraft.core.BlockPos centerPoint) Sets the central point of the structure.voidmethod to set a random sorter typevoidMethod to set the type of the sorterit.unimi.dsi.fastutil.longs.LongArrayListsortBlockPos(it.unimi.dsi.fastutil.longs.LongArrayList posList) Method to sort the list depending on theanimatorType.List<net.minecraft.core.BlockPos> sortBlockPos(List<net.minecraft.core.BlockPos> posList) Method to sort the list depending on theanimatorType.voidsortInsideBlockList(BlockListManager manager) Method to sort the list depending on theanimatorType.sortOrderedBlockList(OrderedBlockListManager orderedBlockList) Method to sort the list depending on theanimatorType.
-
Constructor Details
-
BlockSorter
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
method to get the type of sorter- Returns:
- the type enum of the sorter
-
setType
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
Method to sort the list depending on theanimatorType.- 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 theanimatorType.- Parameters:
posList- the list of BlockPos that will be sorted- Returns:
- the sorted list
-
sortInsideBlockList
Method to sort the list depending on theanimatorType. The method will only modify eachList<BLockPos>in every BlockList. If you want to force the method so that every blockPos getSorted, seesortInsideBlockList()- Parameters:
manager- the manager that will sort the BlockPos of the blockList
-
sortOrderedBlockList
Method to sort the list depending on theanimatorType. 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
-