Added forceSend for attribute value setting, fixed slowness >= 7 removed client-side when sprinting

This commit is contained in:
Dylan K. Taylor
2017-03-09 21:33:55 +00:00
parent 7fb3c7343f
commit c925845173
2 changed files with 5 additions and 2 deletions

View File

@ -169,7 +169,7 @@ class Attribute{
return $this->currentValue;
}
public function setValue($value, $fit = false){
public function setValue($value, $fit = false, bool $forceSend = false){
if($value > $this->getMaxValue() or $value < $this->getMinValue()){
if(!$fit){
throw new \InvalidArgumentException("Value $value exceeds the range!");
@ -180,7 +180,10 @@ class Attribute{
if($this->currentValue != $value){
$this->desynchronized = true;
$this->currentValue = $value;
}elseif($forceSend){
$this->desynchronized = true;
}
return $this;
}