Class PaperServerProvider

java.lang.Object
net.tnemc.plugincore.paper.impl.PaperServerProvider
All Implemented Interfaces:
ServerConnector

public class PaperServerProvider extends Object implements ServerConnector
BukkitServerProvider
Since:
0.1.2.0
Author:
creatorfromhell
  • Constructor Details

  • Method Details

    • setDefaultWorld

      public void setDefaultWorld(String world)
    • name

      public String name()
      Description copied from interface: ServerConnector
      The name of this implementation.
      Specified by:
      name in interface ServerConnector
      Returns:
      The name of the implementation.
    • replacePlaceholder

      public String replacePlaceholder(UUID player, String message)
      Used to replace placeholders from a string.
      Specified by:
      replacePlaceholder in interface ServerConnector
      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

      public ProxyProvider proxy()
      The proxy provider to use for this implementation.
      Specified by:
      proxy in interface ServerConnector
      Returns:
      The proxy provider to use for this implementation.
    • source

      public CmdSource<?> source(@NotNull @NotNull revxrsal.commands.command.CommandActor actor)
      Used to convert an CommandActor to a CmdSource.
      Specified by:
      source in interface ServerConnector
      Parameters:
      actor - The command actor.
      Returns:
      The CmdSource for this actor.
    • onlinePlayers

      public int onlinePlayers()
      Used to get the amount of online players.
      Specified by:
      onlinePlayers in interface ServerConnector
      Returns:
      The amount of online players.
    • findPlayer

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

      public PlayerProvider initializePlayer(@NotNull @NotNull Object player)
      This is used to return an instance of an player based on the provided instance's player object.
      Specified by:
      initializePlayer in interface ServerConnector
      Parameters:
      player - The instance of the player.
      Returns:
      The initialized player object.
    • playedBefore

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

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

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

      public Optional<UUID> fromName(String name)
      Description copied from interface: ServerConnector
      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.
      Specified by:
      fromName in interface ServerConnector
      Parameters:
      name - The name to use for the search.
      Returns:
      An optional containing the UUId if exists, otherwise false.
    • fromID

      public Optional<String> fromID(UUID id)
      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.
      Specified by:
      fromID in interface ServerConnector
      Parameters:
      id - The UUID to use for the search.
      Returns:
      An optional containing the name if exists, otherwise false.
    • defaultWorld

      public String defaultWorld()
      Returns the name of the default world.
      Specified by:
      defaultWorld in interface ServerConnector
      Returns:
      The name of the default world.
    • pluginAvailable

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

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

      public net.tnemc.item.AbstractItemStack<?> stackBuilder()
      Description copied from interface: ServerConnector
      Provides direct access to the implementation's instance of TNIL's AbstractItemStack, which acts as a builder.
      Specified by:
      stackBuilder in interface ServerConnector
      Returns:
      The software's implementation of AbstractItemStack.
    • saveResource

      public void saveResource(String path, boolean replace)
      Description copied from interface: ServerConnector
      Used to save a resource from the plugin's jar file to the local system's storage.
      Specified by:
      saveResource in interface ServerConnector
      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 public @Nullable InputStream getResource(@NotNull @NotNull String filename)
      Retrieves an input stream for the specified filename from the resources.
      Specified by:
      getResource in interface ServerConnector
      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.
      Specified by:
      scheduler in interface ServerConnector
      Returns:
      The scheduler for this implementation.
    • registerCrafting

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

      public net.tnemc.item.paper.PaperCalculationsProvider calculations()
      Specified by:
      calculations in interface ServerConnector