Package org.cyclops.cyclopscore.helper
Class DirectionHelpers
java.lang.Object
org.cyclops.cyclopscore.helper.DirectionHelpers
This class contains helper methods involving directions.
-
Field Summary
Modifier and TypeFieldDescriptionstatic List<net.minecraft.core.Direction>
A list of all theDirection
.static net.minecraft.core.Direction[][]
A double array that contains the visual side. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic Iterator<net.minecraft.core.Direction>
Get an iterator for all theDirection
.static net.minecraft.core.Direction
getEntityFacingDirection
(net.minecraft.world.entity.LivingEntity entity) Get the EnumFacing the entity is facing, only vertical directions.static net.minecraft.core.Direction
getEnumFacingFromXSign
(int xSign) Get theDirection
from the sign of an X offset.static net.minecraft.core.Direction
getEnumFacingFromZSing
(int zSign) Get theDirection
from the sign of an Z offset.static net.minecraft.core.Direction
transformFacingForRotation
(net.minecraft.core.Direction facing, net.minecraft.core.Direction rotation) Transform the given facing based on a rotation.
-
Field Details
-
DIRECTIONS
A list of all theDirection
. -
TEXTURESIDE_ORIENTATION
public static net.minecraft.core.Direction[][] TEXTURESIDE_ORIENTATIONA double array that contains the visual side. The first argument should be the rotation of the blockState and the second argument is the side for which the texture is called.
-
-
Constructor Details
-
DirectionHelpers
public DirectionHelpers()
-
-
Method Details
-
getDirectionIterator
Get an iterator for all theDirection
.- Returns:
- The
Direction
iterator - See Also:
-
DIRECTIONS
Direction
-
getEntityFacingDirection
public static net.minecraft.core.Direction getEntityFacingDirection(net.minecraft.world.entity.LivingEntity entity) Get the EnumFacing the entity is facing, only vertical directions.- Parameters:
entity
- The entity that is facing a direction.- Returns:
- The
Direction
the entity is facing.
-
getEnumFacingFromXSign
public static net.minecraft.core.Direction getEnumFacingFromXSign(int xSign) Get theDirection
from the sign of an X offset.- Parameters:
xSign
- X offset from somewhere.- Returns:
- The
Direction
for the offset.
-
getEnumFacingFromZSing
public static net.minecraft.core.Direction getEnumFacingFromZSing(int zSign) Get theDirection
from the sign of an Z offset.- Parameters:
zSign
- Z offset from somewhere.- Returns:
- The
Direction
for the offset.
-
transformFacingForRotation
public static net.minecraft.core.Direction transformFacingForRotation(net.minecraft.core.Direction facing, net.minecraft.core.Direction rotation) Transform the given facing based on a rotation. The default rotation isDirection.NORTH
, which means no transformation.- Parameters:
facing
- The facing to transform.rotation
- The rotation.- Returns:
- The transformed facing.
-