Class NoteColor


public final class NoteColor extends ParticleColor
An implementation of the ParticleColor class to support note colors.
Since:
10.06.2019
Author:
ByteZ
See Also:
  • Constructor Details

    • NoteColor

      public NoteColor(int note)
      Initializes a new ParticleData object.
      Parameters:
      note - the note that should be displayed.
  • Method Details

    • setEffect

      public void setEffect(ParticleEffect effect)
      Sets the ParticleEffect.
      Overrides:
      setEffect in class ParticleData
      Parameters:
      effect - the ParticleEffect that should be displayed.
    • getRed

      public float getRed()
      Gets the red value of the color.
      Overrides:
      getRed in class ParticleColor
      Returns:
      the red value.
    • getGreen

      public float getGreen()
      Returns 0 because the offsetY isn't used by the color of notes.
      Overrides:
      getGreen in class ParticleColor
      Returns:
      0.
    • getBlue

      public float getBlue()
      Returns 0 because the offsetZ isn't used by the color of notes.
      Overrides:
      getBlue in class ParticleColor
      Returns:
      0.
    • toNMSData

      public Object toNMSData()
      Converts the current ParticleData instance into nms data. If the current minecraft version was released before 1.13 an int array should be returned. If the version was released after 1.12 a nms "ParticleParam" has to be returned.
      Specified by:
      toNMSData in class ParticleColor
      Returns:
      the nms data.
    • random

      public static NoteColor random()
      Generates a random NoteColor instance to support rainbow trails, cloaks and other effects that can be constructed using the note particle.
      Returns:
      a random NoteColor instance.