Skip to content

Rotations 5.46.0 ​

final class · pocketmine\world\generator\vanilla\structure\template\Rotations · source

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 = 2

CLOCKWISE_90 ​

php
public const CLOCKWISE_90 = 1

COUNTERCLOCKWISE_90 ​

php
public const COUNTERCLOCKWISE_90 = 3

MIRROR_FRONT_BACK ​

php
public const MIRROR_FRONT_BACK = 2

Mirror.FRONT_BACK: x = -x (east <-> west)

MIRROR_LEFT_RIGHT ​

php
public const MIRROR_LEFT_RIGHT = 1

Mirror.LEFT_RIGHT: z = -z (north <-> south)

MIRROR_NONE ​

php
public const MIRROR_NONE = 0

NAMES ​

php
public const NAMES = ["none", "clockwise_90", "180", "counterclockwise_90"]

NONE ​

php
public const NONE = 0

Methods ​

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) : array

StructureTemplate.getBoundingBox(startPos, rotation, pivot, mirror, size)

compose() ​

php
public static function compose(int $a, int $b) : int

Rotation.getRotated(rotation): composition of two rotations.

mirrorDirection() ​

php
public static function mirrorDirection(int $direction, int $mirror) : int

mirrorRotation() ​

php
public static function mirrorRotation(int $direction, int $mirror) : int

Mirror.getRotation(direction)

mirrorState() ​

php
public static function mirrorState(\pocketmine\world\generator\vanilla\feature\block\JavaBlocks $blocks, int $state, int $mirror) : int

rotateDirection() ​

php
public static function rotateDirection(int $direction, int $rotation) : int

rotateState() ​

php
public static function rotateState(\pocketmine\world\generator\vanilla\feature\block\JavaBlocks $blocks, int $state, int $rotation) : int

transform() ​

php
public static function transform(int $x, int $z, int $mirror, int $rotation, int $pivotX, int $pivotZ) : array

StructureTemplate.transform(pos, mirror, rotation, pivot)

transformExact() ​

php
public static function transformExact(float $x, float $z, int $mirror, int $rotation, int $pivotX, int $pivotZ) : array

StructureTemplate.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) : int

BlockState.mirror(mirror).rotate(rotation), cached.

transformYaw() ​

php
public static function transformYaw(float $yaw, int $mirror, int $rotation) : float

Yaw of a rotated/mirrored entity (Entity.rotate() + Entity.mirror()).

VanillaMine is a fork of PocketMine-MP, maintained by Luxury Nodes. Not affiliated with the PMMP team or Mojang.