Player: consolidate and add type docs for fields

This commit is contained in:
Dylan K. Taylor 2018-03-17 17:42:01 +00:00
parent 2860e9e8ee
commit b2ee6b2ca5

View File

@ -197,11 +197,41 @@ class Player extends Human implements CommandSender, ChunkLoader, IPlayer{
/** @var int */ /** @var int */
protected $protocol = -1; protected $protocol = -1;
/** @var string */
protected $ip;
/** @var int */
protected $port;
/** @var bool[] */
private $needACK = [];
/** @var DataPacket[] */
private $batchedPackets = [];
/**
* @var int
* Last measurement of player's latency in milliseconds.
*/
protected $lastPingMeasure = 1;
/** @var float */
public $creationTime = 0;
/** @var bool */ /** @var bool */
protected $playedBefore;
public $spawned = false;
public $loggedIn = false; public $loggedIn = false;
protected $gamemode;
/** @var bool */
public $spawned = false;
/** @var string */
protected $username = "";
/** @var string */
protected $iusername = "";
/** @var string */
protected $displayName = "";
/** @var int */
protected $randomClientId;
/** @var bool */ /** @var bool */
protected $authenticated = false; protected $authenticated = false;
/** @var string */ /** @var string */
@ -214,89 +244,84 @@ class Player extends Human implements CommandSender, ChunkLoader, IPlayer{
protected $windowIndex = []; protected $windowIndex = [];
/** @var bool[] */ /** @var bool[] */
protected $permanentWindows = []; protected $permanentWindows = [];
protected $messageCounter = 2;
/** @var Vector3 */
public $speed = null;
protected $achievements = [];
/** @var PlayerCursorInventory */ /** @var PlayerCursorInventory */
protected $cursorInventory; protected $cursorInventory;
/** @var CraftingGrid */ /** @var CraftingGrid */
protected $craftingGrid = null; protected $craftingGrid = null;
/** @var CraftingTransaction|null */ /** @var CraftingTransaction|null */
protected $craftingTransaction = null; protected $craftingTransaction = null;
public $creationTime = 0; /** @var int */
protected $messageCounter = 2;
protected $randomClientId; /** @var bool */
protected $ip;
protected $removeFormat = true; protected $removeFormat = true;
protected $port;
protected $username = "";
protected $iusername = "";
protected $displayName = "";
protected $startAction = -1;
/** @var Vector3|null */
protected $sleeping = null;
/** @var bool[] name of achievement => bool */
protected $achievements = [];
/** @var bool */
protected $playedBefore;
/** @var int */
protected $gamemode;
/** @var int */
private $loaderId = 0; private $loaderId = 0;
/** @var bool[] chunkHash => bool (true = sent, false = needs sending) */
protected $stepHeight = 0.6;
public $usedChunks = []; public $usedChunks = [];
protected $chunkLoadCount = 0; /** @var bool[] chunkHash => dummy */
protected $loadQueue = []; protected $loadQueue = [];
/** @var int */
protected $nextChunkOrderRun = 5; protected $nextChunkOrderRun = 5;
/** @var int */
protected $viewDistance = -1;
/** @var int */
protected $spawnThreshold;
/** @var int */
protected $chunkLoadCount = 0;
/** @var int */
protected $chunksPerTick;
/** @var bool[] map: raw UUID (string) => bool */ /** @var bool[] map: raw UUID (string) => bool */
protected $hiddenPlayers = []; protected $hiddenPlayers = [];
/** @var Vector3|null */ /** @var Vector3|null */
protected $newPosition; protected $newPosition;
/** @var Vector3|null */
public $speed = null;
/** @var bool */ /** @var bool */
protected $isTeleporting = false; protected $isTeleporting = false;
/** @var int */
protected $viewDistance = -1;
protected $chunksPerTick;
protected $spawnThreshold;
/** @var null|WeakPosition */
private $spawnPosition = null;
protected $inAirTicks = 0; protected $inAirTicks = 0;
/** @var int */
protected $startAirTicks = 5; protected $startAirTicks = 5;
/** @var float */
//TODO: Abilities protected $stepHeight = 0.6;
protected $autoJump = true; /** @var bool */
protected $allowFlight = false;
protected $flying = false;
protected $allowMovementCheats = false; protected $allowMovementCheats = false;
private $needACK = []; /** @var Vector3|null */
protected $sleeping = null;
/** @var WeakPosition|null */
private $spawnPosition = null;
private $batchedPackets = []; //TODO: Abilities
/** @var bool */
protected $autoJump = true;
/** @var bool */
protected $allowFlight = false;
/** @var bool */
protected $flying = false;
/** @var PermissibleBase */ /** @var PermissibleBase */
private $perm = null; private $perm = null;
/** @var int|null */ /** @var int|null */
protected $lineHeight = null; protected $lineHeight = null;
/** @var string */ /** @var string */
protected $locale = "en_US"; protected $locale = "en_US";
/** /** @var int */
* @var int protected $startAction = -1;
* Last measurement of player's latency in milliseconds.
*/
protected $lastPingMeasure = 1;
/** @var int[] ID => ticks map */ /** @var int[] ID => ticks map */
protected $usedItemsCooldown = []; protected $usedItemsCooldown = [];