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 the MinecraftService 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.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

  • Constructor Details

  • Method Details

    • getInstance

      public static MinecraftManager 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 the MinecraftService 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. Uses getConfig(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 a FileConfiguration
    • 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.IOException
      parses the response.
      Parameters:
      is - the InputStream to parse.
      Returns:
      the parsed String.
      Throws:
      java.io.IOException - something went wrong.