mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-10 21:45:35 +00:00
Merge commit 'e6a58e269099a7942d157a214beacc6c30f5617d'
This commit is contained in:
commit
c73001d65e
@ -106,9 +106,13 @@ class BedrockWorldData extends BaseNbtWorldData{
|
||||
}
|
||||
|
||||
protected function load() : CompoundTag{
|
||||
$rawLevelData = file_get_contents($this->dataPath);
|
||||
if($rawLevelData === false or strlen($rawLevelData) <= 8){
|
||||
throw new CorruptedWorldException("Truncated level.dat");
|
||||
}
|
||||
$nbt = new LittleEndianNbtSerializer();
|
||||
try{
|
||||
$worldData = $nbt->read(substr(file_get_contents($this->dataPath), 8))->mustGetCompoundTag();
|
||||
$worldData = $nbt->read(substr($rawLevelData, 8))->mustGetCompoundTag();
|
||||
}catch(NbtDataException $e){
|
||||
throw new CorruptedWorldException($e->getMessage(), 0, $e);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user