Interface ServerConnector

All Known Implementing Classes:
BukkitServerProvider, PaperServerProvider, SpongeServerProvider

public interface ServerConnector
Acts like a bridge between various server software and classes specific to each server software such as opening menus, and sending messages.
Since:
0.1.2.0
Author:
creatorfromhell
  • Method Details

    • name

      The name of this implementation.
      Returns:
      The name of the implementation.
    • replacePlaceholder

      String replacePlaceholder(UUID player, String message)
      Used to replace placeholders from a string.
      Parameters:
      player - The player to use for the placeholder replacement.
      message - The message to replace placeholders in.
      Returns:
      The string after placeholders have been replaced.
    • proxy

      The proxy provider to use for this implementation.
      Returns:
      The proxy provider to use for this implementation.
    • source

      CmdSource<?> source(@NotNull @NotNull revxrsal.commands.command.CommandActor actor)
      Used to convert an CommandActor to a CmdSource.
      Returns:
      The CmdSource for this actor.
    • onlinePlayers

      Used to get the amount of online players.
      Returns:
      The amount of online players.
    • findPlayer

      Optional<PlayerProvider> findPlayer(@NotNull @NotNull UUID identifier)
      Attempts to find a player based on an identifier.
      Parameters:
      identifier - The identifier
      Returns:
      An Optional containing the located player, or an empty Optional if no player is located.
    • initializePlayer

      PlayerProvider initializePlayer(@NotNull @NotNull Object player)
      This is used to return an instance of an player based on the provided instance's player object.
      Parameters:
      player - The instance of the player.
      Returns:
      The initialized player object.
    • getCached

      default UUID getCached(String name)
      Used to get a cached UUID based on a username.
      Parameters:
      name - The name to use for the check.
      Returns:
      The UUID from the cached player. If no data with the player name exists, this will not check the MojangAPI, it'll instead generate a random UUID.
    • playedBefore

      boolean playedBefore(UUID uuid)
      Used to determine if this player has played on this server before.
      Parameters:
      uuid - The UUID that is associated with the player.
      Returns:
      True if the player has played on the server before, otherwise false.
    • playedBefore

      boolean playedBefore(String name)
      Used to determine if a player with the specified username has played before.
      Parameters:
      name - The username to search for.
      Returns:
      True if someone with the specified username has played before, otherwise false.
    • online

      boolean online(String name)
      Used to determine if a player with the specified username is online.
      Parameters:
      name - The username to search for.
      Returns:
      True if someone with the specified username is online.
    • fromName

      Used to locate a UUID for a specific name. This could be called from either a primary or secondary thread, and should not call back to the Mojang API ever.
      Parameters:
      name - The name to use for the search.
      Returns:
      An optional containing the UUId if exists, otherwise false.
    • fromID

      Used to locate a username for a specific name. This could be called from either a primary or secondary thread, and should not call back to the Mojang API ever.
      Parameters:
      id - The UUID to use for the search.
      Returns:
      An optional containing the name if exists, otherwise false.
    • playerMatcher

      Returns the pattern utilized to determine if a string is a valid player username.
      Returns:
      The pattern to use for determining if a string is a valid player username.
      See Also:
    • defaultWorld

      Returns the name of the default world.
      Returns:
      The name of the default world.
    • pluginAvailable

      default boolean pluginAvailable(String name)
      Determines if a plugin with the correlating name is currently installed.
      Parameters:
      name - The name to use for our check.
      Returns:
      True if a plugin with that name exists, otherwise false.
    • replaceColours

      String replaceColours(String string, boolean strip)
      Used to replace colour codes in a string.
      Parameters:
      string - The string to format.
      strip - If true, the color codes are striped from the string.
      Returns:
      The formatted string.
    • stackBuilder

      net.tnemc.item.AbstractItemStack<?> stackBuilder()
      Provides direct access to the implementation's instance of TNIL's AbstractItemStack, which acts as a builder.
      Returns:
      The software's implementation of AbstractItemStack.
    • saveResource

      void saveResource(String path, boolean replace)
      Used to save a resource from the plugin's jar file to the local system's storage.
      Parameters:
      path - The path to the resource inside the jar.
      replace - If the file exists in the local system's storage, should it be replaced?
    • getResource

      @Nullable @Nullable InputStream getResource(@NotNull @NotNull String filename)
      Retrieves an input stream for the specified filename from the resources.
      Parameters:
      filename - The name of the file to retrieve from the resources. Cannot be null.
      Returns:
      An input stream for the specified file, or null if the file is not found in the resources.
    • scheduler

      Provides this implementation's scheduler.
      Returns:
      The scheduler for this implementation.
    • registerCrafting

      void registerCrafting(@NotNull @NotNull String key, @NotNull @NotNull CraftingRecipe recipe)
      Used to register a crafting recipe to the server.
      Parameters:
      key - The key for the crafting recipe to be registered.
      recipe - The crafting recipe to register.
      See Also:
    • calculations

      <S, T extends net.tnemc.item.AbstractItemStack<S>, INV> net.tnemc.item.providers.CalculationsProvider<T,S,INV> calculations()