Module gomint.api

Class MojangRotation


  • public class MojangRotation
    extends Object
    Version:
    1.0

    Mojang rotations are stored in 16 different stages. A byte holds the correct value and can be multiplied with 22.5f to get the correct amount of degrees

    Author:
    geNAZt
    • Constructor Detail

      • MojangRotation

        public MojangRotation​(byte initValue)
        Construct a new mojang based rotation
        Parameters:
        initValue - of this rotation. must be degrees / 22.5f
    • Method Detail

      • getRotationValue

        public byte getRotationValue()
        Get the correct value for metadata
        Returns:
        rotation divided by 22.5f (to be stored in blocks)
      • fromEntityForBlock

        public static MojangRotation fromEntityForBlock​(Entity entity)
        Create a new rotation from a entity
        Parameters:
        entity - which should be used for gettin the rotation
        Returns:
        mojang rotation for block metadata