layers - 1; } public function readStateFromMeta(int $meta) : void{ $this->layers = BlockDataValidator::readBoundedInt("layers", $meta + 1, 1, 8); } public function getStateBitmask() : int{ return 0b111; } public function getName() : string{ return "Snow Layer"; } public function canBeReplaced() : bool{ return true; } public function getHardness() : float{ return 0.1; } public function getToolType() : int{ return BlockToolType::TYPE_SHOVEL; } public function getToolHarvestLevel() : int{ return TieredTool::TIER_WOODEN; } public function place(Item $item, Block $blockReplace, Block $blockClicked, int $face, Vector3 $clickVector, Player $player = null) : bool{ if($blockReplace->getSide(Facing::DOWN)->isSolid()){ //TODO: fix placement return parent::place($item, $blockReplace, $blockClicked, $face, $clickVector, $player); } return false; } public function onNearbyBlockChange() : void{ if(!$this->getSide(Facing::DOWN)->isSolid()){ $this->getLevel()->setBlock($this, BlockFactory::get(Block::AIR), false); } } public function ticksRandomly() : bool{ return true; } public function onRandomTick() : void{ if($this->level->getBlockLightAt($this->x, $this->y, $this->z) >= 12){ $this->getLevel()->setBlock($this, BlockFactory::get(Block::AIR), false); } } public function getDropsForCompatibleTool(Item $item) : array{ return [ ItemFactory::get(Item::SNOWBALL) //TODO: check layer count ]; } public function isAffectedBySilkTouch() : bool{ return false; } }