<commit_before>package de.slikey.effectlib.effect;

import org.bukkit.Location;
import org.bukkit.util.Vector;

import de.slikey.effectlib.EffectManager;
import de.slikey.effectlib.EffectType;
import de.slikey.effectlib.util.MathUtils;
import de.slikey.effectlib.util.ParticleEffect;
import de.slikey.effectlib.util.RandomUtils;
import de.slikey.effectlib.util.VectorUtils;

public class StarLocationEffect extends LocationEffect {

	/**
	 * Particles to create the star
	 */
	public ParticleEffect particle = ParticleEffect.FLAME;

	/**
	 * Particles per spike
	 */
	public int particles = 70;

	/**
	 * Height of the spikes in blocks
	 */
	public float spikeHeight = 4;

	/**
	 * Half amount of spikes. Creation is only done half and then mirrored.
	 */
	public int spikesHalf = 3;

	/**
	 * Inner radius of the star. (0.5)
	 */
	public float innerRadius = 0.5f;

	public StarLocationEffect(EffectManager effectManager, Location location) {
		super(effectManager, location);
		type = EffectType.REPEATING;
		period = 4;
		iterations = 50;
	}

	@Override
	public void onRun() {
		float radius = 3 * innerRadius / MathUtils.SQRT_3;
		for (int j = 0; j < 2; j++) {
			double yRotation = j * Math.PI / 2;
			for (int i = 0; i < spikesHalf * 2; i++) {
				double xRotation = i * Math.PI / spikesHalf + j * Math.PI;
				for (int x = 0; x < particles; x++) {
					double angle = 2 * Math.PI * x / particles;
					float height = RandomUtils.random.nextFloat() * spikeHeight;
					Vector v = new Vector(Math.cos(angle), 0, Math.sin(angle));
					v.multiply((spikeHeight - height) * radius / spikeHeight);
					v.setY(innerRadius + height);
					VectorUtils.rotateAroundAxisX(v, xRotation);
					VectorUtils.rotateAroundAxisY(v, yRotation);
					location.add(v);
					particle.display(location, visibleRange);
					location.subtract(v);
				}
			}

		}
	}

}<commit_msg>Improved performance of star<commit_after>package de.slikey.effectlib.effect;

import org.bukkit.Location;
import org.bukkit.util.Vector;

import de.slikey.effectlib.EffectManager;
import de.slikey.effectlib.EffectType;
import de.slikey.effectlib.util.MathUtils;
import de.slikey.effectlib.util.ParticleEffect;
import de.slikey.effectlib.util.RandomUtils;
import de.slikey.effectlib.util.VectorUtils;

public class StarLocationEffect extends LocationEffect {

	/**
	 * Particles to create the star
	 */
	public ParticleEffect particle = ParticleEffect.FLAME;

	/**
	 * Particles per spike
	 */
	public int particles = 70;

	/**
	 * Height of the spikes in blocks
	 */
	public float spikeHeight = 3.5f;

	/**
	 * Half amount of spikes. Creation is only done half and then mirrored.
	 */
	public int spikesHalf = 3;

	/**
	 * Inner radius of the star. (0.5)
	 */
	public float innerRadius = 0.5f;

	public StarLocationEffect(EffectManager effectManager, Location location) {
		super(effectManager, location);
		type = EffectType.REPEATING;
		period = 4;
		iterations = 50;
	}

	@Override
	public void onRun() {
		float radius = 3 * innerRadius / MathUtils.SQRT_3;
		for (int i = 0; i < spikesHalf * 2; i++) {
			double xRotation = i * Math.PI / spikesHalf;
			for (int x = 0; x < particles; x++) {
				double angle = 2 * Math.PI * x / particles;
				float height = RandomUtils.random.nextFloat() * spikeHeight;
				Vector v = new Vector(Math.cos(angle), 0, Math.sin(angle));
				v.multiply((spikeHeight - height) * radius / spikeHeight);
				v.setY(innerRadius + height);
				VectorUtils.rotateAroundAxisX(v, xRotation);
				location.add(v);
				particle.display(location, visibleRange);
				location.subtract(v);
				VectorUtils.rotateAroundAxisX(v, Math.PI);
				VectorUtils.rotateAroundAxisY(v, Math.PI / 2);
				location.add(v);
				particle.display(location, visibleRange);
				location.subtract(v);
			}
		}
	}

}
{'fraction_non_alphanumeric': 0.11960836200052924, 'fraction_numerical': 0.010849431066419687, 'mean_word_length': 3.5161290322580645, 'pattern_counts': {'":': 0, '<': 8, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6076002', 'n_tokens_mistral': 1453, 'n_tokens_neox': 1218, 'n_words': 318}