Package forestry.api.farming
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 Summary
Modifier and TypeMethodDescriptionnet.minecraft.network.chat.ComponentgetDisplayName(boolean manual) intgetFertilizerConsumption(IFarmHousing housing) Determines how much fertilizer should be used to harvest a single crop.net.minecraft.world.item.ItemStackgetIcon()getLogic(boolean manual) Returns the instance of the manual or managedIFarmLogic.getSoils()intgetWaterConsumption(IFarmHousing housing, float hydrationModifier) booleanisAcceptedResource(net.minecraft.world.item.ItemStack stack) booleanisAcceptedSeedling(net.minecraft.world.item.ItemStack stack) Checks if the given stack is a seedling (plantable sapling, seed, etc.) for anyIFarmableof this farm.booleanisAcceptedSoil(net.minecraft.world.level.block.state.BlockState state) booleanisAcceptedWindfall(net.minecraft.world.item.ItemStack stack)
-
Method Details
-
getFertilizerConsumption
Determines how much fertilizer should be used to harvest a single crop. Forestry's default Fertilizer is worth500fertilizer per item.- Parameters:
housing- The farm housing.- Returns:
- The amount of fertilizer used to harvest a single crop.
-
getWaterConsumption
- Parameters:
hydrationModifier- A modifier that depends on the weather and the biome of the farm.- Returns:
- The amount of water that the
IFarmHousingautomatically 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:
trueif the given block state is a valid soil state.
-
isAcceptedResource
boolean isAcceptedResource(net.minecraft.world.item.ItemStack stack) - Returns:
trueif 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 anyIFarmableof this farm. -
isAcceptedWindfall
boolean isAcceptedWindfall(net.minecraft.world.item.ItemStack stack) -
getSoils
Collection<Soil> getSoils() -
getFarmables
- Returns:
- The farmable resources produced by this farm type.
-
getLogic
Returns the instance of the manual or managedIFarmLogic.
-