Package com.welcome234.pluginsystem
Class Server
java.lang.Object
com.welcome234.pluginsystem.Server
Represents the server, containing settings, and server management.
-
Method Summary
Modifier and TypeMethodDescriptionstatic voidSends a broadcast announcement message to the serverGets all players who are currently admin on the serverGets all players who are currently banned on the serverstatic booleanGets whether building is allowed on the serverstatic booleanGets whether explosions are enabled on the serverstatic booleanGets whether fluids like lava, and water can flow on the serverstatic StringgetName()Gets the current name of the server, as specified in the server settingsstatic intgetPort()Gets the port that this server is running onstatic booleanGets whether portals can be entered on the serverstatic booleanGets whether Player vs Entity is enabled on the serverstatic booleanGets whether Player vs Player is enabled on the serverstatic booleanGets whether entities can randomly spawn in new chunks on the serverstatic booleanGets whether new players are automatically given the starter blocks in their inventorystatic doublegetTPS()Gets the current Ticks Per Second for the serverstatic longGets the length of time the server has been runningstatic StringGets the version of Cube2D this server is currently running on.Gets all players who are currently whitelisted on the serverstatic booleanGets whether whitelist is enabled on the serverstatic booleanisPaused()Gets whether the server is in a paused statestatic voidsendMessageToAll(String message)Sends a chat message to all players, including the serverstatic voidshutdown()Shuts down the server and stops everything
-
Method Details
-
getName
Gets the current name of the server, as specified in the server settings- Returns:
- Server name
-
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
Sends a broadcast announcement message to the server- Parameters:
message- Message to send- Throws:
IllegalArgumentException- if message is null
-
sendMessageToAll
Sends a chat message to all players, including the server- Parameters:
message- Message to send- Throws:
IllegalArgumentException- if message is null
-
getAdminPlayers
Gets all players who are currently admin on the server- Returns:
- Array list of admin players
-
getBannedPlayers
Gets all players who are currently banned on the server- Returns:
- Array list of banned players
-
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
-