Interface IFarmType


public interface IFarmType
An IFarmType describes a type of farm, defining rules for how the farm can operate. A farm type contains two instances of IFarmLogic, one manual, and one managed. In base Forestry, each farm type has two legacy farm blocks and one circuit upgrade, so the farm type can be used in both legacy block farms and in a quadrant of a multiblock farm.
  • Method Details

    • getFertilizerConsumption

      int getFertilizerConsumption(IFarmHousing housing)
      Determines how much fertilizer should be used to harvest a single crop. Forestry's default Fertilizer is worth 500 fertilizer per item.
      Parameters:
      housing - The farm housing.
      Returns:
      The amount of fertilizer used to harvest a single crop.
    • getWaterConsumption

      int getWaterConsumption(IFarmHousing housing, float hydrationModifier)
      Parameters:
      hydrationModifier - A modifier that depends on the weather and the biome of the farm.
      Returns:
      The amount of water that the IFarmHousing automatically removes after this logic cultivated a block or harvested a crop.
    • getDisplayName

      net.minecraft.network.chat.Component getDisplayName(boolean manual)
    • getTranslationKey

      String getTranslationKey()
    • getIcon

      net.minecraft.world.item.ItemStack getIcon()
      Returns:
      the itemStack that represents this farm logic. Used as an icon for the farm logic.
    • isAcceptedSoil

      boolean isAcceptedSoil(net.minecraft.world.level.block.state.BlockState state)
      Returns:
      true if the given block state is a valid soil state.
    • isAcceptedResource

      boolean isAcceptedResource(net.minecraft.world.item.ItemStack stack)
      Returns:
      true if the given stack is the item form of a soil.
    • isAcceptedSeedling

      boolean isAcceptedSeedling(net.minecraft.world.item.ItemStack stack)
      Checks if the given stack is a seedling (plantable sapling, seed, etc.) for any IFarmable of this farm.
    • isAcceptedWindfall

      boolean isAcceptedWindfall(net.minecraft.world.item.ItemStack stack)
    • getSoils

      Collection<Soil> getSoils()
    • getFarmables

      List<IFarmable> getFarmables()
      Returns:
      The farmable resources produced by this farm type.
    • getLogic

      IFarmLogic getLogic(boolean manual)
      Returns the instance of the manual or managed IFarmLogic.