Package forestry.api.farming
Interface IFarmInventory
public interface IFarmInventory
Helper interface that every farm inventory implements.
Handles the inventory and item management of the farm. Which item the farm will accept is defined by the
IFarmLogic's and the IFarmType.
-
Method Summary
Modifier and TypeMethodDescriptionbooleanacceptsAsFertilizer(net.minecraft.world.item.ItemStack stack) Checks if the inventory will accept the given stack as a fertelizerbooleanacceptsAsResource(net.minecraft.world.item.ItemStack stack) Checks if the inventory will accept the given stack as a resourcebooleanacceptsAsSeedling(net.minecraft.world.item.ItemStack stack) Checks if the inventory will accept the given stack as a saplingnet.minecraft.world.ContainerSub-inventory that contains only the fertilizernet.minecraft.world.ContainerSub-inventory that contains only the germlingsnet.minecraft.world.ContainerSub-inventory that contains only the outputnet.minecraft.world.ContainerSub-inventory that contains only the resourcesbooleanhasResources(List<net.minecraft.world.item.ItemStack> resources) Checks if the inventory contains the given resources.voidremoveResources(List<net.minecraft.world.item.ItemStack> resources) Remove the given resource from the inventory, if possible
-
Method Details
-
hasResources
Checks if the inventory contains the given resources.- Parameters:
resources- A list of items to check- Returns:
- True if the inventory contains the resources; false otherwise.
-
removeResources
Remove the given resource from the inventory, if possible- Parameters:
resources- A list of items to remove
-
acceptsAsSeedling
boolean acceptsAsSeedling(net.minecraft.world.item.ItemStack stack) Checks if the inventory will accept the given stack as a sapling- Parameters:
stack- The stack to check- Returns:
- True if the stack is valid; false otherwise
-
acceptsAsResource
boolean acceptsAsResource(net.minecraft.world.item.ItemStack stack) Checks if the inventory will accept the given stack as a resource- Parameters:
stack- The stack to check- Returns:
- True if the stack is valid; false otherwise
-
acceptsAsFertilizer
boolean acceptsAsFertilizer(net.minecraft.world.item.ItemStack stack) Checks if the inventory will accept the given stack as a fertelizer- Parameters:
stack- The stack to check- Returns:
- True if the stack is valid; false otherwise
-
getProductInventory
net.minecraft.world.Container getProductInventory()Sub-inventory that contains only the output -
getGermlingsInventory
net.minecraft.world.Container getGermlingsInventory()Sub-inventory that contains only the germlings -
getResourcesInventory
net.minecraft.world.Container getResourcesInventory()Sub-inventory that contains only the resources -
getFertilizerInventory
net.minecraft.world.Container getFertilizerInventory()Sub-inventory that contains only the fertilizer
-