9
0
mirror of https://github.com/BX-Team/DivineMC.git synced 2025-12-20 07:19:23 +00:00

[ci-skip] finish patches

This commit is contained in:
NONPLAYT
2023-03-21 20:54:44 +03:00
parent 747de0799b
commit 340edaf4d3
62 changed files with 597 additions and 176 deletions

View File

@@ -0,0 +1,33 @@
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
*