Class RegularColor

Direct Known Subclasses:
DustData

public class RegularColor extends ParticleColor
An implementation of the ParticleColor class that supports normal RGB values.

If you want to define a custom size for ParticleEffect.REDSTONE or the second color for ParticleEffect.DUST_COLOR_TRANSITION, use DustData and DustColorTransitionData. You can however use this class if you're just looking to set the color.

Since:
10.06.2019
Author:
ByteZ
See Also:
  • Constructor Details

    • RegularColor

      public RegularColor(Color color)
      Initializes a new ParticleData object.
      Parameters:
      color - the Color the particle should have.
    • RegularColor

      public RegularColor(int red, int green, int blue)
      Initializes a new ParticleData object.
      Parameters:
      red - the red value of the color.
      green - the green value of the color.
      blue - the blue value of the color.
  • Method Details

    • getRed

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

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

      public float getBlue()
      Gets the blue value of the color.
      Overrides:
      getBlue in class ParticleColor
      Returns:
      the blue value.
    • 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.

      This method also supports TransitioningDust particles since 1.6.

      Specified by:
      toNMSData in class ParticleColor
      Returns:
      the nms data.
    • random

      public static RegularColor random()
      Generates a random RegularColor instance with a high saturation. If you want a completely random Color use random(boolean) with false as the highSaturarion parameter.
      Returns:
      a randomly generated RegularColor instance.
    • random

      public static RegularColor random(boolean highSaturation)
      Generates a random RegularColor instance. If the highSaturation parameter is set to true, a random hue from the HSV spectrum will be used. Otherwise, 3 random integers ranging from 0 to 255 for the RGB values will be generated.
      Parameters:
      highSaturation - determines if the colors should have a high saturation.
      Returns:
      a randomly generated RegularColor instance.
    • fromHSVHue

      public static RegularColor fromHSVHue(int hue)
      Constructs a RegularColor using the HSV color spectrum.
      Parameters:
      hue - the hue the specific color has.
      Returns:
      a RegularColor instance with the given HSV value as its Color.
      See Also: