mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-04-22 08:44:01 +00:00
Level: Make sleepTicks private, don't write directly
This commit is contained in:
parent
e5c58f9b04
commit
bcb080e2b9
@ -1183,7 +1183,7 @@ class Player extends Human implements CommandSender, ChunkLoader, IPlayer{
|
||||
|
||||
$this->setSpawn($pos);
|
||||
|
||||
$this->level->sleepTicks = 60;
|
||||
$this->level->setSleepTicks(60);
|
||||
|
||||
return true;
|
||||
}
|
||||
@ -1200,7 +1200,7 @@ class Player extends Human implements CommandSender, ChunkLoader, IPlayer{
|
||||
$this->setDataProperty(self::DATA_PLAYER_BED_POSITION, self::DATA_TYPE_POS, [0, 0, 0]);
|
||||
$this->setPlayerFlag(self::DATA_PLAYER_FLAG_SLEEP, false);
|
||||
|
||||
$this->level->sleepTicks = 0;
|
||||
$this->level->setSleepTicks(0);
|
||||
|
||||
$pk = new AnimatePacket();
|
||||
$pk->entityRuntimeId = $this->id;
|
||||
|
@ -223,7 +223,7 @@ class Level implements ChunkManager, Metadatable{
|
||||
private $blockStates;
|
||||
|
||||
/** @var int */
|
||||
public $sleepTicks = 0;
|
||||
private $sleepTicks = 0;
|
||||
|
||||
/** @var int */
|
||||
private $chunkTickRadius;
|
||||
@ -838,6 +838,10 @@ class Level implements ChunkManager, Metadatable{
|
||||
}
|
||||
}
|
||||
|
||||
public function setSleepTicks(int $ticks) : void{
|
||||
$this->sleepTicks = $ticks;
|
||||
}
|
||||
|
||||
public function sendBlockExtraData(int $x, int $y, int $z, int $id, int $data, array $targets = null){
|
||||
$pk = new LevelEventPacket;
|
||||
$pk->evid = LevelEventPacket::EVENT_SET_DATA;
|
||||
|
Loading…
x
Reference in New Issue
Block a user