Package net.minecraft.server.integrated
Class IntegratedServer
java.lang.Object
net.minecraft.util.thread.ThreadExecutor<R>
net.minecraft.util.thread.ReentrantThreadExecutor<ServerTask>
net.minecraft.server.MinecraftServer
net.minecraft.server.integrated.IntegratedServer
- All Implemented Interfaces:
AutoCloseable,Executor,CommandOutput,SnooperListener,MessageListener<ServerTask>
@Environment(CLIENT) public class IntegratedServer extends MinecraftServer
-
Field Summary
Fields Modifier and Type Field Description private MinecraftClientclientprivate GameModefield_28075private LanServerPingerlanPingerprivate intlanPortprivate UUIDlocalPlayerUuidprivate static LoggerLOGGERprivate booleanpausedFields inherited from class net.minecraft.server.MinecraftServer
DEMO_LEVEL_INFO, lastTickLengths, proxy, registryManager, saveHandler, saveProperties, session, USER_CACHE_FILEFields inherited from interface net.minecraft.server.command.CommandOutput
DUMMY -
Constructor Summary
Constructors Constructor Description IntegratedServer(Thread serverThread, MinecraftClient client, DynamicRegistryManager.Impl registryManager, LevelStorage.Session session, ResourcePackManager resourcePackManager, ServerResourceManager serverResourceManager, SaveProperties saveProperties, com.mojang.authlib.minecraft.MinecraftSessionService minecraftSessionService, com.mojang.authlib.GameProfileRepository gameProfileRepository, UserCache userCache, WorldGenerationProgressListenerFactory worldGenerationProgressListenerFactory) -
Method Summary
Modifier and Type Method Description voidaddSnooperInfo(Snooper snooper)intadjustTrackingDistance(int initialDistance)booleanareCommandBlocksEnabled()Specifies whether command blocks can execute commands on the server.GameModegetForcedGameMode()Returns the game mode a player should be set to when connecting to the server, ornullif none is set.intgetFunctionPermissionLevel()Optional<String>getModdedStatusMessage()intgetOpPermissionLevel()intgetRateLimit()FilegetRunDirectory()intgetServerPort()booleanisDedicated()booleanisHost(com.mojang.authlib.GameProfile profile)booleanisRemote()booleanisUsingNativeTransport()booleanopenToLan(GameMode gameMode, boolean cheatsAllowed, int port)Opens a server for LAN connections.CrashReportpopulateCrashReport(CrashReport report)voidsetCrashReport(CrashReport report)voidsetDefaultGameMode(GameMode gameMode)voidsetLocalPlayerUuid(UUID localPlayerUuid)booleansetupServer()booleanshouldBroadcastConsoleToOps()booleanshouldBroadcastRconToOps()voidshutdown()voidstop(boolean bool)booleansyncChunkWrites()voidtick(BooleanSupplier shouldKeepTicking)Methods inherited from class net.minecraft.server.MinecraftServer
acceptsStatusQuery, addServerGuiTickable, canExecute, close, convertLevel, createFilterer, createTask, createWorlds, dump, enableProfiler, executeTask, exit, forcePlayerSampleUpdate, generateKeyPair, getAdvancementLoader, getBossBarManager, getCommandFunctionManager, getCommandManager, getCommandSource, getCurrentPlayerCount, getDataCommandStorage, getDataFixer, getDataPackManager, getDefaultGameMode, getFile, getGameProfileRepo, getGameRules, getIconFile, getItemModifierManager, getKeyPair, getLootManager, getMaxPlayerCount, getMaxWorldBorderRadius, getMetricsData, getNetworkCompressionThreshold, getNetworkIo, getOverworld, getPermissionLevel, getPlayerIdleTimeout, getPlayerInteractionManager, getPlayerManager, getPlayerNames, getPredicateManager, getProfiler, getRecipeManager, getRegistryManager, getResourcePackHash, getResourcePackUrl, getSavePath, getSaveProperties, getScoreboard, getServerIp, getServerMetadata, getServerModName, getServerMotd, getServerStartTime, getSessionService, getSnooper, getSpawnProtectionRadius, getSpawnRadius, getStructureManager, getTagManager, getThread, getTicks, getTickTime, getUserCache, getUserName, getVersion, getWorld, getWorldRegistryKeys, getWorlds, hasGui, hasIconFile, isDebugRunning, isDemo, isEnforceWhitelist, isFlightEnabled, isHardcore, isLoading, isMonsterSpawningEnabled, isNetherAllowed, isOnlineMode, isPvpEnabled, isRunning, isSinglePlayer, isSpawnProtected, isStopped, isStopping, kickNonWhitelistedPlayers, loadDataPacks, loadWorld, loadWorldResourcePack, method_16208, method_27731, reloadResources, requireResourcePack, runServer, runTask, save, sendSystemMessage, setDemo, setDifficulty, setDifficultyLocked, setEnforceWhitelist, setFlightEnabled, setMotd, setOnlineMode, setPlayerIdleTimeout, setPlayerManager, setPreventProxyConnections, setPvpEnabled, setResourcePack, setServerId, setServerIp, setServerName, setServerPort, shouldExecuteAsync, shouldPreventProxyConnections, shouldReceiveFeedback, shouldSpawnAnimals, shouldSpawnNpcs, shouldTrackOutput, startServer, stopDebug, tickWorldsMethods inherited from class net.minecraft.util.thread.ReentrantThreadExecutor
hasRunningTasksMethods inherited from class net.minecraft.util.thread.ThreadExecutor
cancelTasks, execute, getName, getTaskCount, isOnThread, runTasks, runTasks, send, submit, submit, submitAndJoin, waitForTasksMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.minecraft.util.thread.MessageListener
ask, method_27918
-
Field Details
-
LOGGER
-
client
-
paused
private boolean paused -
lanPort
private int lanPort -
field_28075
-
lanPinger
-
localPlayerUuid
-
-
Constructor Details
-
IntegratedServer
public IntegratedServer(Thread serverThread, MinecraftClient client, DynamicRegistryManager.Impl registryManager, LevelStorage.Session session, ResourcePackManager resourcePackManager, ServerResourceManager serverResourceManager, SaveProperties saveProperties, com.mojang.authlib.minecraft.MinecraftSessionService minecraftSessionService, com.mojang.authlib.GameProfileRepository gameProfileRepository, UserCache userCache, WorldGenerationProgressListenerFactory worldGenerationProgressListenerFactory)
-
-
Method Details
-
setupServer
public boolean setupServer()- Specified by:
setupServerin classMinecraftServer
-
tick
- Overrides:
tickin classMinecraftServer
-
shouldBroadcastRconToOps
public boolean shouldBroadcastRconToOps()- Specified by:
shouldBroadcastRconToOpsin classMinecraftServer
-
shouldBroadcastConsoleToOps
public boolean shouldBroadcastConsoleToOps() -
getRunDirectory
- Overrides:
getRunDirectoryin classMinecraftServer
-
isDedicated
public boolean isDedicated()- Specified by:
isDedicatedin classMinecraftServer
-
getRateLimit
public int getRateLimit()- Specified by:
getRateLimitin classMinecraftServer
-
isUsingNativeTransport
public boolean isUsingNativeTransport()- Specified by:
isUsingNativeTransportin classMinecraftServer
-
setCrashReport
- Overrides:
setCrashReportin classMinecraftServer
-
populateCrashReport
- Overrides:
populateCrashReportin classMinecraftServer
-
getModdedStatusMessage
- Specified by:
getModdedStatusMessagein classMinecraftServer
-
addSnooperInfo
- Specified by:
addSnooperInfoin interfaceSnooperListener- Overrides:
addSnooperInfoin 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.- Overrides:
openToLanin 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
-
shutdown
public void shutdown()- Overrides:
shutdownin classMinecraftServer
-
stop
public void stop(boolean bool)- Overrides:
stopin classMinecraftServer
-
isRemote
public boolean isRemote()- Specified by:
isRemotein classMinecraftServer
-
getServerPort
public int getServerPort()- Overrides:
getServerPortin classMinecraftServer
-
setDefaultGameMode
- Overrides:
setDefaultGameModein classMinecraftServer
-
areCommandBlocksEnabled
public boolean areCommandBlocksEnabled()Specifies whether command blocks can execute commands on the server.- Specified by:
areCommandBlocksEnabledin classMinecraftServer
-
getOpPermissionLevel
public int getOpPermissionLevel()- Specified by:
getOpPermissionLevelin classMinecraftServer
-
getFunctionPermissionLevel
public int getFunctionPermissionLevel()- Specified by:
getFunctionPermissionLevelin classMinecraftServer
-
setLocalPlayerUuid
-
isHost
public boolean isHost(com.mojang.authlib.GameProfile profile)- Specified by:
isHostin classMinecraftServer
-
adjustTrackingDistance
public int adjustTrackingDistance(int initialDistance)- Overrides:
adjustTrackingDistancein classMinecraftServer
-
syncChunkWrites
public boolean syncChunkWrites()- Overrides:
syncChunkWritesin classMinecraftServer
-
getForcedGameMode
Returns the game mode a player should be set to when connecting to the server, ornullif none is set.- Overrides:
getForcedGameModein classMinecraftServer
-