-
-
Notifications
You must be signed in to change notification settings - Fork 106
/
ParticleHelper.java
35 lines (27 loc) · 1 KB
/
ParticleHelper.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 net.aufdemrand.denizen.nms.abstracts;
import net.aufdemrand.denizen.nms.interfaces.Particle;
import org.bukkit.Effect;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public abstract class ParticleHelper {
public HashMap<String, Effect> effectRemap = new HashMap<>();
private final Map<String, Particle> particles = new HashMap<>();
private final List<Particle> visibleParticles = new ArrayList<>();
protected void register(String name, Particle particle) {
particles.put(name.toUpperCase(), particle);
if (particle.isVisible()) {
visibleParticles.add(particle);
}
}
public boolean hasParticle(String name) {
return particles.containsKey(name.toUpperCase());
}
public Particle getParticle(String name) {
return particles.get(name.toUpperCase());
}
public List<Particle> getVisibleParticles() {
return visibleParticles;
}
}