Integrate dev-major-next version of pocketmine/math

this is a reduced version compared to the original, due to the difficulty of getting rid of Facing values internally.
This commit is contained in:
Dylan K. Taylor
2025-08-29 21:47:20 +01:00
parent 97027db70a
commit 6f6b23d4e4
194 changed files with 909 additions and 873 deletions

View File

@ -79,10 +79,10 @@ class Bed extends Transparent implements Colored, HorizontalFacing{
}
protected function recalculateCollisionBoxes() : array{
return [AxisAlignedBB::one()->trim(Facing::UP, 7 / 16)];
return [AxisAlignedBB::one()->trimmedCopy(Facing::UP, 7 / 16)];
}
public function getSupportType(int $facing) : SupportType{
public function getSupportType(Facing $facing) : SupportType{
return SupportType::NONE;
}
@ -106,7 +106,7 @@ class Bed extends Transparent implements Colored, HorizontalFacing{
return $this;
}
private function getOtherHalfSide() : int{
private function getOtherHalfSide() : Facing{
return $this->head ? Facing::opposite($this->facing) : $this->facing;
}
@ -119,7 +119,7 @@ class Bed extends Transparent implements Colored, HorizontalFacing{
return null;
}
public function onInteract(Item $item, int $face, Vector3 $clickVector, ?Player $player = null, array &$returnedItems = []) : bool{
public function onInteract(Item $item, Facing $face, Vector3 $clickVector, ?Player $player = null, array &$returnedItems = []) : bool{
if($player !== null){
$other = $this->getOtherHalf();
$playerPos = $player->getPosition();
@ -172,7 +172,7 @@ class Bed extends Transparent implements Colored, HorizontalFacing{
return $entity->getMotion()->y * -3 / 4; // 2/3 in Java, according to the wiki
}
public function place(BlockTransaction $tx, Item $item, Block $blockReplace, Block $blockClicked, int $face, Vector3 $clickVector, ?Player $player = null) : bool{
public function place(BlockTransaction $tx, Item $item, Block $blockReplace, Block $blockClicked, Facing $face, Vector3 $clickVector, ?Player $player = null) : bool{
if($this->canBeSupportedAt($blockReplace)){
$this->facing = $player !== null ? $player->getHorizontalFacing() : Facing::NORTH;