Class DirectionTransformationUtil
java.lang.Object
alexiil.mc.lib.multipart.api.misc.DirectionTransformationUtil
A handful of utilities for working with
DirectionTransformations.-
Method Summary
Modifier and TypeMethodDescriptionstatic BlockMirrorgetMirror(DirectionTransformation transformation) Gets the equivalentBlockMirrorfor a givenDirectionTransformationif any.static DirectionTransformationgetRelativeTransformation(DirectionTransformation base, DirectionTransformation newTransformation) Gets the relative transformation that would need to be prepended to the base transformation to obtain the new transformation.static BlockRotationgetRotation(DirectionTransformation transformation) Gets the equivalentBlockRotationfor a givenDirectionTransformationif any.static booleanisRotationOrMirror(DirectionTransformation transformation) Determines whether aDirectionTransformationcan be represented as either aBlockRotationorBlockMirror.
-
Method Details
-
getRotation
Gets the equivalentBlockRotationfor a givenDirectionTransformationif any.- Parameters:
transformation- The transformation to try and turn into a BlockRotation.- Returns:
- The BlockRotation equivalent to the given transformation or
nullif the given transformation has no equivalent BlockRotation.
-
getMirror
Gets the equivalentBlockMirrorfor a givenDirectionTransformationif any.- Parameters:
transformation- The transformation to try and turn into a BlockMirror.- Returns:
- The BlockMirror equivalent to the given transformation or
nullif the given transformation has no equivalent BlockMirror.
-
isRotationOrMirror
Determines whether aDirectionTransformationcan be represented as either aBlockRotationorBlockMirror. -
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
baseto obtainnewTransformation.
-