YATS/Forge Documentation
 All Classes Namespaces Files Functions Variables Enumerator Pages
net.minecraft.server.MinecraftServer Class Referenceabstract
Inheritance diagram for net.minecraft.server.MinecraftServer:
net.minecraft.command.ICommandSender net.minecraft.profiler.IPlayerUsage net.minecraft.server.dedicated.DedicatedServer net.minecraft.server.integrated.IntegratedServer

Public Member Functions

 MinecraftServer (File par1File)
 
synchronized String getUserMessage ()
 
abstract boolean canStructuresSpawn ()
 
abstract EnumGameType getGameType ()
 
abstract int getDifficulty ()
 
abstract boolean isHardcore ()
 
void stopServer ()
 
String getServerHostname ()
 
void setHostname (String par1Str)
 
boolean isServerRunning ()
 
void initiateShutdown ()
 
void run ()
 
void tick ()
 
void updateTimeLightAndEntities ()
 
boolean getAllowNether ()
 
void startServerThread ()
 
File getFile (String par1Str)
 
void logInfo (String par1Str)
 
void logWarning (String par1Str)
 
WorldServer worldServerForDimension (int par1)
 
void func_82010_a (IUpdatePlayerListBox par1IUpdatePlayerListBox)
 
String getHostname ()
 
int getPort ()
 
String getServerMOTD ()
 
String getMinecraftVersion ()
 
int getCurrentPlayerCount ()
 
int getMaxPlayers ()
 
String[] getAllUsernames ()
 
String getPlugins ()
 
String executeCommand (String par1Str)
 
boolean isDebuggingEnabled ()
 
void logSevere (String par1Str)
 
void logDebug (String par1Str)
 
String getServerModName ()
 
CrashReport addServerInfoToCrashReport (CrashReport par1CrashReport)
 
List getPossibleCompletions (ICommandSender par1ICommandSender, String par2Str)
 
String getCommandSenderName ()
 
void sendChatToPlayer (String par1Str)
 
boolean canCommandSenderUseCommand (int par1, String par2Str)
 
String translateString (String par1Str, Object...par2ArrayOfObj)
 
ICommandManager getCommandManager ()
 
KeyPair getKeyPair ()
 
int getServerPort ()
 
void setServerPort (int par1)
 
String getServerOwner ()
 
void setServerOwner (String par1Str)
 
boolean isSinglePlayer ()
 
String getFolderName ()
 
void setFolderName (String par1Str)
 
void setWorldName (String par1Str)
 
String getWorldName ()
 
void setKeyPair (KeyPair par1KeyPair)
 
void setDifficultyForAllWorlds (int par1)
 
boolean isDemo ()
 
void setDemo (boolean par1)
 
void canCreateBonusChest (boolean par1)
 
ISaveFormat getActiveAnvilConverter ()
 
void deleteWorldAndStopServer ()
 
String getTexturePack ()
 
void setTexturePack (String par1Str)
 
void addServerStatsToSnooper (PlayerUsageSnooper par1PlayerUsageSnooper)
 
void addServerTypeToSnooper (PlayerUsageSnooper par1PlayerUsageSnooper)
 
boolean isSnooperEnabled ()
 
int textureSize ()
 
abstract boolean isDedicatedServer ()
 
boolean isServerInOnlineMode ()
 
void setOnlineMode (boolean par1)
 
boolean getCanSpawnAnimals ()
 
void setCanSpawnAnimals (boolean par1)
 
boolean getCanSpawnNPCs ()
 
void setCanSpawnNPCs (boolean par1)
 
boolean isPVPEnabled ()
 
void setAllowPvp (boolean par1)
 
boolean isFlightAllowed ()
 
void setAllowFlight (boolean par1)
 
abstract boolean isCommandBlockEnabled ()
 
String getMOTD ()
 
void setMOTD (String par1Str)
 
int getBuildLimit ()
 
void setBuildLimit (int par1)
 
boolean isServerStopped ()
 
ServerConfigurationManager getConfigurationManager ()
 
void setConfigurationManager (ServerConfigurationManager par1ServerConfigurationManager)
 
void setGameType (EnumGameType par1EnumGameType)
 
abstract NetworkListenThread getNetworkThread ()
 
boolean serverIsInRunLoop ()
 
boolean getGuiEnabled ()
 
abstract String shareToLAN (EnumGameType enumgametype, boolean flag)
 
int getTickCounter ()
 
void enableProfiling ()
 
PlayerUsageSnooper getPlayerUsageSnooper ()
 
ChunkCoordinates getPlayerCoordinates ()
 
int getSpawnProtectionSize ()
 
boolean func_96290_a (World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer)
 
abstract ILogAgent getLogAgent ()
 
void func_104055_i (boolean par1)
 
boolean func_104056_am ()
 

Static Public Member Functions

static MinecraftServer getServer ()
 
static ServerConfigurationManager getServerConfigurationManager (MinecraftServer par0MinecraftServer)
 
static void main (String[] par0ArrayOfStr)
 
static void fmlReentry (ArgsWrapper wrap)
 

Public Attributes

final Profiler theProfiler = new Profiler()
 
WorldServer[] worldServers = new WorldServer[0]
 
String currentTask
 
int percentDone
 
final long[] sentPacketCountArray = new long[100]
 
final long[] sentPacketSizeArray = new long[100]
 
final long[] receivedPacketCountArray = new long[100]
 
final long[] receivedPacketSizeArray = new long[100]
 
final long[] tickTimeArray = new long[100]
 
Hashtable< Integer, long[]> worldTickTimes = new Hashtable<Integer, long[]>()
 

Protected Member Functions

abstract boolean startServer () throws IOException
 
void convertMapIfNeeded (String par1Str)
 
synchronized void setUserMessage (String par1Str)
 
void loadAllWorlds (String par1Str, String par2Str, long par3, WorldType par5WorldType, String par6Str)
 
void initialWorldChunkLoad ()
 
void outputPercentRemaining (String par1Str, int par2)
 
void clearCurrentTask ()
 
void saveAllWorlds (boolean par1)
 
File getDataDirectory ()
 
void finalTick (CrashReport par1CrashReport)
 
void systemExitNow ()
 
boolean allowSpawnMonsters ()
 

Constructor & Destructor Documentation

net.minecraft.server.MinecraftServer.MinecraftServer ( File  par1File)

Member Function Documentation

CrashReport net.minecraft.server.MinecraftServer.addServerInfoToCrashReport ( CrashReport  par1CrashReport)

Adds the server info, including from theWorldServer, to the crash report.

void net.minecraft.server.MinecraftServer.addServerStatsToSnooper ( PlayerUsageSnooper  par1PlayerUsageSnooper)
void net.minecraft.server.MinecraftServer.addServerTypeToSnooper ( PlayerUsageSnooper  par1PlayerUsageSnooper)
boolean net.minecraft.server.MinecraftServer.allowSpawnMonsters ( )
protected
boolean net.minecraft.server.MinecraftServer.canCommandSenderUseCommand ( int  par1,
String  par2Str 
)

Returns true if the command sender is allowed to use the given command.

Implements net.minecraft.command.ICommandSender.

void net.minecraft.server.MinecraftServer.canCreateBonusChest ( boolean  par1)
abstract boolean net.minecraft.server.MinecraftServer.canStructuresSpawn ( )
pure virtual
void net.minecraft.server.MinecraftServer.clearCurrentTask ( )
protected

Set current task to null and set its percentage to 0.

void net.minecraft.server.MinecraftServer.convertMapIfNeeded ( String  par1Str)
protected
void net.minecraft.server.MinecraftServer.deleteWorldAndStopServer ( )

WARNING : directly calls getActiveAnvilConverter().deleteWorldDirectory(theWorldServer[0].getSaveHandler().getWorldDirectoryName());

void net.minecraft.server.MinecraftServer.enableProfiling ( )
String net.minecraft.server.MinecraftServer.executeCommand ( String  par1Str)
void net.minecraft.server.MinecraftServer.finalTick ( CrashReport  par1CrashReport)
protected

Called on exit from the main run() loop.

static void net.minecraft.server.MinecraftServer.fmlReentry ( ArgsWrapper  wrap)
static
void net.minecraft.server.MinecraftServer.func_104055_i ( boolean  par1)
boolean net.minecraft.server.MinecraftServer.func_104056_am ( )
void net.minecraft.server.MinecraftServer.func_82010_a ( IUpdatePlayerListBox  par1IUpdatePlayerListBox)
boolean net.minecraft.server.MinecraftServer.func_96290_a ( World  par1World,
int  par2,
int  par3,
int  par4,
EntityPlayer  par5EntityPlayer 
)
ISaveFormat net.minecraft.server.MinecraftServer.getActiveAnvilConverter ( )
boolean net.minecraft.server.MinecraftServer.getAllowNether ( )
String [] net.minecraft.server.MinecraftServer.getAllUsernames ( )

Returns an array of the usernames of all the connected players.

int net.minecraft.server.MinecraftServer.getBuildLimit ( )
boolean net.minecraft.server.MinecraftServer.getCanSpawnAnimals ( )
boolean net.minecraft.server.MinecraftServer.getCanSpawnNPCs ( )
ICommandManager net.minecraft.server.MinecraftServer.getCommandManager ( )
String net.minecraft.server.MinecraftServer.getCommandSenderName ( )

Gets the name of this command sender (usually username, but possibly "Rcon")

Implements net.minecraft.command.ICommandSender.

ServerConfigurationManager net.minecraft.server.MinecraftServer.getConfigurationManager ( )
int net.minecraft.server.MinecraftServer.getCurrentPlayerCount ( )

Returns the number of players currently on the server.

File net.minecraft.server.MinecraftServer.getDataDirectory ( )
protected
abstract int net.minecraft.server.MinecraftServer.getDifficulty ( )
pure virtual

Defaults to "1" (Easy) for the dedicated server, defaults to "2" (Normal) on the client.

Implemented in net.minecraft.server.dedicated.DedicatedServer, and net.minecraft.server.integrated.IntegratedServer.

File net.minecraft.server.MinecraftServer.getFile ( String  par1Str)

Returns a File object from the specified string.

String net.minecraft.server.MinecraftServer.getFolderName ( )
abstract EnumGameType net.minecraft.server.MinecraftServer.getGameType ( )
pure virtual
boolean net.minecraft.server.MinecraftServer.getGuiEnabled ( )
String net.minecraft.server.MinecraftServer.getHostname ( )

Returns the server's hostname.

KeyPair net.minecraft.server.MinecraftServer.getKeyPair ( )

Gets KeyPair instanced in MinecraftServer.

abstract ILogAgent net.minecraft.server.MinecraftServer.getLogAgent ( )
pure virtual
int net.minecraft.server.MinecraftServer.getMaxPlayers ( )

Returns the maximum number of players allowed on the server.

String net.minecraft.server.MinecraftServer.getMinecraftVersion ( )

Returns the server's Minecraft version as string.

String net.minecraft.server.MinecraftServer.getMOTD ( )
abstract NetworkListenThread net.minecraft.server.MinecraftServer.getNetworkThread ( )
pure virtual
ChunkCoordinates net.minecraft.server.MinecraftServer.getPlayerCoordinates ( )

Return the position for this command sender.

Implements net.minecraft.command.ICommandSender.

PlayerUsageSnooper net.minecraft.server.MinecraftServer.getPlayerUsageSnooper ( )
String net.minecraft.server.MinecraftServer.getPlugins ( )

Used by RCon's Query in the form of "MajorServerMod 1.2.3: MyPlugin 1.3; AnotherPlugin 2.1; AndSoForth 1.0".

int net.minecraft.server.MinecraftServer.getPort ( )

Never used, but "getServerPort" is already taken.

List net.minecraft.server.MinecraftServer.getPossibleCompletions ( ICommandSender  par1ICommandSender,
String  par2Str 
)

If par2Str begins with /, then it searches for commands, otherwise it returns players.

static MinecraftServer net.minecraft.server.MinecraftServer.getServer ( )
static

Gets mcServer.

static ServerConfigurationManager net.minecraft.server.MinecraftServer.getServerConfigurationManager ( MinecraftServer  par0MinecraftServer)
static

Gets the current player count, maximum player count, and player entity list.

String net.minecraft.server.MinecraftServer.getServerHostname ( )

"getHostname" is already taken, but both return the hostname.

String net.minecraft.server.MinecraftServer.getServerModName ( )
String net.minecraft.server.MinecraftServer.getServerMOTD ( )

Returns the server message of the day

String net.minecraft.server.MinecraftServer.getServerOwner ( )

Returns the username of the server owner (for integrated servers)

int net.minecraft.server.MinecraftServer.getServerPort ( )

Gets serverPort.

int net.minecraft.server.MinecraftServer.getSpawnProtectionSize ( )

Return the spawn protection area's size.

String net.minecraft.server.MinecraftServer.getTexturePack ( )
int net.minecraft.server.MinecraftServer.getTickCounter ( )
synchronized String net.minecraft.server.MinecraftServer.getUserMessage ( )
String net.minecraft.server.MinecraftServer.getWorldName ( )
void net.minecraft.server.MinecraftServer.initialWorldChunkLoad ( )
protected
void net.minecraft.server.MinecraftServer.initiateShutdown ( )

Sets the serverRunning variable to false, in order to get the server to shut down.

abstract boolean net.minecraft.server.MinecraftServer.isCommandBlockEnabled ( )
pure virtual

Return whether command blocks are enabled.

Implemented in net.minecraft.server.dedicated.DedicatedServer, and net.minecraft.server.integrated.IntegratedServer.

boolean net.minecraft.server.MinecraftServer.isDebuggingEnabled ( )

Returns true if debugging is enabled, false otherwise.

abstract boolean net.minecraft.server.MinecraftServer.isDedicatedServer ( )
pure virtual
boolean net.minecraft.server.MinecraftServer.isDemo ( )

Gets whether this is a demo or not.

boolean net.minecraft.server.MinecraftServer.isFlightAllowed ( )
abstract boolean net.minecraft.server.MinecraftServer.isHardcore ( )
pure virtual
boolean net.minecraft.server.MinecraftServer.isPVPEnabled ( )
boolean net.minecraft.server.MinecraftServer.isServerInOnlineMode ( )
boolean net.minecraft.server.MinecraftServer.isServerRunning ( )
boolean net.minecraft.server.MinecraftServer.isServerStopped ( )
boolean net.minecraft.server.MinecraftServer.isSinglePlayer ( )
boolean net.minecraft.server.MinecraftServer.isSnooperEnabled ( )

Returns whether snooping is enabled or not.

Implements net.minecraft.profiler.IPlayerUsage.

void net.minecraft.server.MinecraftServer.loadAllWorlds ( String  par1Str,
String  par2Str,
long  par3,
WorldType  par5WorldType,
String  par6Str 
)
protected
void net.minecraft.server.MinecraftServer.logDebug ( String  par1Str)

If isDebuggingEnabled(), logs the message with a level of INFO.

void net.minecraft.server.MinecraftServer.logInfo ( String  par1Str)

Logs the message with a level of INFO.

void net.minecraft.server.MinecraftServer.logSevere ( String  par1Str)

Logs the error message with a level of SEVERE.

void net.minecraft.server.MinecraftServer.logWarning ( String  par1Str)

Logs the message with a level of WARN.

static void net.minecraft.server.MinecraftServer.main ( String[]  par0ArrayOfStr)
static
void net.minecraft.server.MinecraftServer.outputPercentRemaining ( String  par1Str,
int  par2 
)
protected

Used to display a percent remaining given text and the percentage.

void net.minecraft.server.MinecraftServer.run ( )
void net.minecraft.server.MinecraftServer.saveAllWorlds ( boolean  par1)
protected

par1 indicates if a log message should be output.

void net.minecraft.server.MinecraftServer.sendChatToPlayer ( String  par1Str)
boolean net.minecraft.server.MinecraftServer.serverIsInRunLoop ( )
void net.minecraft.server.MinecraftServer.setAllowFlight ( boolean  par1)
void net.minecraft.server.MinecraftServer.setAllowPvp ( boolean  par1)
void net.minecraft.server.MinecraftServer.setBuildLimit ( int  par1)
void net.minecraft.server.MinecraftServer.setCanSpawnAnimals ( boolean  par1)
void net.minecraft.server.MinecraftServer.setCanSpawnNPCs ( boolean  par1)
void net.minecraft.server.MinecraftServer.setConfigurationManager ( ServerConfigurationManager  par1ServerConfigurationManager)
void net.minecraft.server.MinecraftServer.setDemo ( boolean  par1)

Sets whether this is a demo or not.

void net.minecraft.server.MinecraftServer.setDifficultyForAllWorlds ( int  par1)
void net.minecraft.server.MinecraftServer.setFolderName ( String  par1Str)
void net.minecraft.server.MinecraftServer.setGameType ( EnumGameType  par1EnumGameType)

Sets the game type for all worlds.

void net.minecraft.server.MinecraftServer.setHostname ( String  par1Str)
void net.minecraft.server.MinecraftServer.setKeyPair ( KeyPair  par1KeyPair)
void net.minecraft.server.MinecraftServer.setMOTD ( String  par1Str)
void net.minecraft.server.MinecraftServer.setOnlineMode ( boolean  par1)
void net.minecraft.server.MinecraftServer.setServerOwner ( String  par1Str)

Sets the username of the owner of this server (in the case of an integrated server)

void net.minecraft.server.MinecraftServer.setServerPort ( int  par1)
void net.minecraft.server.MinecraftServer.setTexturePack ( String  par1Str)
synchronized void net.minecraft.server.MinecraftServer.setUserMessage ( String  par1Str)
protected

Typically "menu.convertingLevel", "menu.loadingLevel" or others.

void net.minecraft.server.MinecraftServer.setWorldName ( String  par1Str)
abstract String net.minecraft.server.MinecraftServer.shareToLAN ( EnumGameType  enumgametype,
boolean  flag 
)
pure virtual

On dedicated does nothing. On integrated, sets commandsAllowedForAll, gameType and allows external connections.

Implemented in net.minecraft.server.dedicated.DedicatedServer, and net.minecraft.server.integrated.IntegratedServer.

abstract boolean net.minecraft.server.MinecraftServer.startServer ( ) throws IOException
protectedpure virtual
void net.minecraft.server.MinecraftServer.startServerThread ( )
void net.minecraft.server.MinecraftServer.stopServer ( )

Saves all necessary data as preparation for stopping the server.

void net.minecraft.server.MinecraftServer.systemExitNow ( )
protected

Directly calls System.exit(0), instantly killing the program.

int net.minecraft.server.MinecraftServer.textureSize ( )

This is checked to be 16 upon receiving the packet, otherwise the packet is ignored.

void net.minecraft.server.MinecraftServer.tick ( )

Main function called by run() every loop.

String net.minecraft.server.MinecraftServer.translateString ( String  par1Str,
Object...  par2ArrayOfObj 
)

Translates and formats the given string key with the given arguments.

Implements net.minecraft.command.ICommandSender.

void net.minecraft.server.MinecraftServer.updateTimeLightAndEntities ( )
WorldServer net.minecraft.server.MinecraftServer.worldServerForDimension ( int  par1)

Gets the worldServer by the given dimension.

Member Data Documentation

String net.minecraft.server.MinecraftServer.currentTask

The task the server is currently working on(and will output on outputPercentRemaining).

int net.minecraft.server.MinecraftServer.percentDone

The percentage of the current task finished so far.

final long [] net.minecraft.server.MinecraftServer.receivedPacketCountArray = new long[100]
final long [] net.minecraft.server.MinecraftServer.receivedPacketSizeArray = new long[100]
final long [] net.minecraft.server.MinecraftServer.sentPacketCountArray = new long[100]
final long [] net.minecraft.server.MinecraftServer.sentPacketSizeArray = new long[100]
final Profiler net.minecraft.server.MinecraftServer.theProfiler = new Profiler()
final long [] net.minecraft.server.MinecraftServer.tickTimeArray = new long[100]
WorldServer [] net.minecraft.server.MinecraftServer.worldServers = new WorldServer[0]

The server world instances.

Hashtable<Integer, long[]> net.minecraft.server.MinecraftServer.worldTickTimes = new Hashtable<Integer, long[]>()

Stats are [dimension][tick%100] system.nanoTime is stored.


The documentation for this class was generated from the following file: