net.minecraft.server

## Class MinecraftServer

- java.lang.Object
- - net.minecraft.server.MinecraftServer

- All Implemented Interfaces:
    java.lang.Runnable, ICommandSender, IPlayerUsage
  Direct Known Subclasses:
    DedicatedServer, IntegratedServer

      public abstract class MinecraftServer
      extends java.lang.Object
      implements ICommandSender, java.lang.Runnable, IPlayerUsage

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `java.lang.String` | `currentTask`
    `int` | `percentDone`
    `protected java.net.Proxy` | `serverProxy`
    `Profiler` | `theProfiler`
    `long[]` | `tickTimeArray`
    `WorldServer[]` | `worldServers`
    `java.util.Hashtable<java.lang.Integer,long[]>` | `worldTickTimes`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `MinecraftServer(java.io.File p_i45281_1_, java.net.Proxy p_i45281_2_)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addChatMessage(IChatComponent p_145747_1_)`
    `CrashReport` | `addServerInfoToCrashReport(CrashReport par1CrashReport)`
    `void` | `addServerStatsToSnooper(PlayerUsageSnooper par1PlayerUsageSnooper)`
    `void` | `addServerTypeToSnooper(PlayerUsageSnooper par1PlayerUsageSnooper)`
    `protected boolean` | `allowSpawnMonsters()`
    `boolean` | `canCommandSenderUseCommand(int par1, java.lang.String par2Str)`
    `void` | `canCreateBonusChest(boolean par1)`
    `abstract boolean` | `canStructuresSpawn()`
    `protected void` | `clearCurrentTask()`
    `protected void` | `convertMapIfNeeded(java.lang.String par1Str)`
    `void` | `deleteWorldAndStopServer()`
    `void` | `enableProfiling()`
    `protected void` | `finalTick(CrashReport par1CrashReport)`
    `void` | `func_143006_e(int par1)`
    `int` | `func_143007_ar()`
    `IChatComponent` | `func_145748_c_()`
    `com.mojang.authlib.minecraft.MinecraftSessionService` | `func_147130_as()`
    `void` | `func_147132_au()`
    `ServerStatusResponse` | `func_147134_at()`
    `abstract EnumDifficulty` | `func_147135_j()`
    `boolean` | `func_147136_ar()`
    `NetworkSystem` | `func_147137_ag()`
    `void` | `func_147139_a(EnumDifficulty p_147139_1_)`
    `void` | `func_155759_m(java.lang.String p_155759_1_)`
    `void` | `func_82010_a(IUpdatePlayerListBox par1IUpdatePlayerListBox)`
    `ISaveFormat` | `getActiveAnvilConverter()`
    `boolean` | `getAllowNether()`
    `java.lang.String[]` | `getAllUsernames()`
    `int` | `getBuildLimit()`
    `boolean` | `getCanSpawnAnimals()`
    `boolean` | `getCanSpawnNPCs()`
    `ICommandManager` | `getCommandManager()`
    `java.lang.String` | `getCommandSenderName()`
    `ServerConfigurationManager` | `getConfigurationManager()`
    `int` | `getCurrentPlayerCount()`
    `protected java.io.File` | `getDataDirectory()`
    `World` | `getEntityWorld()`
    `java.io.File` | `getFile(java.lang.String par1Str)`
    `java.lang.String` | `getFolderName()`
    `boolean` | `getForceGamemode()`
    `abstract WorldSettings.GameType` | `getGameType()`
    `boolean` | `getGuiEnabled()`
    `java.lang.String` | `getHostname()`
    `java.security.KeyPair` | `getKeyPair()`
    `int` | `getMaxPlayers()`
    `java.lang.String` | `getMinecraftVersion()`
    `java.lang.String` | `getMotd()`
    `java.lang.String` | `getMOTD()`
    `abstract int` | `getOpPermissionLevel()`
    `ChunkCoordinates` | `getPlayerCoordinates()`
    `PlayerUsageSnooper` | `getPlayerUsageSnooper()`
    `java.lang.String` | `getPlugins()`
    `int` | `getPort()`
    `java.util.List` | `getPossibleCompletions(ICommandSender par1ICommandSender, java.lang.String par2Str)`
    `static MinecraftServer` | `getServer()`
    `java.lang.String` | `getServerHostname()`
    `java.lang.String` | `getServerModName()`
    `java.lang.String` | `getServerOwner()`
    `int` | `getServerPort()`
    `java.net.Proxy` | `getServerProxy()`
    `int` | `getSpawnProtectionSize()`
    `static long` | `getSystemTimeMillis()`
    `java.lang.String` | `getTexturePack()`
    `int` | `getTickCounter()`
    `java.lang.String` | `getUserMessage()`
    `java.lang.String` | `getWorldName()`
    `java.lang.String` | `handleRConCommand(java.lang.String par1Str)`
    `protected void` | `initialWorldChunkLoad()`
    `void` | `initiateShutdown()`
    `boolean` | `isBlockProtected(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer)`
    `abstract boolean` | `isCommandBlockEnabled()`
    `boolean` | `isDebuggingEnabled()`
    `abstract boolean` | `isDedicatedServer()`
    `boolean` | `isDemo()`
    `boolean` | `isFlightAllowed()`
    `abstract boolean` | `isHardcore()`
    `boolean` | `isPVPEnabled()`
    `boolean` | `isServerInOnlineMode()`
    `boolean` | `isServerRunning()`
    `boolean` | `isServerStopped()`
    `boolean` | `isSinglePlayer()`
    `boolean` | `isSnooperEnabled()`
    `protected void` | `loadAllWorlds(java.lang.String par1Str, java.lang.String par2Str, long par3, WorldType par5WorldType, java.lang.String par6Str)`
    `void` | `logDebug(java.lang.String par1Str)`
    `void` | `logInfo(java.lang.String par1Str)`
    `void` | `logSevere(java.lang.String par1Str)`
    `void` | `logWarning(java.lang.String par1Str)`
    `static void` | `main(java.lang.String[] par0ArrayOfStr)`
    `protected void` | `outputPercentRemaining(java.lang.String par1Str, int par2)`
    `void` | `run()`
    `protected void` | `saveAllWorlds(boolean par1)`
    `boolean` | `serverIsInRunLoop()`
    `void` | `setAllowFlight(boolean par1)`
    `void` | `setAllowPvp(boolean par1)`
    `void` | `setBuildLimit(int par1)`
    `void` | `setCanSpawnAnimals(boolean par1)`
    `void` | `setCanSpawnNPCs(boolean par1)`
    `void` | `setConfigurationManager(ServerConfigurationManager par1ServerConfigurationManager)`
    `void` | `setDemo(boolean par1)`
    `void` | `setFolderName(java.lang.String par1Str)`
    `void` | `setForceGamemode(boolean par1)`
    `void` | `setGameType(WorldSettings.GameType par1EnumGameType)`
    `void` | `setHostname(java.lang.String par1Str)`
    `void` | `setKeyPair(java.security.KeyPair par1KeyPair)`
    `void` | `setMOTD(java.lang.String par1Str)`
    `void` | `setOnlineMode(boolean par1)`
    `void` | `setServerOwner(java.lang.String par1Str)`
    `void` | `setServerPort(int par1)`
    `protected void` | `setUserMessage(java.lang.String par1Str)`
    `void` | `setWorldName(java.lang.String par1Str)`
    `abstract java.lang.String` | `shareToLAN(WorldSettings.GameType var1, boolean var2)`
    `protected abstract boolean` | `startServer()`
    `void` | `startServerThread()`
    `void` | `stopServer()`
    `protected void` | `systemExitNow()`
    `void` | `tick()`
    `void` | `updateTimeLightAndEntities()`
    `WorldServer` | `worldServerForDimension(int par1)`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### theProfiler

          public final Profiler theProfiler

    - #### worldServers

          public WorldServer[] worldServers

    - #### serverProxy

          protected final java.net.Proxy serverProxy

    - #### currentTask

          public java.lang.String currentTask

    - #### percentDone

          public int percentDone

    - #### tickTimeArray

          public final long[] tickTimeArray

    - #### worldTickTimes

          public java.util.Hashtable<java.lang.Integer,long[]> worldTickTimes

  - ### Constructor Detail

    - #### MinecraftServer

          public MinecraftServer(java.io.File p_i45281_1_,
                         java.net.Proxy p_i45281_2_)

  - ### Method Detail

    - #### startServer

          protected abstract boolean startServer()
                                          throws java.io.IOException

      Throws:
        `java.io.IOException`

    - #### convertMapIfNeeded

          protected void convertMapIfNeeded(java.lang.String par1Str)

    - #### setUserMessage

          protected void setUserMessage(java.lang.String par1Str)

    - #### getUserMessage

          public java.lang.String getUserMessage()

    - #### loadAllWorlds

          protected void loadAllWorlds(java.lang.String par1Str,
                           java.lang.String par2Str,
                           long par3,
                           WorldType par5WorldType,
                           java.lang.String par6Str)

    - #### initialWorldChunkLoad

          protected void initialWorldChunkLoad()

    - #### canStructuresSpawn

          public abstract boolean canStructuresSpawn()

    - #### getGameType

          public abstract WorldSettings.GameType getGameType()

    - #### func_147135_j

          public abstract EnumDifficulty func_147135_j()

    - #### isHardcore

          public abstract boolean isHardcore()

    - #### getOpPermissionLevel

          public abstract int getOpPermissionLevel()

    - #### outputPercentRemaining

          protected void outputPercentRemaining(java.lang.String par1Str,
                                    int par2)

    - #### clearCurrentTask

          protected void clearCurrentTask()

    - #### saveAllWorlds

          protected void saveAllWorlds(boolean par1)

    - #### stopServer

          public void stopServer()

    - #### isServerRunning

          public boolean isServerRunning()

    - #### initiateShutdown

          public void initiateShutdown()

    - #### run

          public void run()

      Specified by:
        `run` in interface `java.lang.Runnable`

    - #### getDataDirectory

          protected java.io.File getDataDirectory()

    - #### finalTick

          protected void finalTick(CrashReport par1CrashReport)

    - #### systemExitNow

          protected void systemExitNow()

    - #### tick

          public void tick()

    - #### updateTimeLightAndEntities

          public void updateTimeLightAndEntities()

    - #### getAllowNether

          public boolean getAllowNether()

    - #### startServerThread

          public void startServerThread()

    - #### getFile

          public java.io.File getFile(java.lang.String par1Str)

    - #### logWarning

          public void logWarning(java.lang.String par1Str)

    - #### worldServerForDimension

          public WorldServer worldServerForDimension(int par1)

    - #### getMinecraftVersion

          public java.lang.String getMinecraftVersion()

    - #### getCurrentPlayerCount

          public int getCurrentPlayerCount()

    - #### getMaxPlayers

          public int getMaxPlayers()

    - #### getAllUsernames

          public java.lang.String[] getAllUsernames()

    - #### getServerModName

          public java.lang.String getServerModName()

    - #### addServerInfoToCrashReport

          public CrashReport addServerInfoToCrashReport(CrashReport par1CrashReport)

    - #### getPossibleCompletions

          public java.util.List getPossibleCompletions(ICommandSender par1ICommandSender,
                                              java.lang.String par2Str)

    - #### getServer

          public static MinecraftServer getServer()

    - #### getCommandSenderName

          public java.lang.String getCommandSenderName()

      Specified by:
        `getCommandSenderName` in interface `ICommandSender`

    - #### addChatMessage

          public void addChatMessage(IChatComponent p_145747_1_)

      Specified by:
        `addChatMessage` in interface `ICommandSender`

    - #### canCommandSenderUseCommand

          public boolean canCommandSenderUseCommand(int par1,
                                           java.lang.String par2Str)

      Specified by:
        `canCommandSenderUseCommand` in interface `ICommandSender`

    - #### getCommandManager

          public ICommandManager getCommandManager()

    - #### getKeyPair

          public java.security.KeyPair getKeyPair()

    - #### getServerOwner

          public java.lang.String getServerOwner()

    - #### setServerOwner

          public void setServerOwner(java.lang.String par1Str)

    - #### isSinglePlayer

          public boolean isSinglePlayer()

    - #### getFolderName

          public java.lang.String getFolderName()

    - #### setFolderName

          public void setFolderName(java.lang.String par1Str)

    - #### setWorldName

          public void setWorldName(java.lang.String par1Str)

    - #### getWorldName

          public java.lang.String getWorldName()

    - #### setKeyPair

          public void setKeyPair(java.security.KeyPair par1KeyPair)

    - #### func_147139_a

          public void func_147139_a(EnumDifficulty p_147139_1_)

    - #### allowSpawnMonsters

          protected boolean allowSpawnMonsters()

    - #### isDemo

          public boolean isDemo()

    - #### setDemo

          public void setDemo(boolean par1)

    - #### canCreateBonusChest

          public void canCreateBonusChest(boolean par1)

    - #### getActiveAnvilConverter

          public ISaveFormat getActiveAnvilConverter()

    - #### deleteWorldAndStopServer

          public void deleteWorldAndStopServer()

    - #### getTexturePack

          public java.lang.String getTexturePack()

    - #### addServerStatsToSnooper

          public void addServerStatsToSnooper(PlayerUsageSnooper par1PlayerUsageSnooper)

      Specified by:
        `addServerStatsToSnooper` in interface `IPlayerUsage`

    - #### addServerTypeToSnooper

          public void addServerTypeToSnooper(PlayerUsageSnooper par1PlayerUsageSnooper)

      Specified by:
        `addServerTypeToSnooper` in interface `IPlayerUsage`

    - #### isSnooperEnabled

          public boolean isSnooperEnabled()

      Specified by:
        `isSnooperEnabled` in interface `IPlayerUsage`

    - #### isDedicatedServer

          public abstract boolean isDedicatedServer()

    - #### isServerInOnlineMode

          public boolean isServerInOnlineMode()

    - #### setOnlineMode

          public void setOnlineMode(boolean par1)

    - #### getCanSpawnAnimals

          public boolean getCanSpawnAnimals()

    - #### setCanSpawnAnimals

          public void setCanSpawnAnimals(boolean par1)

    - #### getCanSpawnNPCs

          public boolean getCanSpawnNPCs()

    - #### setCanSpawnNPCs

          public void setCanSpawnNPCs(boolean par1)

    - #### isPVPEnabled

          public boolean isPVPEnabled()

    - #### setAllowPvp

          public void setAllowPvp(boolean par1)

    - #### isFlightAllowed

          public boolean isFlightAllowed()

    - #### setAllowFlight

          public void setAllowFlight(boolean par1)

    - #### isCommandBlockEnabled

          public abstract boolean isCommandBlockEnabled()

    - #### getMOTD

          public java.lang.String getMOTD()

    - #### setMOTD

          public void setMOTD(java.lang.String par1Str)

    - #### getBuildLimit

          public int getBuildLimit()

    - #### setBuildLimit

          public void setBuildLimit(int par1)

    - #### getConfigurationManager

          public ServerConfigurationManager getConfigurationManager()

    - #### setConfigurationManager

          public void setConfigurationManager(ServerConfigurationManager par1ServerConfigurationManager)

    - #### setGameType

          public void setGameType(WorldSettings.GameType par1EnumGameType)

    - #### func_147137_ag

          public NetworkSystem func_147137_ag()

    - #### serverIsInRunLoop

          public boolean serverIsInRunLoop()

    - #### getGuiEnabled

          public boolean getGuiEnabled()

    - #### shareToLAN

          public abstract java.lang.String shareToLAN(WorldSettings.GameType var1,
                                    boolean var2)

    - #### getTickCounter

          public int getTickCounter()

    - #### enableProfiling

          public void enableProfiling()

    - #### getPlayerUsageSnooper

          public PlayerUsageSnooper getPlayerUsageSnooper()

    - #### getPlayerCoordinates

          public ChunkCoordinates getPlayerCoordinates()

      Specified by:
        `getPlayerCoordinates` in interface `ICommandSender`

    - #### getEntityWorld

          public World getEntityWorld()

      Specified by:
        `getEntityWorld` in interface `ICommandSender`

    - #### getSpawnProtectionSize

          public int getSpawnProtectionSize()

    - #### isBlockProtected

          public boolean isBlockProtected(World par1World,
                                 int par2,
                                 int par3,
                                 int par4,
                                 EntityPlayer par5EntityPlayer)

    - #### getForceGamemode

          public boolean getForceGamemode()

    - #### getServerProxy

          public java.net.Proxy getServerProxy()

    - #### getSystemTimeMillis

          public static long getSystemTimeMillis()

    - #### func_143007_ar

          public int func_143007_ar()

    - #### func_143006_e

          public void func_143006_e(int par1)

    - #### func_145748_c_

          public IChatComponent func_145748_c_()

      Specified by:
        `func_145748_c_` in interface `ICommandSender`

    - #### func_147136_ar

          public boolean func_147136_ar()

    - #### func_147130_as

          public com.mojang.authlib.minecraft.MinecraftSessionService func_147130_as()

    - #### func_147134_at

          public ServerStatusResponse func_147134_at()

    - #### func_147132_au

          public void func_147132_au()

    - #### getServerHostname

          public java.lang.String getServerHostname()

    - #### setHostname

          public void setHostname(java.lang.String par1Str)

    - #### func_82010_a

          public void func_82010_a(IUpdatePlayerListBox par1IUpdatePlayerListBox)

    - #### main

          public static void main(java.lang.String[] par0ArrayOfStr)

    - #### logInfo

          public void logInfo(java.lang.String par1Str)

    - #### getHostname

          public java.lang.String getHostname()

    - #### getPort

          public int getPort()

    - #### getMotd

          public java.lang.String getMotd()

    - #### getPlugins

          public java.lang.String getPlugins()

    - #### handleRConCommand

          public java.lang.String handleRConCommand(java.lang.String par1Str)

    - #### isDebuggingEnabled

          public boolean isDebuggingEnabled()

    - #### logSevere

          public void logSevere(java.lang.String par1Str)

    - #### logDebug

          public void logDebug(java.lang.String par1Str)

    - #### getServerPort

          public int getServerPort()

    - #### setServerPort

          public void setServerPort(int par1)

    - #### func_155759_m

          public void func_155759_m(java.lang.String p_155759_1_)

    - #### isServerStopped

          public boolean isServerStopped()

    - #### setForceGamemode

          public void setForceGamemode(boolean par1)