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 Type
    Method
    Description
    boolean
    acceptsAsFertilizer(net.minecraft.world.item.ItemStack stack)
    Checks if the inventory will accept the given stack as a fertelizer
    boolean
    acceptsAsResource(net.minecraft.world.item.ItemStack stack)
    Checks if the inventory will accept the given stack as a resource
    boolean
    acceptsAsSeedling(net.minecraft.world.item.ItemStack stack)
    Checks if the inventory will accept the given stack as a sapling
    net.minecraft.world.Container
    Sub-inventory that contains only the fertilizer
    net.minecraft.world.Container
    Sub-inventory that contains only the germlings
    net.minecraft.world.Container
    Sub-inventory that contains only the output
    net.minecraft.world.Container
    Sub-inventory that contains only the resources
    boolean
    hasResources(List<net.minecraft.world.item.ItemStack> resources)
    Checks if the inventory contains the given resources.
    void
    removeResources(List<net.minecraft.world.item.ItemStack> resources)
    Remove the given resource from the inventory, if possible
  • Method Details

    • hasResources

      boolean hasResources(List<net.minecraft.world.item.ItemStack> resources)
      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

      void removeResources(List<net.minecraft.world.item.ItemStack> resources)
      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