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