mirror of
https://github.com/PaperMC/Paper.git
synced 2025-08-05 06:32:17 -07:00
net.minecraft
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
--- a/net/minecraft/ChatFormatting.java
|
||||
+++ b/net/minecraft/ChatFormatting.java
|
||||
@@ -112,6 +_,19 @@
|
||||
return friendlyName == null ? null : FORMATTING_BY_NAME.get(cleanName(friendlyName));
|
||||
}
|
||||
|
||||
+ // Paper start - add method to get by hex value
|
||||
+ @Nullable
|
||||
+ public static ChatFormatting getByHexValue(int i) {
|
||||
+ for (ChatFormatting value : values()) {
|
||||
+ if (value.getColor() != null && value.getColor() == i) {
|
||||
+ return value;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ return null;
|
||||
+ }
|
||||
+ // Paper end - add method to get by hex value
|
||||
+
|
||||
@Nullable
|
||||
public static ChatFormatting getById(int index) {
|
||||
if (index < 0) {
|
Reference in New Issue
Block a user