Class FullBlockListComparator
java.lang.Object
net.rodofire.easierworldcreator.blockdata.blocklist.basic.comparator.BlockListComparator<FullBlockList,net.minecraft.util.Pair<net.minecraft.nbt.NbtCompound,Integer>,FullOrderedBlockListComparator,net.minecraft.util.Pair<net.minecraft.block.BlockState,net.minecraft.nbt.NbtCompound>>
net.rodofire.easierworldcreator.blockdata.blocklist.basic.comparator.FullBlockListComparator
public class FullBlockListComparator
extends BlockListComparator<FullBlockList,net.minecraft.util.Pair<net.minecraft.nbt.NbtCompound,Integer>,FullOrderedBlockListComparator,net.minecraft.util.Pair<net.minecraft.block.BlockState,net.minecraft.nbt.NbtCompound>>
class to manage a list of FullBlockList automatically
-
Field Summary
Fields inherited from class net.rodofire.easierworldcreator.blockdata.blocklist.basic.comparator.BlockListComparator
blockLists, indexes -
Constructor Summary
ConstructorsConstructorDescriptioninit an empty comparatorFullBlockListComparator(List<FullBlockList> fullBlockLists) init a comparatorFullBlockListComparator(FullBlockList fullBlockList) init a comparator -
Method Summary
Modifier and TypeMethodDescriptiongetCleaned(List<FullBlockList> 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, @Nullable net.minecraft.nbt.NbtCompound nbtCompound, 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, @Nullable net.minecraft.nbt.NbtCompound nbtCompound, boolean force, Set<net.minecraft.block.Block> blocksToForce) Method to add a state and a pos to the list.voidput(FullBlockList type) Method to add a state and a pos to the list.Methods inherited from class net.rodofire.easierworldcreator.blockdata.blocklist.basic.comparator.BlockListComparator
contains, get, get, getFirst, getLast, getOrderedSorted, getRandom, getRandom, getSorted, placeAll, placeAllWithDeletion, placeAllWithVerification, placeAllWithVerificationDeletion, put, put, size, sort
-
Constructor Details
-
FullBlockListComparator
init a comparator- Parameters:
fullBlockLists- the list of blockList that will be indexed
-
FullBlockListComparator
init a comparator- Parameters:
fullBlockList- a blockList that will be indexed
-
FullBlockListComparator
public FullBlockListComparator()init an empty comparator
-
-
Method Details
-
initIndexes
protected void initIndexes()method tu initialize the indexes.- Specified by:
initIndexesin classBlockListComparator<FullBlockList,net.minecraft.util.Pair<net.minecraft.nbt.NbtCompound, Integer>, FullOrderedBlockListComparator, net.minecraft.util.Pair<net.minecraft.block.BlockState, net.minecraft.nbt.NbtCompound>>
-
put
public void put(net.minecraft.block.BlockState state, net.minecraft.util.math.BlockPos pos, @Nullable @Nullable net.minecraft.nbt.NbtCompound nbtCompound, 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 usenbtCompound- the nbt data of the block that'll be put
-
put
public void put(net.minecraft.block.BlockState state, List<net.minecraft.util.math.BlockPos> posList, @Nullable @Nullable net.minecraft.nbt.NbtCompound nbtCompound, 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 usenbtCompound- the nbt data of the block that'll be put
-
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 classBlockListComparator<FullBlockList,net.minecraft.util.Pair<net.minecraft.nbt.NbtCompound, Integer>, FullOrderedBlockListComparator, net.minecraft.util.Pair<net.minecraft.block.BlockState, net.minecraft.nbt.NbtCompound>> - Parameters:
type- the BlockList that will be added in the comparator
-
getOrdered
Method to get the ordered version of the comparator- Specified by:
getOrderedin classBlockListComparator<FullBlockList,net.minecraft.util.Pair<net.minecraft.nbt.NbtCompound, Integer>, FullOrderedBlockListComparator, net.minecraft.util.Pair<net.minecraft.block.BlockState, net.minecraft.nbt.NbtCompound>> - 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 classBlockListComparator<FullBlockList,net.minecraft.util.Pair<net.minecraft.nbt.NbtCompound, Integer>, FullOrderedBlockListComparator, net.minecraft.util.Pair<net.minecraft.block.BlockState, net.minecraft.nbt.NbtCompound>> - Parameters:
blockList- the blockList that will bea cleaned- Returns:
- the cleaned version of the list
-