Class HubParkourAPI
java.lang.Object
me.block2block.hubparkour.api.HubParkourAPI
The HubParkour API.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidCloses the GUI associated with the specified player, if any.static IHologramcreateHologram(IParkour parkour, String name, Location location) Creates a new hologram associated with the specified parkour, name, and location.static GUIRetrieves the GUI instance associated with the provided player.static ItemStackgetItem(int type) Gets the ItemStack of a specific item type.static IParkourgetParkour(int id) Get a specific parkour.static IParkourgetParkour(String name) Get a specific parkour.static IHubParkourPlayerGet a player that is currently in parkour.static MaterialgetPressurePlateType(int type) Gets the material type of a specific pressure plate type.static booleanisInParkour(Player player) Use to check if a player is in a parkour.static booleanDetermines whether the server version is 1.14 or newer.static booleanDetermines whether the server version is before 1.13.static voidOpens the specified GUI for the given player.
-
Constructor Details
-
HubParkourAPI
public HubParkourAPI()
-
-
Method Details
-
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.
- Throws:
NullPointerException
-
getItem
Gets the ItemStack of a specific item type.- Parameters:
type- the type of item.- Returns:
- the ItemStack.
- Throws:
NullPointerException
-
getGUI
Retrieves the 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 the specified GUI for the given player.- Parameters:
player- the player for whom the GUI will be opened. Must not be null.gui- the GUI instance to open for the specified player. Must not be null.- Throws:
NullPointerException- if either the player or the GUI is null.
-
isPre1_13
public static boolean isPre1_13()Determines whether the server version is before 1.13.- Returns:
- true if the server version is 1.12 or lower; false otherwise.
-
isPost1_14
public static boolean isPost1_14()Determines whether the server version is 1.14 or newer.- Returns:
- true if the server version is 1.14 or above, false otherwise.
-
createHologram
Creates a new hologram associated with the specified parkour, name, and location.- Parameters:
parkour- theIParkourinstance to associate with the hologram. Must not be null.name- the name of the hologram. Must not be null.location- theLocationwhere the hologram will be displayed. Must not be null.- Returns:
- the created
IHolograminstance. - Throws:
NullPointerException- ifparkour,name, orlocationis null.
-