mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-04-21 08:17:34 +00:00
BedrockWorldData: do not load worlds with a newer NetworkVersion than we support
often, protocol updates are done without consideration for the current world format version. We don't want to require the world support to be updated at the same time, since this might delay updates.
This commit is contained in:
parent
096daef0d0
commit
d80f65ae7c
@ -156,6 +156,12 @@ class BedrockWorldData extends BaseNbtWorldData{
|
||||
if($version > self::CURRENT_STORAGE_VERSION){
|
||||
throw new UnsupportedWorldFormatException("LevelDB world format version $version is currently unsupported");
|
||||
}
|
||||
//StorageVersion is rarely updated - instead, the game relies on the NetworkVersion tag, which is synced with
|
||||
//the network protocol version for that version.
|
||||
$protocolVersion = $worldData->getInt(self::TAG_NETWORK_VERSION, Limits::INT32_MAX);
|
||||
if($protocolVersion > self::CURRENT_STORAGE_NETWORK_VERSION){
|
||||
throw new UnsupportedWorldFormatException("LevelDB world protocol version $protocolVersion is currently unsupported");
|
||||
}
|
||||
|
||||
return $worldData;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user