mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-08 10:53:05 +00:00
Support editing the back side of signs (#6774)
* Deprecate BaseSign get/set/updateText(), add get/set/updateFaceText() which accepts true/false for front/back * add isFrontFace() to SignChangeEvent * add optional frontFace to Player::openSignEditor() * add BaseSign::getFacingDegrees() and getHitboxCenter() which need to be implemented by subclasses
This commit is contained in:
@ -32,6 +32,7 @@ use pocketmine\math\AxisAlignedBB;
|
||||
use pocketmine\math\Facing;
|
||||
use pocketmine\math\Vector3;
|
||||
use pocketmine\player\Player;
|
||||
use pocketmine\utils\AssumptionFailedError;
|
||||
use pocketmine\world\BlockTransaction;
|
||||
|
||||
final class WallHangingSign extends BaseSign implements HorizontalFacing{
|
||||
@ -78,4 +79,14 @@ final class WallHangingSign extends BaseSign implements HorizontalFacing{
|
||||
($block instanceof WallHangingSign && Facing::axis(Facing::rotateY($block->getFacing(), clockwise: true)) === Facing::axis($face)) ||
|
||||
$block->getSupportType(Facing::opposite($face)) === SupportType::FULL;
|
||||
}
|
||||
|
||||
protected function getFacingDegrees() : float{
|
||||
return match($this->facing){
|
||||
Facing::SOUTH => 0,
|
||||
Facing::WEST => 90,
|
||||
Facing::NORTH => 180,
|
||||
Facing::EAST => 270,
|
||||
default => throw new AssumptionFailedError("Invalid facing direction: " . $this->facing),
|
||||
};
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user