Merge branch 'master' into api3/network

This commit is contained in:
Dylan K. Taylor
2017-03-09 18:12:37 +00:00
10 changed files with 167 additions and 34 deletions

View File

@ -183,6 +183,7 @@ use pocketmine\network\mcpe\protocol\TransferPacket;
use pocketmine\network\mcpe\protocol\UnknownPacket;
use pocketmine\network\mcpe\protocol\UpdateAttributesPacket;
use pocketmine\network\mcpe\protocol\UpdateBlockPacket;
use pocketmine\network\mcpe\protocol\UpdateTradePacket;
use pocketmine\network\mcpe\protocol\UseItemPacket;
use pocketmine\network\SourceInterface;
use pocketmine\permission\PermissibleBase;
@ -771,21 +772,12 @@ class Player extends Human implements CommandSender, InventoryHolder, ChunkLoade
$level = $level === null ? $this->level : $level;
$index = Level::chunkHash($x, $z);
if(isset($this->usedChunks[$index])){
$chunk = $level->getChunk($x, $z);
foreach($chunk->getEntities() as $entity){
foreach($level->getChunkEntities($x, $z) as $entity){
if($entity !== $this){
$entity->despawnFrom($this);
}
}
if($level !== $this->level){
$pk = new FullChunkDataPacket();
$pk->chunkX = $x;
$pk->chunkZ = $z;
$pk->data = chr($chunk->getSubChunkSendCount());
$this->dataPacket($pk);
}
unset($this->usedChunks[$index]);
}
$level->unregisterChunkLoader($this, $x, $z);
@ -3287,6 +3279,10 @@ class Player extends Human implements CommandSender, InventoryHolder, ChunkLoade
return true;
}
public function handleUpdateTrade(UpdateTradePacket $packet) : bool{
return false;
}
public function handleResourcePackDataInfo(ResourcePackDataInfoPacket $packet) : bool{
return false;
}