Block API typehints

This commit is contained in:
Dylan K. Taylor
2017-08-17 13:50:19 +01:00
parent f6c31680f6
commit 83af4dcd59
162 changed files with 665 additions and 667 deletions

View File

@ -40,15 +40,15 @@ class Trapdoor extends Transparent{
protected $id = self::TRAPDOOR;
public function __construct($meta = 0){
public function __construct(int $meta = 0){
$this->meta = $meta;
}
public function getName(){
public function getName() : string{
return "Wooden Trapdoor";
}
public function getHardness(){
public function getHardness() : float{
return 3;
}
@ -123,7 +123,7 @@ class Trapdoor extends Transparent{
return $bb;
}
public function place(Item $item, Block $block, Block $target, $face, $fx, $fy, $fz, Player $player = null){
public function place(Item $item, Block $block, Block $target, int $face, float $fx, float $fy, float $fz, Player $player = null) : bool{
$directions = [
0 => 1,
1 => 3,
@ -146,14 +146,14 @@ class Trapdoor extends Transparent{
];
}
public function onActivate(Item $item, Player $player = null){
public function onActivate(Item $item, Player $player = null) : bool{
$this->meta ^= self::MASK_OPENED;
$this->getLevel()->setBlock($this, $this, true);
$this->level->addSound(new DoorSound($this));
return true;
}
public function getToolType(){
public function getToolType() : int{
return Tool::TYPE_AXE;
}