Package forestry.api.storage
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 Summary
Modifier and TypeMethodDescriptionnet.minecraft.world.item.ItemcreateBackpack(IBackpackDefinition definition, EnumBackpackType type) Creates a backpack with the given UID and type, returning the item.net.minecraft.world.item.ItemcreateNaturalistBackpack(IBackpackDefinition definition, net.minecraft.resources.ResourceLocation speciesTypeId, net.minecraft.world.item.CreativeModeTab tab) Create a backpack that can hold items from a specificISpeciesType.Predicate<net.minecraft.world.item.ItemStack>createNaturalistBackpackFilter(net.minecraft.resources.ResourceLocation speciesTypeId) Makes a new naturalist backpack filter.
-
Method Details
-
createBackpack
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 specificISpeciesType.- 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 specificISpeciesType. Useful for implementingIBackpackDefinitionfor naturalist's backpacks.- Parameters:
speciesTypeId- The species root's unique ID.- Returns:
- a new backpack filter for the specified species root
- See Also:
-