java.lang.Object
net.rodofire.easierworldcreator.blockdata.blocklist.basic.comparator.BlockListComparator<DefaultBlockList,Integer,DefaultOrderedBlockListComparator,net.minecraft.block.BlockState>
net.rodofire.easierworldcreator.blockdata.blocklist.basic.comparator.DefaultBlockListComparator

public class DefaultBlockListComparator extends BlockListComparator<DefaultBlockList,Integer,DefaultOrderedBlockListComparator,net.minecraft.block.BlockState>
class to manage a list of DefaultBlockList automatically
  • Constructor Details

    • DefaultBlockListComparator

      public DefaultBlockListComparator(List<DefaultBlockList> defaultBlockLists)
      init a comparator
      Parameters:
      defaultBlockLists - the list of blockList that will be indexed
    • DefaultBlockListComparator

      public DefaultBlockListComparator(DefaultBlockList defaultBlockList)
      init a comparator
      Parameters:
      defaultBlockList - a blockList that will be indexed
    • DefaultBlockListComparator

      public DefaultBlockListComparator()
      init an empty comparator
  • Method Details

    • initIndexes

      protected void initIndexes()
      method tu initialize the indexes.
      Specified by:
      initIndexes in class BlockListComparator<DefaultBlockList,Integer,DefaultOrderedBlockListComparator,net.minecraft.block.BlockState>
    • put

      public void put(net.minecraft.block.BlockState state, net.minecraft.util.math.BlockPos pos)
      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
    • put

      public void put(net.minecraft.block.BlockState state, List<net.minecraft.util.math.BlockPos> posList)
      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
    • put

      public void put(DefaultBlockList 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<DefaultBlockList,Integer,DefaultOrderedBlockListComparator,net.minecraft.block.BlockState>
      Parameters:
      type - the BlockList that will be added in the comparator
    • getCleaned

      public List<DefaultBlockList> getCleaned(List<DefaultBlockList> 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<DefaultBlockList,Integer,DefaultOrderedBlockListComparator,net.minecraft.block.BlockState>
      Parameters:
      blockList - the blockList that will bea cleaned
      Returns:
      the cleaned version of the list
    • getOrdered

      public DefaultOrderedBlockListComparator getOrdered()
      Method to get the ordered version of the comparator
      Specified by:
      getOrdered in class BlockListComparator<DefaultBlockList,Integer,DefaultOrderedBlockListComparator,net.minecraft.block.BlockState>
      Returns:
      the ordered version
    • toJson

      public void toJson(Path path, net.minecraft.util.math.BlockPos offset)