Package net.minecraft.server.dedicated
Class MinecraftDedicatedServer
java.lang.Object
net.minecraft.util.thread.ThreadExecutor<R>
net.minecraft.util.thread.ReentrantThreadExecutor<ServerTask>
net.minecraft.server.MinecraftServer
net.minecraft.server.dedicated.MinecraftDedicatedServer
- All Implemented Interfaces:
AutoCloseable
,Executor
,CommandOutput
,DedicatedServer
,SnooperListener
,MessageListener<ServerTask>
public class MinecraftDedicatedServer extends MinecraftServer implements DedicatedServer
-
Field Summary
Fields Modifier and Type Field Description private List<PendingServerCommand>
commandQueue
private TextFilterer
filterer
private DedicatedServerGui
gui
private static Logger
LOGGER
private ServerPropertiesLoader
propertiesLoader
private QueryResponseHandler
queryResponseHandler
private RconCommandOutput
rconCommandOutput
private RconListener
rconServer
private static Pattern
SHA1_PATTERN
Fields inherited from class net.minecraft.server.MinecraftServer
DEMO_LEVEL_INFO, lastTickLengths, proxy, registryManager, saveHandler, saveProperties, session, USER_CACHE_FILE
Fields inherited from interface net.minecraft.server.command.CommandOutput
DUMMY
-
Constructor Summary
Constructors Constructor Description MinecraftDedicatedServer(Thread thread, DynamicRegistryManager.Impl impl, LevelStorage.Session session, ResourcePackManager resourcePackManager, ServerResourceManager serverResourceManager, SaveProperties saveProperties, ServerPropertiesLoader serverPropertiesLoader, com.mojang.datafixers.DataFixer dataFixer, com.mojang.authlib.minecraft.MinecraftSessionService minecraftSessionService, com.mojang.authlib.GameProfileRepository gameProfileRepository, UserCache userCache, WorldGenerationProgressListenerFactory worldGenerationProgressListenerFactory)
-
Method Summary
Methods inherited from class net.minecraft.server.MinecraftServer
addServerGuiTickable, canExecute, close, convertLevel, createTask, createWorlds, dump, enableProfiler, executeTask, forcePlayerSampleUpdate, getAdvancementLoader, getBossBarManager, getCommandFunctionManager, getCommandManager, getCommandSource, getCurrentPlayerCount, getDataCommandStorage, getDataFixer, getDataPackManager, getDefaultGameMode, getFile, getGameProfileRepo, getGameRules, getIconFile, getKeyPair, getLootManager, getMaxPlayerCount, getMetricsData, getNetworkIo, getOverworld, getPermissionLevel, getPlayerIdleTimeout, getPlayerNames, getPredicateManager, getProfiler, getRecipeManager, getRegistryManager, getResourcePackHash, getResourcePackUrl, getRunDirectory, getSavePath, getSaveProperties, getScoreboard, getServerIp, getServerMetadata, getServerModName, getServerMotd, getServerPort, getServerStartTime, getSessionService, getSnooper, getSpawnRadius, getStructureManager, getTagManager, getThread, getTicks, getTickTime, getUserCache, getUserName, getVersion, getWorld, getWorldHeight, getWorldRegistryKeys, getWorlds, hasIconFile, isDebugRunning, isDemo, isEnforceWhitelist, isFlightEnabled, isLoading, isOnlineMode, isPvpEnabled, isRunning, isSinglePlayer, isStopped, isStopping, kickNonWhitelistedPlayers, loadDataPacks, loadWorld, loadWorldResourcePack, method_16208, method_31400, reloadResources, runServer, runTask, save, sendSystemMessage, setCrashReport, setDefaultGameMode, setDemo, setDifficulty, setDifficultyLocked, setEnforceWhitelist, setFlightEnabled, setForceGameMode, setMotd, setOnlineMode, setPlayerManager, setPreventProxyConnections, setPvpEnabled, setResourcePack, setServerId, setServerIp, setServerName, setServerPort, setWorldHeight, shouldExecuteAsync, shouldForceGameMode, shouldPreventProxyConnections, shouldReceiveFeedback, shouldTrackOutput, startServer, stop, stopDebug, tick
Methods inherited from class net.minecraft.util.thread.ReentrantThreadExecutor
hasRunningTasks
Methods inherited from class net.minecraft.util.thread.ThreadExecutor
cancelTasks, execute, getName, getTaskCount, isOnThread, runTasks, runTasks, send, submit, submit, submitAndJoin, waitForTasks
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface net.minecraft.server.dedicated.DedicatedServer
getCurrentPlayerCount, getMaxPlayerCount, getPlayerNames, getVersion
Methods inherited from interface net.minecraft.util.thread.MessageListener
ask, method_27918
-
Field Details
-
LOGGER
-
SHA1_PATTERN
-
commandQueue
-
queryResponseHandler
-
rconCommandOutput
-
rconServer
-
propertiesLoader
-
gui
-
filterer
-
-
Constructor Details
-
MinecraftDedicatedServer
public MinecraftDedicatedServer(Thread thread, DynamicRegistryManager.Impl impl, LevelStorage.Session session, ResourcePackManager resourcePackManager, ServerResourceManager serverResourceManager, SaveProperties saveProperties, ServerPropertiesLoader serverPropertiesLoader, com.mojang.datafixers.DataFixer dataFixer, com.mojang.authlib.minecraft.MinecraftSessionService minecraftSessionService, com.mojang.authlib.GameProfileRepository gameProfileRepository, UserCache userCache, WorldGenerationProgressListenerFactory worldGenerationProgressListenerFactory)
-
-
Method Details
-
setupServer
- Specified by:
setupServer
in classMinecraftServer
- Throws:
IOException
-
shouldSpawnAnimals
public boolean shouldSpawnAnimals()- Overrides:
shouldSpawnAnimals
in classMinecraftServer
-
isMonsterSpawningEnabled
public boolean isMonsterSpawningEnabled()- Overrides:
isMonsterSpawningEnabled
in classMinecraftServer
-
shouldSpawnNpcs
public boolean shouldSpawnNpcs()- Overrides:
shouldSpawnNpcs
in classMinecraftServer
-
createResourcePackHash
-
getProperties
- Specified by:
getProperties
in interfaceDedicatedServer
-
method_27731
public void method_27731()- Overrides:
method_27731
in classMinecraftServer
-
isHardcore
public boolean isHardcore()- Overrides:
isHardcore
in classMinecraftServer
-
populateCrashReport
- Overrides:
populateCrashReport
in classMinecraftServer
-
getModdedStatusMessage
- Specified by:
getModdedStatusMessage
in classMinecraftServer
-
exit
public void exit()- Overrides:
exit
in classMinecraftServer
-
tickWorlds
- Overrides:
tickWorlds
in classMinecraftServer
-
isNetherAllowed
public boolean isNetherAllowed()- Overrides:
isNetherAllowed
in classMinecraftServer
-
addSnooperInfo
- Specified by:
addSnooperInfo
in interfaceSnooperListener
- Overrides:
addSnooperInfo
in classMinecraftServer
-
enqueueCommand
-
executeQueuedCommands
public void executeQueuedCommands() -
isDedicated
public boolean isDedicated()- Specified by:
isDedicated
in classMinecraftServer
-
getRateLimit
public int getRateLimit()- Specified by:
getRateLimit
in classMinecraftServer
-
isUsingNativeTransport
public boolean isUsingNativeTransport()- Specified by:
isUsingNativeTransport
in classMinecraftServer
-
getPlayerManager
- Overrides:
getPlayerManager
in classMinecraftServer
-
isRemote
public boolean isRemote()- Specified by:
isRemote
in classMinecraftServer
-
getHostname
- Specified by:
getHostname
in interfaceDedicatedServer
-
getPort
public int getPort()- Specified by:
getPort
in interfaceDedicatedServer
-
getMotd
- Specified by:
getMotd
in interfaceDedicatedServer
-
createGui
public void createGui() -
hasGui
public boolean hasGui()- Overrides:
hasGui
in classMinecraftServer
-
openToLan
Opens a server for LAN connections. This is only supported on an integrated server, a dedicated server will always fail to open to LAN.- Specified by:
openToLan
in classMinecraftServer
- Parameters:
gameMode
- the game mode connecting players will have set by defaultcheatsAllowed
- whether players on the server have operator permissionsport
- the port to open up to LAN connections- Returns:
- whether the server was successfully opened to LAN
-
areCommandBlocksEnabled
public boolean areCommandBlocksEnabled()Specifies whether command blocks can execute commands on the server.- Specified by:
areCommandBlocksEnabled
in classMinecraftServer
-
getSpawnProtectionRadius
public int getSpawnProtectionRadius()- Overrides:
getSpawnProtectionRadius
in classMinecraftServer
-
isSpawnProtected
- Overrides:
isSpawnProtected
in classMinecraftServer
-
acceptsStatusQuery
public boolean acceptsStatusQuery()- Overrides:
acceptsStatusQuery
in classMinecraftServer
-
getOpPermissionLevel
public int getOpPermissionLevel()- Specified by:
getOpPermissionLevel
in classMinecraftServer
-
getFunctionPermissionLevel
public int getFunctionPermissionLevel()- Specified by:
getFunctionPermissionLevel
in classMinecraftServer
-
setPlayerIdleTimeout
public void setPlayerIdleTimeout(int playerIdleTimeout)- Overrides:
setPlayerIdleTimeout
in classMinecraftServer
-
shouldBroadcastRconToOps
public boolean shouldBroadcastRconToOps()- Specified by:
shouldBroadcastRconToOps
in classMinecraftServer
-
shouldBroadcastConsoleToOps
public boolean shouldBroadcastConsoleToOps()- Specified by:
shouldBroadcastConsoleToOps
in interfaceCommandOutput
-
getMaxWorldBorderRadius
public int getMaxWorldBorderRadius()- Overrides:
getMaxWorldBorderRadius
in classMinecraftServer
-
getNetworkCompressionThreshold
public int getNetworkCompressionThreshold()- Overrides:
getNetworkCompressionThreshold
in classMinecraftServer
-
convertData
protected boolean convertData() -
sleepFiveSeconds
private void sleepFiveSeconds() -
getMaxTickTime
public long getMaxTickTime() -
getPlugins
- Specified by:
getPlugins
in interfaceDedicatedServer
-
executeRconCommand
- Specified by:
executeRconCommand
in interfaceDedicatedServer
-
setUseWhitelist
public void setUseWhitelist(boolean bool) -
shutdown
public void shutdown()- Overrides:
shutdown
in classMinecraftServer
-
isHost
public boolean isHost(com.mojang.authlib.GameProfile profile)- Specified by:
isHost
in classMinecraftServer
-
adjustTrackingDistance
public int adjustTrackingDistance(int initialDistance)- Overrides:
adjustTrackingDistance
in classMinecraftServer
-
getLevelName
- Specified by:
getLevelName
in interfaceDedicatedServer
-
syncChunkWrites
public boolean syncChunkWrites()- Overrides:
syncChunkWrites
in classMinecraftServer
-
createFilterer
- Overrides:
createFilterer
in classMinecraftServer
-