Class CompoundOrderedBlockListComparator
java.lang.Object
net.rodofire.easierworldcreator.blockdata.blocklist.ordered.comparator.OrderedBlockListComparator<net.minecraft.util.Pair<net.minecraft.block.BlockState,net.minecraft.nbt.NbtCompound>>
net.rodofire.easierworldcreator.blockdata.blocklist.ordered.comparator.CompoundOrderedBlockListComparator
- Direct Known Subclasses:
FullOrderedBlockListComparator
public class CompoundOrderedBlockListComparator
extends OrderedBlockListComparator<net.minecraft.util.Pair<net.minecraft.block.BlockState,net.minecraft.nbt.NbtCompound>>
CompoundOrderedBlockListComparator. The class provides the ability to add Nbt Compounds to the order blockList comparator
-
Field Summary
Fields inherited from class net.rodofire.easierworldcreator.blockdata.blocklist.ordered.comparator.OrderedBlockListComparator
posMap, statesMap -
Constructor Summary
ConstructorsConstructorDescriptioninit an empty Compound ComparatorCompoundOrderedBlockListComparator(Map<net.minecraft.util.Pair<net.minecraft.block.BlockState, net.minecraft.nbt.NbtCompound>, List<net.minecraft.util.math.BlockPos>> info) init a comparatorCompoundOrderedBlockListComparator(net.minecraft.util.Pair<net.minecraft.block.BlockState, net.minecraft.nbt.NbtCompound> state, List<net.minecraft.util.math.BlockPos> posList) init a default ordered blockList comparator -
Method Summary
Modifier and TypeMethodDescriptionnet.minecraft.block.BlockStategetBlockState(short index) method to get the blockState related to the indexSet<net.minecraft.block.BlockState> Method to get the set of BlockStates that are saved in the comparatornet.minecraft.nbt.NbtCompoundgetCompound(short index) method to get the blockState related to the indexSet<net.minecraft.nbt.NbtCompound> Method to get the set of compound that are saved in the comparatornet.minecraft.block.BlockStateMethod to get the first BlockStatenet.minecraft.nbt.NbtCompoundMethod to get the first BlockStatenet.minecraft.util.Pair<net.minecraft.block.BlockState, net.minecraft.nbt.NbtCompound> Method to get the first Pairnet.minecraft.block.BlockStateMethod to get the last BlockStatenet.minecraft.nbt.NbtCompoundMethod to get the last BlockStatenet.minecraft.util.Pair<net.minecraft.block.BlockState, net.minecraft.nbt.NbtCompound> Method to get the last Pairnet.minecraft.util.Pair<net.minecraft.block.BlockState, net.minecraft.nbt.NbtCompound> getPair(short index) method to get the Pair related to the indexList<net.minecraft.util.Pair<net.minecraft.block.BlockState, net.minecraft.nbt.NbtCompound>> getPairs()Method to get the Set of pair that are saved in the comparatorvoidplace(net.minecraft.world.StructureWorldAccess world, int index) method to place the Block related to the indexvoidplaceFirst(net.minecraft.world.StructureWorldAccess world) method to place the first BlockvoidplaceFirstWithDeletion(net.minecraft.world.StructureWorldAccess world) Method to place the first Block and deleting it.booleanplaceFirstWithVerification(net.minecraft.world.StructureWorldAccess world) Method to place the first Block.booleanplaceFirstWithVerificationDeletion(net.minecraft.world.StructureWorldAccess world) Method to place the first Block and deleting it.voidplaceLast(net.minecraft.world.StructureWorldAccess world) Method to place the last Block of the comparator.voidplaceLastWithDeletion(net.minecraft.world.StructureWorldAccess world) Method to place the last Block of the comparator and removing it then.booleanplaceLastWithVerification(net.minecraft.world.StructureWorldAccess world) Method to place the last Block.booleanplaceLastWithVerificationDeletion(net.minecraft.world.StructureWorldAccess world) Method to place the last Block of the comparator and removing it then.voidplaceWithDeletion(net.minecraft.world.StructureWorldAccess world, int index) method to place the block with the deletion of the BlockPosbooleanplaceWithVerification(net.minecraft.world.StructureWorldAccess world, int index) Method to place the block related to the index.booleanplaceWithVerificationDeletion(net.minecraft.world.StructureWorldAccess world, int index) Method to place the block with the deletion of the BlockPos The method also performs verification to know if the block can be placed.voidput(CompoundOrderedBlockListComparator comparator) Methods inherited from class net.rodofire.easierworldcreator.blockdata.blocklist.ordered.comparator.OrderedBlockListComparator
arePosEmpty, getBlockPos, getBlockPos, getBlockPos, getBlockPosSet, getFirstBlockPos, getFirstPosPair, getLastBlockPos, getLastPosPair, getPosList, getPosMap, getPosPair, getRandomBlockPos, getRandomBlockPos, getStateIndex, getStatesMap, getT, isPosEmpty, isPresent, isPresent, isStateEmpty, posSize, put, put, put, putAll, removeAll, removeBlockPos, removeBlockPos, removeBlockPos, removeBlockPosPair, removeFirstBlockPos, removeFirstPos, removeLastBlockPosPair, removeState, removeState, replaceState, setPosList, setPosMap, stateSize
-
Constructor Details
-
CompoundOrderedBlockListComparator
public CompoundOrderedBlockListComparator(net.minecraft.util.Pair<net.minecraft.block.BlockState, net.minecraft.nbt.NbtCompound> state, List<net.minecraft.util.math.BlockPos> posList) init a default ordered blockList comparator- Parameters:
state- the pair of state and NbtCompound that will be tested and put (in the case it doesn't exist)posList- the blockPos that will be put related to the given state
-
CompoundOrderedBlockListComparator
public CompoundOrderedBlockListComparator(Map<net.minecraft.util.Pair<net.minecraft.block.BlockState, net.minecraft.nbt.NbtCompound>, List<net.minecraft.util.math.BlockPos>> info) init a comparator- Parameters:
info- the map that will be used to init the comparator
-
CompoundOrderedBlockListComparator
public CompoundOrderedBlockListComparator()init an empty Compound Comparator
-
-
Method Details
-
put
-
getPairs
public List<net.minecraft.util.Pair<net.minecraft.block.BlockState,net.minecraft.nbt.NbtCompound>> getPairs()Method to get the Set of pair that are saved in the comparator- Returns:
- the list of pair
-
getPair
public net.minecraft.util.Pair<net.minecraft.block.BlockState,net.minecraft.nbt.NbtCompound> getPair(short index) method to get the Pair related to the index- Parameters:
index- the index of the Pair- Returns:
- the Pair related to the index
-
getFirstPair
public net.minecraft.util.Pair<net.minecraft.block.BlockState,net.minecraft.nbt.NbtCompound> getFirstPair()Method to get the first Pair- Returns:
- the first Pair
-
getLastPair
public net.minecraft.util.Pair<net.minecraft.block.BlockState,net.minecraft.nbt.NbtCompound> getLastPair()Method to get the last Pair- Returns:
- the last Pair
-
getBlockStates
Method to get the set of BlockStates that are saved in the comparator- Returns:
- the set of blockStates
-
getBlockState
public net.minecraft.block.BlockState getBlockState(short index) method to get the blockState related to the index- Parameters:
index- the index of the BlockState- Returns:
- the blockState related to the index
-
getFirstBlockState
public net.minecraft.block.BlockState getFirstBlockState()Method to get the first BlockState- Returns:
- the first BlockState
-
getLastBlockState
public net.minecraft.block.BlockState getLastBlockState()Method to get the last BlockState- Returns:
- the last BlockState
-
getCompounds
Method to get the set of compound that are saved in the comparator- Returns:
- the set of compound
-
getCompound
public net.minecraft.nbt.NbtCompound getCompound(short index) method to get the blockState related to the index- Parameters:
index- the index of the BlockState- Returns:
- the blockState related to the index
-
getFirstCompound
public net.minecraft.nbt.NbtCompound getFirstCompound()Method to get the first BlockState- Returns:
- the first BlockState
-
getLastCompound
public net.minecraft.nbt.NbtCompound getLastCompound()Method to get the last BlockState- Returns:
- the last BlockState
-
place
public void place(net.minecraft.world.StructureWorldAccess world, int index) method to place the Block related to the index- Specified by:
placein classOrderedBlockListComparator<net.minecraft.util.Pair<net.minecraft.block.BlockState,net.minecraft.nbt.NbtCompound>> - Parameters:
world- the world the block will be placedindex- the index of the BlockPos
-
placeWithDeletion
public void placeWithDeletion(net.minecraft.world.StructureWorldAccess world, int index) method to place the block with the deletion of the BlockPos- Specified by:
placeWithDeletionin classOrderedBlockListComparator<net.minecraft.util.Pair<net.minecraft.block.BlockState,net.minecraft.nbt.NbtCompound>> - Parameters:
world- the world the block will be placedindex- the index of the block
-
placeWithVerification
public boolean placeWithVerification(net.minecraft.world.StructureWorldAccess world, int index) Method to place the block related to the index. The method also performs verification to know if the block can be placed.- Specified by:
placeWithVerificationin classOrderedBlockListComparator<net.minecraft.util.Pair<net.minecraft.block.BlockState,net.minecraft.nbt.NbtCompound>> - Parameters:
world- the world the block will be placedindex- the index of the block- Returns:
- true if the block was placed, false if not
-
placeWithVerificationDeletion
public boolean placeWithVerificationDeletion(net.minecraft.world.StructureWorldAccess world, int index) Method to place the block with the deletion of the BlockPos The method also performs verification to know if the block can be placed.- Specified by:
placeWithVerificationDeletionin classOrderedBlockListComparator<net.minecraft.util.Pair<net.minecraft.block.BlockState,net.minecraft.nbt.NbtCompound>> - Parameters:
world- the world the block will be placedindex- the index of the block- Returns:
- true if the block was placed, false if not
-
placeFirst
public void placeFirst(net.minecraft.world.StructureWorldAccess world) method to place the first Block- Specified by:
placeFirstin classOrderedBlockListComparator<net.minecraft.util.Pair<net.minecraft.block.BlockState,net.minecraft.nbt.NbtCompound>> - Parameters:
world- the world the block will be placed
-
placeFirstWithDeletion
public void placeFirstWithDeletion(net.minecraft.world.StructureWorldAccess world) Method to place the first Block and deleting it. You shouldn't use this method in normal case since that the method is pretty costly O(n). Use insteadplaceLastWithDeletion()that is faster O(1).- Specified by:
placeFirstWithDeletionin classOrderedBlockListComparator<net.minecraft.util.Pair<net.minecraft.block.BlockState,net.minecraft.nbt.NbtCompound>> - Parameters:
world- the world where the block will be placed
-
placeFirstWithVerification
public boolean placeFirstWithVerification(net.minecraft.world.StructureWorldAccess world) Method to place the first Block.The method also performs verification to know if the block can be placed.
- Specified by:
placeFirstWithVerificationin classOrderedBlockListComparator<net.minecraft.util.Pair<net.minecraft.block.BlockState,net.minecraft.nbt.NbtCompound>> - Parameters:
world- the world where the block will be placed- Returns:
- true if the block was placed, false if not.
-
placeFirstWithVerificationDeletion
public boolean placeFirstWithVerificationDeletion(net.minecraft.world.StructureWorldAccess world) Method to place the first Block and deleting it.
The method also performs verification to know if the block can be placed.
You shouldn't use this method in normal case since that the method is pretty costly O(n).
Use instead
placeLastWithDeletion()that is faster O(1).- Specified by:
placeFirstWithVerificationDeletionin classOrderedBlockListComparator<net.minecraft.util.Pair<net.minecraft.block.BlockState,net.minecraft.nbt.NbtCompound>> - Parameters:
world- the world where the block will be placed- Returns:
- true if the block was placed, false if not.
-
placeLastWithDeletion
public void placeLastWithDeletion(net.minecraft.world.StructureWorldAccess world) Method to place the last Block of the comparator and removing it then. Consider using this method because it gives you better performance.- Specified by:
placeLastWithDeletionin classOrderedBlockListComparator<net.minecraft.util.Pair<net.minecraft.block.BlockState,net.minecraft.nbt.NbtCompound>> - Parameters:
world- the world the last block will be placed
-
placeLast
public void placeLast(net.minecraft.world.StructureWorldAccess world) Method to place the last Block of the comparator.- Specified by:
placeLastin classOrderedBlockListComparator<net.minecraft.util.Pair<net.minecraft.block.BlockState,net.minecraft.nbt.NbtCompound>> - Parameters:
world- the world the last block will be placed
-
placeLastWithVerification
public boolean placeLastWithVerification(net.minecraft.world.StructureWorldAccess world) Method to place the last Block.- Specified by:
placeLastWithVerificationin classOrderedBlockListComparator<net.minecraft.util.Pair<net.minecraft.block.BlockState,net.minecraft.nbt.NbtCompound>> - Parameters:
world- the world the last block will be placed The method also performs verification to know if the block can be placed.- Returns:
- true if the block was placed, false if not
-
placeLastWithVerificationDeletion
public boolean placeLastWithVerificationDeletion(net.minecraft.world.StructureWorldAccess world) Method to place the last Block of the comparator and removing it then. The method also performs verification to know if the block can be placed. Consider using this method because it gives you better performance.- Specified by:
placeLastWithVerificationDeletionin classOrderedBlockListComparator<net.minecraft.util.Pair<net.minecraft.block.BlockState,net.minecraft.nbt.NbtCompound>> - Parameters:
world- the world the last block will be placed- Returns:
- true if the block was placed, false if not
-