Skip to content

Direction 5.46.0 ​

final class · pocketmine\world\generator\vanilla\feature\block\Direction · source

Java's Direction enum, as ints in vanilla's ordinal order (the order matters: vanilla iterates and picks random directions by ordinal).

Constants ​

AXIS ​

php
public const AXIS = [1, 1, 2, 2, 0, 0]

Axis per direction: 0 = x, 1 = y, 2 = z.

DOWN ​

php
public const DOWN = 0

EAST ​

php
public const EAST = 5

HORIZONTAL ​

php
public const HORIZONTAL = [self::SOUTH, self::WEST, self::NORTH, self::EAST]

Horizontal directions in 2D data value order (Direction.Plane.HORIZONTAL / from2DDataValue): S, W, N, E.

NAMES ​

php
public const NAMES = ["down", "up", "north", "south", "west", "east"]

NORTH ​

php
public const NORTH = 2

OPPOSITE ​

php
public const OPPOSITE = [1, 0, 3, 2, 5, 4]

PLANE_HORIZONTAL ​

php
public const PLANE_HORIZONTAL = [self::NORTH, self::EAST, self::SOUTH, self::WEST]

Direction.Plane.HORIZONTAL iteration order: N, E, S, W.

PLANE_VERTICAL ​

php
public const PLANE_VERTICAL = [self::UP, self::DOWN]

Direction.Plane.VERTICAL: UP, DOWN.

SOUTH ​

php
public const SOUTH = 3

STEP_X ​

php
public const STEP_X = [0, 0, 0, 0, -1, 1]

STEP_Y ​

php
public const STEP_Y = [-1, 1, 0, 0, 0, 0]

STEP_Z ​

php
public const STEP_Z = [0, 0, -1, 1, 0, 0]

UP ​

php
public const UP = 1

WEST ​

php
public const WEST = 4

Methods ​

clockWise() ​

php
public static function clockWise(int $direction) : int

Clockwise rotation around Y (horizontal directions only).

counterClockWise() ​

php
public static function counterClockWise(int $direction) : int

fromName() ​

php
public static function fromName(string $name) : int

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