mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-10-20 15:41:33 +00:00
Fixed entities getting OnGround default to true
This commit is contained in:
@@ -130,16 +130,6 @@ class Arrow extends Projectile{
|
||||
|
||||
$this->move($this->motionX, $this->motionY, $this->motionZ);
|
||||
|
||||
$friction = 1 - $this->drag;
|
||||
|
||||
if($this->onGround){
|
||||
$friction = $this->getLevel()->getBlock(new Vector3($this->getFloorX(), $this->getFloorY() - 1, $this->getFloorZ()))->frictionFactor * $friction;
|
||||
}
|
||||
|
||||
$this->motionX *= $friction;
|
||||
$this->motionY *= 1 - $this->drag;
|
||||
$this->motionZ *= $friction;
|
||||
|
||||
if($this->onGround){
|
||||
$this->motionX = 0;
|
||||
$this->motionY = 0;
|
||||
|
||||
@@ -198,7 +198,7 @@ abstract class Entity extends Position implements Metadatable{
|
||||
$this->airTicks = $this->namedtag["Air"];
|
||||
|
||||
if(!isset($this->namedtag->OnGround)){
|
||||
$this->namedtag->OnGround = new Byte("OnGround", 1);
|
||||
$this->namedtag->OnGround = new Byte("OnGround", 0);
|
||||
}
|
||||
$this->onGround = $this->namedtag["OnGround"] > 0 ? true : false;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user