Class BlockSorter
java.lang.Object
net.rodofire.easierworldcreator.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.util.math.Vec3dReturns the axis direction used in the animation.net.minecraft.util.math.BlockPosReturns the central point of the structure.getType()method to get the type of sortervoidsetAxisDirection(net.minecraft.util.math.Vec3d axisDirection) Sets the axis direction used in the animation.voidsetCenterPoint(net.minecraft.util.math.BlockPos centerPoint) Sets the central point of the structure.voidmethod to set a random sorter typevoidMethod to set the type of the sorter<W extends AbstractOrderedBlockListComparator<U>,U>
WsortBlockList(W defaultBlockList) Method to sort the list depending on theanimatorType.List<net.minecraft.util.math.BlockPos> sortBlockPos(List<net.minecraft.util.math.BlockPos> posList) Method to sort the list depending on theanimatorType.<T extends DefaultBlockList>
voidsortInsideBlockList(List<T> blockListShapeManager) 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.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
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
public List<net.minecraft.util.math.BlockPos> sortBlockPos(List<net.minecraft.util.math.BlockPos> 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()- Type Parameters:
T- the object extending defaultBlockList- Parameters:
blockListShapeManager- the list of BlockList that will be sorted
-
sortBlockList
Method to sort the list depending on theanimatorType. The method will sort every blockPos of the BlockList and will return the related class to- Type Parameters:
W- the object related to the orderedBlockListComparatorU- 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
-