public abstract class MinecraftServer extends RecursiveEventLoop<TickDelayedTask> implements ISnooperInfo, ICommandSource, java.lang.AutoCloseable, java.lang.Runnable
修飾子とタイプ | フィールドと説明 |
---|---|
protected IChunkStatusListenerFactory |
chunkStatusListenerFactory |
static WorldSettings |
DEMO_WORLD_SETTINGS |
protected java.net.Proxy |
serverProxy |
protected java.lang.Thread |
serverThread |
protected long |
serverTime |
long[] |
tickTimeArray |
static java.io.File |
USER_CACHE_FILE |
DUMMY
コンストラクタと説明 |
---|
MinecraftServer(java.io.File p_i50590_1_,
java.net.Proxy p_i50590_2_,
com.mojang.datafixers.DataFixer dataFixerIn,
Commands p_i50590_4_,
com.mojang.authlib.yggdrasil.YggdrasilAuthenticationService p_i50590_5_,
com.mojang.authlib.minecraft.MinecraftSessionService p_i50590_6_,
com.mojang.authlib.GameProfileRepository p_i50590_7_,
PlayerProfileCache p_i50590_8_,
IChunkStatusListenerFactory p_i50590_9_,
java.lang.String p_i50590_10_) |
修飾子とタイプ | メソッドと説明 |
---|---|
CrashReport |
addServerInfoToCrashReport(CrashReport report)
Adds the server info, including from theWorldServer, to the crash report.
|
abstract boolean |
allowLoggingRcon() |
protected boolean |
allowSpawnMonsters() |
void |
applyServerIconToResponse(ServerStatusResponse response) |
void |
canCreateBonusChest(boolean enable) |
protected boolean |
canRun(TickDelayedTask runnable) |
abstract boolean |
canStructuresSpawn() |
void |
close() |
protected void |
convertMapIfNeeded(java.lang.String worldNameIn) |
boolean |
driveOne() |
void |
dumpDebugInfo(java.nio.file.Path p_223711_1_) |
void |
enableProfiling() |
void |
fillSnooper(Snooper snooper) |
protected void |
finalTick(CrashReport report)
Called on exit from the main run() loop.
|
java.util.Map<DimensionType,ServerWorld> |
forgeGetWorldMap()
非推奨です。
|
CommandStorage |
func_229735_aN_() |
LootPredicateManager |
func_229736_aP_() |
abstract java.util.Optional<java.lang.String> |
func_230045_q_() |
SaveFormat |
getActiveAnvilConverter() |
AdvancementManager |
getAdvancementManager() |
boolean |
getAllowNether() |
java.util.concurrent.Executor |
getBackgroundExecutor() |
int |
getBuildLimit() |
boolean |
getCanSpawnAnimals() |
boolean |
getCanSpawnNPCs() |
Commands |
getCommandManager() |
CommandSource |
getCommandSource() |
int |
getCurrentPlayerCount()
Returns the number of players currently on the server.
|
CustomServerBossInfoManager |
getCustomBossEvents() |
java.io.File |
getDataDirectory() |
com.mojang.datafixers.DataFixer |
getDataFixer() |
abstract Difficulty |
getDifficulty()
Get the server's difficulty
|
java.lang.Thread |
getExecutionThread() |
java.io.File |
getFile(java.lang.String fileName)
Returns a File object from the specified string.
|
java.lang.String |
getFolderName() |
boolean |
getForceGamemode()
Get the forceGamemode field (whether joining players will be put in their old gamemode or the default one)
|
FrameTimer |
getFrameTimer() |
abstract int |
getFunctionLevel() |
FunctionManager |
getFunctionManager() |
com.mojang.authlib.GameProfileRepository |
getGameProfileRepository() |
GameRules |
getGameRules() |
abstract GameType |
getGameType() |
boolean |
getGuiEnabled() |
java.security.KeyPair |
getKeyPair()
Gets KeyPair instanced in MinecraftServer.
|
LootTableManager |
getLootTableManager() |
int |
getMaxPlayerIdleMinutes() |
int |
getMaxPlayers()
Returns the maximum number of players allowed on the server.
|
int |
getMaxWorldSize() |
com.mojang.authlib.minecraft.MinecraftSessionService |
getMinecraftSessionService() |
java.lang.String |
getMinecraftVersion()
Returns the server's Minecraft version as string.
|
java.lang.String |
getMOTD() |
int |
getNetworkCompressionThreshold()
The compression treshold.
|
NetworkSystem |
getNetworkSystem() |
NetworkTagManager |
getNetworkTagManager() |
java.lang.String[] |
getOnlinePlayerNames()
Returns an array of the usernames of all the connected players.
|
abstract int |
getOpPermissionLevel() |
int |
getPermissionLevel(com.mojang.authlib.GameProfile profile) |
PlayerList |
getPlayerList() |
PlayerProfileCache |
getPlayerProfileCache() |
boolean |
getPreventProxyConnections() |
DebugProfiler |
getProfiler() |
abstract boolean |
getPublic()
Returns true if this integrated server is open to LAN
|
RecipeManager |
getRecipeManager() |
IReloadableResourceManager |
getResourceManager() |
java.lang.String |
getResourcePackHash() |
ResourcePackList<ResourcePackInfo> |
getResourcePacks() |
java.lang.String |
getResourcePackUrl() |
ServerScoreboard |
getScoreboard() |
java.lang.String |
getServerHostname()
"getHostname" is already taken, but both return the hostname.
|
java.lang.String |
getServerModName() |
java.lang.String |
getServerOwner()
Returns the username of the server owner (for integrated servers)
|
int |
getServerPort()
Gets serverPort.
|
ServerStatusResponse |
getServerStatusResponse() |
long |
getServerTime() |
Snooper |
getSnooper() |
int |
getSpawnProtectionSize()
Return the spawn protection area's size.
|
int |
getSpawnRadius(ServerWorld worldIn) |
int |
getTickCounter() |
float |
getTickTime() |
long[] |
getTickTime(DimensionType dim) |
ServerWorld |
getWorld(DimensionType dimension)
Gets the worldServer by the given dimension.
|
java.io.File |
getWorldIconFile() |
java.lang.String |
getWorldName() |
java.lang.Iterable<ServerWorld> |
getWorlds() |
protected abstract boolean |
init()
Initialises the server and starts it.
|
void |
initiateShutdown(boolean waitForServer)
Sets the serverRunning variable to false, in order to get the server to shut down.
|
boolean |
isAnvilFileSet() |
boolean |
isBlockProtected(World worldIn,
BlockPos pos,
PlayerEntity playerIn) |
abstract boolean |
isCommandBlockEnabled()
Return whether command blocks are enabled.
|
boolean |
isDebuggingEnabled()
Returns true if debugging is enabled, false otherwise.
|
abstract boolean |
isDedicatedServer() |
boolean |
isDemo()
Gets whether this is a demo or not.
|
boolean |
isFlightAllowed() |
abstract boolean |
isHardcore()
Defaults to false.
|
boolean |
isPVPEnabled() |
boolean |
isServerInOnlineMode() |
abstract boolean |
isServerOwner(com.mojang.authlib.GameProfile profileIn) |
boolean |
isServerRunning() |
boolean |
isServerStopped() |
boolean |
isSinglePlayer() |
boolean |
isThreadAlive() |
boolean |
isWhitelistEnabled() |
boolean |
isWorldIconSet() |
void |
kickPlayersNotWhitelisted(CommandSource commandSourceIn) |
protected void |
loadAllWorlds(java.lang.String saveName,
java.lang.String worldNameIn,
long seed,
WorldType type,
com.google.gson.JsonElement generatorOptions) |
protected void |
loadDataPacks(java.io.File p_195560_1_,
WorldInfo p_195560_2_) |
protected void |
loadInitialChunks(IChunkStatusListener p_213186_1_)
Loads the spawn chunks and any forced chunks
|
protected void |
loadWorlds(SaveHandler saveHandlerIn,
WorldInfo info,
WorldSettings worldSettingsIn,
IChunkStatusListener chunkStatusListenerIn) |
void |
logDebug(java.lang.String msg)
If isDebuggingEnabled(), logs the message with a level of INFO.
|
void |
logInfo(java.lang.String msg)
Logs the message with a level of INFO.
|
void |
logSevere(java.lang.String msg)
Logs the error message with a level of SEVERE.
|
void |
logWarning(java.lang.String msg)
Logs the message with a level of WARN.
|
static void |
main(java.lang.String[] p_main_0_) |
void |
markWorldsDirty()
非推奨です。
|
void |
refreshStatusNextTick() |
void |
registerTickable(java.lang.Runnable tickable) |
void |
reload() |
void |
run() |
protected void |
run(TickDelayedTask taskIn) |
protected void |
runScheduledTasks()
Runs all pending tasks and waits for more tasks until serverTime is reached.
|
boolean |
save(boolean suppressLog,
boolean flush,
boolean forced) |
void |
sendMessage(ITextComponent component)
Send a chat message to the CommandSender
|
boolean |
serverIsInRunLoop() |
void |
setAllowFlight(boolean allow) |
void |
setAllowPvp(boolean allowPvp) |
void |
setBuildLimit(int maxBuildHeight) |
void |
setCanSpawnAnimals(boolean spawnAnimals) |
void |
setCanSpawnNPCs(boolean spawnNpcs) |
void |
setDemo(boolean demo)
Sets whether this is a demo or not.
|
void |
setDifficultyForAllWorlds(Difficulty difficulty,
boolean p_147139_2_) |
void |
setDifficultyLocked(boolean locked) |
protected void |
setEraseCache(boolean eraseCacheIn) |
void |
setForceGamemode(boolean force)
Set the forceGamemode field (whether joining players will be put in their old gamemode or the default one)
|
protected void |
setForceWorldUpgrade(boolean forceWorldUpgradeIn) |
void |
setGameType(GameType gameMode)
Sets the game type for all worlds.
|
void |
setHostname(java.lang.String host) |
void |
setKeyPair(java.security.KeyPair keyPair) |
void |
setMOTD(java.lang.String motdIn) |
void |
setOnlineMode(boolean online) |
void |
setPlayerIdleTimeout(int idleTimeout) |
void |
setPlayerList(PlayerList list) |
void |
setPreventProxyConnections(boolean p_190517_1_) |
void |
setResourcePack(java.lang.String url,
java.lang.String hash) |
protected void |
setResourcePackFromWorld(java.lang.String worldNameIn,
SaveHandler saveHandlerIn) |
protected void |
setServerId(java.lang.String serverIdIn) |
void |
setServerOwner(java.lang.String owner)
Sets the username of the owner of this server (in the case of an integrated server)
|
void |
setServerPort(int port) |
protected void |
setUserMessage(ITextComponent userMessageIn) |
void |
setWhitelistEnabled(boolean whitelistEnabledIn) |
void |
setWorldName(java.lang.String worldNameIn) |
abstract boolean |
shareToLAN(GameType gameMode,
boolean cheats,
int port) |
boolean |
shouldDeferTasks() |
boolean |
shouldReceiveErrors() |
boolean |
shouldReceiveFeedback() |
abstract boolean |
shouldUseNativeTransport()
Get if native transport should be used.
|
void |
startServerThread() |
protected void |
stopServer()
Saves all necessary data as preparation for stopping the server.
|
protected void |
systemExitNow()
Directly calls System.exit(0), instantly killing the program.
|
protected void |
tick(java.util.function.BooleanSupplier hasTimeLeft)
Main function called by run() every loop.
|
protected void |
updateTimeLightAndEntities(java.util.function.BooleanSupplier hasTimeLeft) |
protected TickDelayedTask |
wrapTask(java.lang.Runnable runnable) |
isTaskRunning
deferTask, drainTasks, driveUntil, dropTasks, enqueue, execute, getName, getQueueSize, isOnExecutionThread, runAsync, runImmediately, supplyAsync, threadYieldPark
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
allowLogging
func_213141_a, inline
public static final java.io.File USER_CACHE_FILE
public static final WorldSettings DEMO_WORLD_SETTINGS
protected final IChunkStatusListenerFactory chunkStatusListenerFactory
protected final java.net.Proxy serverProxy
public final long[] tickTimeArray
protected final java.lang.Thread serverThread
protected long serverTime
public MinecraftServer(java.io.File p_i50590_1_, java.net.Proxy p_i50590_2_, com.mojang.datafixers.DataFixer dataFixerIn, Commands p_i50590_4_, com.mojang.authlib.yggdrasil.YggdrasilAuthenticationService p_i50590_5_, com.mojang.authlib.minecraft.MinecraftSessionService p_i50590_6_, com.mojang.authlib.GameProfileRepository p_i50590_7_, PlayerProfileCache p_i50590_8_, IChunkStatusListenerFactory p_i50590_9_, java.lang.String p_i50590_10_)
protected abstract boolean init() throws java.io.IOException
java.io.IOException
protected void convertMapIfNeeded(java.lang.String worldNameIn)
protected void setUserMessage(ITextComponent userMessageIn)
protected void loadAllWorlds(java.lang.String saveName, java.lang.String worldNameIn, long seed, WorldType type, com.google.gson.JsonElement generatorOptions)
protected void loadWorlds(SaveHandler saveHandlerIn, WorldInfo info, WorldSettings worldSettingsIn, IChunkStatusListener chunkStatusListenerIn)
protected void loadDataPacks(java.io.File p_195560_1_, WorldInfo p_195560_2_)
protected void loadInitialChunks(IChunkStatusListener p_213186_1_)
protected void setResourcePackFromWorld(java.lang.String worldNameIn, SaveHandler saveHandlerIn)
public abstract boolean canStructuresSpawn()
public abstract GameType getGameType()
public abstract Difficulty getDifficulty()
public abstract boolean isHardcore()
public abstract int getOpPermissionLevel()
public abstract int getFunctionLevel()
public abstract boolean allowLoggingRcon()
public boolean save(boolean suppressLog, boolean flush, boolean forced)
public void close()
close
インタフェース内 java.lang.AutoCloseable
close
インタフェース内 ITaskExecutor<TickDelayedTask>
protected void stopServer()
public java.lang.String getServerHostname()
public void setHostname(java.lang.String host)
public boolean isServerRunning()
public void initiateShutdown(boolean waitForServer)
public void run()
run
インタフェース内 java.lang.Runnable
protected void runScheduledTasks()
protected TickDelayedTask wrapTask(java.lang.Runnable runnable)
wrapTask
クラス内 ThreadTaskExecutor<TickDelayedTask>
protected boolean canRun(TickDelayedTask runnable)
canRun
クラス内 ThreadTaskExecutor<TickDelayedTask>
public boolean driveOne()
driveOne
クラス内 ThreadTaskExecutor<TickDelayedTask>
protected void run(TickDelayedTask taskIn)
run
クラス内 RecursiveEventLoop<TickDelayedTask>
public void applyServerIconToResponse(ServerStatusResponse response)
public boolean isWorldIconSet()
public java.io.File getWorldIconFile()
public java.io.File getDataDirectory()
protected void finalTick(CrashReport report)
protected void systemExitNow()
protected void tick(java.util.function.BooleanSupplier hasTimeLeft)
protected void updateTimeLightAndEntities(java.util.function.BooleanSupplier hasTimeLeft)
public boolean getAllowNether()
public void registerTickable(java.lang.Runnable tickable)
public static void main(java.lang.String[] p_main_0_)
protected void setServerId(java.lang.String serverIdIn)
protected void setForceWorldUpgrade(boolean forceWorldUpgradeIn)
protected void setEraseCache(boolean eraseCacheIn)
public void startServerThread()
public boolean isThreadAlive()
public java.io.File getFile(java.lang.String fileName)
public void logInfo(java.lang.String msg)
public void logWarning(java.lang.String msg)
public ServerWorld getWorld(DimensionType dimension)
public java.lang.Iterable<ServerWorld> getWorlds()
public java.lang.String getMinecraftVersion()
public int getCurrentPlayerCount()
public int getMaxPlayers()
public java.lang.String[] getOnlinePlayerNames()
public boolean isDebuggingEnabled()
public void logSevere(java.lang.String msg)
public void logDebug(java.lang.String msg)
public java.lang.String getServerModName()
public CrashReport addServerInfoToCrashReport(CrashReport report)
public abstract java.util.Optional<java.lang.String> func_230045_q_()
public boolean isAnvilFileSet()
public void sendMessage(ITextComponent component)
sendMessage
インタフェース内 ICommandSource
public java.security.KeyPair getKeyPair()
public int getServerPort()
public void setServerPort(int port)
public java.lang.String getServerOwner()
public void setServerOwner(java.lang.String owner)
public boolean isSinglePlayer()
public java.lang.String getFolderName()
public void setWorldName(java.lang.String worldNameIn)
public java.lang.String getWorldName()
public void setKeyPair(java.security.KeyPair keyPair)
public void setDifficultyForAllWorlds(Difficulty difficulty, boolean p_147139_2_)
public void setDifficultyLocked(boolean locked)
protected boolean allowSpawnMonsters()
public boolean isDemo()
public void setDemo(boolean demo)
public void canCreateBonusChest(boolean enable)
public SaveFormat getActiveAnvilConverter()
public java.lang.String getResourcePackUrl()
public java.lang.String getResourcePackHash()
public void setResourcePack(java.lang.String url, java.lang.String hash)
public void fillSnooper(Snooper snooper)
fillSnooper
インタフェース内 ISnooperInfo
public abstract boolean isDedicatedServer()
public boolean isServerInOnlineMode()
public void setOnlineMode(boolean online)
public boolean getPreventProxyConnections()
public void setPreventProxyConnections(boolean p_190517_1_)
public boolean getCanSpawnAnimals()
public void setCanSpawnAnimals(boolean spawnAnimals)
public boolean getCanSpawnNPCs()
public abstract boolean shouldUseNativeTransport()
public void setCanSpawnNPCs(boolean spawnNpcs)
public boolean isPVPEnabled()
public void setAllowPvp(boolean allowPvp)
public boolean isFlightAllowed()
public void setAllowFlight(boolean allow)
public abstract boolean isCommandBlockEnabled()
public java.lang.String getMOTD()
public void setMOTD(java.lang.String motdIn)
public int getBuildLimit()
public void setBuildLimit(int maxBuildHeight)
public boolean isServerStopped()
public PlayerList getPlayerList()
public void setPlayerList(PlayerList list)
public abstract boolean getPublic()
public void setGameType(GameType gameMode)
@Nullable public NetworkSystem getNetworkSystem()
public boolean serverIsInRunLoop()
public boolean getGuiEnabled()
public abstract boolean shareToLAN(GameType gameMode, boolean cheats, int port)
public int getTickCounter()
public void enableProfiling()
public Snooper getSnooper()
public int getSpawnProtectionSize()
public boolean isBlockProtected(World worldIn, BlockPos pos, PlayerEntity playerIn)
public void setForceGamemode(boolean force)
public boolean getForceGamemode()
public int getMaxPlayerIdleMinutes()
public void setPlayerIdleTimeout(int idleTimeout)
public com.mojang.authlib.minecraft.MinecraftSessionService getMinecraftSessionService()
public com.mojang.authlib.GameProfileRepository getGameProfileRepository()
public PlayerProfileCache getPlayerProfileCache()
public ServerStatusResponse getServerStatusResponse()
public void refreshStatusNextTick()
public int getMaxWorldSize()
public boolean shouldDeferTasks()
shouldDeferTasks
クラス内 RecursiveEventLoop<TickDelayedTask>
public java.lang.Thread getExecutionThread()
public int getNetworkCompressionThreshold()
public long getServerTime()
public com.mojang.datafixers.DataFixer getDataFixer()
public int getSpawnRadius(@Nullable ServerWorld worldIn)
public AdvancementManager getAdvancementManager()
public FunctionManager getFunctionManager()
public void reload()
public void kickPlayersNotWhitelisted(CommandSource commandSourceIn)
public IReloadableResourceManager getResourceManager()
public ResourcePackList<ResourcePackInfo> getResourcePacks()
public Commands getCommandManager()
public CommandSource getCommandSource()
public boolean shouldReceiveFeedback()
shouldReceiveFeedback
インタフェース内 ICommandSource
public boolean shouldReceiveErrors()
shouldReceiveErrors
インタフェース内 ICommandSource
public RecipeManager getRecipeManager()
public NetworkTagManager getNetworkTagManager()
public ServerScoreboard getScoreboard()
public CommandStorage func_229735_aN_()
public LootTableManager getLootTableManager()
public LootPredicateManager func_229736_aP_()
public GameRules getGameRules()
public CustomServerBossInfoManager getCustomBossEvents()
public boolean isWhitelistEnabled()
public void setWhitelistEnabled(boolean whitelistEnabledIn)
public float getTickTime()
public int getPermissionLevel(com.mojang.authlib.GameProfile profile)
public FrameTimer getFrameTimer()
public DebugProfiler getProfiler()
public java.util.concurrent.Executor getBackgroundExecutor()
public abstract boolean isServerOwner(com.mojang.authlib.GameProfile profileIn)
@Nullable public long[] getTickTime(DimensionType dim)
@Deprecated public java.util.Map<DimensionType,ServerWorld> forgeGetWorldMap()
@Deprecated public void markWorldsDirty()
public void dumpDebugInfo(java.nio.file.Path p_223711_1_) throws java.io.IOException
java.io.IOException