public interface IFarmLogic
Every farm block has only ony one logic a multi-block farm has four, one for every direction.
| Modifier and Type | Method and Description |
|---|---|
default void |
addSoil(net.minecraft.item.ItemStack resource,
net.minecraft.block.state.IBlockState soilState,
boolean hasMetaData)
Deprecated.
|
default net.minecraft.util.NonNullList<net.minecraft.item.ItemStack> |
collect(net.minecraft.world.World world,
IFarmHousing farmHousing)
Collects all items that are laying on the ground and are in the
IFarmHousing.getArea() of the farm. |
default boolean |
cultivate(net.minecraft.world.World world,
IFarmHousing farmHousing,
net.minecraft.util.math.BlockPos pos,
FarmDirection direction,
int extent)
Tries to cultivate one or more blocks at the given position and with the given extent.
|
int |
getFertilizerConsumption() |
net.minecraft.item.ItemStack |
getIconItemStack() |
java.lang.String |
getName() |
default IFarmProperties |
getProperties()
Returns the
IFarmProperties that created this logic. |
default net.minecraft.util.ResourceLocation |
getTextureMap()
Deprecated.
No longer needed because mc always uses the same map for blocks and items.
TODO remove this method in 1.13
|
default java.lang.String |
getUnlocalizedName() |
int |
getWaterConsumption(float hydrationModifier) |
default java.util.Collection<ICrop> |
harvest(net.minecraft.world.World world,
net.minecraft.util.math.BlockPos pos,
FarmDirection direction,
int extent)
Deprecated.
|
default java.util.Collection<ICrop> |
harvest(net.minecraft.world.World world,
IFarmHousing farmHousing,
net.minecraft.util.math.BlockPos pos,
FarmDirection direction,
int extent) |
boolean |
isAcceptedGermling(net.minecraft.item.ItemStack itemstack)
Checks if the given stack is a germling (plantable sapling, seed, etc.) for any
IFarmable of this farm. |
boolean |
isAcceptedResource(net.minecraft.item.ItemStack itemstack)
Checks if the given stack is a resource or a soil that this logic uses to grow plants on or to create other
products like peat.
|
default boolean |
isManual() |
default IFarmLogic |
setManual(boolean manual)
Deprecated.
Since Forestry 5.8 logic instances are created at the constructor of the
IFarmProperties and
have a immutable manual state.
TODO Remove this method in 1.13 |
int getFertilizerConsumption()
IFarmHousing automatically removes after this logic cultivated
a block or harvested a crop.int getWaterConsumption(float hydrationModifier)
hydrationModifier - A modifier that depends on the weather and the biome of the farm.IFarmHousing automatically removes after this logic cultivated
a block or harvested a crop.boolean isAcceptedResource(net.minecraft.item.ItemStack itemstack)
boolean isAcceptedGermling(net.minecraft.item.ItemStack itemstack)
IFarmable of this farm.default net.minecraft.util.NonNullList<net.minecraft.item.ItemStack> collect(net.minecraft.world.World world,
IFarmHousing farmHousing)
IFarmHousing.getArea() of the farm.world - The world of the farm.farmHousing - The farm that uses this logic.default boolean cultivate(net.minecraft.world.World world,
IFarmHousing farmHousing,
net.minecraft.util.math.BlockPos pos,
FarmDirection direction,
int extent)
world - The world of the farm.farmHousing - The farm that uses this logic.pos - The position at that the logic should start to cultivate.direction - The direction of the extension.extent - How many blocks this logic has to cultivate after it cultivated the block at the given position.
The positions of the next blocks are having a offset in the given direction.@Deprecated default java.util.Collection<ICrop> harvest(net.minecraft.world.World world, net.minecraft.util.math.BlockPos pos, FarmDirection direction, int extent)
world - The world of the farm.pos - The position at that the logic should start to harvest.direction - The direction of the extension.extent - How many blocks this logic tries to harvest after it has tried to harvested the block at the given position.
The positions of the next blocks are having a offset in the given direction.default java.util.Collection<ICrop> harvest(net.minecraft.world.World world, IFarmHousing farmHousing, net.minecraft.util.math.BlockPos pos, FarmDirection direction, int extent)
default IFarmProperties getProperties()
IFarmProperties that created this logic.IFarmProperties that created this logic. Returns a fake instance from
IFarmRegistry.createFakeInstance(IFarmLogic) if the logic is older that Forestry 5.8.
TODO: Remove "default" from this method in 1.13default boolean isManual()
@Deprecated default IFarmLogic setManual(boolean manual)
IFarmProperties and
have a immutable manual state.
TODO Remove this method in 1.13@Deprecated
default void addSoil(net.minecraft.item.ItemStack resource,
net.minecraft.block.state.IBlockState soilState,
boolean hasMetaData)
IFarmRegistry.getProperties(String) to get the IFarmProperties for the farm logic and register the soil
with IFarmProperties.registerSoil(ItemStack, IBlockState, boolean).default java.lang.String getUnlocalizedName()
java.lang.String getName()
@Deprecated default net.minecraft.util.ResourceLocation getTextureMap()
net.minecraft.item.ItemStack getIconItemStack()