Avoid more Vector3 mutations using withComponents()

This commit is contained in:
Dylan K. Taylor
2020-09-25 18:40:13 +01:00
parent 1d8e7abdd4
commit db7fb25196
3 changed files with 12 additions and 22 deletions

View File

@@ -97,7 +97,7 @@ class Squid extends WaterAnimal{
if($this->isAlive()){
if($this->location->y > 62 and $this->swimDirection !== null){
$this->swimDirection->y = -0.5;
$this->swimDirection = $this->swimDirection->withComponents(null, -0.5, null);
}
$inWater = $this->isUnderwater();