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

@ -53,7 +53,7 @@ class Door extends Transparent{
//copy door properties from other half
$other = $this->getSide($this->top ? Facing::DOWN : Facing::UP);
if($other instanceof Door && $other->isSameType($this)){
if($other instanceof Door && $other->hasSameTypeId($this)){
if($this->top){
$this->facing = $other->facing;
$this->open = $other->open;
@ -126,7 +126,7 @@ class Door extends Transparent{
$next = $this->getSide(Facing::rotateY($this->facing, false));
$next2 = $this->getSide(Facing::rotateY($this->facing, true));
if($next->isSameType($this) || (!$next2->isTransparent() && $next->isTransparent())){ //Door hinge
if($next->hasSameTypeId($this) || (!$next2->isTransparent() && $next->isTransparent())){ //Door hinge
$this->hingeRight = true;
}
@ -145,7 +145,7 @@ class Door extends Transparent{
$other = $this->getSide($this->top ? Facing::DOWN : Facing::UP);
$world = $this->position->getWorld();
if($other instanceof Door && $other->isSameType($this)){
if($other instanceof Door && $other->hasSameTypeId($this)){
$other->open = $this->open;
$world->setBlock($other->position, $other);
}
@ -166,7 +166,7 @@ class Door extends Transparent{
public function getAffectedBlocks() : array{
$other = $this->getSide($this->top ? Facing::DOWN : Facing::UP);
if($other->isSameType($this)){
if($other->hasSameTypeId($this)){
return [$this, $other];
}
return parent::getAffectedBlocks();