/
Particle.java
39 lines (30 loc) · 1.22 KB
/
Particle.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
36
37
38
39
package com.denizenscript.denizen.nms.interfaces;
import org.bukkit.Location;
import org.bukkit.entity.Player;
import org.bukkit.util.Vector;
public class Particle {
public org.bukkit.Particle particle;
public Particle(org.bukkit.Particle particle) {
this.particle = particle;
}
public void playFor(Player player, Location location, int count, Vector offset, double extra) {
player.spawnParticle(particle, location, count, offset.getX(), offset.getY(), offset.getZ(), extra);
}
public <T> void playFor(Player player, Location location, int count, Vector offset, double extra, T data) {
player.spawnParticle(particle, location, count, offset.getX(), offset.getY(), offset.getZ(), extra, data);
}
public boolean isVisible() {
return particle != org.bukkit.Particle.SUSPENDED && particle != org.bukkit.Particle.SUSPENDED_DEPTH
&& particle != org.bukkit.Particle.WATER_BUBBLE;
}
public String getName() {
return particle.name();
}
public Class neededData() {
Class clazz = particle.getDataType();
if (clazz == Void.class) {
return null;
}
return clazz;
}
}