mirror of
https://github.com/GTNewHorizons/ForestryMC.git
synced 2026-11-18 11:19:28 +00:00
46 lines
1.5 KiB
Java
Executable File
46 lines
1.5 KiB
Java
Executable File
/*******************************************************************************
|
|
* Copyright (c) 2011-2014 SirSengir.
|
|
* All rights reserved. This program and the accompanying materials
|
|
* are made available under the terms of the GNU Lesser Public License v3
|
|
* which accompanies this distribution, and is available at
|
|
* http://www.gnu.org/licenses/lgpl-3.0.txt
|
|
*
|
|
* Various Contributors including, but not limited to:
|
|
* SirSengir (original work), CovertJaguar, Player, Binnie, MysteriousAges
|
|
******************************************************************************/
|
|
package forestry.apiculture.genetics;
|
|
|
|
import forestry.api.apiculture.IBeeGenome;
|
|
import forestry.api.apiculture.IBeeHousing;
|
|
import forestry.api.genetics.IEffectData;
|
|
import java.util.List;
|
|
import net.minecraft.entity.monster.EntityMob;
|
|
import net.minecraft.util.AxisAlignedBB;
|
|
import net.minecraft.util.DamageSource;
|
|
|
|
public class AlleleEffectHeroic extends AlleleEffectThrottled {
|
|
|
|
public AlleleEffectHeroic(String uid) {
|
|
super(uid, "heroic", false, 40, true, false);
|
|
}
|
|
|
|
@Override
|
|
public IEffectData doEffect(IBeeGenome genome, IEffectData storedData, IBeeHousing housing) {
|
|
|
|
if (isHalted(storedData, housing))
|
|
return storedData;
|
|
|
|
AxisAlignedBB hurtBox = getBounding(genome, housing, 1.0f);
|
|
@SuppressWarnings("rawtypes")
|
|
List list = housing.getWorld().getEntitiesWithinAABB(EntityMob.class, hurtBox);
|
|
|
|
for (Object obj : list) {
|
|
EntityMob mob = (EntityMob) obj;
|
|
mob.attackEntityFrom(DamageSource.generic, 2);
|
|
}
|
|
|
|
return storedData;
|
|
}
|
|
|
|
}
|