Block: rename isSameType() to hasSameTypeId()

this should remove any ambiguity about its behaviour.
This commit is contained in:
Dylan K. Taylor
2023-04-21 20:25:21 +01:00
parent 769be8e140
commit 6c0ad9589b
15 changed files with 33 additions and 33 deletions

View File

@ -131,7 +131,7 @@ class Bamboo extends Transparent{
private function seekToTop() : Bamboo{
$world = $this->position->getWorld();
$top = $this;
while(($next = $world->getBlock($top->position->up())) instanceof Bamboo && $next->isSameType($this)){
while(($next = $world->getBlock($top->position->up())) instanceof Bamboo && $next->hasSameTypeId($this)){
$top = $next;
}
return $top;
@ -156,7 +156,7 @@ class Bamboo extends Transparent{
public function onNearbyBlockChange() : void{
$world = $this->position->getWorld();
$below = $world->getBlock($this->position->down());
if(!$this->canBeSupportedBy($below) && !$below->isSameType($this)){
if(!$this->canBeSupportedBy($below) && !$below->hasSameTypeId($this)){
$world->useBreakOn($this->position);
}
}
@ -168,7 +168,7 @@ class Bamboo extends Transparent{
}
$height = 1;
while($world->getBlock($this->position->subtract(0, $height, 0))->isSameType($this)){
while($world->getBlock($this->position->subtract(0, $height, 0))->hasSameTypeId($this)){
if(++$height >= $maxHeight){
return false;
}