mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-05-13 01:09:44 +00:00
Skin: accommodate JSON geometry containing comments, closes #3121
This commit is contained in:
parent
f347345bb3
commit
39cc590829
@ -23,9 +23,9 @@ declare(strict_types=1);
|
|||||||
|
|
||||||
namespace pocketmine\entity;
|
namespace pocketmine\entity;
|
||||||
|
|
||||||
|
use Ahc\Json\Comment as CommentedJsonDecoder;
|
||||||
use function implode;
|
use function implode;
|
||||||
use function in_array;
|
use function in_array;
|
||||||
use function json_decode;
|
|
||||||
use function json_encode;
|
use function json_encode;
|
||||||
use function strlen;
|
use function strlen;
|
||||||
|
|
||||||
@ -129,7 +129,7 @@ class Skin{
|
|||||||
*/
|
*/
|
||||||
public function debloatGeometryData() : void{
|
public function debloatGeometryData() : void{
|
||||||
if($this->geometryData !== ""){
|
if($this->geometryData !== ""){
|
||||||
$this->geometryData = (string) json_encode(json_decode($this->geometryData));
|
$this->geometryData = (string) json_encode((new CommentedJsonDecoder())->decode($this->geometryData));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user