mirror of
https://github.com/oldminecraftcommunity/NostalgiaCore.git
synced 2026-11-20 19:49:44 +00:00
Add PHPDoc Documentation to block types.
This commit is contained in:
parent
5eed43ddd0
commit
5dc52ad97d
8 changed files with 163 additions and 28 deletions
|
|
@ -21,22 +21,57 @@
|
|||
|
||||
|
||||
class GenericBlock extends Block{
|
||||
public function __construct($id, $meta = 0, $name = "Unknown"){
|
||||
/**
|
||||
* @param int $id
|
||||
* @param int $meta
|
||||
* @param string $name
|
||||
*/
|
||||
public function __construct($id, $meta = 0, $name = "Unknown"){
|
||||
parent::__construct($id, $meta, $name);
|
||||
}
|
||||
public function place(Item $item, Player $player, Block $block, Block $target, $face, $fx, $fy, $fz){
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Item $item
|
||||
* @param Player $player
|
||||
* @param Block $block
|
||||
* @param Block $target
|
||||
* @param integer $face
|
||||
* @param integer $fx
|
||||
* @param integer $fy
|
||||
* @param integer $fz
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public function place(Item $item, Player $player, Block $block, Block $target, $face, $fx, $fy, $fz){
|
||||
return $this->level->setBlock($this, $this, true, false, true);
|
||||
}
|
||||
|
||||
public function isBreakable(Item $item, Player $player){
|
||||
|
||||
/**
|
||||
* @param Item $item
|
||||
* @param Player $player
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
public function isBreakable(Item $item, Player $player){
|
||||
return ($this->breakable);
|
||||
}
|
||||
|
||||
public function onBreak(Item $item, Player $player){
|
||||
|
||||
/**
|
||||
* @param Item $item
|
||||
* @param Player $player
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public function onBreak(Item $item, Player $player){
|
||||
return $this->level->setBlock($this, new AirBlock(), true, false, true);
|
||||
}
|
||||
|
||||
public function onUpdate($type){
|
||||
|
||||
/**
|
||||
* @param integer $type
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
public function onUpdate($type){
|
||||
if($this->hasPhysics === true and $type === BLOCK_UPDATE_NORMAL){
|
||||
$down = $this->getSide(0);
|
||||
if($down->getID() === AIR or ($down instanceof LiquidBlock)){
|
||||
|
|
@ -57,7 +92,13 @@ class GenericBlock extends Block{
|
|||
return false;
|
||||
}
|
||||
|
||||
public function onActivate(Item $item, Player $player){
|
||||
/**
|
||||
* @param Item $item
|
||||
* @param Player $player
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
public function onActivate(Item $item, Player $player){
|
||||
return $this->isActivable;
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue