mirror of
https://github.com/oldminecraftcommunity/NostalgiaCore.git
synced 2026-11-21 03:59:43 +00:00
32 lines
No EOL
691 B
PHP
32 lines
No EOL
691 B
PHP
<?php
|
|
|
|
class LiquidBlock extends TransparentBlock{
|
|
/**
|
|
* @param int $id
|
|
* @param int $meta
|
|
* @param string $name
|
|
*/
|
|
public function __construct($id, $meta = 0, $name = "Unknown"){
|
|
parent::__construct($id, $meta, $name);
|
|
$this->isLiquid = true;
|
|
$this->breakable = false;
|
|
$this->isReplaceable = true;
|
|
$this->isSolid = false;
|
|
$this->isFullBlock = true;
|
|
$this->hardness = 500;
|
|
}
|
|
|
|
public static function getPercentAir($meta){
|
|
if($meta >= 8) $meta = 0;
|
|
$f = ($meta + 1) / 9;
|
|
return $f;
|
|
}
|
|
|
|
public function getDrops(Item $item, Player $player){
|
|
return array();
|
|
}
|
|
|
|
public function getLiquidHeight(){
|
|
return (($this->meta >= 8 ? 0 : $this->meta)+1) / 9;
|
|
}
|
|
} |