moving sneak & sprint properties to Living

This commit is contained in:
Dylan K. Taylor
2020-05-21 19:55:58 +01:00
parent 74e1f6320a
commit ec8ee29291
4 changed files with 38 additions and 36 deletions

View File

@@ -209,10 +209,6 @@ abstract class Entity{
protected $immobile = false;
/** @var bool */
protected $invisible = false;
/** @var bool */
protected $sneaking = false;
/** @var bool */
protected $sprinting = false;
/** @var int|null */
protected $ownerId = null;
@@ -345,26 +341,6 @@ abstract class Entity{
);
}
public function isSneaking() : bool{
return $this->sneaking;
}
public function setSneaking(bool $value = true) : void{
$this->sneaking = $value;
}
public function isSprinting() : bool{
return $this->sprinting;
}
public function setSprinting(bool $value = true) : void{
if($value !== $this->isSprinting()){
$this->sprinting = $value;
$attr = $this->attributeMap->get(Attribute::MOVEMENT_SPEED);
$attr->setValue($value ? ($attr->getValue() * 1.3) : ($attr->getValue() / 1.3), false, true);
}
}
public function isImmobile() : bool{
return $this->immobile;
}
@@ -1697,7 +1673,6 @@ abstract class Entity{
$this->networkProperties->setGenericFlag(EntityMetadataFlags::IMMOBILE, $this->immobile);
$this->networkProperties->setGenericFlag(EntityMetadataFlags::INVISIBLE, $this->invisible);
$this->networkProperties->setGenericFlag(EntityMetadataFlags::ONFIRE, $this->isOnFire());
$this->networkProperties->setGenericFlag(EntityMetadataFlags::SNEAKING, $this->sneaking);
$this->networkProperties->setGenericFlag(EntityMetadataFlags::WALLCLIMBING, $this->canClimbWalls);
}