use of org.blockartistry.mod.DynSurround.client.fx.particle.EntityHealPopOffFX in project BetterRain by OreCruncher.
the class DamageEffectHandler method handleEvent.
@SideOnly(Side.CLIENT)
public static void handleEvent(final HealthData data) {
if (!ModOptions.enableDamagePopoffs)
return;
// Don't show the players pop-offs
if (EnvironState.isPlayer(data.entityId))
return;
// Don't want to display if too far away.
final double distance = EnvironState.distanceToPlayer(data.posX, data.posY, data.posZ);
if (distance >= DISTANCE_THRESHOLD_SQ)
return;
final World world = EnvironState.getWorld();
final EffectRenderer renderer = Minecraft.getMinecraft().effectRenderer;
EntityFX fx;
if (data.isCritical) {
fx = new EntityCriticalPopOffFX(world, data.posX, data.posY, data.posZ);
renderer.addEffect(fx);
}
if (data.amount > 0) {
fx = new EntityDamagePopOffFX(world, data.posX, data.posY, data.posZ, data.amount);
} else {
fx = new EntityHealPopOffFX(world, data.posX, data.posY, data.posZ, MathHelper.abs_int(data.amount));
}
renderer.addEffect(fx);
}
Aggregations