Package ch.njol.skript.util
Enum Class SkriptColor
- All Implemented Interfaces:
Color
,YggdrasilSerializable
,YggdrasilSerializable.YggdrasilExtendedSerializable
,Serializable
,Comparable<SkriptColor>
,Constable
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
Nested classes/interfaces inherited from interface ch.njol.yggdrasil.YggdrasilSerializable
YggdrasilSerializable.YggdrasilExtendedSerializable, YggdrasilSerializable.YggdrasilRobustEnum, YggdrasilSerializable.YggdrasilRobustSerializable
-
Enum Constant Summary
Enum ConstantDescription -
Method Summary
Modifier and TypeMethodDescriptionorg.bukkit.Color
Gets Bukkit color representing this color.org.bukkit.ChatColor
org.bukkit.DyeColor
Gets Bukkit dye color representing this color, if one exists.void
deserialize(@NonNull Fields fields)
Deserialises this object.static SkriptColor
fromBukkitColor(org.bukkit.Color color)
static SkriptColor
fromDyeColor(org.bukkit.DyeColor dye)
static @Nullable SkriptColor
fromDyeData(short data)
Deprecated.Magic numbersstatic @Nullable SkriptColor
static @Nullable SkriptColor
fromWoolData(short data)
Deprecated.Magic numbers@Nullable Adjective
byte
Deprecated.getName()
byte
Deprecated.Serialises this object.toString()
static SkriptColor
Returns the enum constant of this class with the specified name.static SkriptColor[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
BLACK
-
DARK_GREY
-
LIGHT_GREY
-
WHITE
-
DARK_BLUE
-
BROWN
-
DARK_CYAN
-
LIGHT_CYAN
-
DARK_GREEN
-
LIGHT_GREEN
-
YELLOW
-
ORANGE
-
DARK_RED
-
LIGHT_RED
-
DARK_PURPLE
-
LIGHT_PURPLE
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum class has no constant with the specified nameNullPointerException
- if the argument is null
-
asBukkitColor
public org.bukkit.Color asBukkitColor()Description copied from interface:Color
Gets Bukkit color representing this color.- Specified by:
asBukkitColor
in interfaceColor
- Returns:
- Bukkit color.
-
asDyeColor
public org.bukkit.DyeColor asDyeColor()Description copied from interface:Color
Gets Bukkit dye color representing this color, if one exists.- Specified by:
asDyeColor
in interfaceColor
- Returns:
- Dye color or null.
-
getName
-
serialize
Description copied from interface:YggdrasilSerializable.YggdrasilExtendedSerializable
Serialises this object. Only fields contained in the returned Fields object will be written to stream.You can use return new
Fields
(this); to emulate the default behaviour.- Specified by:
serialize
in interfaceYggdrasilSerializable.YggdrasilExtendedSerializable
- Returns:
- A Fields object containing all fields that should be written to stream
- Throws:
NotSerializableException
- If this object or one of its fields is not serialisable
-
deserialize
Description copied from interface:YggdrasilSerializable.YggdrasilExtendedSerializable
Deserialises this object. No fields have been set when this method is called, use fields.setFields
(this, yggdrasil) to set all compatible non-transient and non-static fields (and call incompatible/missing field handlers if applicable – this implies that errors will be thrown if the fields object is invalid).You can use fields.
setFields
(this); to emulate the default behaviour.- Specified by:
deserialize
in interfaceYggdrasilSerializable.YggdrasilExtendedSerializable
- Parameters:
fields
- A Fields object containing all fields read from stream- Throws:
StreamCorruptedException
- If the Fields object is invalid, i.e. was not written byYggdrasilSerializable.YggdrasilExtendedSerializable.serialize()
or Yggrdasil's default serialisation.
-
getFormattedChat
-
getAdjective
-
asChatColor
public org.bukkit.ChatColor asChatColor() -
getWoolData
Deprecated. -
getDyeData
Deprecated. -
fromName
- Parameters:
name
- The String name of the color defined by Skript's .lang files.- Returns:
- Skript Color if matched up with the defined name
-
fromDyeColor
- Parameters:
dye
- DyeColor to match against a defined Skript Color.- Returns:
- Skript Color if matched up with the defined DyeColor
-
fromBukkitColor
-
fromDyeData
Deprecated.Magic numbers- Parameters:
data
- short to match against a defined Skript Color.- Returns:
- Skript Color if matched up with the defined short
-
fromWoolData
Deprecated.Magic numbers- Parameters:
data
- short to match against a defined Skript Color.- Returns:
- Skript Color if matched up with the defined short
-
toString
- Overrides:
toString
in classEnum<SkriptColor>
-