Rotations 5.46.0
Vanilla's Rotation and Mirror: transforms of template positions (StructureTemplate.transform()), directions and block states (BlockState.rotate() / mirror()).
Constants
CLOCKWISE_180
php
public const CLOCKWISE_180 = 2CLOCKWISE_90
php
public const CLOCKWISE_90 = 1COUNTERCLOCKWISE_90
php
public const COUNTERCLOCKWISE_90 = 3MIRROR_FRONT_BACK
php
public const MIRROR_FRONT_BACK = 2Mirror.FRONT_BACK: x = -x (east <-> west)
MIRROR_LEFT_RIGHT
php
public const MIRROR_LEFT_RIGHT = 1Mirror.LEFT_RIGHT: z = -z (north <-> south)
MIRROR_NONE
php
public const MIRROR_NONE = 0NAMES
php
public const NAMES = ["none", "clockwise_90", "180", "counterclockwise_90"]NONE
php
public const NONE = 0Methods
boundingBox()
php
public static function boundingBox(int $x, int $y, int $z, int $sizeX, int $sizeY, int $sizeZ, int $rotation, int $mirror = self::MIRROR_NONE, int $pivotX = 0, int $pivotZ = 0) : arrayStructureTemplate.getBoundingBox(startPos, rotation, pivot, mirror, size)
compose()
php
public static function compose(int $a, int $b) : intRotation.getRotated(rotation): composition of two rotations.
mirrorDirection()
php
public static function mirrorDirection(int $direction, int $mirror) : intmirrorRotation()
php
public static function mirrorRotation(int $direction, int $mirror) : intMirror.getRotation(direction)
mirrorState()
php
public static function mirrorState(\pocketmine\world\generator\vanilla\feature\block\JavaBlocks $blocks, int $state, int $mirror) : introtateDirection()
php
public static function rotateDirection(int $direction, int $rotation) : introtateState()
php
public static function rotateState(\pocketmine\world\generator\vanilla\feature\block\JavaBlocks $blocks, int $state, int $rotation) : inttransform()
php
public static function transform(int $x, int $z, int $mirror, int $rotation, int $pivotX, int $pivotZ) : arrayStructureTemplate.transform(pos, mirror, rotation, pivot)
transformExact()
php
public static function transformExact(float $x, float $z, int $mirror, int $rotation, int $pivotX, int $pivotZ) : arrayStructureTemplate.transform(Vec3 pos, mirror, rotation, pivot), for entity positions.
transformState()
php
public static function transformState(\pocketmine\world\generator\vanilla\feature\block\JavaBlocks $blocks, int $state, int $mirror, int $rotation) : intBlockState.mirror(mirror).rotate(rotation), cached.
transformYaw()
php
public static function transformYaw(float $yaw, int $mirror, int $rotation) : floatYaw of a rotated/mirrored entity (Entity.rotate() + Entity.mirror()).
