All Known Subinterfaces:
ParticleTypeColorable, ParticleTypeMotion, ParticleTypeNote, ParticleTypeRedstone

public interface ParticleType

Class used to represent particle type with no additional features.

It provides a non-reflective packet method overloads to construct particle packet with desired parameters.

All packet methods does not validate parameters in any way.

IMPORTANT NOTE: All methods annotated with Shared annotation caches and returns exactly one and the same instance with changed state between method calls. For an independent copy of returned instances, check detachCopy methods on them.

  • Method Summary

    Modifier and Type
    Method
    Description
    Makes an independent from previously called particle type, copy of this particle type.
    boolean
    Checks if this particle is supported by this Spigot version.
    packet(boolean far, double x, double y, double z)
    Construct particle packet that will spawn 1 particle at specified position.
    packet(boolean far, double x, double y, double z, double offsetX, double offsetY, double offsetZ, double speed, int count)
    Construct particle packet that will spawn count particles at specified position using provided offset parameters and speed parameter.
    packet(boolean far, double x, double y, double z, double offsetX, double offsetY, double offsetZ, int count)
    Construct particle packet that will spawn count particles at specified position using provided offset parameters.
    packet(boolean far, double x, double y, double z, double speed, int count)
    Construct particle packet that will spawn count particles at specified position using speed parameter.
    packet(boolean far, double x, double y, double z, int count)
    Construct particle packet that will spawn count particles at specified position.
    packet(boolean far, org.bukkit.Location loc)
    Construct particle packet that will spawn 1 particle at specified position.
    packet(boolean far, org.bukkit.Location loc, double offsetX, double offsetY, double offsetZ, double speed, int count)
    Construct particle packet that will spawn count particles at specified position using provided offset parameters and speed parameter.
    packet(boolean far, org.bukkit.Location loc, double offsetX, double offsetY, double offsetZ, int count)
    Construct particle packet that will spawn count particles at specified position using provided offset parameters.
    packet(boolean far, org.bukkit.Location loc, double speed, int count)
    Construct particle packet that will spawn count particles at specified position using speed parameter.
    packet(boolean far, org.bukkit.Location loc, int count)
    Construct particle packet that will spawn count particles at specified position.
    packet(boolean far, org.bukkit.util.Vector loc)
    Construct particle packet that will spawn 1 particle at specified position.
    packet(boolean far, org.bukkit.util.Vector loc, double offsetX, double offsetY, double offsetZ, double speed, int count)
    Construct particle packet that will spawn count particles at specified position using provided offset parameters and speed parameter.
    packet(boolean far, org.bukkit.util.Vector loc, double offsetX, double offsetY, double offsetZ, int count)
    Construct particle packet that will spawn count particles at specified position using provided offset parameters.
    packet(boolean far, org.bukkit.util.Vector loc, double speed, int count)
    Construct particle packet that will spawn count particles at specified position using speed parameter.
    packet(boolean far, org.bukkit.util.Vector loc, int count)
    Construct particle packet that will spawn count particles at specified position.
  • Method Details

    • detachCopy

      ParticleType detachCopy()

      Makes an independent from previously called particle type, copy of this particle type.

      Returned instance can be cached and reused.

      Returns:
      an independent copy of this selected particle type.
    • packet

      ParticlePacket packet(boolean far, org.bukkit.Location loc)

      Construct particle packet that will spawn 1 particle at specified position.

      Parameters are not validated in any way.

      It is wise to check, if particle is supported by current Spigot version using isPresent() method.

      Parameters:
      far - if true, packets will be rendered much further than 16 blocks (flag is ignored prior to MC 1.8 versions).
      loc - a Location containing position.
      Returns:
      an NMS Packet wrapped in shared ParticlePacket object.
      Throws:
      ParticleException - when requested particle type is not supported by this server version.
    • packet

      ParticlePacket packet(boolean far, org.bukkit.util.Vector loc)

      Construct particle packet that will spawn 1 particle at specified position.

      Parameters are not validated in any way.

      It is wise to check, if particle is supported by current Spigot version using isPresent() method.

      Parameters:
      far - if true, packets will be rendered much further than 16 blocks (flag is ignored prior to MC 1.8 versions).
      loc - a Vector containing position.
      Returns:
      an NMS Packet wrapped in shared ParticlePacket object.
      Throws:
      ParticleException - when requested particle type is not supported by this server version.
    • packet

      ParticlePacket packet(boolean far, double x, double y, double z)

      Construct particle packet that will spawn 1 particle at specified position.

      Parameters are not validated in any way.

      It is wise to check, if particle is supported by current Spigot version using isPresent() method.

      Parameters:
      far - if true, packets will be rendered much further than 16 blocks (flag is ignored prior to MC 1.8 versions).
      x - component of a position.
      y - component of a position.
      z - component of a position.
      Returns:
      an NMS Packet wrapped in shared ParticlePacket object.
      Throws:
      ParticleException - when requested particle type is not supported by this server version.
    • packet

      ParticlePacket packet(boolean far, org.bukkit.Location loc, int count)

      Construct particle packet that will spawn count particles at specified position.

      Parameters are not validated in any way.

      It is wise to check, if particle is supported by current Spigot version using isPresent() method.

      Parameters:
      far - if true, packets will be rendered much further than 16 blocks (flag is ignored prior to MC 1.8 versions).
      loc - a Location containing position.
      count - amount of particles to spawn.
      Returns:
      an NMS Packet wrapped in shared ParticlePacket object.
      Throws:
      ParticleException - when requested particle type is not supported by this server version.
    • packet

      ParticlePacket packet(boolean far, org.bukkit.util.Vector loc, int count)

      Construct particle packet that will spawn count particles at specified position.

      Parameters are not validated in any way.

      It is wise to check, if particle is supported by current Spigot version using isPresent() method.

      Parameters:
      far - if true, packets will be rendered much further than 16 blocks (flag is ignored prior to MC 1.8 versions).
      loc - a Vector containing position.
      count - amount of particles to spawn.
      Returns:
      an NMS Packet wrapped in shared ParticlePacket object.
      Throws:
      ParticleException - when requested particle type is not supported by this server version.
    • packet

      ParticlePacket packet(boolean far, double x, double y, double z, int count)

      Construct particle packet that will spawn count particles at specified position.

      Parameters are not validated in any way.

      It is wise to check, if particle is supported by current Spigot version using isPresent() method.

      Parameters:
      far - if true, packets will be rendered much further than 16 blocks (flag is ignored prior to MC 1.8 versions).
      x - component of a position.
      y - component of a position.
      z - component of a position.
      count - amount of particles to spawn.
      Returns:
      an NMS Packet wrapped in shared ParticlePacket object.
      Throws:
      ParticleException - when requested particle type is not supported by this server version.
    • packet

      ParticlePacket packet(boolean far, org.bukkit.Location loc, double speed, int count)

      Construct particle packet that will spawn count particles at specified position using speed parameter.

      Parameters are not validated in any way.

      It is wise to check, if particle is supported by current Spigot version using isPresent() method.

      Parameters:
      far - if true, packets will be rendered much further than 16 blocks (flag is ignored prior to MC 1.8 versions).
      loc - a Location containing position.
      speed - parameter used in various contexts.
      count - amount of particles to spawn.
      Returns:
      an NMS Packet wrapped in shared ParticlePacket object.
      Throws:
      ParticleException - when requested particle type is not supported by this server version.
    • packet

      ParticlePacket packet(boolean far, org.bukkit.util.Vector loc, double speed, int count)

      Construct particle packet that will spawn count particles at specified position using speed parameter.

      Parameters are not validated in any way.

      It is wise to check, if particle is supported by current Spigot version using isPresent() method.

      Parameters:
      far - if true, packets will be rendered much further than 16 blocks (flag is ignored prior to MC 1.8 versions).
      loc - a Vector containing position.
      speed - parameter used in various contexts.
      count - amount of particles to spawn.
      Returns:
      an NMS Packet wrapped in shared ParticlePacket object.
      Throws:
      ParticleException - when requested particle type is not supported by this server version.
    • packet

      ParticlePacket packet(boolean far, double x, double y, double z, double speed, int count)

      Construct particle packet that will spawn count particles at specified position using speed parameter.

      Parameters are not validated in any way.

      It is wise to check, if particle is supported by current Spigot version using isPresent() method.

      Parameters:
      far - if true, packets will be rendered much further than 16 blocks (flag is ignored prior to MC 1.8 versions).
      x - component of a position.
      y - component of a position.
      z - component of a position.
      speed - parameter used in various contexts.
      count - amount of particles to spawn.
      Returns:
      an NMS Packet wrapped in shared ParticlePacket object.
      Throws:
      ParticleException - when requested particle type is not supported by this server version.
    • packet

      ParticlePacket packet(boolean far, org.bukkit.Location loc, double offsetX, double offsetY, double offsetZ, int count)

      Construct particle packet that will spawn count particles at specified position using provided offset parameters.

      Parameters are not validated in any way.

      It is wise to check, if particle is supported by current Spigot version using isPresent() method.

      Parameters:
      far - if true, packets will be rendered much further than 16 blocks (flag is ignored prior to MC 1.8 versions).
      loc - a Location containing position.
      offsetX - parameter used in various contexts.
      offsetY - parameter used in various contexts.
      offsetZ - parameter used in various contexts.
      count - amount of particles to spawn.
      Returns:
      an NMS Packet wrapped in shared ParticlePacket object.
      Throws:
      ParticleException - when requested particle type is not supported by this server version.
    • packet

      ParticlePacket packet(boolean far, org.bukkit.util.Vector loc, double offsetX, double offsetY, double offsetZ, int count)

      Construct particle packet that will spawn count particles at specified position using provided offset parameters.

      Parameters are not validated in any way.

      It is wise to check, if particle is supported by current Spigot version using isPresent() method.

      Parameters:
      far - if true, packets will be rendered much further than 16 blocks (flag is ignored prior to MC 1.8 versions).
      loc - a Vector containing position.
      offsetX - parameter used in various contexts.
      offsetY - parameter used in various contexts.
      offsetZ - parameter used in various contexts.
      count - amount of particles to spawn.
      Returns:
      an NMS Packet wrapped in shared ParticlePacket object.
      Throws:
      ParticleException - when requested particle type is not supported by this server version.
    • packet

      ParticlePacket packet(boolean far, double x, double y, double z, double offsetX, double offsetY, double offsetZ, int count)

      Construct particle packet that will spawn count particles at specified position using provided offset parameters.

      Parameters are not validated in any way.

      It is wise to check, if particle is supported by current Spigot version using isPresent() method.

      Parameters:
      far - if true, packets will be rendered much further than 16 blocks (flag is ignored prior to MC 1.8 versions).
      x - component of a position.
      y - component of a position.
      z - component of a position.
      offsetX - parameter used in various contexts.
      offsetY - parameter used in various contexts.
      offsetZ - parameter used in various contexts.
      count - amount of particles to spawn.
      Returns:
      an NMS Packet wrapped in shared ParticlePacket object.
      Throws:
      ParticleException - when requested particle type is not supported by this server version.
    • packet

      ParticlePacket packet(boolean far, org.bukkit.Location loc, double offsetX, double offsetY, double offsetZ, double speed, int count)

      Construct particle packet that will spawn count particles at specified position using provided offset parameters and speed parameter.

      Parameters are not validated in any way.

      It is wise to check, if particle is supported by current Spigot version using isPresent() method.

      Parameters:
      far - if true, packets will be rendered much further than 16 blocks (flag is ignored prior to MC 1.8 versions).
      loc - a Location containing position.
      offsetX - parameter used in various contexts.
      offsetY - parameter used in various contexts.
      offsetZ - parameter used in various contexts.
      speed - parameter used in various contexts.
      count - amount of particles to spawn.
      Returns:
      an NMS Packet wrapped in shared ParticlePacket object.
      Throws:
      ParticleException - when requested particle type is not supported by this server version.
    • packet

      ParticlePacket packet(boolean far, org.bukkit.util.Vector loc, double offsetX, double offsetY, double offsetZ, double speed, int count)

      Construct particle packet that will spawn count particles at specified position using provided offset parameters and speed parameter.

      Parameters are not validated in any way.

      It is wise to check, if particle is supported by current Spigot version using isPresent() method.

      Parameters:
      far - if true, packets will be rendered much further than 16 blocks (flag is ignored prior to MC 1.8 versions).
      loc - a Vector containing position.
      offsetX - parameter used in various contexts.
      offsetY - parameter used in various contexts.
      offsetZ - parameter used in various contexts.
      speed - parameter used in various contexts.
      count - amount of particles to spawn.
      Returns:
      an NMS Packet wrapped in shared ParticlePacket object.
      Throws:
      ParticleException - when requested particle type is not supported by this server version.
    • packet

      ParticlePacket packet(boolean far, double x, double y, double z, double offsetX, double offsetY, double offsetZ, double speed, int count)

      Construct particle packet that will spawn count particles at specified position using provided offset parameters and speed parameter.

      Parameters are not validated in any way.

      This method is overridden by dynamically generated subclasses and depending on implementation this method will look roughly like this:

      
       public Packet packet(boolean far, double x, double y, double z,
                            double offsetX, double offsetY, double offsetZ,
                            double speed, int count) {
           sharedPacket.setPacket(new PacketPlayOutWorldParticles(parameters...));
           return sharedPacket;
       }
       

      It is wise to check, if particle is supported by current Spigot version using isPresent() method.

      Parameters:
      far - if true, packets will be rendered much further than 16 blocks (flag is ignored prior to MC 1.8 versions).
      x - component of a position.
      y - component of a position.
      z - component of a position.
      offsetX - parameter used in various contexts.
      offsetY - parameter used in various contexts.
      offsetZ - parameter used in various contexts.
      speed - parameter used in various contexts.
      count - amount of particles to spawn.
      Returns:
      an NMS Packet wrapped in shared ParticlePacket object.
      Throws:
      ParticleException - when requested particle type is not supported by this server version.
    • isPresent

      boolean isPresent()

      Checks if this particle is supported by this Spigot version.

      This method is overridden by dynamically generated subclasses.

      Returns:
      true if this particle is supported by this server version, false otherwise.