java.lang.Object
net.rodofire.easierworldcreator.blockdata.blocklist.basic.comparator.BlockListComparator<CompoundBlockList,net.minecraft.util.Pair<net.minecraft.nbt.NbtCompound,Integer>,CompoundOrderedBlockListComparator,net.minecraft.util.Pair<net.minecraft.block.BlockState,net.minecraft.nbt.NbtCompound>>
net.rodofire.easierworldcreator.blockdata.blocklist.basic.comparator.CompoundBlockListComparator

public class CompoundBlockListComparator extends BlockListComparator<CompoundBlockList,net.minecraft.util.Pair<net.minecraft.nbt.NbtCompound,Integer>,CompoundOrderedBlockListComparator,net.minecraft.util.Pair<net.minecraft.block.BlockState,net.minecraft.nbt.NbtCompound>>
class to manage a list of Compound BlockList automatically
  • Constructor Details

    • CompoundBlockListComparator

      public CompoundBlockListComparator(List<CompoundBlockList> compoundBlockLists)
      init a comparator
      Parameters:
      compoundBlockLists - the list of blockList that will be indexed
    • CompoundBlockListComparator

      public CompoundBlockListComparator(CompoundBlockList compoundBlockList)
      init a comparator
      Parameters:
      compoundBlockList - a blockList that will be indexed
    • CompoundBlockListComparator

      public CompoundBlockListComparator()
      init an empty comparator
  • Method Details

    • initIndexes

      protected void initIndexes()
      method tu initialize the indexes.
      Specified by:
      initIndexes in class BlockListComparator<CompoundBlockList,net.minecraft.util.Pair<net.minecraft.nbt.NbtCompound,Integer>,CompoundOrderedBlockListComparator,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)
      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 tested
      pos - the pos that you want to use
      nbtCompound - 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)
      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 tested
      posList - the list of pos that you want to use
      nbtCompound - the nbt data of the block that'll be put
    • put

      public void put(CompoundBlockList type)
      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:
      put in class BlockListComparator<CompoundBlockList,net.minecraft.util.Pair<net.minecraft.nbt.NbtCompound,Integer>,CompoundOrderedBlockListComparator,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:
      getOrdered in class BlockListComparator<CompoundBlockList,net.minecraft.util.Pair<net.minecraft.nbt.NbtCompound,Integer>,CompoundOrderedBlockListComparator,net.minecraft.util.Pair<net.minecraft.block.BlockState,net.minecraft.nbt.NbtCompound>>
      Returns:
      the ordered version
    • getCleaned

      public List<CompoundBlockList> getCleaned(List<CompoundBlockList> blockList)

      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:
      getCleaned in class BlockListComparator<CompoundBlockList,net.minecraft.util.Pair<net.minecraft.nbt.NbtCompound,Integer>,CompoundOrderedBlockListComparator,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