Interface DocumentView


public interface DocumentView
An active view of a document that's been spawned in the world.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Closes this view
    org.joml.Vector2f
    Gets the position of the player's cursor in screen coordinates.
    org.joml.Vector3f
    Gets the position of the player's cursor along the screen in world coordinates.
    Gets the document that belongs to this view
    Gets the path of the opened document
    org.bukkit.entity.Player
    Gets the player this view belongs to
    Gets the resources of this view
    Gets the screen that this view is rendered with
    org.bukkit.World
    Gets the world the view is spawned in.
    boolean
    Test if the view is closed
    boolean
    Tests if this view is currently being looked at by the player.
    void
    moveTo(@NotNull org.bukkit.Location location)
    Moves the page to the specified location.
    void
    moveTo(@NotNull org.bukkit.Location location, boolean changeRotation)
    Moves the page to the specified location.
    void
    moveTo(@NotNull org.bukkit.World world, @NotNull org.joml.Vector3f position)
    Moves the page to the specified position in the specified world.
    void
    moveTo(@NotNull org.joml.Vector3f position)
    Moves the page to the specified position.
    void
    transform(@NotNull org.bukkit.util.Transformation transformation)
    Apply a transformation to the view's screen.
  • Method Details

    • getDocument

      Document getDocument()
      Gets the document that belongs to this view
      Returns:
      View document
    • getScreen

      Screen getScreen()
      Gets the screen that this view is rendered with
      Returns:
      View Screen
    • getCursorScreenPosition

      org.joml.Vector2f getCursorScreenPosition()
      Gets the position of the player's cursor in screen coordinates.
      Returns:
      Cursor screen position, or null, if the player is not looking at the screen
    • getCursorWorldPosition

      org.joml.Vector3f getCursorWorldPosition()
      Gets the position of the player's cursor along the screen in world coordinates.
      Returns:
      Cursor world position, or null, if the player is not looking at the screen
    • getPath

      ResourcePath getPath()
      Gets the path of the opened document
      Returns:
      Document path
    • getResources

      ViewResources getResources()
      Gets the resources of this view
      Returns:
      View resources
    • getPlayer

      org.bukkit.entity.Player getPlayer()
      Gets the player this view belongs to
      Returns:
      View player
    • getWorld

      org.bukkit.World getWorld()
      Gets the world the view is spawned in.
      Returns:
      View world.
    • close

      void close()
      Closes this view
    • isClosed

      boolean isClosed()
      Test if the view is closed
      Returns:
      true, if the view has been closed, false if it's open.
    • isSelected

      boolean isSelected()
      Tests if this view is currently being looked at by the player.
      Returns:
      true, if getPlayer() is currently looking at the view, false otherwise.
    • transform

      void transform(@NotNull @NotNull org.bukkit.util.Transformation transformation)
      Apply a transformation to the view's screen.
      Parameters:
      transformation - Transformation to apply to the screen
      Throws:
      NullPointerException - If transformation is null
    • moveTo

      void moveTo(@NotNull @NotNull org.bukkit.Location location)
      Moves the page to the specified location.

      The view will be moved so the bottom middle is at the location. The specified location's yaw and pitch become the screen's rotation.

      Parameters:
      location - New location
      Throws:
      NullPointerException - If location is null
    • moveTo

      void moveTo(@NotNull @NotNull org.bukkit.Location location, boolean changeRotation)
      Moves the page to the specified location.

      The view ill be moved so the bottom middle is at the specified location.

      If #changeRotation is set to true, the specified location's yaw and pitch will become the screen's rotation.

      Parameters:
      location - New location
      changeRotation - true, to change the screen's rotation, false otherwise
      Throws:
      NullPointerException - If location is null
    • moveTo

      void moveTo(@NotNull @NotNull org.bukkit.World world, @NotNull @NotNull org.joml.Vector3f position)
      Moves the page to the specified position in the specified world.

      The view will be moved so the bottom middle is at the specified position

      Parameters:
      world - New world
      position - New position
      Throws:
      NullPointerException - If world or position is null
    • moveTo

      void moveTo(@NotNull @NotNull org.joml.Vector3f position)
      Moves the page to the specified position.

      The view will be moved so the bottom middle is at the specified position

      Parameters:
      position - New position
      Throws:
      NullPointerException - If position is null