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.PaperCalculationsProvider
Returns the name of the default world.findPlayer
(@NotNull UUID identifier) Attempts to find aplayer
based on anidentifier
.Used to locate a username for a specific name.Used to locate a UUID for a specific name.@Nullable InputStream
getResource
(@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 anplayer
based on the provided instance's player object.name()
The name of this implementation.boolean
Used to determine if a player with the specified username is online.int
Used to get the amount of online players.boolean
playedBefore
(String name) Used to determine if a player with the specified username has played before.boolean
playedBefore
(UUID uuid) Used to determine if this player has played on this server before.boolean
pluginAvailable
(String name) Determines if a plugin with the correlating name is currently installed.proxy()
The proxy provider to use for this implementation.void
registerCrafting
(@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.void
saveResource
(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
.void
setDefaultWorld
(String world) CmdSource
<?> source
(@NotNull revxrsal.commands.command.CommandActor actor) Used to convert anCommandActor
to 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, wait
Methods 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:ServerConnector
The name of this implementation.- Specified by:
name
in interfaceServerConnector
- Returns:
- The name of the implementation.
-
replacePlaceholder
Used to replace placeholders from a string.- Specified by:
replacePlaceholder
in 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:
proxy
in interfaceServerConnector
- Returns:
- The proxy provider to use for this implementation.
-
source
Used to convert anCommandActor
to aCmdSource
.- Specified by:
source
in interfaceServerConnector
- Parameters:
actor
- The command actor.- Returns:
- The
CmdSource
for this actor.
-
onlinePlayers
Used to get the amount of online players.- Specified by:
onlinePlayers
in interfaceServerConnector
- Returns:
- The amount of online players.
-
findPlayer
Attempts to find aplayer
based on anidentifier
.- Specified by:
findPlayer
in 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 anplayer
based on the provided instance's player object.- Specified by:
initializePlayer
in interfaceServerConnector
- Parameters:
player
- The instance of the player.- Returns:
- The initialized
player object
.
-
playedBefore
Used to determine if this player has played on this server before.- Specified by:
playedBefore
in interfaceServerConnector
- Parameters:
uuid
- TheUUID
that 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:
playedBefore
in 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:
online
in interfaceServerConnector
- Parameters:
name
- The username to search for.- Returns:
- True if someone with the specified username is online.
-
fromName
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 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:
fromID
in interfaceServerConnector
- Parameters:
id
- TheUUID
to use for the search.- Returns:
- An optional containing the name if exists, otherwise false.
-
defaultWorld
Returns the name of the default world.- Specified by:
defaultWorld
in interfaceServerConnector
- Returns:
- The name of the default world.
-
pluginAvailable
Determines if a plugin with the correlating name is currently installed.- Specified by:
pluginAvailable
in 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:
replaceColours
in 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:ServerConnector
Provides direct access to the implementation's instance of TNIL's AbstractItemStack, which acts as a builder.- Specified by:
stackBuilder
in interfaceServerConnector
- Returns:
- The software's implementation of
AbstractItemStack
.
-
saveResource
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 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:
getResource
in 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:
scheduler
in interfaceServerConnector
- Returns:
- The scheduler for this implementation.
-
registerCrafting
Used to register a crafting recipe to the server.- Specified by:
registerCrafting
in interfaceServerConnector
- Parameters:
key
- The key for the crafting recipe to be registered.recipe
- The crafting recipe to register.- See Also:
-
calculations
- Specified by:
calculations
in interfaceServerConnector
-