Class GlowParticle

java.lang.Object
net.glowstone.constants.GlowParticle

public class GlowParticle extends Object
Id mappings for particles.
  • Constructor Details

    • GlowParticle

      public GlowParticle(org.bukkit.NamespacedKey name, org.bukkit.Particle particle)
  • Method Details

    • getExtData

      public Object[] getExtData(Object o)
      Gets the extra data for this particle.
      Parameters:
      o - The data parameter, of type getDataType()
      Returns:
      The networkable data that represents this extra particle data
    • getExtData

      public static Object[] getExtData(org.bukkit.Particle particle, Object object)
      Convert an object to an extData array if possible for a particle.
      Parameters:
      particle - the Particle to validate.
      object - the Object to convert.
      Returns:
      The extData array for the particle effect.
    • getExtData

      public static Object[] getExtData(org.bukkit.Effect effect, Object object)
      Convert an object to an extData array if possible for an effect.
      Parameters:
      effect - the Effect to validate.
      object - the Object to convert.
      Returns:
      The extData array for the particle effect.
    • getParticle

      public static GlowParticle getParticle(org.bukkit.NamespacedKey name)
    • getParticle

      public static GlowParticle getParticle(org.bukkit.Particle particle)
    • getParticle

      public static GlowParticle getParticle(org.bukkit.Effect effect)
    • getId

      public static int getId(@NotNull @NotNull org.bukkit.Particle particle)
      Get the particle id for a specified Particle.
      Parameters:
      particle - the Particle.
      Returns:
      the particle id.
    • getId

      public static int getId(org.bukkit.Effect effect)
      Get the particle id for a specified Effect.
      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 handle
      handler - 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

      public Class<?> getDataType()
    • getDataHandler

      public Function<Object,Object[]> getDataHandler()