Fix book placed in wrong slot in Chiseled Bookshelf (#6085)

This commit is contained in:
ace 2023-10-10 19:35:50 +08:00 committed by GitHub
parent c9163a1505
commit 8b52a5cd9e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -97,8 +97,9 @@ class ChiseledBookshelf extends Opaque{
return false;
}
$x = Facing::axis($face) === Axis::X ? $clickVector->getZ() : $clickVector->getX();
$slot = ChiseledBookshelfSlot::fromBlockFaceCoordinates(
Facing::axis($face) === Axis::X ? $clickVector->getZ() : $clickVector->getX(),
Facing::isPositive(Facing::rotateY($face, true)) ? 1 - $x : $x,
$clickVector->y
);
$tile = $this->position->getWorld()->getTile($this->position);