Added ChatColor values method

This commit is contained in:
Archy-X 2020-12-28 00:00:47 -07:00
parent 5975f8d838
commit 05f3760044

View File

@ -8,6 +8,7 @@ import net.minestom.server.utils.validate.Check;
import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable; import org.jetbrains.annotations.Nullable;
import java.util.Collection;
import java.util.HashMap; import java.util.HashMap;
import java.util.Map; import java.util.Map;
@ -199,6 +200,15 @@ public final class ChatColor {
return legacyColorCodesMap.getOrDefault(colorCode, NO_COLOR); return legacyColorCodesMap.getOrDefault(colorCode, NO_COLOR);
} }
/**
* Gets a collection of all chat colors
* @return a collection of all chat colors
*/
@NotNull
public static Collection<ChatColor> values() {
return colorCode.values();
}
public boolean isEmpty() { public boolean isEmpty() {
return empty; return empty;
} }