diff --git a/src/block/Block.php b/src/block/Block.php index 266e4c785..41983df64 100644 --- a/src/block/Block.php +++ b/src/block/Block.php @@ -342,10 +342,6 @@ class Block{ return false; } - public function addVelocityToEntity(Entity $entity) : ?Vector3{ - return null; - } - final public function getPosition() : Position{ return $this->position; } @@ -585,6 +581,19 @@ class Block{ 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). * @return float|null The new vertical velocity of the entity, or null if unchanged.