mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-06 09:56:06 +00:00
PhpStorm automated formatting (#11)
* PhpStorm reformatting * Tuned PhpStorm reformatting * Improved ItemIds and BlockIds formatting * Tuned more PhpStorm reformatting * Improved string concatenation
This commit is contained in:
@ -23,6 +23,7 @@
|
||||
* Various Utilities used around the code
|
||||
*/
|
||||
namespace pocketmine\utils;
|
||||
|
||||
use pocketmine\entity\Entity;
|
||||
|
||||
class Binary{
|
||||
|
@ -20,6 +20,7 @@
|
||||
*/
|
||||
|
||||
namespace pocketmine\utils;
|
||||
|
||||
use pocketmine\scheduler\FileWriteTask;
|
||||
use pocketmine\Server;
|
||||
|
||||
|
@ -189,7 +189,7 @@ class MainLogger extends \AttachableThreadedLogger{
|
||||
$threadName = (new \ReflectionClass($thread))->getShortName() . " thread";
|
||||
}
|
||||
|
||||
$message = TextFormat::toANSI(TextFormat::AQUA . "[" . date("H:i:s", $now) . "] ". TextFormat::RESET . $color ."[" . $threadName . "/" . $prefix . "]:" . " " . $message . TextFormat::RESET);
|
||||
$message = TextFormat::toANSI(TextFormat::AQUA . "[" . date("H:i:s", $now) . "] " . TextFormat::RESET . $color . "[" . $threadName . "/" . $prefix . "]:" . " " . $message . TextFormat::RESET);
|
||||
$cleanMessage = TextFormat::clean($message);
|
||||
|
||||
if(!Terminal::hasFormattingCodes()){
|
||||
|
@ -71,7 +71,7 @@ class Random{
|
||||
$this->seed = $seed;
|
||||
$this->x = self::X ^ $seed;
|
||||
$this->y = self::Y ^ ($seed << 17) | (($seed >> 15) & 0x7fffffff) & 0xffffffff;
|
||||
$this->z = self::Z ^ ($seed << 31) | (($seed >> 1) & 0x7fffffff) & 0xffffffff;
|
||||
$this->z = self::Z ^ ($seed << 31) | (($seed >> 1) & 0x7fffffff) & 0xffffffff;
|
||||
$this->w = self::W ^ ($seed << 18) | (($seed >> 14) & 0x7fffffff) & 0xffffffff;
|
||||
}
|
||||
|
||||
@ -100,7 +100,7 @@ class Random{
|
||||
$this->y = $this->z;
|
||||
$this->z = $this->w;
|
||||
$this->w = ($this->w ^ (($this->w >> 19) & 0x7fffffff)
|
||||
^ ($t ^ (($t >> 8) & 0x7fffffff))) & 0xffffffff;
|
||||
^ ($t ^ (($t >> 8) & 0x7fffffff))) & 0xffffffff;
|
||||
|
||||
return $this->w;
|
||||
}
|
||||
|
@ -59,7 +59,7 @@ abstract class TextFormat{
|
||||
* @return array
|
||||
*/
|
||||
public static function tokenize($string){
|
||||
return preg_split("/(". TextFormat::ESCAPE ."[0123456789abcdefklmnor])/", $string, -1, PREG_SPLIT_NO_EMPTY | PREG_SPLIT_DELIM_CAPTURE);
|
||||
return preg_split("/(" . TextFormat::ESCAPE . "[0123456789abcdefklmnor])/", $string, -1, PREG_SPLIT_NO_EMPTY | PREG_SPLIT_DELIM_CAPTURE);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -72,7 +72,7 @@ abstract class TextFormat{
|
||||
*/
|
||||
public static function clean($string, $removeFormat = true){
|
||||
if($removeFormat){
|
||||
return str_replace(TextFormat::ESCAPE, "", preg_replace(["/". TextFormat::ESCAPE ."[0123456789abcdefklmnor]/", "/\x1b[\\(\\][[0-9;\\[\\(]+[Bm]/"], "", $string));
|
||||
return str_replace(TextFormat::ESCAPE, "", preg_replace(["/" . TextFormat::ESCAPE . "[0123456789abcdefklmnor]/", "/\x1b[\\(\\][[0-9;\\[\\(]+[Bm]/"], "", $string));
|
||||
}
|
||||
return str_replace("\x1b", "", preg_replace("/\x1b[\\(\\][[0-9;\\[\\(]+[Bm]/", "", $string));
|
||||
}
|
||||
|
Reference in New Issue
Block a user