Class Server

java.lang.Object
com.welcome234.pluginsystem.Server

public class Server extends Object
Represents the server, containing settings, and server management.
  • Method Details

    • getName

      public static String getName()
      Gets the current name of the server, as specified in the server settings
      Returns:
      Server name
    • getVersion

      public static String getVersion()
      Gets the version of Cube2D this server is currently running on.
      Returns:
      Server version
    • getPort

      public static int getPort()
      Gets the port that this server is running on
      Returns:
      Server port number
    • getTPS

      public static double getTPS()
      Gets the current Ticks Per Second for the server
      Returns:
      Server ticks per second rate
    • isPaused

      public static boolean isPaused()
      Gets whether the server is in a paused state
      Returns:
      Whether paused
    • getUptime

      public static long getUptime()
      Gets the length of time the server has been running
      Returns:
      Server uptime in milliseconds
    • getExplosivesEnabled

      public static boolean getExplosivesEnabled()
      Gets whether explosions are enabled on the server
      Returns:
      Whether enabled
    • getPortalsEnabled

      public static boolean getPortalsEnabled()
      Gets whether portals can be entered on the server
      Returns:
      Whether enabled
    • getRandomSpawningEnabled

      public static boolean getRandomSpawningEnabled()
      Gets whether entities can randomly spawn in new chunks on the server
      Returns:
      Whether enabled
    • getBuildingAllowed

      public static boolean getBuildingAllowed()
      Gets whether building is allowed on the server
      Returns:
      Whether allowed
    • getStartItemsGiven

      public static boolean getStartItemsGiven()
      Gets whether new players are automatically given the starter blocks in their inventory
      Returns:
      Whether enabled
    • getPVPEnabled

      public static boolean getPVPEnabled()
      Gets whether Player vs Player is enabled on the server
      Returns:
      Whether enabled
    • getPVEEnabled

      public static boolean getPVEEnabled()
      Gets whether Player vs Entity is enabled on the server
      Returns:
      Whether enabled
    • getFluidPhysicsEnabled

      public static boolean getFluidPhysicsEnabled()
      Gets whether fluids like lava, and water can flow on the server
      Returns:
      Whether enabled
    • getWhitelistEnabled

      public static boolean getWhitelistEnabled()
      Gets whether whitelist is enabled on the server
      Returns:
      Whether enabled
    • broadcast

      public static void broadcast(String message)
      Sends a broadcast announcement message to the server
      Parameters:
      message - Message to send
      Throws:
      IllegalArgumentException - if message is null
    • sendMessageToAll

      public static void sendMessageToAll(String message)
      Sends a chat message to all players, including the server
      Parameters:
      message - Message to send
      Throws:
      IllegalArgumentException - if message is null
    • getAdminPlayers

      public static ArrayList<Player> getAdminPlayers()
      Gets all players who are currently admin on the server
      Returns:
      Array list of admin players
    • getBannedPlayers

      public static ArrayList<Player> getBannedPlayers()
      Gets all players who are currently banned on the server
      Returns:
      Array list of banned players
    • getWhitelistedPlayers

      public static ArrayList<Player> getWhitelistedPlayers()
      Gets all players who are currently whitelisted on the server
      Returns:
      Array list of whitelisted players
    • shutdown

      public static void shutdown()
      Shuts down the server and stops everything