mirror of
https://github.com/BX-Team/DivineMC.git
synced 2025-12-19 14:59:25 +00:00
34 lines
1.0 KiB
Diff
34 lines
1.0 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: Aikar <aikar@aikar.co>
|
|
Date: Mon, 24 Apr 2017 20:27:23 -0400
|
|
Subject: [PATCH] EMC - Add ChatColor.getById
|
|
|
|
|
|
diff --git a/src/main/java/org/bukkit/ChatColor.java b/src/main/java/org/bukkit/ChatColor.java
|
|
index e3f185dc982d1c38195a4e01ddd485c13ffa58c0..8a3d05702ad0cfa8384d3a9c7a5695d82e13523e 100644
|
|
--- a/src/main/java/org/bukkit/ChatColor.java
|
|
+++ b/src/main/java/org/bukkit/ChatColor.java
|
|
@@ -233,6 +233,10 @@ public enum ChatColor {
|
|
}
|
|
};
|
|
|
|
+ public int getId() {
|
|
+ return intCode;
|
|
+ }
|
|
+
|
|
/**
|
|
* The special character which prefixes all chat colour codes. Use this if
|
|
* you need to dynamically convert colour codes from your custom format.
|
|
@@ -296,6 +300,11 @@ public enum ChatColor {
|
|
return !isFormat && this != RESET;
|
|
}
|
|
|
|
+ @Nullable
|
|
+ public static ChatColor getById(int id) {
|
|
+ return BY_ID.get(id);
|
|
+ }
|
|
+
|
|
/**
|
|
* Gets the color represented by the specified color code
|
|
*
|