Interface DocumentView
-
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Closes this vieworg.joml.Vector2fGets the position of the player's cursor in screen coordinates.org.joml.Vector3fGets the position of the player's cursor along the screen in world coordinates.Gets the document that belongs to this viewGet the instance name of this view.getPath()Gets the path of the opened documentGets the players this view belongs toGets the resources of this viewGets the screen that this view is rendered with@NotNull org.bukkit.util.TransformationGet the current screen transformation.org.bukkit.WorldgetWorld()Gets the world the view is spawned in.booleanisClosed()Test if the view is closedbooleanTests if this view is currently being looked at by the player.voidmoveTo(@NotNull org.bukkit.Location location) Moves the page to the specifiedlocation.voidmoveTo(@NotNull org.bukkit.Location location, boolean changeRotation) Moves the page to the specifiedlocation.voidmoveTo(@NotNull org.bukkit.World world, @NotNull org.joml.Vector3f position) Moves the page to the specifiedpositionin the specifiedworld.voidmoveTo(@NotNull org.joml.Vector3f position) Moves the page to the specifiedposition.voidsetScreenTransform(@NotNull org.bukkit.util.Transformation transformation) Set the current screen transformation.voidtransform(@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
-
getInstanceName
String getInstanceName()Get the instance name of this view.Instance names are unique names given to each page used to differentiate them from other open pages of the same module or same resource path.
- Returns:
- Instance name
-
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
-
getPlayers
PlayerSet getPlayers()Gets the players this view belongs to- Returns:
- View players
-
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,falseif it's open.
-
isSelected
boolean isSelected()Tests if this view is currently being looked at by the player.- Returns:
true, ifis currently looking at the view,invalid reference
#getPlayer()falseotherwise.
-
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- Iftransformationisnull
-
setScreenTransform
void setScreenTransform(@NotNull @NotNull org.bukkit.util.Transformation transformation) Set the current screen transformation.The translation component of the specified transformation becomes the position of the center of the screen
- Parameters:
transformation- New screen Transformation- Throws:
NullPointerException- Iftransformationisnull
-
getScreenTransform
@NotNull @NotNull org.bukkit.util.Transformation getScreenTransform()Get the current screen transformation.The returned transformation's translation component will be the screen center's position
- Returns:
- View screen's transformation
-
moveTo
void moveTo(@NotNull @NotNull org.bukkit.Location location) Moves the page to the specifiedlocation.The view will be moved so the bottom middle is at the
location. The specifiedlocation's yaw and pitch become the screen's rotation.- Parameters:
location- New location- Throws:
NullPointerException- Iflocationisnull
-
moveTo
void moveTo(@NotNull @NotNull org.bukkit.Location location, boolean changeRotation) Moves the page to the specifiedlocation.The view ill be moved so the bottom middle is at the specified
location.If
#changeRotationis set totrue, the specifiedlocation's yaw and pitch will become the screen's rotation.- Parameters:
location- New locationchangeRotation-true, to change the screen's rotation,falseotherwise- Throws:
NullPointerException- Iflocationisnull
-
moveTo
void moveTo(@NotNull @NotNull org.bukkit.World world, @NotNull @NotNull org.joml.Vector3f position) Moves the page to the specifiedpositionin the specifiedworld.The view will be moved so the bottom middle is at the specified
position- Parameters:
world- New worldposition- New position- Throws:
NullPointerException- Ifworldorpositionisnull
-
moveTo
void moveTo(@NotNull @NotNull org.joml.Vector3f position) Moves the page to the specifiedposition.The view will be moved so the bottom middle is at the specified
position- Parameters:
position- New position- Throws:
NullPointerException- Ifpositionisnull
-