mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-06 09:56:06 +00:00
Avoid more Vector3 mutations using withComponents()
This commit is contained in:
@ -288,7 +288,7 @@ abstract class Living extends Entity{
|
||||
*/
|
||||
public function jump() : void{
|
||||
if($this->onGround){
|
||||
$this->motion->y = $this->getJumpVelocity(); //Y motion should already be 0 if we're jumping from the ground.
|
||||
$this->motion = $this->motion->withComponents(null, $this->getJumpVelocity(), null); //Y motion should already be 0 if we're jumping from the ground.
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user