PocketMine-MP 5.21.2 git-b2aa6396c3cc2cafdd815eacc360e1ad89599899
|
Static Public Member Functions | |
static | addBase (string $baseFormat, string $string) |
static | clean (string $string, bool $removeFormat=true) |
static | colorize (string $string, string $placeholder="&") |
static | toHTML (string $string) |
static | tokenize (string $string) |
Public Attributes | |
const | AQUA = TextFormat::ESCAPE . "b" |
const | BLACK = TextFormat::ESCAPE . "0" |
const | BLUE = TextFormat::ESCAPE . "9" |
const | BOLD = TextFormat::ESCAPE . "l" |
const | COLORS |
const | DARK_AQUA = TextFormat::ESCAPE . "3" |
const | DARK_BLUE = TextFormat::ESCAPE . "1" |
const | DARK_GRAY = TextFormat::ESCAPE . "8" |
const | DARK_GREEN = TextFormat::ESCAPE . "2" |
const | DARK_PURPLE = TextFormat::ESCAPE . "5" |
const | DARK_RED = TextFormat::ESCAPE . "4" |
const | EOL = "\n" |
const | ESCAPE = "\xc2\xa7" |
const | FORMATS |
const | GOLD = TextFormat::ESCAPE . "6" |
const | GRAY = TextFormat::ESCAPE . "7" |
const | GREEN = TextFormat::ESCAPE . "a" |
const | ITALIC = TextFormat::ESCAPE . "o" |
const | LIGHT_PURPLE = TextFormat::ESCAPE . "d" |
const | MINECOIN_GOLD = TextFormat::ESCAPE . "g" |
const | OBFUSCATED = TextFormat::ESCAPE . "k" |
const | RED = TextFormat::ESCAPE . "c" |
const | RESET = TextFormat::ESCAPE . "r" |
const | STRIKETHROUGH = TextFormat::ESCAPE . "m" |
const | UNDERLINE = TextFormat::ESCAPE . "n" |
const | WHITE = TextFormat::ESCAPE . "f" |
const | YELLOW = TextFormat::ESCAPE . "e" |
Class used to handle Minecraft chat format, and convert it to other formats like HTML
Definition at line 45 of file TextFormat.php.
|
static |
Adds base formatting to the string. The given format codes will be inserted directly after any RESET (§r) codes.
This is useful for log messages, where a RESET code should return to the log message's original colour (e.g. blue for NOTICE), rather than whatever the terminal's base text colour is (usually some off-white colour).
Example behaviour:
Note: Adding base formatting to the output string a second time will result in a combination of formats from both calls. This is not by design, but simply a consequence of the way the function is implemented.
Definition at line 174 of file TextFormat.php.
|
static |
Cleans the string from Minecraft codes, ANSI Escape Codes and invalid UTF-8 characters
Definition at line 143 of file TextFormat.php.
|
static |
Replaces placeholders of § with the correct character. Only valid codes (as in the constants of the TextFormat class) will be converted.
string | $placeholder | default "&" |
Definition at line 157 of file TextFormat.php.
|
static |
Returns an HTML-formatted string with colors/markup
Definition at line 189 of file TextFormat.php.
|
static |
const pocketmine\utils\TextFormat::AQUA = TextFormat::ESCAPE . "b" |
Definition at line 60 of file TextFormat.php.
const pocketmine\utils\TextFormat::BLACK = TextFormat::ESCAPE . "0" |
Definition at line 49 of file TextFormat.php.
const pocketmine\utils\TextFormat::BLUE = TextFormat::ESCAPE . "9" |
Definition at line 58 of file TextFormat.php.
const pocketmine\utils\TextFormat::BOLD = TextFormat::ESCAPE . "l" |
Definition at line 88 of file TextFormat.php.
const pocketmine\utils\TextFormat::COLORS |
Definition at line 67 of file TextFormat.php.
const pocketmine\utils\TextFormat::DARK_AQUA = TextFormat::ESCAPE . "3" |
Definition at line 52 of file TextFormat.php.
const pocketmine\utils\TextFormat::DARK_BLUE = TextFormat::ESCAPE . "1" |
Definition at line 50 of file TextFormat.php.
const pocketmine\utils\TextFormat::DARK_GRAY = TextFormat::ESCAPE . "8" |
Definition at line 57 of file TextFormat.php.
const pocketmine\utils\TextFormat::DARK_GREEN = TextFormat::ESCAPE . "2" |
Definition at line 51 of file TextFormat.php.
const pocketmine\utils\TextFormat::DARK_PURPLE = TextFormat::ESCAPE . "5" |
Definition at line 54 of file TextFormat.php.
const pocketmine\utils\TextFormat::DARK_RED = TextFormat::ESCAPE . "4" |
Definition at line 53 of file TextFormat.php.
const pocketmine\utils\TextFormat::EOL = "\n" |
Definition at line 47 of file TextFormat.php.
const pocketmine\utils\TextFormat::ESCAPE = "\xc2\xa7" |
Definition at line 46 of file TextFormat.php.
const pocketmine\utils\TextFormat::FORMATS |
Definition at line 93 of file TextFormat.php.
const pocketmine\utils\TextFormat::GOLD = TextFormat::ESCAPE . "6" |
Definition at line 55 of file TextFormat.php.
const pocketmine\utils\TextFormat::GRAY = TextFormat::ESCAPE . "7" |
Definition at line 56 of file TextFormat.php.
const pocketmine\utils\TextFormat::GREEN = TextFormat::ESCAPE . "a" |
Definition at line 59 of file TextFormat.php.
const pocketmine\utils\TextFormat::ITALIC = TextFormat::ESCAPE . "o" |
Definition at line 91 of file TextFormat.php.
const pocketmine\utils\TextFormat::LIGHT_PURPLE = TextFormat::ESCAPE . "d" |
Definition at line 62 of file TextFormat.php.
const pocketmine\utils\TextFormat::MINECOIN_GOLD = TextFormat::ESCAPE . "g" |
Definition at line 65 of file TextFormat.php.
const pocketmine\utils\TextFormat::OBFUSCATED = TextFormat::ESCAPE . "k" |
Definition at line 87 of file TextFormat.php.
const pocketmine\utils\TextFormat::RED = TextFormat::ESCAPE . "c" |
Definition at line 61 of file TextFormat.php.
const pocketmine\utils\TextFormat::RESET = TextFormat::ESCAPE . "r" |
Definition at line 101 of file TextFormat.php.
const pocketmine\utils\TextFormat::STRIKETHROUGH = TextFormat::ESCAPE . "m" |
Definition at line 89 of file TextFormat.php.
const pocketmine\utils\TextFormat::UNDERLINE = TextFormat::ESCAPE . "n" |
Definition at line 90 of file TextFormat.php.
const pocketmine\utils\TextFormat::WHITE = TextFormat::ESCAPE . "f" |
Definition at line 64 of file TextFormat.php.
const pocketmine\utils\TextFormat::YELLOW = TextFormat::ESCAPE . "e" |
Definition at line 63 of file TextFormat.php.