2016-12-04 15:03:01 +01:00
|
|
|
package de.ellpeck.actuallyadditions.api.farmer;
|
|
|
|
|
|
|
|
import de.ellpeck.actuallyadditions.api.internal.IFarmer;
|
|
|
|
import net.minecraft.item.ItemStack;
|
|
|
|
import net.minecraft.util.math.BlockPos;
|
|
|
|
import net.minecraft.world.World;
|
|
|
|
|
2018-07-28 02:05:30 +02:00
|
|
|
public interface IFarmerBehavior {
|
2016-12-04 15:03:01 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Try to plant a seed with this behavior
|
2018-07-07 12:07:22 +02:00
|
|
|
* If this method returns true, the seed ItemStack will be shrunk by one.
|
|
|
|
* This method will not be called if the block at the given position is not replaceable.
|
2016-12-04 15:03:01 +01:00
|
|
|
*
|
|
|
|
* @param seed The seed stack to plant
|
|
|
|
* @param world The world
|
|
|
|
* @param pos The position to plant the seed on
|
|
|
|
* @param farmer The Farmer doing this action. Can be used to query and extract energy and add items to the slots
|
|
|
|
* @return If planting was successful
|
|
|
|
*/
|
2017-02-22 13:28:53 +01:00
|
|
|
FarmerResult tryPlantSeed(ItemStack seed, World world, BlockPos pos, IFarmer farmer);
|
2016-12-04 15:03:01 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Try to harvest a plant with this behavior
|
|
|
|
*
|
|
|
|
* @param world The world
|
|
|
|
* @param pos The position of the plant
|
|
|
|
* @param farmer The Farmer doing this action. Can be used to query and extract energy and add items to the slots
|
|
|
|
* @return If harvesting was successful
|
|
|
|
*/
|
2017-02-22 13:28:53 +01:00
|
|
|
FarmerResult tryHarvestPlant(World world, BlockPos pos, IFarmer farmer);
|
2016-12-04 15:03:01 +01:00
|
|
|
|
2017-02-22 13:28:53 +01:00
|
|
|
int getPriority();
|
2018-07-28 02:05:30 +02:00
|
|
|
|
|
|
|
default Integer getPrioInt() {
|
|
|
|
return getPriority();
|
|
|
|
}
|
2016-12-04 15:03:01 +01:00
|
|
|
}
|