Class HubParkourAPI

java.lang.Object
me.block2block.hubparkour.api.HubParkourAPI

public class HubParkourAPI extends Object
The HubParkour API.
  • Constructor Details

    • HubParkourAPI

      public HubParkourAPI()
  • Method Details

    • isInParkour

      public static boolean isInParkour(Player player) throws NullPointerException
      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 - if player is null.
    • getPlayer

      public static IHubParkourPlayer getPlayer(Player player) throws NullPointerException
      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 - if player is null.
    • getParkour

      public static IParkour getParkour(int id)
      Get a specific parkour.
      Parameters:
      id - the id of the parkour.
      Returns:
      The parkour, if it does not exist, null.
    • getParkour

      public static IParkour getParkour(String name) throws NullPointerException
      Get a specific parkour.
      Parameters:
      name - the name of the parkour
      Returns:
      The parkour, if it does not exist, null.
      Throws:
      NullPointerException - if name is null.
    • getPressurePlateType

      public static Material getPressurePlateType(int type) throws NullPointerException
      Gets the material type of a specific pressure plate type.
      Parameters:
      type - the type of pressure plate.
      Returns:
      the material.
      Throws:
      NullPointerException
    • getItem

      public static ItemStack getItem(int type) throws NullPointerException
      Gets the ItemStack of a specific item type.
      Parameters:
      type - the type of item.
      Returns:
      the ItemStack.
      Throws:
      NullPointerException
    • getGUI

      public static GUI getGUI(Player player)
      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

      public static void closeGUI(Player player)
      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

      public static void openGUI(Player player, GUI gui)
      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

      public static IHologram createHologram(IParkour parkour, String name, Location location)
      Creates a new hologram associated with the specified parkour, name, and location.
      Parameters:
      parkour - the IParkour instance to associate with the hologram. Must not be null.
      name - the name of the hologram. Must not be null.
      location - the Location where the hologram will be displayed. Must not be null.
      Returns:
      the created IHologram instance.
      Throws:
      NullPointerException - if parkour, name, or location is null.