100.0){ throw new \InvalidArgumentException("Yield must be in range 0.0 - 100.0"); } } public function getPosition() : Position{ return $this->position; } /** * Returns the percentage chance of drops from each block destroyed by the explosion. * * @return float 0-100 */ public function getYield() : float{ return $this->yield; } /** * Sets the percentage chance of drops from each block destroyed by the explosion. * * @param float $yield 0-100 */ public function setYield(float $yield) : void{ Utils::checkFloatNotInfOrNaN("yield", $yield); if($yield < 0.0 || $yield > 100.0){ throw new \InvalidArgumentException("Yield must be in range 0.0 - 100.0"); } $this->yield = $yield; } /** * Returns a list of blocks destroyed by the explosion. * * @return Block[] */ public function getAffectedBlocks() : array{ return $this->blocks; } /** * Sets the blocks destroyed by the explosion. * * @param Block[] $blocks */ public function setAffectedBlocks(array $blocks) : void{ Utils::validateArrayValueType($blocks, fn(Block $block) => null); $this->blocks = $blocks; } /** * Returns a list of affected blocks that will be replaced by fire. * * @return Block[] */ public function getIgnitions() : array{ return $this->ignitions; } /** * Set the list of blocks that will be replaced by fire. * * @param Block[] $ignitions */ public function setIgnitions(array $ignitions) : void{ Utils::validateArrayValueType($ignitions, fn(Block $block) => null); $this->ignitions = $ignitions; } }