Package net.arcadiusmc.delphi
Interface DocumentView
public interface DocumentView
An active view of a document that's been spawned in the world.
-
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 viewgetPath()Gets the path of the opened documentorg.bukkit.entity.PlayerGets the player this view belongs toGets the resources of this viewGets the screen that this view is rendered withorg.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.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
-
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,falseif it's open.
-
isSelected
boolean isSelected()Tests if this view is currently being looked at by the player.- Returns:
true, ifgetPlayer()is currently looking at the view,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
-
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
-