From de5e9df82b532ba3ac12e2155f30f9935db37b13 Mon Sep 17 00:00:00 2001 From: Shoghi Cervantes Date: Wed, 25 Jun 2014 22:32:57 +0200 Subject: [PATCH] Fixes for chat formatting --- src/pocketmine/utils/TextFormat.php | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/pocketmine/utils/TextFormat.php b/src/pocketmine/utils/TextFormat.php index c07bab76a..ed4baa90a 100644 --- a/src/pocketmine/utils/TextFormat.php +++ b/src/pocketmine/utils/TextFormat.php @@ -100,6 +100,24 @@ class TextFormat{ } $newString["extra"][$index] = []; $pointer =& $newString["extra"][$index]; + if($color !== "white"){ + $pointer["color"] = $color; + } + if($bold !== false){ + $pointer["bold"] = true; + } + if($italic !== false){ + $pointer["italic"] = true; + } + if($underlined !== false){ + $pointer["underlined"] = true; + } + if($strikethrough !== false){ + $pointer["strikethrough"] = true; + } + if($obfuscated !== false){ + $pointer["obfuscated"] = true; + } ++$index; } switch($token){