Package net.minecraft.util
Enum EnumFacing
- java.lang.Object
-
- java.lang.Enum<EnumFacing>
-
- net.minecraft.util.EnumFacing
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Comparable<EnumFacing>
,IStringSerializable
public enum EnumFacing extends java.lang.Enum<EnumFacing> implements IStringSerializable
+ This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. NOT FOR COMMERCIAL OR MALICIOUS USE (please read the 'LICENSE' file this repo's root directory for more info)
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
EnumFacing.Axis
static class
EnumFacing.AxisDirection
static class
EnumFacing.Plane
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static EnumFacing
byName(java.lang.String name)
+ Get the facing specified by the given namestatic EnumFacing
fromAngle(double angle)
+ Get the Facing corresponding to the given angle (0-360).static EnumFacing
func_181076_a(EnumFacing.AxisDirection parAxisDirection, EnumFacing.Axis parAxis)
EnumFacing.Axis
getAxis()
EnumFacing.AxisDirection
getAxisDirection()
+ Get the AxisDirection of this Facing.Vec3i
getDirectionVec()
+ Get a normalized Vector that points in the direction of this Facing.static EnumFacing
getFacingFromVector(float parFloat1, float parFloat2, float parFloat3)
static EnumFacing
getFront(int index)
+ Get a Facing by it's index (0-5).int
getFrontOffsetX()
+ Returns a offset that addresses the block in front of this facing.int
getFrontOffsetY()
int
getFrontOffsetZ()
+ Returns a offset that addresses the block in front of this facing.static EnumFacing
getHorizontal(int parInt1)
+ Get a Facing by it's horizontal index (0-3).int
getHorizontalIndex()
+ Get the index of this horizontal facing (0-3).int
getIndex()
+ Get the Index of this Facing (0-5).java.lang.String
getName()
java.lang.String
getName2()
+ Same as getName, but does not override the method from Enum.EnumFacing
getOpposite()
+ Get the opposite Facing (e.g.static EnumFacing
random(EaglercraftRandom rand)
+ Choose a random Facing using the given RandomEnumFacing
rotateAround(EnumFacing.Axis axis)
+ Rotate this Facing around the given axis clockwise.EnumFacing
rotateY()
+ Rotate this Facing around the Y axis clockwise (NORTH => EAST => SOUTH => WEST => NORTH)EnumFacing
rotateYCCW()
+ Rotate this Facing around the Y axis counter-clockwise (NORTH => WEST => SOUTH => EAST => NORTH)java.lang.String
toString()
static EnumFacing
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.static EnumFacing[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
DOWN
public static final EnumFacing DOWN
-
UP
public static final EnumFacing UP
-
NORTH
public static final EnumFacing NORTH
-
SOUTH
public static final EnumFacing SOUTH
-
WEST
public static final EnumFacing WEST
-
EAST
public static final EnumFacing EAST
-
-
Method Detail
-
values
public static EnumFacing[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (EnumFacing c : EnumFacing.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static EnumFacing valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (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:
java.lang.IllegalArgumentException
- if this enum type has no constant with the specified namejava.lang.NullPointerException
- if the argument is null
-
getIndex
public int getIndex()
+ Get the Index of this Facing (0-5). The order is D-U-N-S-W-E
-
getHorizontalIndex
public int getHorizontalIndex()
+ Get the index of this horizontal facing (0-3). The order is S-W-N-E
-
getAxisDirection
public EnumFacing.AxisDirection getAxisDirection()
+ Get the AxisDirection of this Facing.
-
getOpposite
public EnumFacing getOpposite()
+ Get the opposite Facing (e.g. DOWN => UP)
-
rotateAround
public EnumFacing rotateAround(EnumFacing.Axis axis)
+ Rotate this Facing around the given axis clockwise. If this facing cannot be rotated around the given axis, returns this facing without rotating.
-
rotateY
public EnumFacing rotateY()
+ Rotate this Facing around the Y axis clockwise (NORTH => EAST => SOUTH => WEST => NORTH)
-
rotateYCCW
public EnumFacing rotateYCCW()
+ Rotate this Facing around the Y axis counter-clockwise (NORTH => WEST => SOUTH => EAST => NORTH)
-
getFrontOffsetX
public int getFrontOffsetX()
+ Returns a offset that addresses the block in front of this facing.
-
getFrontOffsetY
public int getFrontOffsetY()
-
getFrontOffsetZ
public int getFrontOffsetZ()
+ Returns a offset that addresses the block in front of this facing.
-
getName2
public java.lang.String getName2()
+ Same as getName, but does not override the method from Enum.
-
getAxis
public EnumFacing.Axis getAxis()
-
byName
public static EnumFacing byName(java.lang.String name)
+ Get the facing specified by the given name
-
getFront
public static EnumFacing getFront(int index)
+ Get a Facing by it's index (0-5). The order is D-U-N-S-W-E. Named getFront for legacy reasons.
-
getHorizontal
public static EnumFacing getHorizontal(int parInt1)
+ Get a Facing by it's horizontal index (0-3). The order is S-W-N-E.
-
fromAngle
public static EnumFacing fromAngle(double angle)
+ Get the Facing corresponding to the given angle (0-360). An angle of 0 is SOUTH, an angle of 90 would be WEST.
-
random
public static EnumFacing random(EaglercraftRandom rand)
+ Choose a random Facing using the given Random
-
getFacingFromVector
public static EnumFacing getFacingFromVector(float parFloat1, float parFloat2, float parFloat3)
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Enum<EnumFacing>
-
getName
public java.lang.String getName()
- Specified by:
getName
in interfaceIStringSerializable
-
func_181076_a
public static EnumFacing func_181076_a(EnumFacing.AxisDirection parAxisDirection, EnumFacing.Axis parAxis)
-
getDirectionVec
public Vec3i getDirectionVec()
+ Get a normalized Vector that points in the direction of this Facing.
-
-