Package de.neo.rankbridge.shared.manager
Class MinecraftManager
java.lang.Object
de.neo.rankbridge.shared.manager.MinecraftManager
public class MinecraftManager
extends java.lang.Object
The Manager for Minecraft.
- Version:
- 1.0
- Author:
- Neo8
-
Field Summary
Fields Modifier and Type Field Description private static MinecraftManager
INSTANCE
-
Constructor Summary
Constructors Constructor Description MinecraftManager()
New Instance. -
Method Summary
Modifier and Type Method Description private java.lang.String
getBungeeName(java.lang.String uuid)
Makes a GET Request to get the name of an OfflinePlayer in BungeeCord.java.lang.Object
getConfig()
Returns the Configuration of the plugin.java.lang.Object
getConfig(java.lang.Boolean isRunningOnBungeecord)
Returns the Configuration of the plugin.static MinecraftManager
getInstance()
Returns the instance of the MinecraftManager.java.lang.Integer
getInt(java.lang.String path)
Returns an Integer out of the config.java.util.ArrayList<?>
getList(java.lang.String path)
Returns the List out of the config.java.lang.Long
getLong(java.lang.String path)
Returns a Long out of the config.java.lang.String
getName(java.lang.String uuid)
Returns the Name of an player by uuid.java.lang.String
getString(java.lang.String path)
Returns a String out of the config.java.lang.Boolean
hasPermission(java.lang.String uuid, java.lang.String perm)
Checks if a players has a Permission.java.lang.Boolean
isMinecraftServiceRegistered()
Checks if theMinecraftService
is registered.java.lang.Boolean
isRunningOnBungeecord()
Checks if this plugin is running on Bungeecord.private java.lang.String
parse(java.io.InputStream is)
parses the response.void
setPermission(java.lang.String uuid, java.lang.String perm)
Sets a permision to a player.void
unsetPermission(java.lang.String uuid, java.lang.String perm)
Unsets a permision to a player.
-
Field Details
-
Constructor Details
-
MinecraftManager
public MinecraftManager()New Instance.
-
-
Method Details
-
getInstance
Returns the instance of the MinecraftManager.- Returns:
- the Instance.
-
getName
public java.lang.String getName(java.lang.String uuid)Returns the Name of an player by uuid.- Parameters:
uuid
- the uuid of the Player.- Returns:
- the name of the Player.
-
hasPermission
public java.lang.Boolean hasPermission(java.lang.String uuid, java.lang.String perm)Checks if a players has a Permission.- Parameters:
uuid
- the uuid of the player.perm
- the permission to check.- Returns:
- Boolean whether the player has the permission or not.
-
setPermission
public void setPermission(java.lang.String uuid, java.lang.String perm)Sets a permision to a player.- Parameters:
uuid
- the uuid of the player.perm
- the permission to set.
-
unsetPermission
public void unsetPermission(java.lang.String uuid, java.lang.String perm)Unsets a permision to a player.- Parameters:
uuid
- the uuid of the player.perm
- the permission to unset.
-
getString
public java.lang.String getString(java.lang.String path)Returns a String out of the config.- Parameters:
path
- the path to look at.- Returns:
- the value of the path.
-
getInt
public java.lang.Integer getInt(java.lang.String path)Returns an Integer out of the config.- Parameters:
path
- the path to look at.- Returns:
- the value of the path.
-
getLong
public java.lang.Long getLong(java.lang.String path)Returns a Long out of the config.- Parameters:
path
- the path to look at.- Returns:
- the value of the path.
-
getList
public java.util.ArrayList<?> getList(java.lang.String path)Returns the List out of the config.- Parameters:
path
- the path to look at.- Returns:
- the value of the path.
-
isMinecraftServiceRegistered
public java.lang.Boolean isMinecraftServiceRegistered()Checks if theMinecraftService
is registered. If false you should not continue using this class.- Returns:
- Boolean whether the
MinecraftService
is registered or not.
-
isRunningOnBungeecord
public java.lang.Boolean isRunningOnBungeecord()Checks if this plugin is running on Bungeecord. If false, this plugin is running on Spigot.- Returns:
- Boolean whether this plugin is running on Bungeecord or not.
-
getConfig
public java.lang.Object getConfig()Returns the Configuration of the plugin. UsesgetConfig(Boolean)
- Returns:
- The return of
getConfig(Boolean)
-
getConfig
public java.lang.Object getConfig(java.lang.Boolean isRunningOnBungeecord)Returns the Configuration of the plugin.- Parameters:
isRunningOnBungeecord
- Boolean whether this plugin is running on Bungeecord or not.- Returns:
- An Object which is a
Configuration
or aFileConfiguration
-
getBungeeName
private java.lang.String getBungeeName(java.lang.String uuid)Makes a GET Request to get the name of an OfflinePlayer in BungeeCord.- Parameters:
uuid
- the uuid of the player.- Returns:
- the name of the player.
-
parse
private java.lang.String parse(java.io.InputStream is) throws java.io.IOExceptionparses the response.- Parameters:
is
- the InputStream to parse.- Returns:
- the parsed String.
- Throws:
java.io.IOException
- something went wrong.
-