Class BackendAPI
java.lang.Object
me.block2block.hubparkour.api.BackendAPI
The backend API class which the API uses to execute methods.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract voidCloses the GUI associated with the specified player, if any.abstract IHologramcreateHologram(IParkour parkour, String name, Location location) Creates a new hologram associated with a specific parkour, having a unique name and a specified location in the world.abstract GUIRetrieves a GUI instance associated with the provided player.static BackendAPIabstract ItemStackgetItem(int type) Gets the ItemStack of a specific item type.abstract IParkourgetParkour(int id) Get a specific parkour.abstract IParkourgetParkour(String name) Get a specific parkour.abstract IHubParkourPlayerGet a player that is currently in parkour.abstract MaterialgetPressurePlateType(int type) Gets the material type of a specific pressure plate type.abstract booleanisInParkour(Player player) Use to check if a player is in a parkour.abstract booleanDetermines whether the server version is 1.14 or newer.abstract booleanDetermines whether the server is before 1.13.abstract voidOpens a specified GUI for the given player.static voidsetImplementation(BackendAPI implementation)
-
Constructor Details
-
BackendAPI
public BackendAPI()
-
-
Method Details
-
getImplementation
-
setImplementation
-
isInParkour
Use to check if a player is in a parkour.- Parameters:
player- the player to check.- Returns:
- if the player is in a parkour.
- Throws:
NullPointerException- ifplayeris null.
-
getPlayer
Get a player that is currently in parkour.- Parameters:
player- The player to retrieve.- Returns:
- the player, or if the player is not in a parkour, null.
- Throws:
NullPointerException- ifplayeris null.
-
getParkour
Get a specific parkour.- Parameters:
id- the id of the parkour.- Returns:
- The parkour, if it does not exist, null.
-
getParkour
Get a specific parkour.- Parameters:
name- the name of the parkour- Returns:
- The parkour, if it does not exist, null.
- Throws:
NullPointerException- ifnameis null.
-
getPressurePlateType
Gets the material type of a specific pressure plate type.- Parameters:
type- the type of pressure plate.- Returns:
- the material.
-
getItem
Gets the ItemStack of a specific item type.- Parameters:
type- the type of item.- Returns:
- the ItemStack.
-
getGUI
Retrieves a GUI instance associated with the provided player.- Parameters:
player- the player for whom the GUI is being retrieved. Must not be null.- Returns:
- the GUI instance corresponding to the specified player, or null if no GUI is associated.
- Throws:
NullPointerException- if the provided player is null.
-
closeGUI
Closes the GUI associated with the specified player, if any.- Parameters:
player- the player whose GUI should be closed. Must not be null.- Throws:
NullPointerException- if the provided player is null.
-
openGUI
Opens a specified GUI for the given player. This method associates the player with the provided GUI instance and displays the interface.- Parameters:
player- the player for whom the GUI will be opened. Must not be null.gui- the GUI instance to be opened for the player. Must not be null.- Throws:
NullPointerException- if either the player or GUI is null.
-
isPre1_13
public abstract boolean isPre1_13()Determines whether the server is before 1.13.- Returns:
- true if the server is 1.12 or below.
-
isPost1_14
public abstract boolean isPost1_14()Determines whether the server version is 1.14 or newer.- Returns:
- true if the server version is 1.14 or above
-
createHologram
Creates a new hologram associated with a specific parkour, having a unique name and a specified location in the world.- Parameters:
parkour- the parkour instance to associate with the hologram. Must not be null.name- the unique internal name for the hologram. Must not be null.location- the location in the world where the hologram will be created. Must not be null.- Returns:
- the created hologram instance.
- Throws:
NullPointerException- if any of the parameters are null.
-