mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-04-21 00:07:30 +00:00
Further (major!) performance enhancements to entity ticking
This commit is contained in:
parent
b8ade18888
commit
c32b75fa18
@ -1097,7 +1097,6 @@ abstract class Entity extends Location implements Metadatable{
|
||||
public function entityBaseTick(int $tickDiff = 1) : bool{
|
||||
//TODO: check vehicles
|
||||
|
||||
$this->blocksAround = null;
|
||||
$this->justCreated = false;
|
||||
|
||||
if(!$this->isAlive()){
|
||||
@ -1313,6 +1312,8 @@ abstract class Entity extends Location implements Metadatable{
|
||||
final public function setForceMovementUpdate(bool $value = true){
|
||||
$this->forceMovementUpdate = $value;
|
||||
$this->onGround = false;
|
||||
|
||||
$this->blocksAround = null;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -1473,6 +1474,8 @@ abstract class Entity extends Location implements Metadatable{
|
||||
}
|
||||
|
||||
public function fastMove(float $dx, float $dy, float $dz) : bool{
|
||||
$this->blocksAround = null;
|
||||
|
||||
if($dx == 0 and $dz == 0 and $dy == 0){
|
||||
return true;
|
||||
}
|
||||
@ -1512,13 +1515,12 @@ abstract class Entity extends Location implements Metadatable{
|
||||
}
|
||||
|
||||
public function move(float $dx, float $dy, float $dz) : bool{
|
||||
$this->blocksAround = null;
|
||||
|
||||
if($dx == 0 and $dz == 0 and $dy == 0){
|
||||
return true;
|
||||
}
|
||||
|
||||
$this->blocksAround = null;
|
||||
|
||||
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));
|
||||
|
Loading…
x
Reference in New Issue
Block a user