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 MinecraftClient
client
private LanServerPinger
lanPinger
private int
lanPort
private UUID
localPlayerUuid
private static Logger
LOGGER
private boolean
paused
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 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 void
addSnooperInfo(Snooper snooper)
int
adjustTrackingDistance(int initialDistance)
boolean
areCommandBlocksEnabled()
Specifies whether command blocks can execute commands on the server.int
getFunctionPermissionLevel()
Optional<String>
getModdedStatusMessage()
int
getOpPermissionLevel()
int
getRateLimit()
File
getRunDirectory()
int
getServerPort()
boolean
isDedicated()
boolean
isHost(com.mojang.authlib.GameProfile profile)
boolean
isRemote()
boolean
isUsingNativeTransport()
boolean
openToLan(GameMode gameMode, boolean cheatsAllowed, int port)
Opens a server for LAN connections.CrashReport
populateCrashReport(CrashReport report)
void
setCrashReport(CrashReport report)
void
setDefaultGameMode(GameMode gameMode)
void
setLocalPlayerUuid(UUID localPlayerUuid)
boolean
setupServer()
boolean
shouldBroadcastConsoleToOps()
boolean
shouldBroadcastRconToOps()
void
shutdown()
void
stop(boolean bool)
boolean
syncChunkWrites()
void
tick(BooleanSupplier shouldKeepTicking)
Methods inherited from class net.minecraft.server.MinecraftServer
acceptsStatusQuery, addServerGuiTickable, canExecute, close, convertLevel, createFilterer, createTask, createWorlds, dump, enableProfiler, executeTask, exit, forcePlayerSampleUpdate, getAdvancementLoader, getBossBarManager, getCommandFunctionManager, getCommandManager, getCommandSource, getCurrentPlayerCount, getDataCommandStorage, getDataFixer, getDataPackManager, getDefaultGameMode, getFile, getGameProfileRepo, getGameRules, getIconFile, getKeyPair, getLootManager, getMaxPlayerCount, getMaxWorldBorderRadius, getMetricsData, getNetworkCompressionThreshold, getNetworkIo, getOverworld, getPermissionLevel, getPlayerIdleTimeout, 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, getWorldHeight, 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, method_31400, reloadResources, runServer, runTask, save, sendSystemMessage, setDemo, setDifficulty, setDifficultyLocked, setEnforceWhitelist, setFlightEnabled, setForceGameMode, setMotd, setOnlineMode, setPlayerIdleTimeout, setPlayerManager, setPreventProxyConnections, setPvpEnabled, setResourcePack, setServerId, setServerIp, setServerName, setServerPort, setWorldHeight, shouldExecuteAsync, shouldForceGameMode, shouldPreventProxyConnections, shouldReceiveFeedback, shouldSpawnAnimals, shouldSpawnNpcs, shouldTrackOutput, startServer, stopDebug, tickWorlds
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.util.thread.MessageListener
ask, method_27918
-
Field Details
-
LOGGER
-
client
-
paused
private boolean paused -
lanPort
private int lanPort -
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:
setupServer
in classMinecraftServer
-
tick
- Overrides:
tick
in classMinecraftServer
-
shouldBroadcastRconToOps
public boolean shouldBroadcastRconToOps()- Specified by:
shouldBroadcastRconToOps
in classMinecraftServer
-
shouldBroadcastConsoleToOps
public boolean shouldBroadcastConsoleToOps() -
getRunDirectory
- Overrides:
getRunDirectory
in classMinecraftServer
-
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
-
setCrashReport
- Overrides:
setCrashReport
in classMinecraftServer
-
populateCrashReport
- Overrides:
populateCrashReport
in classMinecraftServer
-
getModdedStatusMessage
- Specified by:
getModdedStatusMessage
in classMinecraftServer
-
addSnooperInfo
- Specified by:
addSnooperInfo
in interfaceSnooperListener
- Overrides:
addSnooperInfo
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
-
shutdown
public void shutdown()- Overrides:
shutdown
in classMinecraftServer
-
stop
public void stop(boolean bool)- Overrides:
stop
in classMinecraftServer
-
isRemote
public boolean isRemote()- Specified by:
isRemote
in classMinecraftServer
-
getServerPort
public int getServerPort()- Overrides:
getServerPort
in classMinecraftServer
-
setDefaultGameMode
- Overrides:
setDefaultGameMode
in classMinecraftServer
-
areCommandBlocksEnabled
public boolean areCommandBlocksEnabled()Specifies whether command blocks can execute commands on the server.- Specified by:
areCommandBlocksEnabled
in classMinecraftServer
-
getOpPermissionLevel
public int getOpPermissionLevel()- Specified by:
getOpPermissionLevel
in classMinecraftServer
-
getFunctionPermissionLevel
public int getFunctionPermissionLevel()- Specified by:
getFunctionPermissionLevel
in classMinecraftServer
-
setLocalPlayerUuid
-
isHost
public boolean isHost(com.mojang.authlib.GameProfile profile)- Specified by:
isHost
in classMinecraftServer
-
adjustTrackingDistance
public int adjustTrackingDistance(int initialDistance)- Overrides:
adjustTrackingDistance
in classMinecraftServer
-
syncChunkWrites
public boolean syncChunkWrites()- Overrides:
syncChunkWrites
in classMinecraftServer
-