Interface ParticleTypeNote

All Superinterfaces:
ParticleType

public interface ParticleTypeNote extends ParticleType

Class used to represent note particle type that can construct colored particle packet.

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

Some packetNote methods overloads have to validate color parameter(s) to properly select certain color.

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.

See Also:
  • Method Summary

    Modifier and Type
    Method
    Description
    Makes an independent from previously called particle type, copy of this particle type.
    packetNote(boolean far, double x, double y, double z, double color)
    Construct particle packet that will spawn 1 colored note particle at specified position with provided color.
    packetNote(boolean far, double x, double y, double z, int r, int g, int b)
    Construct particle packet that will spawn 1 colored note particle at specified position with provided color.
    packetNote(boolean far, double x, double y, double z, org.bukkit.Color color)
    Construct particle packet that will spawn 1 colored note particle at specified position with provided color.
    packetNote(boolean far, org.bukkit.Location loc, double color)
    Construct particle packet that will spawn 1 colored note particle at specified position with provided color.
    packetNote(boolean far, org.bukkit.Location loc, int r, int g, int b)
    Construct particle packet that will spawn 1 colored note particle at specified position with provided color.
    packetNote(boolean far, org.bukkit.Location loc, org.bukkit.Color color)
    Construct particle packet that will spawn 1 colored note particle at specified position with provided color.
    packetNote(boolean far, org.bukkit.util.Vector loc, double color)
    Construct particle packet that will spawn 1 colored note particle at specified position with provided color.
    packetNote(boolean far, org.bukkit.util.Vector loc, int r, int g, int b)
    Construct particle packet that will spawn 1 colored note particle at specified position with provided color.
    packetNote(boolean far, org.bukkit.util.Vector loc, org.bukkit.Color color)
    Construct particle packet that will spawn 1 colored note particle at specified position with provided color.

    Methods inherited from interface com.github.fierioziy.particlenativeapi.api.particle.type.ParticleType

    isPresent, packet, packet, packet, packet, packet, packet, packet, packet, packet, packet, packet, packet, packet, packet, packet
  • Method Details

    • detachCopy

      ParticleTypeNote detachCopy()

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

      Returned instance can be cached and reused.

      Specified by:
      detachCopy in interface ParticleType
      Returns:
      an independent copy of this selected particle type.
    • packetNote

      ParticlePacket packetNote(boolean far, org.bukkit.Location loc, org.bukkit.Color color)

      Construct particle packet that will spawn 1 colored note particle at specified position with provided color.

      This method may not work correctly due to bug - MC-80658. It affects MC versions between 1.8 and 1.13 where most of the colors are gray-ish.

      It has been fixed in MC 1.14 where normal colors spectrum works again.

      Note particle can't be dimmed and brighten so certain checks have to be performed:

      • at least one color channel must have value of 255,
      • there is no more than 2 channels active at the same time.

      Otherwise, an UnsupportedOperationException will be thrown.

      Examples of valid colors:

      • (255, 180, 0)
      • (255, 0, 255)
      • (0, 255, 0)

      Examples of colors that will throw an exception:

      • (0, 180, 0) - must be at least 1 color channel with 255 value,
      • (255, 30, 255) - all color channels can't be active at the same time.

      It is wise to check, if particle is supported by current Spigot version using ParticleType.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.
      color - a Color object with specified color.
      Returns:
      an NMS Packet wrapped in shared ParticlePacket object.
      Throws:
      ParticleException - when requested particle type is not supported by this server version.
      UnsupportedOperationException - when color does not have at least 1 color channel with 255 value or when there is more than 2 color channels active at the same time.
    • packetNote

      ParticlePacket packetNote(boolean far, org.bukkit.util.Vector loc, org.bukkit.Color color)

      Construct particle packet that will spawn 1 colored note particle at specified position with provided color.

      This method may not work correctly due to bug - MC-80658. It affects MC versions between 1.8 and 1.13 where most of the colors are gray-ish.

      It has been fixed in MC 1.14 where normal colors spectrum works again.

      Note particle can't be dimmed and brighten so certain checks have to be performed:

      • at least one color channel must have value of 255,
      • there is no more than 2 channels active at the same time.

      Otherwise, an UnsupportedOperationException will be thrown.

      Examples of valid colors:

      • (255, 180, 0)
      • (255, 0, 255)
      • (0, 255, 0)

      Examples of colors that will throw an exception:

      • (0, 180, 0) - must be at least 1 color channel with 255 value,
      • (255, 30, 255) - all color channels can't be active at the same time.

      It is wise to check, if particle is supported by current Spigot version using ParticleType.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.
      color - a Color object with specified color.
      Returns:
      an NMS Packet wrapped in shared ParticlePacket object.
      Throws:
      ParticleException - when requested particle type is not supported by this server version.
      UnsupportedOperationException - when color does not have at least 1 color channel with 255 value or when there is more than 2 color channels active at the same time.
    • packetNote

      ParticlePacket packetNote(boolean far, double x, double y, double z, org.bukkit.Color color)

      Construct particle packet that will spawn 1 colored note particle at specified position with provided color.

      This method may not work correctly due to bug - MC-80658. It affects MC versions between 1.8 and 1.13 where most of the colors are gray-ish.

      It has been fixed in MC 1.14 where normal colors spectrum works again.

      Note particle can't be dimmed and brighten so certain checks have to be performed:

      • at least one color channel must have value of 255,
      • there is no more than 2 channels active at the same time.

      Otherwise, an UnsupportedOperationException will be thrown.

      Examples of valid colors:

      • (255, 180, 0)
      • (255, 0, 255)
      • (0, 255, 0)

      Examples of colors that will throw an exception:

      • (0, 180, 0) - must be at least 1 color channel with 255 value,
      • (255, 30, 255) - all color channels can't be active at the same time.

      It is wise to check, if particle is supported by current Spigot version using ParticleType.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.
      color - a Color object with specified color.
      Returns:
      an NMS Packet wrapped in shared ParticlePacket object.
      Throws:
      ParticleException - when requested particle type is not supported by this server version.
      UnsupportedOperationException - when color does not have at least 1 color channel with 255 value or when there is more than 2 color channels active at the same time.
    • packetNote

      ParticlePacket packetNote(boolean far, org.bukkit.Location loc, int r, int g, int b)

      Construct particle packet that will spawn 1 colored note particle at specified position with provided color.

      This method may not work correctly due to bug - MC-80658. It affects MC versions between 1.8 and 1.13 where most of the colors are gray-ish.

      It has been fixed in MC 1.14 where normal colors spectrum works again.

      Note particle can't be dimmed and brighten so certain checks have to be performed:

      • at least one color channel must have value of 255,
      • there is no more than 2 channels active at the same time.

      Otherwise, an UnsupportedOperationException will be thrown.

      Examples of valid colors:

      • (255, 180, 0)
      • (255, 0, 255)
      • (0, 255, 0)

      Examples of colors that will throw an exception:

      • (0, 180, 0) - must be at least 1 color channel with 255 value,
      • (255, 30, 255) - all color channels can't be active at the same time.

      It is wise to check, if particle is supported by current Spigot version using ParticleType.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.
      r - red color value that should be between 0 and 255.
      g - green color value that should be between 0 and 255.
      b - blue color value that should be between 0 and 255.
      Returns:
      an NMS Packet wrapped in shared ParticlePacket object.
      Throws:
      ParticleException - when requested particle type is not supported by this server version.
      UnsupportedOperationException - when color does not have at least 1 color channel with 255 value or when there is more than 2 color channels active at the same time.
    • packetNote

      ParticlePacket packetNote(boolean far, org.bukkit.util.Vector loc, int r, int g, int b)

      Construct particle packet that will spawn 1 colored note particle at specified position with provided color.

      This method may not work correctly due to bug - MC-80658. It affects MC versions between 1.8 and 1.13 where most of the colors are gray-ish.

      It has been fixed in MC 1.14 where normal colors spectrum works again.

      Note particle can't be dimmed and brighten so certain checks have to be performed:

      • at least one color channel must have value of 255,
      • there is no more than 2 channels active at the same time.

      Otherwise, an UnsupportedOperationException will be thrown.

      Examples of valid colors:

      • (255, 180, 0)
      • (255, 0, 255)
      • (0, 255, 0)

      Examples of colors that will throw an exception:

      • (0, 180, 0) - must be at least 1 color channel with 255 value,
      • (255, 30, 255) - all color channels can't be active at the same time.

      It is wise to check, if particle is supported by current Spigot version using ParticleType.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.
      r - red color value that should be between 0 and 255.
      g - green color value that should be between 0 and 255.
      b - blue color value that should be between 0 and 255.
      Returns:
      an NMS Packet wrapped in shared ParticlePacket object.
      Throws:
      ParticleException - when requested particle type is not supported by this server version.
      UnsupportedOperationException - when color does not have at least 1 color channel with 255 value or when there is more than 2 color channels active at the same time.
    • packetNote

      ParticlePacket packetNote(boolean far, double x, double y, double z, int r, int g, int b)

      Construct particle packet that will spawn 1 colored note particle at specified position with provided color.

      This method may not work correctly due to bug - MC-80658. It affects MC versions between 1.8 and 1.13 where most of the colors are gray-ish.

      It has been fixed in MC 1.14 where normal colors spectrum works again.

      Note particle can't be dimmed and brighten so certain checks have to be performed:

      • at least one color channel must have value of 255,
      • there is no more than 2 channels active at the same time.

      Otherwise, an UnsupportedOperationException will be thrown.

      Examples of valid colors:

      • (255, 180, 0)
      • (255, 0, 255)
      • (0, 255, 0)

      Examples of colors that will throw an exception:

      • (0, 180, 0) - must be at least 1 color channel with 255 value,
      • (255, 30, 255) - all color channels can't be active at the same time.

      It is wise to check, if particle is supported by current Spigot version using ParticleType.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.
      r - red color value that should be between 0 and 255.
      g - green color value that should be between 0 and 255.
      b - blue color value that should be between 0 and 255.
      Returns:
      an NMS Packet wrapped in shared ParticlePacket object.
      Throws:
      ParticleException - when requested particle type is not supported by this server version.
      UnsupportedOperationException - when color does not have at least 1 color channel with 255 value or when there is more than 2 color channels active at the same time.
    • packetNote

      ParticlePacket packetNote(boolean far, org.bukkit.Location loc, double color)

      Construct particle packet that will spawn 1 colored note particle at specified position with provided color.

      Parameters are not validated in any way.

      Note particle can't be dimmed and brighten.

      To color this particle, you have to use scale between 0.0 and 1.0. An valid proportion can be made by taking an index of certain note's color divided by 24 (amount of color notes).

      Those note colors can be found on the wiki page about Note Block here: NoteBlock#Notes

      It is wise to check, if particle is supported by current Spigot version using ParticleType.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.
      color - a proportion value representing note color.
      Returns:
      an NMS Packet wrapped in shared ParticlePacket object.
      Throws:
      ParticleException - when requested particle type is not supported by this server version.
    • packetNote

      ParticlePacket packetNote(boolean far, org.bukkit.util.Vector loc, double color)

      Construct particle packet that will spawn 1 colored note particle at specified position with provided color.

      Parameters are not validated in any way.

      Note particle can't be dimmed and brighten.

      To color this particle, you have to use scale between 0.0 and 1.0. An valid proportion can be made by taking an index of certain note's color divided by 24 (amount of color notes).

      Those note colors can be found on the wiki page about Note Block here: NoteBlock#Notes

      It is wise to check, if particle is supported by current Spigot version using ParticleType.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.
      color - a proportion value representing note color.
      Returns:
      an NMS Packet wrapped in shared ParticlePacket object.
      Throws:
      ParticleException - when requested particle type is not supported by this server version.
    • packetNote

      ParticlePacket packetNote(boolean far, double x, double y, double z, double color)

      Construct particle packet that will spawn 1 colored note particle at specified position with provided color.

      Parameters are not validated in any way.

      Note particle can't be dimmed and brighten.

      To color this particle, you have to use scale between 0.0 and 1.0. An valid proportion can be made by taking an index of certain note's color divided by 24 (amount of color notes).

      Those note colors can be found on the wiki page about Note Block here: NoteBlock#Notes

      It is wise to check, if particle is supported by current Spigot version using ParticleType.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.
      color - a proportion value representing note color.
      Returns:
      an NMS Packet wrapped in shared ParticlePacket object.
      Throws:
      ParticleException - when requested particle type is not supported by this server version.