Interface Delphi
-
Method Summary
Modifier and TypeMethodDescriptionGets all document views currently opengetAnyTargetedView
(@NotNull org.bukkit.entity.Player player) Get the view currently being looked at by the specifiedplayer
, regardless of who that view belongs to.getByInstanceName
(String instanceName) Get a document view by its instance name.getOpenViews
(@NotNull org.bukkit.entity.Player player) Gets all the document views a player has openGets the Delphi plugin resourcesgetSelectedView
(@NotNull org.bukkit.entity.Player player) Get the view currently being looked at by the specifiedplayer
.@NotNull StylesheetBuilder
Create a new stylesheet builder.Create a new document view builderopenDocument
(@NotNull ResourcePath path, @NotNull org.bukkit.entity.Player player) Attempts to open the document specified by thepath
and show it to player.openDocument
(@NotNull String path, @NotNull org.bukkit.entity.Player player) Attempts to open the document specified by thepath
and show it to player.Attempts to parse a path
-
Method Details
-
getResources
-
newViewBuilder
DocumentViewBuilder newViewBuilder()Create a new document view builder- Returns:
- Created document view builder
-
parsePath
Attempts to parse a path- Parameters:
string
- Parse string- Returns:
- Parse result, either successful, or an error with the error code
ERR_INVALID_PATH
- See Also:
-
openDocument
Result<DocumentView, DelphiException> openDocument(@NotNull @NotNull ResourcePath path, @NotNull @NotNull org.bukkit.entity.Player player) Attempts to open the document specified by thepath
and show it to player.Uses
DelphiResources.findModule(String)
to find the module of thepath
, then creates aViewResources
object with the module and attempts to callViewResources.loadDocument(String)
with the path given to this method.If the document is successfully loaded and initialized, it is spawned and then shown to the player, and the created document view is returned.
Any erroneous result returned by this method will have an error code dictated by either the
DelphiResources.findModule(String)
orViewResources.loadDocument(String)
methods.- Parameters:
path
- Document pathplayer
- Player to show the document to- Returns:
- The opened view, or an error result explaining why the document couldn't be opened.
- Throws:
NullPointerException
- Ifpath
orplayer
arenull
- See Also:
-
openDocument
Result<DocumentView, DelphiException> openDocument(@NotNull @NotNull String path, @NotNull @NotNull org.bukkit.entity.Player player) Attempts to open the document specified by thepath
and show it to player.Uses
DelphiResources.findModule(String)
to find the module of thepath
, then creates aViewResources
object with the module and attempts to callViewResources.loadDocument(String)
with the path given to this method.If the document is successfully loaded and initialized, it is spawned and then shown to the player, and the created document view is returned.
Any erroneous result returned by this method will have an error code dictated by either the
DelphiResources.findModule(String)
,parsePath(String)
orViewResources.loadDocument(String)
methods.- Parameters:
path
- Document pathplayer
- Player to show the document to- Returns:
- The opened view, or an error result explaining why the document couldn't be opened.
- Throws:
NullPointerException
- Ifpath
orplayer
arenull
- See Also:
-
getOpenViews
Gets all the document views a player has open- Parameters:
player
- Player- Returns:
- Unmodifiable open view list, may be empty.
- Throws:
NullPointerException
- ifplayer
isnull
-
getByInstanceName
Get a document view by its instance name.- Parameters:
instanceName
- Instance name- Returns:
- An optional containing the document view with the specified
instanceName
, or an empty optional, if no view with the specified name exists.
-
getAllViews
List<DocumentView> getAllViews()Gets all document views currently open- Returns:
- Unmodifiable open view list, may be empty.
-
getSelectedView
Get the view currently being looked at by the specifiedplayer
.- Parameters:
player
- Player- Returns:
- An optional containing the view the player is currently looking at, or an empty
optional, if the
player
is not looking at any document views. - Throws:
NullPointerException
- Ifplayer
isnull
- See Also:
-
getAnyTargetedView
Get the view currently being looked at by the specifiedplayer
, regardless of who that view belongs to.Unlike
getSelectedView(Player)
this method will ignore who a view belongs to, and will get the closest view the player is looking at.- Parameters:
player
- Player- Returns:
- An optional containing the closest the document view the player is looking at, or an empty optional, if the player is not looking at any views.
- Throws:
NullPointerException
- Ifplayer
isnull
-
newStylesheetBuilder
Create a new stylesheet builder.- Returns:
- New stylesheet builder
-