Package net.tnemc.plugincore.paper.impl
Class PaperServerProvider
java.lang.Object
net.tnemc.plugincore.paper.impl.PaperServerProvider
- All Implemented Interfaces:
ServerConnector
BukkitServerProvider
- Since:
- 0.1.2.0
- Author:
- creatorfromhell
-
Constructor Summary
ConstructorsConstructorDescriptionPaperServerProvider(net.tnemc.item.paper.PaperCalculationsProvider calc) PaperServerProvider(PaperScheduler scheduler) -
Method Summary
Modifier and TypeMethodDescriptionnet.tnemc.item.paper.PaperCalculationsProvidervoidcreateCustomTexture(UUID identifier, String username, String texture) Creates a custom texture for a specific UUID.Returns the name of the default world.findPlayer(@NotNull UUID identifier) Attempts to find aplayerbased on anidentifier.Finds a WorldProvider object based on the provided world name.Used to locate a username for a specific name.Used to locate a UUID for a specific name.@Nullable InputStreamgetResource(@NotNull String filename) Retrieves an input stream for the specified filename from the resources.initializePlayer(@NotNull Object player) This is used to return an instance of anplayerbased on the provided instance's player object.name()The name of this implementation.booleanUsed to determine if a player with the specified username is online.intUsed to get the amount of online players.Retrieves a set of online player names.booleanplayedBefore(String name) Used to determine if a player with the specified username has played before.booleanplayedBefore(UUID uuid) Used to determine if this player has played on this server before.booleanpluginAvailable(String name) Determines if a plugin with the correlating name is currently installed.proxy()The proxy provider to use for this implementation.voidregisterCrafting(@NotNull String key, @NotNull CraftingRecipe recipe) Used to register a crafting recipe to the server.replaceColours(String string, boolean strip) Used to replace colour codes in a string.replacePlaceholder(UUID player, String message) Used to replace placeholders from a string.voidsaveResource(String path, boolean replace) Used to save a resource from the plugin's jar file to the local system's storage.Provides this implementation'sscheduler.voidsetDefaultWorld(String world) CmdSource<?> source(@NotNull revxrsal.commands.command.CommandActor actor) Used to convert anCommandActorto aCmdSource.net.tnemc.item.AbstractItemStack<?> Provides direct access to the implementation's instance of TNIL's AbstractItemStack, which acts as a builder.Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.tnemc.plugincore.core.compatibility.ServerConnector
getCached, playerMatcher
-
Constructor Details
-
PaperServerProvider
public PaperServerProvider() -
PaperServerProvider
-
PaperServerProvider
-
-
Method Details
-
setDefaultWorld
-
name
Description copied from interface:ServerConnectorThe name of this implementation.- Specified by:
namein interfaceServerConnector- Returns:
- The name of the implementation.
-
findWorld
Finds a WorldProvider object based on the provided world name.- Specified by:
findWorldin interfaceServerConnector- Parameters:
world- The name of the world to search for.- Returns:
- An Optional containing the located WorldProvider object if found, or an empty Optional otherwise.
-
replacePlaceholder
Used to replace placeholders from a string.- Specified by:
replacePlaceholderin interfaceServerConnector- 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.- Specified by:
proxyin interfaceServerConnector- Returns:
- The proxy provider to use for this implementation.
-
source
Used to convert anCommandActorto aCmdSource.- Specified by:
sourcein interfaceServerConnector- Parameters:
actor- The command actor.- Returns:
- The
CmdSourcefor this actor.
-
onlinePlayersList
Retrieves a set of online player names.- Specified by:
onlinePlayersListin interfaceServerConnector- Returns:
- Set of online player names.
-
onlinePlayers
Used to get the amount of online players.- Specified by:
onlinePlayersin interfaceServerConnector- Returns:
- The amount of online players.
-
findPlayer
Attempts to find aplayerbased on anidentifier.- Specified by:
findPlayerin interfaceServerConnector- Parameters:
identifier- The identifier- Returns:
- An Optional containing the located
player, or an empty Optional if no player is located.
-
initializePlayer
This is used to return an instance of anplayerbased on the provided instance's player object.- Specified by:
initializePlayerin interfaceServerConnector- Parameters:
player- The instance of the player.- Returns:
- The initialized
player object.
-
createCustomTexture
Creates a custom texture for a specific UUID.- Specified by:
createCustomTexturein interfaceServerConnector- Parameters:
identifier- The UUID to create the custom texture for.username- The username of the profile for which the custom texture is being created.texture- The custom texture data to apply to the profile.
-
playedBefore
Used to determine if this player has played on this server before.- Specified by:
playedBeforein interfaceServerConnector- Parameters:
uuid- TheUUIDthat is associated with the player.- Returns:
- True if the player has played on the server before, otherwise false.
-
playedBefore
Used to determine if a player with the specified username has played before.- Specified by:
playedBeforein interfaceServerConnector- Parameters:
name- The username to search for.- Returns:
- True if someone with the specified username has played before, otherwise false.
-
online
Used to determine if a player with the specified username is online.- Specified by:
onlinein interfaceServerConnector- Parameters:
name- The username to search for.- Returns:
- True if someone with the specified username is online.
-
fromName
Description copied from interface:ServerConnectorUsed 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:
fromNamein interfaceServerConnector- 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.- Specified by:
fromIDin interfaceServerConnector- Parameters:
id- TheUUIDto use for the search.- Returns:
- An optional containing the name if exists, otherwise false.
-
defaultWorld
Returns the name of the default world.- Specified by:
defaultWorldin interfaceServerConnector- Returns:
- The name of the default world.
-
pluginAvailable
Determines if a plugin with the correlating name is currently installed.- Specified by:
pluginAvailablein interfaceServerConnector- Parameters:
name- The name to use for our check.- Returns:
- True if a plugin with that name exists, otherwise false.
-
replaceColours
Used to replace colour codes in a string.- Specified by:
replaceColoursin interfaceServerConnector- Parameters:
string- The string to format.strip- If true, the color codes are striped from the string.- Returns:
- The formatted string.
-
stackBuilder
Description copied from interface:ServerConnectorProvides direct access to the implementation's instance of TNIL's AbstractItemStack, which acts as a builder.- Specified by:
stackBuilderin interfaceServerConnector- Returns:
- The software's implementation of
AbstractItemStack.
-
saveResource
Description copied from interface:ServerConnectorUsed to save a resource from the plugin's jar file to the local system's storage.- Specified by:
saveResourcein interfaceServerConnector- 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
Retrieves an input stream for the specified filename from the resources.- Specified by:
getResourcein interfaceServerConnector- 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'sscheduler.- Specified by:
schedulerin interfaceServerConnector- Returns:
- The scheduler for this implementation.
-
registerCrafting
Used to register a crafting recipe to the server.- Specified by:
registerCraftingin interfaceServerConnector- Parameters:
key- The key for the crafting recipe to be registered.recipe- The crafting recipe to register.- See Also:
-
calculations
- Specified by:
calculationsin interfaceServerConnector
-