mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-05-13 01:09:44 +00:00
Entity: remove dead code
This commit is contained in:
parent
fb128d0276
commit
bae140dc02
@ -1461,47 +1461,6 @@ abstract class Entity extends Location implements Metadatable, EntityIds{
|
|||||||
return $block->isSolid() and !$block->isTransparent() and $block->collidesWithBB($this->getBoundingBox());
|
return $block->isSolid() and !$block->isTransparent() and $block->collidesWithBB($this->getBoundingBox());
|
||||||
}
|
}
|
||||||
|
|
||||||
public function fastMove(float $dx, float $dy, float $dz) : bool{
|
|
||||||
$this->blocksAround = null;
|
|
||||||
|
|
||||||
if($dx == 0 and $dz == 0 and $dy == 0){
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
Timings::$entityMoveTimer->startTiming();
|
|
||||||
|
|
||||||
$newBB = $this->boundingBox->offsetCopy($dx, $dy, $dz);
|
|
||||||
|
|
||||||
$list = $this->level->getCollisionCubes($this, $newBB, false);
|
|
||||||
|
|
||||||
if(count($list) === 0){
|
|
||||||
$this->boundingBox = $newBB;
|
|
||||||
}
|
|
||||||
|
|
||||||
$this->x = ($this->boundingBox->minX + $this->boundingBox->maxX) / 2;
|
|
||||||
$this->y = $this->boundingBox->minY - $this->ySize;
|
|
||||||
$this->z = ($this->boundingBox->minZ + $this->boundingBox->maxZ) / 2;
|
|
||||||
|
|
||||||
$this->checkChunks();
|
|
||||||
|
|
||||||
if(!$this->onGround or $dy != 0){
|
|
||||||
$bb = clone $this->boundingBox;
|
|
||||||
$bb->minY -= 0.75;
|
|
||||||
$this->onGround = false;
|
|
||||||
|
|
||||||
if(count($this->level->getCollisionBlocks($bb)) > 0){
|
|
||||||
$this->onGround = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
$this->isCollided = $this->onGround;
|
|
||||||
$this->updateFallState($dy, $this->onGround);
|
|
||||||
|
|
||||||
|
|
||||||
Timings::$entityMoveTimer->stopTiming();
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
public function move(float $dx, float $dy, float $dz) : void{
|
public function move(float $dx, float $dy, float $dz) : void{
|
||||||
$this->blocksAround = null;
|
$this->blocksAround = null;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user