forked from elBukkit/EffectLib
-
Notifications
You must be signed in to change notification settings - Fork 2
/
LoveEffect.java
35 lines (27 loc) · 893 Bytes
/
LoveEffect.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
package de.slikey.effectlib.effect;
import org.bukkit.Location;
import org.bukkit.Particle;
import de.slikey.effectlib.Effect;
import de.slikey.effectlib.EffectType;
import de.slikey.effectlib.EffectManager;
import de.slikey.effectlib.util.RandomUtils;
public class LoveEffect extends Effect {
public LoveEffect(EffectManager effectManager) {
super(effectManager);
type = EffectType.REPEATING;
particle = Particle.HEART;
period = 2;
iterations = 600;
}
@Override
public void onRun() {
Location location = getLocation();
if (location == null) {
cancel();
return;
}
location.add(RandomUtils.getRandomCircleVector().multiply(RandomUtils.random.nextDouble() * 0.6d));
location.add(0, RandomUtils.random.nextFloat() * 2, 0);
display(particle, location);
}
}