NostalgiaCore/src/material/block/LiquidBlock.php
GameHerobrine b84093e4ce cleanup
2023-12-19 22:34:04 +03:00

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;
}
}