Skip to content

Commit

Permalink
Remove Door::isCompatibleForHinge() change
Browse files Browse the repository at this point in the history
No longer valid behavior on newer versions
  • Loading branch information
IvanCraft623 committed Sep 23, 2024
1 parent 36e7e35 commit ff4467b
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 12 deletions.
7 changes: 0 additions & 7 deletions src/block/CopperDoor.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,4 @@ public function onInteract(Item $item, int $face, Vector3 $clickVector, ?Player

return parent::onInteract($item, $face, $clickVector, $player, $returnedItems);
}

protected function isCompatibleForHinge(Block $other) : bool{
return parent::isCompatibleForHinge($other) &&
$other instanceof CopperDoor &&
$this->getOxidation() === $other->getOxidation() &&
$this->isWaxed() === $other->isWaxed();
}
}
6 changes: 1 addition & 5 deletions src/block/Door.php
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ public function place(BlockTransaction $tx, Item $item, Block $blockReplace, Blo
$next = $this->getSide(Facing::rotateY($this->facing, false));
$next2 = $this->getSide(Facing::rotateY($this->facing, true));

if($this->isCompatibleForHinge($next) || (!$next2->isTransparent() && $next->isTransparent())){ //Door hinge
if($next->hasSameTypeId($this) || (!$next2->isTransparent() && $next->isTransparent())){ //Door hinge
$this->hingeRight = true;
}

Expand Down Expand Up @@ -176,8 +176,4 @@ public function getAffectedBlocks() : array{
private function canBeSupportedAt(Block $block) : bool{
return $block->getAdjacentSupportType(Facing::DOWN)->hasEdgeSupport();
}

protected function isCompatibleForHinge(Block $other) : bool{
return $other->hasSameTypeId($this);
}
}

0 comments on commit ff4467b

Please sign in to comment.