mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-05-31 09:17:42 +00:00
Entity: make stepHeight accessable (#6702)
This commit is contained in:
parent
3636173d75
commit
5527a0c6bf
@ -1187,12 +1187,14 @@ abstract class Entity{
|
||||
|
||||
$moveBB->offset(0, 0, $dz);
|
||||
|
||||
if($this->stepHeight > 0 && $fallingFlag && ($wantedX !== $dx || $wantedZ !== $dz)){
|
||||
$stepHeight = $this->getStepHeight();
|
||||
|
||||
if($stepHeight > 0 && $fallingFlag && ($wantedX !== $dx || $wantedZ !== $dz)){
|
||||
$cx = $dx;
|
||||
$cy = $dy;
|
||||
$cz = $dz;
|
||||
$dx = $wantedX;
|
||||
$dy = $this->stepHeight;
|
||||
$dy = $stepHeight;
|
||||
$dz = $wantedZ;
|
||||
|
||||
$stepBB = clone $this->boundingBox;
|
||||
@ -1262,6 +1264,14 @@ abstract class Entity{
|
||||
Timings::$entityMove->stopTiming();
|
||||
}
|
||||
|
||||
public function setStepHeight(float $stepHeight) : void{
|
||||
$this->stepHeight = $stepHeight;
|
||||
}
|
||||
|
||||
public function getStepHeight() : float{
|
||||
return $this->stepHeight;
|
||||
}
|
||||
|
||||
protected function checkGroundState(float $wantedX, float $wantedY, float $wantedZ, float $dx, float $dy, float $dz) : void{
|
||||
$this->isCollidedVertically = $wantedY !== $dy;
|
||||
$this->isCollidedHorizontally = ($wantedX !== $dx || $wantedZ !== $dz);
|
||||
|
Loading…
x
Reference in New Issue
Block a user