Block: rename getPositionOffset() -> getModelPositionOffset()

this gives a better idea of what the function does, and is also much less annoying for auto complete.
This commit is contained in:
Dylan K. Taylor 2021-10-10 22:35:38 +01:00
parent aa53dc6709
commit fd2df637b6
No known key found for this signature in database
GPG Key ID: 8927471A91CAFD3D
2 changed files with 4 additions and 4 deletions

View File

@ -115,7 +115,7 @@ class Bamboo extends Transparent{
return 12 + (self::getOffsetSeed($x, 0, $z) % 5);
}
public function getPositionOffset() : ?Vector3{
public function getModelPositionOffset() : ?Vector3{
$seed = self::getOffsetSeed($this->position->getFloorX(), 0, $this->position->getFloorZ());
$retX = (($seed % 12) + 1) / 16;
$retZ = ((($seed >> 8) % 12) + 1) / 16;

View File

@ -577,7 +577,7 @@ class Block{
final public function getCollisionBoxes() : array{
if($this->collisionBoxes === null){
$this->collisionBoxes = $this->recalculateCollisionBoxes();
$extraOffset = $this->getPositionOffset();
$extraOffset = $this->getModelPositionOffset();
$offset = $extraOffset !== null ? $this->position->addVector($extraOffset) : $this->position;
foreach($this->collisionBoxes as $bb){
$bb->offset($offset->x, $offset->y, $offset->z);
@ -588,10 +588,10 @@ class Block{
}
/**
* Returns an additional fractional vector to shift the block's effective position by based on the current position.
* Returns an additional fractional vector to shift the block model's position by based on the current position.
* Used to randomize position of things like bamboo canes and tall grass.
*/
public function getPositionOffset() : ?Vector3{
public function getModelPositionOffset() : ?Vector3{
return null;
}