Enum Class Side

java.lang.Object
java.lang.Enum<Side>
li.cil.oc2.api.util.Side
All Implemented Interfaces:
Serializable, Comparable<Side>, Constable

public enum Side extends Enum<Side>
This enum indicates a side of a block device.

It is intended to be used by RPCDevice APIs, providing both convenience for the caller by providing a range of aliases, and also stability, in case Mojang decide to rename the enum fields of the Direction enum at some time in the future.

Sides come in two flavors. Absolute sides (north, south, west and east) always refer to the same direction in the world. Relative sides (front, back, left and right) are resolved against the orientation of the device's container, and hence refer to different directions in the world as that container is rotated. up and down are the same either way.

getDirection() returns the underlying direction as-is. For relative sides that is a direction in the container's local frame, which must be rotated into world space before use; see isRelative().

  • Enum Constant Details

    • DOWN

      public static final Side DOWN
    • down

      public static final Side down
    • d

      public static final Side d
    • UP

      public static final Side UP
    • up

      public static final Side up
    • u

      public static final Side u
    • NORTH

      public static final Side NORTH
    • north

      public static final Side north
    • n

      public static final Side n
    • SOUTH

      public static final Side SOUTH
    • south

      public static final Side south
    • s

      public static final Side s
    • WEST

      public static final Side WEST
    • west

      public static final Side west
    • w

      public static final Side w
    • EAST

      public static final Side EAST
    • east

      public static final Side east
    • e

      public static final Side e
    • BACK

      public static final Side BACK
    • back

      public static final Side back
    • b

      public static final Side b
    • FRONT

      public static final Side FRONT
    • front

      public static final Side front
    • f

      public static final Side f
    • LEFT

      public static final Side LEFT
    • left

      public static final Side left
    • l

      public static final Side l
    • r

      public static final Side r
  • Method Details

    • values

      public static Side[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static Side valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • byIndex

      public static Side byIndex(int index)
    • getDirection

      public net.minecraft.core.Direction getDirection()
    • isRelative

      public boolean isRelative()
    • toString

      public String toString()
      Overrides:
      toString in class Enum<Side>