Block: improve documentation of hasEntityCollision() and onEntityInside()

This commit is contained in:
Dylan K. Taylor 2022-09-24 17:04:42 +01:00
parent cb7c136035
commit 140a809c40
No known key found for this signature in database
GPG Key ID: 8927471A91CAFD3D

View File

@ -329,10 +329,6 @@ class Block{
return false; return false;
} }
public function hasEntityCollision() : bool{
return false;
}
/** /**
* Returns whether entities can climb up this block. * Returns whether entities can climb up this block.
*/ */
@ -561,10 +557,21 @@ class Block{
return false; return false;
} }
/**
* Returns whether the block has actions to be executed when an entity enters its cell (full cube space).
*
* @see Block::onEntityInside()
*/
public function hasEntityCollision() : bool{
return false;
}
/** /**
* Called when an entity's bounding box clips inside this block's cell. Note that the entity may not be intersecting * Called when an entity's bounding box clips inside this block's cell. Note that the entity may not be intersecting
* with the collision box or bounding box. * with the collision box or bounding box.
* *
* WARNING: This will not be called if {@link Block::hasEntityCollision()} returns false.
*
* @return bool Whether the block is still the same after the intersection. If it changed (e.g. due to an explosive * @return bool Whether the block is still the same after the intersection. If it changed (e.g. due to an explosive
* being ignited), this should return false. * being ignited), this should return false.
*/ */