Package net.glowstone.constants
Class GlowParticle
java.lang.Object
net.glowstone.constants.GlowParticle
Id mappings for particles.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionClass<?>
Object[]
getExtData
(Object o) Gets the extra data for this particle.static Object[]
getExtData
(org.bukkit.Effect effect, Object object) Convert an object to an extData array if possible for an effect.static Object[]
getExtData
(org.bukkit.Particle particle, Object object) Convert an object to an extData array if possible for a particle.int
getId()
static int
getId
(@NotNull org.bukkit.Particle particle) Get the particle id for a specifiedParticle
.static int
getId
(org.bukkit.Effect effect) Get the particle id for a specifiedEffect
.org.bukkit.NamespacedKey
getName()
static GlowParticle
getParticle
(org.bukkit.Effect effect) static GlowParticle
getParticle
(org.bukkit.NamespacedKey name) static GlowParticle
getParticle
(org.bukkit.Particle particle) boolean
Determine whether a particle type is considered long distance, meaning it has a higher visible range (65536) than normal (256).static boolean
isLongDistance
(org.bukkit.Effect effect) Checks if this effect is long distance.static boolean
isLongDistance
(org.bukkit.Particle particle) Checks if this particle is long distancestatic boolean
registerParticle
(org.bukkit.NamespacedKey name) Register a new custom particle.static boolean
registerParticleDataHandler
(Class<?> clazz, Function<Object, Object[]> handler) Register a new particle data handler for a certain class.
-
Constructor Details
-
GlowParticle
public GlowParticle(org.bukkit.NamespacedKey name, org.bukkit.Particle particle)
-
-
Method Details
-
getExtData
Gets the extra data for this particle.- Parameters:
o
- The data parameter, of typegetDataType()
- Returns:
- The networkable data that represents this extra particle data
-
getExtData
Convert an object to an extData array if possible for a particle.- Parameters:
particle
- theParticle
to validate.object
- the Object to convert.- Returns:
- The extData array for the particle effect.
-
getExtData
Convert an object to an extData array if possible for an effect.- Parameters:
effect
- theEffect
to validate.object
- the Object to convert.- Returns:
- The extData array for the particle effect.
-
getParticle
-
getParticle
-
getParticle
-
getId
public static int getId(@NotNull @NotNull org.bukkit.Particle particle) Get the particle id for a specifiedParticle
.- Parameters:
particle
- the Particle.- Returns:
- the particle id.
-
getId
public static int getId(org.bukkit.Effect effect) Get the particle id for a specifiedEffect
.- Parameters:
effect
- the effect.- Returns:
- the particle id.
-
isLongDistance
public boolean isLongDistance()Determine whether a particle type is considered long distance, meaning it has a higher visible range (65536) than normal (256).- Returns:
- True if the particle is long distance.
-
isLongDistance
public static boolean isLongDistance(org.bukkit.Particle particle) Checks if this particle is long distance- Parameters:
particle
- The particle- Returns:
- If long distance
- See Also:
-
isLongDistance
public static boolean isLongDistance(org.bukkit.Effect effect) Checks if this effect is long distance.- Parameters:
effect
- The effect- Returns:
- If long distance
- See Also:
-
registerParticle
public static boolean registerParticle(org.bukkit.NamespacedKey name) Register a new custom particle. An ID will be automatically assigned.- Parameters:
name
- The particle's name- Returns:
- If it successfully registered
-
registerParticleDataHandler
public static boolean registerParticleDataHandler(Class<?> clazz, Function<Object, Object[]> handler) Register a new particle data handler for a certain class.- Parameters:
clazz
- The class to handlehandler
- The function that handles instances of this class- Returns:
- If there was not already a handler for this class, and the handler was registered successfully
-
getName
public org.bukkit.NamespacedKey getName() -
getId
public int getId() -
getDataType
-
getDataHandler
-