mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-07-29 14:15:47 +00:00
Block: Relocate and document addVelocityToEntity()
maybe we should consider merging this with onEntityInside(), since they are both called for the same reasons? ...
This commit is contained in:
parent
77a18d0aea
commit
6a0c54f850
@ -342,10 +342,6 @@ class Block{
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function addVelocityToEntity(Entity $entity) : ?Vector3{
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
final public function getPosition() : Position{
|
final public function getPosition() : Position{
|
||||||
return $this->position;
|
return $this->position;
|
||||||
}
|
}
|
||||||
@ -585,6 +581,19 @@ class Block{
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns a direction vector describing which way an entity intersecting this block should be pushed.
|
||||||
|
* This is used by liquids to push entities in liquid currents.
|
||||||
|
*
|
||||||
|
* The returned vector is summed with vectors from every other block the entity is intersecting, and normalized to
|
||||||
|
* produce a final direction vector.
|
||||||
|
*
|
||||||
|
* WARNING: This will not be called if {@link Block::hasEntityCollision()} does not return true!
|
||||||
|
*/
|
||||||
|
public function addVelocityToEntity(Entity $entity) : ?Vector3{
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Called when an entity lands on this block (usually due to falling).
|
* Called when an entity lands on this block (usually due to falling).
|
||||||
* @return float|null The new vertical velocity of the entity, or null if unchanged.
|
* @return float|null The new vertical velocity of the entity, or null if unchanged.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user