Class BackendAPI

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

public abstract class BackendAPI extends Object
The backend API class which the API uses to execute methods.
  • Constructor Details

    • BackendAPI

      public BackendAPI()
  • Method Details

    • getImplementation

      public static BackendAPI getImplementation()
    • setImplementation

      public static void setImplementation(BackendAPI implementation)
    • isInParkour

      public abstract 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 abstract 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 abstract 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 abstract 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 abstract Material getPressurePlateType(int type)
      Gets the material type of a specific pressure plate type.
      Parameters:
      type - the type of pressure plate.
      Returns:
      the material.
    • getItem

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

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

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

      public abstract IHologram createHologram(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.
      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.