mirror of
https://github.com/oldminecraftcommunity/NostalgiaCore.git
synced 2026-11-20 11:39:43 +00:00
38 lines
No EOL
1,023 B
PHP
38 lines
No EOL
1,023 B
PHP
<?php
|
|
|
|
class SnowLayerBlock extends FlowableBlock{
|
|
public function __construct($meta = 0){
|
|
parent::__construct(SNOW_LAYER, $meta, "Snow Layer");
|
|
$this->isReplaceable = true;
|
|
$this->isSolid = false;
|
|
$this->isFullBlock = false;
|
|
$this->hardness = 0.5;
|
|
}
|
|
public static function getAABB(Level $level, $x, $y, $z){
|
|
return null;
|
|
}
|
|
public function place(Item $item, Player $player, Block $block, Block $target, $face, $fx, $fy, $fz){
|
|
$down = $this->getSide(0);
|
|
if($down instanceof SolidBlock){
|
|
$this->level->setBlock($block, $this, true, false, true);
|
|
return true;
|
|
}
|
|
return false;
|
|
}
|
|
|
|
public static function neighborChanged(Level $level, $x, $y, $z, $nX, $nY, $nZ, $oldID){
|
|
if($level->level->getBlockID($x, $y - 1, $z) == AIR){ //Replace with common break method
|
|
$level->fastSetBlockUpdate($x, $y, $z, 0, 0, true);
|
|
}
|
|
}
|
|
|
|
public function getDrops(Item $item, Player $player){
|
|
if($item->isShovel() !== false){
|
|
return array(
|
|
array(SNOWBALL, 0, 1),
|
|
);
|
|
}
|
|
|
|
return array();
|
|
}
|
|
} |