mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-06 01:46:04 +00:00
Modernize property type declarations
This commit is contained in:
@ -32,8 +32,7 @@ class Barrel extends Spawnable implements Container, Nameable{
|
||||
use NameableTrait;
|
||||
use ContainerTrait;
|
||||
|
||||
/** @var BarrelInventory */
|
||||
protected $inventory;
|
||||
protected BarrelInventory $inventory;
|
||||
|
||||
public function __construct(World $world, Vector3 $pos){
|
||||
parent::__construct($world, $pos);
|
||||
|
@ -44,10 +44,8 @@ class Chest extends Spawnable implements Container, Nameable{
|
||||
public const TAG_PAIRZ = "pairz";
|
||||
public const TAG_PAIR_LEAD = "pairlead";
|
||||
|
||||
/** @var ChestInventory */
|
||||
protected $inventory;
|
||||
/** @var DoubleChestInventory|null */
|
||||
protected $doubleInventory = null;
|
||||
protected ChestInventory $inventory;
|
||||
protected ?DoubleChestInventory $doubleInventory = null;
|
||||
|
||||
private ?int $pairX = null;
|
||||
private ?int $pairZ = null;
|
||||
|
@ -33,8 +33,7 @@ use pocketmine\nbt\tag\CompoundTag;
|
||||
class Comparator extends Tile{
|
||||
private const TAG_OUTPUT_SIGNAL = "OutputSignal"; //int
|
||||
|
||||
/** @var int */
|
||||
protected $signalStrength = 0;
|
||||
protected int $signalStrength = 0;
|
||||
|
||||
public function getSignalStrength() : int{
|
||||
return $this->signalStrength;
|
||||
|
@ -48,8 +48,7 @@ abstract class Furnace extends Spawnable implements Container, Nameable{
|
||||
public const TAG_COOK_TIME = "CookTime";
|
||||
public const TAG_MAX_TIME = "MaxTime";
|
||||
|
||||
/** @var FurnaceInventory */
|
||||
protected $inventory;
|
||||
protected FurnaceInventory $inventory;
|
||||
private int $remainingFuelTime = 0;
|
||||
private int $cookTime = 0;
|
||||
private int $maxFuelTime = 0;
|
||||
|
@ -38,11 +38,9 @@ class ShulkerBox extends Spawnable implements Container, Nameable{
|
||||
|
||||
public const TAG_FACING = "facing";
|
||||
|
||||
/** @var int */
|
||||
protected $facing = Facing::NORTH;
|
||||
protected int $facing = Facing::NORTH;
|
||||
|
||||
/** @var ShulkerBoxInventory */
|
||||
protected $inventory;
|
||||
protected ShulkerBoxInventory $inventory;
|
||||
|
||||
public function __construct(World $world, Vector3 $pos){
|
||||
parent::__construct($world, $pos);
|
||||
|
@ -50,11 +50,8 @@ class Sign extends Spawnable{
|
||||
return array_slice(array_pad(explode("\n", $blob), 4, ""), 0, 4);
|
||||
}
|
||||
|
||||
/** @var SignText */
|
||||
protected $text;
|
||||
|
||||
/** @var int|null */
|
||||
protected $editorEntityRuntimeId = null;
|
||||
protected SignText $text;
|
||||
protected ?int $editorEntityRuntimeId = null;
|
||||
|
||||
public function __construct(World $world, Vector3 $pos){
|
||||
$this->text = new SignText();
|
||||
|
@ -45,12 +45,9 @@ abstract class Tile{
|
||||
public const TAG_Y = "y";
|
||||
public const TAG_Z = "z";
|
||||
|
||||
/** @var Position */
|
||||
protected $position;
|
||||
/** @var bool */
|
||||
public $closed = false;
|
||||
/** @var TimingsHandler */
|
||||
protected $timings;
|
||||
protected Position $position;
|
||||
public bool $closed = false;
|
||||
protected TimingsHandler $timings;
|
||||
|
||||
public function __construct(World $world, Vector3 $pos){
|
||||
$this->position = Position::fromObject($pos, $world);
|
||||
|
@ -26,8 +26,7 @@ namespace pocketmine\block\utils;
|
||||
use pocketmine\math\Facing;
|
||||
|
||||
trait AnyFacingTrait{
|
||||
/** @var int */
|
||||
protected $facing = Facing::DOWN;
|
||||
protected int $facing = Facing::DOWN;
|
||||
|
||||
public function getFacing() : int{ return $this->facing; }
|
||||
|
||||
|
@ -27,8 +27,7 @@ use pocketmine\math\Axis;
|
||||
use pocketmine\math\Facing;
|
||||
|
||||
trait HorizontalFacingTrait{
|
||||
/** @var int */
|
||||
protected $facing = Facing::NORTH;
|
||||
protected int $facing = Facing::NORTH;
|
||||
|
||||
public function getFacing() : int{ return $this->facing; }
|
||||
|
||||
|
@ -32,9 +32,7 @@ use pocketmine\player\Player;
|
||||
use pocketmine\world\BlockTransaction;
|
||||
|
||||
trait PillarRotationTrait{
|
||||
|
||||
/** @var int */
|
||||
protected $axis = Axis::Y;
|
||||
protected int $axis = Axis::Y;
|
||||
|
||||
/** @see Axis */
|
||||
public function getAxis() : int{ return $this->axis; }
|
||||
|
Reference in New Issue
Block a user