Interface IBackpackInterface


public interface IBackpackInterface
The Backpack Interface allows you to add items to Forestry backpacks or create your own backpacks.

To create your own backpack, create an IBackpackDefinition. Backpack definitions have a filter, which you can create here with #createNaturalistBackpackFilter(String) or create your own.

After you've created your backpack definition, create the item with createBackpack(IBackpackDefinition, EnumBackpackType) or createNaturalistBackpack(IBackpackDefinition, ResourceLocation, CreativeModeTab) and then register the returned item like any other item.

  • Method Details

    • createBackpack

      net.minecraft.world.item.Item createBackpack(IBackpackDefinition definition, EnumBackpackType type)
      Creates a backpack with the given UID and type, returning the item.
      Parameters:
      definition - The backpack definition.
      type - Type of backpack.
      Returns:
      Created backpack item.
    • createNaturalistBackpack

      net.minecraft.world.item.Item createNaturalistBackpack(IBackpackDefinition definition, net.minecraft.resources.ResourceLocation speciesTypeId, net.minecraft.world.item.CreativeModeTab tab)
      Create a backpack that can hold items from a specific ISpeciesType.
      Parameters:
      definition - The backpack definition.
      speciesTypeId - The species root.
      tab -
      Returns:
      Created backpack item.
    • createNaturalistBackpackFilter

      Predicate<net.minecraft.world.item.ItemStack> createNaturalistBackpackFilter(net.minecraft.resources.ResourceLocation speciesTypeId)
      Makes a new naturalist backpack filter. Only accepts items from a specific ISpeciesType. Useful for implementing IBackpackDefinition for naturalist's backpacks.
      Parameters:
      speciesTypeId - The species root's unique ID.
      Returns:
      a new backpack filter for the specified species root
      See Also: