mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-06 17:59:48 +00:00
improved geometry debloating, also apply on skin changes
This commit is contained in:
@ -87,4 +87,17 @@ class Skin{
|
||||
return $this->geometryData;
|
||||
}
|
||||
|
||||
/**
|
||||
* Hack to cut down on network overhead due to skins, by un-pretty-printing geometry JSON.
|
||||
*
|
||||
* Mojang, some stupid reason, send every single model for every single skin in the selected skin-pack.
|
||||
* Not only that, they are pretty-printed.
|
||||
* TODO: find out what model crap can be safely dropped from the packet (unless it gets fixed first)
|
||||
*/
|
||||
public function debloatGeometryData() : void{
|
||||
if($this->geometryData !== ""){
|
||||
$this->geometryData = (string) json_encode(json_decode($this->geometryData));
|
||||
}
|
||||
}
|
||||
|
||||
}
|
Reference in New Issue
Block a user