mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-10-19 04:15:04 +00:00
Update to latest NBT lib version
This commit is contained in:
@@ -751,12 +751,7 @@ class Server{
|
||||
if(file_exists($path . "$name.dat")){
|
||||
try{
|
||||
$nbt = new BigEndianNBTStream();
|
||||
$compound = $nbt->readCompressed(file_get_contents($path . "$name.dat"));
|
||||
if(!($compound instanceof CompoundTag)){
|
||||
throw new \RuntimeException("Invalid data found in \"$name.dat\", expected " . CompoundTag::class . ", got " . (is_object($compound) ? get_class($compound) : gettype($compound)));
|
||||
}
|
||||
|
||||
return $compound;
|
||||
return $nbt->readCompressed(file_get_contents($path . "$name.dat"));
|
||||
}catch(\Throwable $e){ //zlib decode error / corrupt data
|
||||
rename($path . "$name.dat", $path . "$name.dat.bak");
|
||||
$this->logger->notice($this->getLanguage()->translateString("pocketmine.data.playerCorrupted", [$name]));
|
||||
|
Reference in New Issue
Block a user