Class Camera


  • public class Camera
    extends java.lang.Object
    Created by Nezz
    • Constructor Summary

      Constructors 
      Constructor Description
      Camera()
      Deprecated.
    • Method Summary

      All Methods Static Methods Concrete Methods Deprecated Methods 
      Modifier and Type Method Description
      static Camera getCamera()
      Deprecated.
      static CameraMode getCameraMode()
      Returns the current camera mode, showing how the client will move the camera by default
      static int getPitch()
      Gets the pitch of the camera
      static int getX()
      Gets the X of the camera
      static int getY()
      Gets the Y of the camera
      static int getYaw()
      Gets the yaw of the camera
      static int getZ()
      Gets the Z of the camera
      static int getZoom()
      Gets the camera's current zoom level
      static boolean keyboardRotateTo​(int yaw, int pitch)
      Rotates camera to a particular yaw and pitch using the keyboard
      static boolean keyboardRotateToEntity​(Entity entity)
      Rotates camera to face an entity by using the keyboard
      static boolean keyboardRotateToPitch​(int pitch)
      Rotates camera pitch to specified angle using the keyboard
      static boolean keyboardRotateToTile​(Tile tile)
      Rotates camera to face a tile by using the keyboard
      static boolean keyboardRotateToYaw​(int yaw)
      Rotates camera yaw to specified angle using the keyboard
      static boolean mouseRotateTo​(int yaw, int pitch)
      Rotates camera to a particular yaw and pitch using the mouse scroll wheel
      static boolean mouseRotateToEntity​(Entity entity)
      Rotates camera to face an entity by using the mouse scroll wheel
      static boolean mouseRotateToPitch​(int pitch)
      Rotates camera pitch to specified angle using the mouse scroll wheel
      static boolean mouseRotateToTile​(Tile tile)
      Rotates camera to face a tile by using the mouse scroll wheel
      static boolean mouseRotateToYaw​(int yaw)
      Rotates camera yaw to specified angle using the mouse scroll wheel
      static boolean rotateTo​(int yaw, int pitch)
      Rotates camera to a particular yaw and pitch
      static boolean rotateToEntity​(Entity entity)
      Rotates the camera to face an entity
      static CameraEvent rotateToEntityEvent​(Entity entity)
      Generates and runs a CameraEvent to rotate camera to specified entity
      static CameraEvent rotateToEvent​(int yaw, int pitch)
      Generates and runs a CameraEvent to rotate camera to specified yaw and pitch
      static boolean rotateToPitch​(int pitch)
      Rotates camera pitch to specified angle
      static CameraEvent rotateToPitchEvent​(int pitch)
      Generates and runs a CameraEvent to rotate camera to specified pitch
      static boolean rotateToTile​(Tile tile)
      Rotates the camera to face a tile
      static CameraEvent rotateToTileEvent​(Tile tile)
      Generates and runs a CameraEvent to rotate camera to specified tile
      static boolean rotateToYaw​(int yaw)
      Rotates camera yaw to specified angle
      static CameraEvent rotateToYawEvent​(int yaw)
      Generates and runs a CameraEvent to rotate camera to specified yaw
      static void setCameraMode​(CameraMode mode)  
      static boolean setZoom​(int zoomLevel)
      Sets the camera's zoom level using the scroll wheel
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • Camera

        @Deprecated
        public Camera()
        Deprecated.
    • Method Detail

      • getCamera

        @Deprecated
        public static Camera getCamera()
        Deprecated.
      • getCameraMode

        public static CameraMode getCameraMode()
        Returns the current camera mode, showing how the client will move the camera by default
        Returns:
        Camera mode, the default of which is CameraMode.MOUSE_OR_KEYBOARD which chooses randomly when moving the camera
      • setCameraMode

        public static void setCameraMode​(CameraMode mode)
        Parameters:
        mode - Camera
      • getPitch

        public static int getPitch()
        Gets the pitch of the camera
        Returns:
        value of the pitch
      • getYaw

        public static int getYaw()
        Gets the yaw of the camera
        Returns:
        value of the yaw
      • getX

        public static int getX()
        Gets the X of the camera
        Returns:
        value of the camera X
      • getY

        public static int getY()
        Gets the Y of the camera
        Returns:
        value of the camera Y
      • getZ

        public static int getZ()
        Gets the Z of the camera
        Returns:
        value of the camera Z
      • getZoom

        public static int getZoom()
        Gets the camera's current zoom level
        Returns:
        Zoom level from about 330 (zoomed all the way out) to about 3000 (zoomed all the way in) Note: minimum and maximum zoom levels depend on your position in game
      • setZoom

        public static boolean setZoom​(int zoomLevel)
        Sets the camera's zoom level using the scroll wheel
        Parameters:
        zoomLevel - The desired zoom level, from about 330 (zoomed all the way out) to about 3000 (zoomed all the way in) Note: minimum and maximum zoom levels depend on your position in game
        Returns:
        true if the final zoom level is within an acceptable margin, false otherwise
      • rotateToEntity

        public static boolean rotateToEntity​(Entity entity)
        Rotates the camera to face an entity
        Parameters:
        entity - entity to rotate camera to
        Returns:
        true if successfully rotated
      • rotateToTile

        public static boolean rotateToTile​(Tile tile)
        Rotates the camera to face a tile
        Parameters:
        tile - tile to rotate camera to
        Returns:
        true if successfully rotated
      • rotateTo

        public static boolean rotateTo​(int yaw,
                                       int pitch)
        Rotates camera to a particular yaw and pitch
        Parameters:
        yaw - yaw to rotate to (this is left-right)
        pitch - pitch to rotate to (this is up-down)
        Returns:
        true if successfully rotated
      • rotateToYaw

        public static boolean rotateToYaw​(int yaw)
        Rotates camera yaw to specified angle
        Parameters:
        yaw - yaw to rotate to
        Returns:
        true if successfully rotated
      • rotateToPitch

        public static boolean rotateToPitch​(int pitch)
        Rotates camera pitch to specified angle
        Parameters:
        pitch - pitch to rotate to
        Returns:
        true if successfully rotated
      • mouseRotateToEntity

        public static boolean mouseRotateToEntity​(Entity entity)
        Rotates camera to face an entity by using the mouse scroll wheel
        Parameters:
        entity - entity to rotate camera to
        Returns:
        true if successfully rotated
      • mouseRotateToTile

        public static boolean mouseRotateToTile​(Tile tile)
        Rotates camera to face a tile by using the mouse scroll wheel
        Parameters:
        tile - tile to rotate camera to
        Returns:
        true if successfully rotated
      • mouseRotateTo

        public static boolean mouseRotateTo​(int yaw,
                                            int pitch)
        Rotates camera to a particular yaw and pitch using the mouse scroll wheel
        Parameters:
        yaw - yaw to rotate to (this is left-right)
        pitch - pitch to rotate to (this is up-down)
        Returns:
        true if successfully rotated
      • mouseRotateToYaw

        public static boolean mouseRotateToYaw​(int yaw)
        Rotates camera yaw to specified angle using the mouse scroll wheel
        Parameters:
        yaw - yaw to rotate to
        Returns:
        true if successfully rotated
      • mouseRotateToPitch

        public static boolean mouseRotateToPitch​(int pitch)
        Rotates camera pitch to specified angle using the mouse scroll wheel
        Parameters:
        pitch - pitch to rotate to
        Returns:
        true if successfully rotated
      • keyboardRotateToEntity

        public static boolean keyboardRotateToEntity​(Entity entity)
        Rotates camera to face an entity by using the keyboard
        Parameters:
        entity - entity to rotate camera to
        Returns:
        true if successfully rotated
      • keyboardRotateToTile

        public static boolean keyboardRotateToTile​(Tile tile)
        Rotates camera to face a tile by using the keyboard
        Parameters:
        tile - tile to rotate camera to
        Returns:
        true if successfully rotated
      • keyboardRotateTo

        public static boolean keyboardRotateTo​(int yaw,
                                               int pitch)
        Rotates camera to a particular yaw and pitch using the keyboard
        Parameters:
        yaw - yaw to rotate to (this is left-right)
        pitch - pitch to rotate to (this is up-down)
        Returns:
        true if successfully rotated
      • keyboardRotateToYaw

        public static boolean keyboardRotateToYaw​(int yaw)
        Rotates camera yaw to specified angle using the keyboard
        Parameters:
        yaw - yaw to rotate to
        Returns:
        true if successfully rotated
      • keyboardRotateToPitch

        public static boolean keyboardRotateToPitch​(int pitch)
        Rotates camera pitch to specified angle using the keyboard
        Parameters:
        pitch - pitch to rotate to
        Returns:
        true if successfully rotated
      • rotateToEntityEvent

        public static CameraEvent rotateToEntityEvent​(Entity entity)
        Generates and runs a CameraEvent to rotate camera to specified entity
        Parameters:
        entity - entity to rotate camera to
        Returns:
        CameraEvent
      • rotateToTileEvent

        public static CameraEvent rotateToTileEvent​(Tile tile)
        Generates and runs a CameraEvent to rotate camera to specified tile
        Parameters:
        tile - tile to rotate camera to
        Returns:
        true if successfully rotated
      • rotateToEvent

        public static CameraEvent rotateToEvent​(int yaw,
                                                int pitch)
        Generates and runs a CameraEvent to rotate camera to specified yaw and pitch
        Parameters:
        yaw - yaw to rotate camera to
        pitch - pitch to rotate camera to
        Returns:
        CameraEvent
      • rotateToYawEvent

        public static CameraEvent rotateToYawEvent​(int yaw)
        Generates and runs a CameraEvent to rotate camera to specified yaw
        Parameters:
        yaw - to rotate camera to
        Returns:
        CameraEvent
      • rotateToPitchEvent

        public static CameraEvent rotateToPitchEvent​(int pitch)
        Generates and runs a CameraEvent to rotate camera to specified pitch
        Parameters:
        pitch - pitch to rotate camera to
        Returns:
        CameraEvent