improved geometry debloating, also apply on skin changes

This commit is contained in:
Dylan K. Taylor
2017-10-29 12:14:16 +00:00
parent 600d80331a
commit 991d321928
3 changed files with 16 additions and 12 deletions

View File

@ -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));
}
}
}