mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-05-16 18:59:00 +00:00
Replaced old deprecated calls
This commit is contained in:
parent
f3a53be117
commit
840690d801
@ -3044,6 +3044,7 @@ class Player extends Human implements CommandSender, InventoryHolder, ChunkLoade
|
||||
}
|
||||
|
||||
$this->sendPosition($this, null, null, 1, Network::CHANNEL_WORLD_CHUNKS);
|
||||
$this->spawnToAll();
|
||||
$this->forceMovement = $this->teleportPosition;
|
||||
$this->teleportPosition = null;
|
||||
|
||||
@ -3068,6 +3069,8 @@ class Player extends Human implements CommandSender, InventoryHolder, ChunkLoade
|
||||
|
||||
if(!$this->checkTeleportPosition()){
|
||||
$this->forceMovement = $oldPos;
|
||||
}else{
|
||||
$this->spawnToAll();
|
||||
}
|
||||
|
||||
|
||||
|
@ -1343,7 +1343,7 @@ abstract class Entity extends Location implements Metadatable{
|
||||
$this->chunk = $this->level->getChunk($this->x >> 4, $this->z >> 4, true);
|
||||
|
||||
if(!$this->justCreated){
|
||||
$newChunk = $this->level->getUsingChunk($this->x >> 4, $this->z >> 4);
|
||||
$newChunk = $this->level->getChunkPlayers($this->x >> 4, $this->z >> 4);
|
||||
foreach($this->hasSpawned as $player){
|
||||
if(!isset($newChunk[$player->getId()])){
|
||||
$this->despawnFrom($player);
|
||||
@ -1449,7 +1449,7 @@ abstract class Entity extends Location implements Metadatable{
|
||||
if($this->chunk === null){
|
||||
return;
|
||||
}
|
||||
foreach($this->level->getUsingChunk($this->chunk->getX(), $this->chunk->getZ()) as $player){
|
||||
foreach($this->level->getChunkPlayers($this->chunk->getX(), $this->chunk->getZ()) as $player){
|
||||
if($player->loggedIn === true){
|
||||
$this->spawnTo($player);
|
||||
}
|
||||
|
@ -51,7 +51,7 @@ class ChestInventory extends ContainerInventory{
|
||||
$pk->case1 = 1;
|
||||
$pk->case2 = 2;
|
||||
if(($level = $this->getHolder()->getLevel()) instanceof Level){
|
||||
Server::broadcastPacket($level->getUsingChunk($this->getHolder()->getX() >> 4, $this->getHolder()->getZ() >> 4), $pk->setChannel(Network::CHANNEL_WORLD_EVENTS));
|
||||
Server::broadcastPacket($level->getChunkPlayers($this->getHolder()->getX() >> 4, $this->getHolder()->getZ() >> 4), $pk->setChannel(Network::CHANNEL_WORLD_EVENTS));
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -65,7 +65,7 @@ class ChestInventory extends ContainerInventory{
|
||||
$pk->case1 = 1;
|
||||
$pk->case2 = 0;
|
||||
if(($level = $this->getHolder()->getLevel()) instanceof Level){
|
||||
Server::broadcastPacket($level->getUsingChunk($this->getHolder()->getX() >> 4, $this->getHolder()->getZ() >> 4), $pk->setChannel(Network::CHANNEL_WORLD_EVENTS));
|
||||
Server::broadcastPacket($level->getChunkPlayers($this->getHolder()->getX() >> 4, $this->getHolder()->getZ() >> 4), $pk->setChannel(Network::CHANNEL_WORLD_EVENTS));
|
||||
}
|
||||
}
|
||||
parent::onClose($who);
|
||||
|
@ -106,7 +106,7 @@ class DoubleChestInventory extends ChestInventory implements InventoryHolder{
|
||||
$pk->case1 = 1;
|
||||
$pk->case2 = 2;
|
||||
if(($level = $this->right->getHolder()->getLevel()) instanceof Level){
|
||||
Server::broadcastPacket($level->getUsingChunk($this->right->getHolder()->getX() >> 4, $this->right->getHolder()->getZ() >> 4), $pk->setChannel(Network::CHANNEL_WORLD_EVENTS));
|
||||
Server::broadcastPacket($level->getChunkPlayers($this->right->getHolder()->getX() >> 4, $this->right->getHolder()->getZ() >> 4), $pk->setChannel(Network::CHANNEL_WORLD_EVENTS));
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -120,7 +120,7 @@ class DoubleChestInventory extends ChestInventory implements InventoryHolder{
|
||||
$pk->case1 = 1;
|
||||
$pk->case2 = 0;
|
||||
if(($level = $this->right->getHolder()->getLevel()) instanceof Level){
|
||||
Server::broadcastPacket($level->getUsingChunk($this->right->getHolder()->getX() >> 4, $this->right->getHolder()->getZ() >> 4), $pk->setChannel(Network::CHANNEL_WORLD_EVENTS));
|
||||
Server::broadcastPacket($level->getChunkPlayers($this->right->getHolder()->getX() >> 4, $this->right->getHolder()->getZ() >> 4), $pk->setChannel(Network::CHANNEL_WORLD_EVENTS));
|
||||
}
|
||||
}
|
||||
parent::onClose($who);
|
||||
|
@ -215,7 +215,7 @@ class Explosion{
|
||||
$pk->z = $this->source->z;
|
||||
$pk->radius = $this->size;
|
||||
$pk->records = $send;
|
||||
Server::broadcastPacket($this->level->getUsingChunk($source->x >> 4, $source->z >> 4), $pk->setChannel(Network::CHANNEL_BLOCKS));
|
||||
Server::broadcastPacket($this->level->getChunkPlayers($source->x >> 4, $source->z >> 4), $pk->setChannel(Network::CHANNEL_BLOCKS));
|
||||
|
||||
return true;
|
||||
}
|
||||
|
@ -435,7 +435,7 @@ class Level implements ChunkManager, Metadatable{
|
||||
$pk = $sound->encode();
|
||||
|
||||
if($players === null){
|
||||
$players = $this->getUsingChunk($sound->x >> 4, $sound->z >> 4);
|
||||
$players = $this->getChunkPlayers($sound->x >> 4, $sound->z >> 4);
|
||||
}
|
||||
|
||||
if($pk !== null){
|
||||
@ -451,7 +451,7 @@ class Level implements ChunkManager, Metadatable{
|
||||
$pk = $particle->encode();
|
||||
|
||||
if($players === null){
|
||||
$players = $this->getUsingChunk($particle->x >> 4, $particle->z >> 4);
|
||||
$players = $this->getChunkPlayers($particle->x >> 4, $particle->z >> 4);
|
||||
}
|
||||
|
||||
if($pk !== null){
|
||||
|
@ -59,7 +59,7 @@ abstract class Spawnable extends Tile{
|
||||
return;
|
||||
}
|
||||
|
||||
foreach($this->getLevel()->getUsingChunk($this->chunk->getX(), $this->chunk->getZ()) as $player){
|
||||
foreach($this->getLevel()->getChunkPlayers($this->chunk->getX(), $this->chunk->getZ()) as $player){
|
||||
if($player->spawned === true){
|
||||
$this->spawnTo($player);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user