Class DirectionTransformationUtil
java.lang.Object
alexiil.mc.lib.multipart.api.misc.DirectionTransformationUtil
A handful of utilities for working with
DirectionTransformation
s.-
Method Summary
Modifier and TypeMethodDescriptionstatic BlockMirror
getMirror
(DirectionTransformation transformation) Gets the equivalentBlockMirror
for a givenDirectionTransformation
if any.static DirectionTransformation
getRelativeTransformation
(DirectionTransformation base, DirectionTransformation newTransformation) Gets the relative transformation that would need to be prepended to the base transformation to obtain the new transformation.static BlockRotation
getRotation
(DirectionTransformation transformation) Gets the equivalentBlockRotation
for a givenDirectionTransformation
if any.static boolean
isRotationOrMirror
(DirectionTransformation transformation) Determines whether aDirectionTransformation
can be represented as either aBlockRotation
orBlockMirror
.
-
Method Details
-
getRotation
Gets the equivalentBlockRotation
for a givenDirectionTransformation
if any.- Parameters:
transformation
- The transformation to try and turn into a BlockRotation.- Returns:
- The BlockRotation equivalent to the given transformation or
null
if the given transformation has no equivalent BlockRotation.
-
getMirror
Gets the equivalentBlockMirror
for a givenDirectionTransformation
if any.- Parameters:
transformation
- The transformation to try and turn into a BlockMirror.- Returns:
- The BlockMirror equivalent to the given transformation or
null
if the given transformation has no equivalent BlockMirror.
-
isRotationOrMirror
Determines whether aDirectionTransformation
can be represented as either aBlockRotation
orBlockMirror
. -
getRelativeTransformation
public static DirectionTransformation getRelativeTransformation(DirectionTransformation base, DirectionTransformation newTransformation) Gets the relative transformation that would need to be prepended to the base transformation to obtain the new transformation.- Parameters:
base
- The transformation we're relativizing the new transformation in relation to.newTransformation
- The transformation we're turning into a relative transformation.- Returns:
- A relative transformation that could be prepended to
base
to obtainnewTransformation
.
-