mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-04-23 00:55:57 +00:00
parent
9c65a2b890
commit
6f6e3aaa21
@ -515,6 +515,10 @@ class Player extends Human implements CommandSender, ChunkLoader, IPlayer{
|
||||
return false;
|
||||
}
|
||||
|
||||
public function canBeCollidedWith() : bool{
|
||||
return !$this->isSpectator();
|
||||
}
|
||||
|
||||
public function resetFallDistance(){
|
||||
parent::resetFallDistance();
|
||||
if($this->inAirTicks !== 0){
|
||||
|
@ -1067,6 +1067,10 @@ abstract class Entity extends Location implements Metadatable, EntityIds{
|
||||
return !$this->justCreated and $entity !== $this;
|
||||
}
|
||||
|
||||
public function canBeCollidedWith() : bool{
|
||||
return true;
|
||||
}
|
||||
|
||||
protected function updateMovement(){
|
||||
$diffPosition = ($this->x - $this->lastX) ** 2 + ($this->y - $this->lastY) ** 2 + ($this->z - $this->lastZ) ** 2;
|
||||
$diffRotation = ($this->yaw - $this->lastYaw) ** 2 + ($this->pitch - $this->lastPitch) ** 2;
|
||||
|
@ -1964,7 +1964,7 @@ class Level implements ChunkManager, Metadatable{
|
||||
for($z = $minZ; $z <= $maxZ; ++$z){
|
||||
foreach($this->getChunkEntities($x, $z) as $ent){
|
||||
/** @var Entity|null $entity */
|
||||
if(($entity === null or ($ent !== $entity and $entity->canCollideWith($ent))) and $ent->boundingBox->intersectsWith($bb)){
|
||||
if($ent->canBeCollidedWith() and ($entity === null or ($ent !== $entity and $entity->canCollideWith($ent))) and $ent->boundingBox->intersectsWith($bb)){
|
||||
$nearby[] = $ent;
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user