fixing chunk sending

This commit is contained in:
Intyre
2016-02-27 16:35:38 +01:00
parent b766b969e2
commit e11b76318c
5 changed files with 94 additions and 2 deletions

View File

@ -101,6 +101,7 @@ use pocketmine\nbt\tag\StringTag;
use pocketmine\network\protocol\AdventureSettingsPacket;
use pocketmine\network\protocol\AnimatePacket;
use pocketmine\network\protocol\BatchPacket;
use pocketmine\network\protocol\ChunkRadiusUpdatePacket;
use pocketmine\network\protocol\ContainerClosePacket;
use pocketmine\network\protocol\ContainerSetContentPacket;
use pocketmine\network\protocol\DataPacket;
@ -2874,6 +2875,14 @@ class Player extends Human implements CommandSender, InventoryHolder, ChunkLoade
}
}
break;
case ProtocolInfo::REQUEST_CHUNK_RADIUS_PACKET:
if($this->spawned){
$this->viewDistance = $packet->radius ** 2;
}
$pk = new ChunkRadiusUpdatePacket();
$pk->radius = $packet->radius;
$this->dataPacket($pk);
break;
default:
break;
}