2013-05-23 21:07:28 -07:00
|
|
|
package magicbees.bees;
|
2012-12-29 17:50:58 -08:00
|
|
|
|
|
|
|
|
import java.util.List;
|
|
|
|
|
|
|
|
|
|
|
2013-05-29 11:15:25 -07:00
|
|
|
import magicbees.main.MagicBees;
|
2012-12-29 17:50:58 -08:00
|
|
|
import net.minecraft.entity.Entity;
|
|
|
|
|
import net.minecraft.entity.player.EntityPlayer;
|
|
|
|
|
import net.minecraft.item.Item;
|
|
|
|
|
import net.minecraft.item.ItemStack;
|
|
|
|
|
import net.minecraft.potion.PotionEffect;
|
|
|
|
|
import net.minecraft.util.AxisAlignedBB;
|
|
|
|
|
import forestry.api.apiculture.IAlleleBeeEffect;
|
|
|
|
|
import forestry.api.apiculture.IBeeGenome;
|
|
|
|
|
import forestry.api.apiculture.IBeeHousing;
|
|
|
|
|
import forestry.api.genetics.AlleleManager;
|
|
|
|
|
import forestry.api.genetics.IEffectData;
|
|
|
|
|
|
|
|
|
|
public class AlleleEffectCure extends AlleleEffect
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
public AlleleEffectCure(String id, boolean isDominant)
|
|
|
|
|
{
|
2013-06-14 13:30:00 -07:00
|
|
|
super(id, isDominant, 200);
|
2012-12-29 17:50:58 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public IEffectData validateStorage(IEffectData storedData)
|
|
|
|
|
{
|
|
|
|
|
if (storedData == null)
|
|
|
|
|
{
|
|
|
|
|
storedData = new EffectData(1, 0, 0);
|
|
|
|
|
}
|
|
|
|
|
return storedData;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
2013-06-14 13:30:00 -07:00
|
|
|
public IEffectData doEffectThrottled(IBeeGenome genome, IEffectData storedData, IBeeHousing housing)
|
2012-12-29 17:50:58 -08:00
|
|
|
{
|
2013-06-14 13:30:00 -07:00
|
|
|
List<Entity> entityList = this.getEntitiesWithinRange(genome, housing);
|
2012-12-29 17:50:58 -08:00
|
|
|
|
2013-06-14 13:30:00 -07:00
|
|
|
for (Entity e : entityList)
|
2012-12-29 17:50:58 -08:00
|
|
|
{
|
2013-06-14 13:30:00 -07:00
|
|
|
if (e instanceof EntityPlayer)
|
2012-12-29 17:50:58 -08:00
|
|
|
{
|
2013-06-14 13:30:00 -07:00
|
|
|
EntityPlayer player = (EntityPlayer)e;
|
|
|
|
|
player.curePotionEffects(new ItemStack(Item.bucketMilk));
|
2012-12-29 17:50:58 -08:00
|
|
|
}
|
|
|
|
|
}
|
2013-06-14 13:30:00 -07:00
|
|
|
storedData.setInteger(0, 0);
|
2012-12-29 17:50:58 -08:00
|
|
|
|
|
|
|
|
return storedData;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|