Package ch.njol.skript.util
Class ColorRGB
java.lang.Object
ch.njol.skript.util.ColorRGB
- All Implemented Interfaces:
Color
,YggdrasilSerializable
,YggdrasilSerializable.YggdrasilExtendedSerializable
-
Nested Class Summary
Nested classes/interfaces inherited from interface ch.njol.yggdrasil.YggdrasilSerializable
YggdrasilSerializable.YggdrasilExtendedSerializable, YggdrasilSerializable.YggdrasilRobustEnum, YggdrasilSerializable.YggdrasilRobustSerializable
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionorg.bukkit.Color
Gets Bukkit color representing this color.@Nullable org.bukkit.DyeColor
Gets Bukkit dye color representing this color, if one exists.void
deserialize(Fields fields)
Deserialises this object.static @Nullable ColorRGB
fromString(String string)
getName()
Serialises this object.
-
Constructor Details
-
ColorRGB
public ColorRGB(int red, int green, int blue)
-
-
Method Details
-
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 @Nullable 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
-
fromString
-
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.NotSerializableException
-