Make bees particles animate to pollinate nearby flowers

This commit is contained in:
mezz committed 2016-05-12 01:09:12 -07:00
1 parent 64ed04e09b
commit 2c7d56f308
12 files changed
+227 -61

No files matched your search

@@ -11,23 +11,20 @@ import forestry.api.genetics.IEffectData;
public interface IAlleleBeeEffect extends IAlleleEffect {
/**
* Called by apiaries to cause an effect in the world.
* Called by apiaries to cause an effect in the world. (server)
*
* @param genome
* Genome of the bee queen causing this effect
* @param storedData
* Object containing the stored effect data for the apiary/hive the bee is in.
* @param genome Genome of the bee queen causing this effect
* @param storedData Object containing the stored effect data for the apiary/hive the bee is in.
* @param housing {@link IBeeHousing} the bee currently resides in.
* @return storedData, may have been manipulated.
*/
IEffectData doEffect(IBeeGenome genome, IEffectData storedData, IBeeHousing housing);
/**
* Is called to produce bee effects.
* Is called to produce visual bee effects. (client)
*
* @param genome
* @param storedData
* Object containing the stored effect data for the apiary/hive the bee is in.
* @param genome Genome of the bee queen causing this effect
* @param storedData Object containing the stored effect data for the apiary/hive the bee is in.
* @param housing {@link IBeeHousing} the bee currently resides in.
* @return storedData, may have been manipulated.
*/
@@ -5,7 +5,11 @@
******************************************************************************/
package forestry.api.apiculture;
import javax.annotation.Nonnull;
import java.util.List;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.util.math.BlockPos;
import forestry.api.core.INbtReadable;
import forestry.api.core.INbtWritable;
@@ -60,4 +64,10 @@ public interface IBeekeepingLogic extends INbtWritable, INbtReadable {
*/
void doBeeFX();
/**
* Used by bee fx to direct bees to nearby flowers.
* These positions are synced to the client from the server.
*/
@Nonnull
List<BlockPos> getFlowerPositions();
}
@@ -5,6 +5,9 @@
******************************************************************************/
package forestry.api.genetics;
import javax.annotation.Nonnull;
import java.util.List;
import net.minecraft.block.Block;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
@@ -58,9 +61,14 @@ public interface IFlowerRegistry {
boolean growFlower(String flowerType, World world, IIndividual individual, BlockPos pos);
/**
* @return the coordinates of a nearby accepted flower or null if there is none.
* @param beeHousing The bee housing that will help determine the size of the area to check.
* @param bee The bee that will help determine the size of the area to check.
* @param flowerType See {@link forestry.api.apiculture.FlowerManager}.FlowerTypeXXX
* @param maxFlowers the largest number of flowers to check for before returning. Use 1 if you only need 1.
* @return the coordinates of nearby accepted flowers, with size from 0 to maxFlowers.
*/
BlockPos getAcceptedFlowerCoordinates(IBeeHousing beeHousing, IBee bee, String flowerType);
@Nonnull
List<BlockPos> getAcceptedFlowerCoordinates(IBeeHousing beeHousing, IBee bee, String flowerType, int maxFlowers);
/**
* Checks a single coordinate to see if it is an accepted flower.