mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-06 17:59:48 +00:00
Use base64 instead of hex to display binary in some places
base64 takes less space than hex, which is beneficial for logging larger payloads.
This commit is contained in:
@ -46,7 +46,6 @@ use pocketmine\utils\Binary;
|
||||
use function array_map;
|
||||
use function base64_decode;
|
||||
use function base64_encode;
|
||||
use function bin2hex;
|
||||
use function file_get_contents;
|
||||
use function get_class;
|
||||
use function hex2bin;
|
||||
@ -874,7 +873,7 @@ class Item implements ItemIds, \JsonSerializable{
|
||||
* @return string
|
||||
*/
|
||||
final public function __toString() : string{
|
||||
return "Item " . $this->name . " (" . $this->id . ":" . ($this->hasAnyDamageValue() ? "?" : $this->meta) . ")x" . $this->count . ($this->hasCompoundTag() ? " tags:0x" . bin2hex($this->getCompoundTag()) : "");
|
||||
return "Item " . $this->name . " (" . $this->id . ":" . ($this->hasAnyDamageValue() ? "?" : $this->meta) . ")x" . $this->count . ($this->hasCompoundTag() ? " tags:" . base64_encode($this->getCompoundTag()) : "");
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user