mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-04-22 08:44:01 +00:00
Remove chunk order fields
This commit is contained in:
parent
18c0567944
commit
60260a294b
@ -698,7 +698,7 @@ class Player extends Human implements CommandSender, InventoryHolder, ChunkLoade
|
||||
return $this->spawnPosition instanceof WeakPosition and $this->spawnPosition->isValid();
|
||||
}
|
||||
|
||||
public function sendChunk($x, $z, $payload, $ordering = FullChunkDataPacket::ORDER_COLUMNS){
|
||||
public function sendChunk($x, $z, $payload){
|
||||
if($this->connected === false){
|
||||
return;
|
||||
}
|
||||
@ -712,7 +712,6 @@ class Player extends Human implements CommandSender, InventoryHolder, ChunkLoade
|
||||
$pk = new FullChunkDataPacket();
|
||||
$pk->chunkX = $x;
|
||||
$pk->chunkZ = $z;
|
||||
$pk->order = $ordering;
|
||||
$pk->data = $payload;
|
||||
$this->batchDataPacket($pk);
|
||||
}
|
||||
@ -3569,15 +3568,13 @@ class Player extends Human implements CommandSender, InventoryHolder, ChunkLoade
|
||||
* @param int $chunkX
|
||||
* @param int $chunkZ
|
||||
* @param string $payload
|
||||
* @param int $ordering
|
||||
*
|
||||
* @return DataPacket
|
||||
*/
|
||||
public static function getChunkCacheFromData($chunkX, $chunkZ, $payload, $ordering = FullChunkDataPacket::ORDER_COLUMNS){
|
||||
public static function getChunkCacheFromData($chunkX, $chunkZ, $payload){
|
||||
$pk = new FullChunkDataPacket();
|
||||
$pk->chunkX = $chunkX;
|
||||
$pk->chunkZ = $chunkZ;
|
||||
$pk->order = $ordering;
|
||||
$pk->data = $payload;
|
||||
$pk->encode();
|
||||
|
||||
|
@ -2340,13 +2340,13 @@ class Level implements ChunkManager, Metadatable{
|
||||
}
|
||||
}
|
||||
|
||||
public function chunkRequestCallback(int $x, int $z, string $payload, int $ordering = FullChunkDataPacket::ORDER_COLUMNS){
|
||||
public function chunkRequestCallback(int $x, int $z, string $payload){
|
||||
$this->timings->syncChunkSendTimer->startTiming();
|
||||
|
||||
$index = Level::chunkHash($x, $z);
|
||||
|
||||
if(!isset($this->chunkCache[$index]) and $this->cacheChunks and $this->server->getMemoryManager()->canUseChunkCache()){
|
||||
$this->chunkCache[$index] = Player::getChunkCacheFromData($x, $z, $payload, $ordering);
|
||||
$this->chunkCache[$index] = Player::getChunkCacheFromData($x, $z, $payload);
|
||||
$this->sendChunkFromCache($x, $z);
|
||||
$this->timings->syncChunkSendTimer->stopTiming();
|
||||
return;
|
||||
@ -2356,7 +2356,7 @@ class Level implements ChunkManager, Metadatable{
|
||||
foreach($this->chunkSendQueue[$index] as $player){
|
||||
/** @var Player $player */
|
||||
if($player->isConnected() and isset($player->usedChunks[$index])){
|
||||
$player->sendChunk($x, $z, $payload, $ordering);
|
||||
$player->sendChunk($x, $z, $payload);
|
||||
}
|
||||
}
|
||||
unset($this->chunkSendQueue[$index]);
|
||||
|
@ -105,7 +105,7 @@ class Anvil extends McRegion{
|
||||
$extraData->getBuffer() .
|
||||
$tiles;
|
||||
|
||||
$this->getLevel()->chunkRequestCallback($x, $z, $ordered, FullChunkDataPacket::ORDER_LAYERED);
|
||||
$this->getLevel()->chunkRequestCallback($x, $z, $ordered);
|
||||
|
||||
return null;
|
||||
}
|
||||
|
@ -27,12 +27,8 @@ namespace pocketmine\network\protocol;
|
||||
class FullChunkDataPacket extends DataPacket{
|
||||
const NETWORK_ID = Info::FULL_CHUNK_DATA_PACKET;
|
||||
|
||||
const ORDER_COLUMNS = 0;
|
||||
const ORDER_LAYERED = 1;
|
||||
|
||||
public $chunkX;
|
||||
public $chunkZ;
|
||||
public $order = self::ORDER_COLUMNS;
|
||||
public $data;
|
||||
|
||||
public function decode(){
|
||||
@ -43,7 +39,6 @@ class FullChunkDataPacket extends DataPacket{
|
||||
$this->reset();
|
||||
$this->putVarInt($this->chunkX);
|
||||
$this->putVarInt($this->chunkZ);
|
||||
$this->putByte($this->order);
|
||||
$this->putString($this->data);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user