mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-05-13 09:19:42 +00:00
tile: populate missing return type information
This commit is contained in:
parent
0b9d0f3cdc
commit
8776b71d63
@ -38,6 +38,9 @@ class Bed extends Spawnable{
|
|||||||
return $this->color;
|
return $this->color;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
public function setColor(int $color){
|
public function setColor(int $color){
|
||||||
$this->color = $color & 0xf;
|
$this->color = $color & 0xf;
|
||||||
$this->onChanged();
|
$this->onChanged();
|
||||||
|
@ -117,6 +117,9 @@ class Chest extends Spawnable implements InventoryHolder, Container, Nameable{
|
|||||||
return $this->inventory;
|
return $this->inventory;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
protected function checkPairing(){
|
protected function checkPairing(){
|
||||||
if($this->isPaired() and !$this->getLevel()->isInLoadedTerrain(new Vector3($this->pairX, $this->y, $this->pairZ))){
|
if($this->isPaired() and !$this->getLevel()->isInLoadedTerrain(new Vector3($this->pairX, $this->y, $this->pairZ))){
|
||||||
//paired to a tile in an unloaded chunk
|
//paired to a tile in an unloaded chunk
|
||||||
@ -151,6 +154,9 @@ class Chest extends Spawnable implements InventoryHolder, Container, Nameable{
|
|||||||
return "Chest";
|
return "Chest";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return bool
|
||||||
|
*/
|
||||||
public function isPaired(){
|
public function isPaired(){
|
||||||
return $this->pairX !== null and $this->pairZ !== null;
|
return $this->pairX !== null and $this->pairZ !== null;
|
||||||
}
|
}
|
||||||
@ -169,6 +175,9 @@ class Chest extends Spawnable implements InventoryHolder, Container, Nameable{
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return bool
|
||||||
|
*/
|
||||||
public function pairWith(Chest $tile){
|
public function pairWith(Chest $tile){
|
||||||
if($this->isPaired() or $tile->isPaired()){
|
if($this->isPaired() or $tile->isPaired()){
|
||||||
return false;
|
return false;
|
||||||
@ -183,7 +192,7 @@ class Chest extends Spawnable implements InventoryHolder, Container, Nameable{
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
private function createPair(Chest $tile){
|
private function createPair(Chest $tile) : void{
|
||||||
$this->pairX = $tile->x;
|
$this->pairX = $tile->x;
|
||||||
$this->pairZ = $tile->z;
|
$this->pairZ = $tile->z;
|
||||||
|
|
||||||
@ -191,6 +200,9 @@ class Chest extends Spawnable implements InventoryHolder, Container, Nameable{
|
|||||||
$tile->pairZ = $this->z;
|
$tile->pairZ = $this->z;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return bool
|
||||||
|
*/
|
||||||
public function unpair(){
|
public function unpair(){
|
||||||
if(!$this->isPaired()){
|
if(!$this->isPaired()){
|
||||||
return false;
|
return false;
|
||||||
|
@ -70,11 +70,19 @@ class FlowerPot extends Spawnable{
|
|||||||
return clone $this->item;
|
return clone $this->item;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param Item $item
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
public function setItem(Item $item){
|
public function setItem(Item $item){
|
||||||
$this->item = clone $item;
|
$this->item = clone $item;
|
||||||
$this->onChanged();
|
$this->onChanged();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
public function removeItem(){
|
public function removeItem(){
|
||||||
$this->setItem(ItemFactory::get(Item::AIR, 0, 0));
|
$this->setItem(ItemFactory::get(Item::AIR, 0, 0));
|
||||||
}
|
}
|
||||||
|
@ -138,6 +138,11 @@ class Furnace extends Spawnable implements InventoryHolder, Container, Nameable{
|
|||||||
return $this->getInventory();
|
return $this->getInventory();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param Item $fuel
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
protected function checkFuel(Item $fuel){
|
protected function checkFuel(Item $fuel){
|
||||||
$ev = new FurnaceBurnEvent($this, $fuel, $fuel->getFuelTime());
|
$ev = new FurnaceBurnEvent($this, $fuel, $fuel->getFuelTime());
|
||||||
$ev->call();
|
$ev->call();
|
||||||
|
@ -63,6 +63,11 @@ class ItemFrame extends Spawnable{
|
|||||||
return clone $this->item;
|
return clone $this->item;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param Item|null $item
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
public function setItem(Item $item = null){
|
public function setItem(Item $item = null){
|
||||||
if($item !== null and !$item->isNull()){
|
if($item !== null and !$item->isNull()){
|
||||||
$this->item = clone $item;
|
$this->item = clone $item;
|
||||||
@ -76,6 +81,11 @@ class ItemFrame extends Spawnable{
|
|||||||
return $this->itemRotation;
|
return $this->itemRotation;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param int $rotation
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
public function setItemRotation(int $rotation){
|
public function setItemRotation(int $rotation){
|
||||||
$this->itemRotation = $rotation;
|
$this->itemRotation = $rotation;
|
||||||
$this->onChanged();
|
$this->onChanged();
|
||||||
@ -85,6 +95,11 @@ class ItemFrame extends Spawnable{
|
|||||||
return $this->itemDropChance;
|
return $this->itemDropChance;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param float $chance
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
public function setItemDropChance(float $chance){
|
public function setItemDropChance(float $chance){
|
||||||
$this->itemDropChance = $chance;
|
$this->itemDropChance = $chance;
|
||||||
$this->onChanged();
|
$this->onChanged();
|
||||||
|
@ -38,6 +38,8 @@ interface Nameable{
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param string $str
|
* @param string $str
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function setName(string $str);
|
public function setName(string $str);
|
||||||
|
|
||||||
|
@ -57,6 +57,11 @@ class Skull extends Spawnable{
|
|||||||
$nbt->setByte(self::TAG_ROT, $this->skullRotation);
|
$nbt->setByte(self::TAG_ROT, $this->skullRotation);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param int $type
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
public function setType(int $type){
|
public function setType(int $type){
|
||||||
$this->skullType = $type;
|
$this->skullType = $type;
|
||||||
$this->onChanged();
|
$this->onChanged();
|
||||||
|
@ -62,6 +62,9 @@ abstract class Spawnable extends Tile{
|
|||||||
$this->spawnToAll();
|
$this->spawnToAll();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
public function spawnToAll(){
|
public function spawnToAll(){
|
||||||
if($this->closed){
|
if($this->closed){
|
||||||
return;
|
return;
|
||||||
|
@ -84,6 +84,9 @@ abstract class Tile extends Position{
|
|||||||
/** @var TimingsHandler */
|
/** @var TimingsHandler */
|
||||||
protected $timings;
|
protected $timings;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
public static function init(){
|
public static function init(){
|
||||||
self::registerTile(Banner::class, [self::BANNER, "minecraft:banner"]);
|
self::registerTile(Banner::class, [self::BANNER, "minecraft:banner"]);
|
||||||
self::registerTile(Bed::class, [self::BED, "minecraft:bed"]);
|
self::registerTile(Bed::class, [self::BED, "minecraft:bed"]);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user