Package codechicken.multipart.util
Enum Class PartMap
- All Implemented Interfaces:
Serializable,Comparable<PartMap>,Constable
Defines what each slot in a multipart tile corresponds to and provides some utility functions.
For performance reasons, it is recommended that integer constants be used as opposed to this enum
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum Constants -
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic PartMapcorner(int i) Don't actually use this.static PartMapedge(int i) Don't actually use this.static intedgeAxisMask(int e) Returns a 3 bit mask of the axis xzy that are variable in this edge.static intedgeBetween(int s1, int s2) Returns the slot of the edge between 2 sides.static PartMapface(int i) Don't actually use this.static intpackEdgeBits(int e, int bits) Repacks a mask of axis bits indicating positive positions, into an edge in along the same axis as e.static intunpackEdgeBits(int e) Unpacks an edge index, to a mask where high values indicate positive positions in that axis.static PartMapReturns the enum constant of this class with the specified name.static PartMap[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
BOTTOM
-
TOP
-
NORTH
-
SOUTH
-
WEST
-
EAST
-
CENTER
-
CORNER_NNN
-
CORNER_NPN
-
CORNER_NNP
-
CORNER_NPP
-
CORNER_PNN
-
CORNER_PPN
-
CORNER_PNP
-
CORNER_PPP
-
EDGE_NYN
-
EDGE_NYP
-
EDGE_PYN
-
EDGE_PYP
-
EDGE_NNZ
-
EDGE_PNZ
-
EDGE_NPZ
-
EDGE_PPZ
-
EDGE_XNN
-
EDGE_XPN
-
EDGE_XNP
-
EDGE_XPP
-
-
Field Details
-
i
public final int i -
mask
public final int mask
-
-
Method Details
-
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
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 nameNullPointerException- if the argument is null
-
face
Don't actually use this. -
edge
Don't actually use this. -
corner
Don't actually use this. -
edgeAxisMask
public static int edgeAxisMask(int e) Returns a 3 bit mask of the axis xzy that are variable in this edge. For example, the first 4 edges (15-18) are along the Y axis, variable in x and z, so the mask is 110b. Note axis y is 1invalid input: '<'invalid input: '<'0, z is 1invalid input: '<'invalid input: '<'1 and x is 1invalid input: '<'invalid input: '<'2 Note the parameter e is relative to the first edge slot and can range from 0-11 -
unpackEdgeBits
public static int unpackEdgeBits(int e) Unpacks an edge index, to a mask where high values indicate positive positions in that axis. Note the parameter e is relative to the first edge slot and can range from 0-11 For example, edge 1 (slot 16), is EDGE_NYP so the mask returned would be 010 as z is positive. -
packEdgeBits
public static int packEdgeBits(int e, int bits) Repacks a mask of axis bits indicating positive positions, into an edge in along the same axis as e. Note the parameter e is relative to the first edge slot and can range from 0-11 -
edgeBetween
public static int edgeBetween(int s1, int s2) Returns the slot of the edge between 2 sides.
-