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 ConstantsEnum ConstantDescription -
Method Summary
Modifier and TypeMethodDescriptionGets Bukkit color representing this color.Gets Bukkit dye color representing this color, if one exists.voiddeserialize(@NotNull Fields fields) Deserializes this object.static SkriptColorfromBukkitColor(Color color) static SkriptColorfromDyeColor(DyeColor dye) static @Nullable SkriptColorfromDyeData(short data) Deprecated.Magic numbersstatic @Nullable SkriptColorstatic @Nullable SkriptColorfromWoolData(short data) Deprecated.Magic numbers@Nullable AdjectivebyteDeprecated.getName()byteDeprecated.static StringReplace chat color character '§' with 'invalid input: '&'' This is an alternative method toChatColor.stripColor(String)But does not strip the color code.Serialises this object.toString()static SkriptColorReturns 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
Description copied from interface:ColorGets Bukkit color representing this color.- Specified by:
asBukkitColorin interfaceColor- Returns:
- Bukkit color.
-
asDyeColor
Description copied from interface:ColorGets Bukkit dye color representing this color, if one exists.- Specified by:
asDyeColorin interfaceColor- Returns:
- Dye color or null.
-
getName
-
serialize
Description copied from interface:YggdrasilSerializable.YggdrasilExtendedSerializableSerialises 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:
serializein 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 serializable
-
deserialize
Description copied from interface:YggdrasilSerializable.YggdrasilExtendedSerializableDeserializes 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:
deserializein 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 Yggdrasil's default serialisation.
-
getFormattedChat
-
getAdjective
-
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
-
replaceColorChar
Replace chat color character '§' with 'invalid input: '&'' This is an alternative method toChatColor.stripColor(String)But does not strip the color code.- Parameters:
s- string to replace chat color character of.- Returns:
- String with replaced chat color character
-
toString
- Overrides:
toStringin classEnum<SkriptColor>
-