Merge branch 'minor-next' into trees

This commit is contained in:
Dylan K. Taylor
2023-07-01 12:25:44 +01:00
46 changed files with 770 additions and 310 deletions

View File

@ -2032,6 +2032,12 @@ class World implements ChunkManager{
if($clickVector === null){
$clickVector = new Vector3(0.0, 0.0, 0.0);
}else{
$clickVector = new Vector3(
min(1.0, max(0.0, $clickVector->x)),
min(1.0, max(0.0, $clickVector->y)),
min(1.0, max(0.0, $clickVector->z))
);
}
if(!$this->isInWorld($blockReplace->getPosition()->x, $blockReplace->getPosition()->y, $blockReplace->getPosition()->z)){

View File

@ -43,6 +43,7 @@ use pocketmine\world\WorldCreationOptions;
use Symfony\Component\Filesystem\Path;
use function array_map;
use function file_put_contents;
use function sprintf;
use function strlen;
use function substr;
use function time;
@ -154,12 +155,18 @@ class BedrockWorldData extends BaseNbtWorldData{
}
$version = $worldData->getInt(self::TAG_STORAGE_VERSION, Limits::INT32_MAX);
if($version === Limits::INT32_MAX){
throw new CorruptedWorldException(sprintf("Missing '%s' tag in level.dat", self::TAG_STORAGE_VERSION));
}
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 === Limits::INT32_MAX){
throw new CorruptedWorldException(sprintf("Missing '%s' tag in level.dat", self::TAG_NETWORK_VERSION));
}
if($protocolVersion > self::CURRENT_STORAGE_NETWORK_VERSION){
throw new UnsupportedWorldFormatException("LevelDB world protocol version $protocolVersion is currently unsupported");
}