Class ForceBlockListComparator
java.lang.Object
net.rodofire.easierworldcreator.blockdata.blocklist.basic.comparator.AbstractBlockListComparator<ForceBlockList,Integer,ForceOrderedBlockListComparator,net.minecraft.block.BlockState>
net.rodofire.easierworldcreator.blockdata.blocklist.basic.comparator.ForceBlockListComparator
public class ForceBlockListComparator
extends AbstractBlockListComparator<ForceBlockList,Integer,ForceOrderedBlockListComparator,net.minecraft.block.BlockState>
class to manage a list of FullBlockList automatically
-
Field Summary
Fields inherited from class net.rodofire.easierworldcreator.blockdata.blocklist.basic.comparator.AbstractBlockListComparator
blockLists, indexes -
Constructor Summary
ConstructorsConstructorDescriptioninit an empty comparatorForceBlockListComparator(List<ForceBlockList> forceBlockList) init a comparatorForceBlockListComparator(ForceBlockListComparator comparator) init a comparatorForceBlockListComparator(ForceBlockList forceBlockList) init a comparator -
Method Summary
Modifier and TypeMethodDescriptiongetCleaned(List<ForceBlockList> blockList) Method to clean a blockList.Method to get the ordered version of the comparatorprotected voidmethod tu initialize the indexes.voidput(net.minecraft.block.BlockState state, List<net.minecraft.util.math.BlockPos> posList, boolean force, Set<net.minecraft.block.Block> blocksToForce) Method to add a state and a pos to the list.voidput(net.minecraft.block.BlockState state, net.minecraft.util.math.BlockPos pos, boolean force, Set<net.minecraft.block.Block> blocksToForce) Method to add a state and a pos to the list.voidput(ForceBlockList type) Method to add a state and a pos to the list.Methods inherited from class net.rodofire.easierworldcreator.blockdata.blocklist.basic.comparator.AbstractBlockListComparator
contains, get, get, getFirst, getLast, getOrderedSorted, getRandom, getRandom, getSorted, placeAll, placeAllWithDeletion, placeAllWithVerification, placeAllWithVerificationDeletion, put, put, put, size, sort, toString
-
Constructor Details
-
ForceBlockListComparator
init a comparator- Parameters:
comparator- the comparator that will be fused
-
ForceBlockListComparator
init a comparator- Parameters:
forceBlockList- the list of blockList that will be indexed
-
ForceBlockListComparator
init a comparator- Parameters:
forceBlockList- a blockList that will be indexed
-
ForceBlockListComparator
public ForceBlockListComparator()init an empty comparator
-
-
Method Details
-
initIndexes
protected void initIndexes()method tu initialize the indexes.- Specified by:
initIndexesin classAbstractBlockListComparator<ForceBlockList,Integer, ForceOrderedBlockListComparator, net.minecraft.block.BlockState>
-
put
public void put(net.minecraft.block.BlockState state, net.minecraft.util.math.BlockPos pos, boolean force, Set<net.minecraft.block.Block> blocksToForce) Method to add a state and a pos to the list. If the state already exists, no blockList will be created. The method will also update the indexes- Parameters:
state- the state that will be testedpos- the pos that you want to use
-
put
public void put(net.minecraft.block.BlockState state, List<net.minecraft.util.math.BlockPos> posList, boolean force, Set<net.minecraft.block.Block> blocksToForce) Method to add a state and a pos to the list. If the state already exists, no blockList will be created. The method will also update the indexes- Parameters:
state- the state that will be testedposList- the list of pos that you want to use
-
put
Method to add a state and a pos to the list. If the state already exists, no blockList will be created. The method will also update the indexes- Specified by:
putin classAbstractBlockListComparator<ForceBlockList,Integer, ForceOrderedBlockListComparator, net.minecraft.block.BlockState> - Parameters:
type- the BlockList that will be added in the comparator
-
getOrdered
Method to get the ordered version of the comparator- Specified by:
getOrderedin classAbstractBlockListComparator<ForceBlockList,Integer, ForceOrderedBlockListComparator, net.minecraft.block.BlockState> - Returns:
- the ordered version
-
getCleaned
Method to clean a blockList.
In the case, there are multiple common BlockState.
All the blockPos common of a BlockState will be fused in a single BlockState
- Specified by:
getCleanedin classAbstractBlockListComparator<ForceBlockList,Integer, ForceOrderedBlockListComparator, net.minecraft.block.BlockState> - Parameters:
blockList- the blockList that will bea cleaned- Returns:
- the cleaned version of the list
-