Class ColorCompat

java.lang.Object
io.github.sefiraat.slimetinker.utils.ColorCompat

public final class ColorCompat extends Object
Version-safe replacement for ChatColor.of(String) (added in 1.16). On 1.16+ the hex colour is produced by reflectively invoking ChatColor.of, preserving the exact colour. On older servers (e.g. 1.8) where that method is absent, the nearest of the 16 legacy ChatColor values is returned so the plugin still loads and text stays sensibly coloured.
  • Method Details

    • of

      @Nonnull public static net.md_5.bungee.api.ChatColor of(@Nonnull String hex)