mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-07 04:17:07 +00:00
Fixed keepMovement logic
This commit is contained in:
parent
00a9ae6c95
commit
a8ad956b29
@ -1455,15 +1455,15 @@ abstract class Entity extends Location implements Metadatable, EntityIds{
|
||||
return true;
|
||||
}
|
||||
|
||||
if($this->keepMovement){
|
||||
$this->boundingBox->offset($dx, $dy, $dz);
|
||||
$this->setPosition($this->temporalVector->setComponents(($this->boundingBox->minX + $this->boundingBox->maxX) / 2, $this->boundingBox->minY, ($this->boundingBox->minZ + $this->boundingBox->maxZ) / 2));
|
||||
$this->onGround = $this->isPlayer ? true : false;
|
||||
return true;
|
||||
}else{
|
||||
|
||||
Timings::$entityMoveTimer->startTiming();
|
||||
|
||||
$movX = $dx;
|
||||
$movY = $dy;
|
||||
$movZ = $dz;
|
||||
|
||||
if($this->keepMovement){
|
||||
$this->boundingBox->offset($dx, $dy, $dz);
|
||||
}else{
|
||||
$this->ySize *= 0.4;
|
||||
|
||||
/*
|
||||
@ -1478,10 +1478,6 @@ abstract class Entity extends Location implements Metadatable, EntityIds{
|
||||
}
|
||||
*/
|
||||
|
||||
$movX = $dx;
|
||||
$movY = $dy;
|
||||
$movZ = $dz;
|
||||
|
||||
$axisalignedbb = clone $this->boundingBox;
|
||||
|
||||
/*$sneakFlag = $this->onGround and $this instanceof Player;
|
||||
@ -1575,7 +1571,7 @@ abstract class Entity extends Location implements Metadatable, EntityIds{
|
||||
}else{
|
||||
$this->ySize += 0.5; //FIXME: this should be the height of the block it walked up, not fixed 0.5
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
$this->x = ($this->boundingBox->minX + $this->boundingBox->maxX) / 2;
|
||||
@ -1599,14 +1595,12 @@ abstract class Entity extends Location implements Metadatable, EntityIds{
|
||||
$this->motionZ = 0;
|
||||
}
|
||||
|
||||
|
||||
//TODO: vehicle collision events (first we need to spawn them!)
|
||||
|
||||
Timings::$entityMoveTimer->stopTiming();
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
protected function checkGroundState(float $movX, float $movY, float $movZ, float $dx, float $dy, float $dz){
|
||||
$this->isCollidedVertically = $movY != $dy;
|
||||
|
Loading…
x
Reference in New Issue
Block a user