mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-05-29 16:47:00 +00:00
Merge commit '1e624e7bb95bee7083dd6fb8f6e94b29e06a2b3a'
This commit is contained in:
commit
799db6efed
@ -127,6 +127,11 @@ class Attribute{
|
|||||||
return $this->minValue;
|
return $this->minValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param float $minValue
|
||||||
|
*
|
||||||
|
* @return $this
|
||||||
|
*/
|
||||||
public function setMinValue(float $minValue){
|
public function setMinValue(float $minValue){
|
||||||
if($minValue > ($max = $this->getMaxValue())){
|
if($minValue > ($max = $this->getMaxValue())){
|
||||||
throw new \InvalidArgumentException("Minimum $minValue is greater than the maximum $max");
|
throw new \InvalidArgumentException("Minimum $minValue is greater than the maximum $max");
|
||||||
@ -143,6 +148,11 @@ class Attribute{
|
|||||||
return $this->maxValue;
|
return $this->maxValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param float $maxValue
|
||||||
|
*
|
||||||
|
* @return $this
|
||||||
|
*/
|
||||||
public function setMaxValue(float $maxValue){
|
public function setMaxValue(float $maxValue){
|
||||||
if($maxValue < ($min = $this->getMinValue())){
|
if($maxValue < ($min = $this->getMinValue())){
|
||||||
throw new \InvalidArgumentException("Maximum $maxValue is less than the minimum $min");
|
throw new \InvalidArgumentException("Maximum $maxValue is less than the minimum $min");
|
||||||
@ -159,6 +169,11 @@ class Attribute{
|
|||||||
return $this->defaultValue;
|
return $this->defaultValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param float $defaultValue
|
||||||
|
*
|
||||||
|
* @return $this
|
||||||
|
*/
|
||||||
public function setDefaultValue(float $defaultValue){
|
public function setDefaultValue(float $defaultValue){
|
||||||
if($defaultValue > $this->getMaxValue() or $defaultValue < $this->getMinValue()){
|
if($defaultValue > $this->getMaxValue() or $defaultValue < $this->getMinValue()){
|
||||||
throw new \InvalidArgumentException("Default $defaultValue is outside the range " . $this->getMinValue() . " - " . $this->getMaxValue());
|
throw new \InvalidArgumentException("Default $defaultValue is outside the range " . $this->getMinValue() . " - " . $this->getMaxValue());
|
||||||
|
Loading…
x
Reference in New Issue
Block a user