Apparently hanging signs are self supporting

This commit is contained in:
Dylan K. Taylor
2025-08-25 02:15:24 +01:00
parent f04c458e54
commit 4a2c7dc684
2 changed files with 9 additions and 24 deletions

View File

@ -27,6 +27,7 @@ use pocketmine\block\utils\HorizontalFacing;
use pocketmine\block\utils\HorizontalFacingTrait;
use pocketmine\item\Item;
use pocketmine\math\Axis;
use pocketmine\math\AxisAlignedBB;
use pocketmine\math\Facing;
use pocketmine\math\Vector3;
use pocketmine\player\Player;
@ -39,12 +40,13 @@ final class WallHangingSign extends BaseSign implements HorizontalFacing{
return Facing::rotateY($this->facing, clockwise: true);
}
protected function getSupportingFaceOptions() : array{
//wall hanging signs can be supported from either end of the post
return [
Facing::rotateY($this->facing, clockwise: true),
Facing::rotateY($this->facing, clockwise: false)
];
public function onNearbyBlockChange() : void{
//NOOP - disable default self-destruct behaviour
}
protected function recalculateCollisionBoxes() : array{
//only the cross bar is collidable
return [AxisAlignedBB::one()->trim(Facing::DOWN, 7 / 8)->squash(Facing::axis($this->facing), 3 / 4)];
}
public function place(BlockTransaction $tx, Item $item, Block $blockReplace, Block $blockClicked, int $face, Vector3 $clickVector, ?Player $player = null) : bool{