Class AlphabeticalItemGroupFiller

java.lang.Object
io.github.vampirestudios.vampirelib.api.itemGroupSorting.AlphabeticalItemGroupFiller
All Implemented Interfaces:
ItemGroupFiller

public final class AlphabeticalItemGroupFiller extends Object implements ItemGroupFiller
Implementation class of ItemGroupFiller for filling Items alphabetically.

shouldInclude is used to test what items should be considered when inserting an item at its alphabetical position.

See Also:
  • Constructor Details

    • AlphabeticalItemGroupFiller

      public AlphabeticalItemGroupFiller(Predicate<net.minecraft.world.item.Item> shouldInclude)
  • Method Details

    • forClass

      public static <I extends net.minecraft.world.item.Item> AlphabeticalItemGroupFiller forClass(Class<I> clazz)
      Creates an AlphabeticalItemGroupFiller that fills items alphabetically for items that are an instance of a class. (e.g. Having a modded spawn egg filled alphabetically into the vanilla's spawn eggs)
      Type Parameters:
      I - The type of the class, must extend Item.
      Parameters:
      clazz - The class to test for.
      Returns:
      An AlphabeticalItemGroupFiller that fills items alphabetically for items that are an instance of a class. (e.g. Having a modded spawn egg filled alphabetically into the vanilla's spawn eggs)
    • fillItem

      public void fillItem(net.minecraft.world.item.Item item, net.minecraft.world.item.CreativeModeTab group, net.minecraft.core.NonNullList<net.minecraft.world.item.ItemStack> items)
      Description copied from interface: ItemGroupFiller
      Fills an Item for a CreativeModeTab given a NonNullList of the ItemStacks for that CreativeModeTab.
      Specified by:
      fillItem in interface ItemGroupFiller
      Parameters:
      item - The Item to fill.
      group - The CreativeModeTab to fill into.
      items - A NonNullList of the ItemStacks for the CreativeModeTab.