public abstract class MinecraftServer extends java.lang.Object implements java.lang.Runnable, ICommandSender, IThreadListener, ISnooperInfo
Modifier and Type | Field and Description |
---|---|
protected ICommandManager |
commandManager |
java.lang.String |
currentTask |
protected java.util.Queue<java.util.concurrent.FutureTask<?>> |
futureTaskQueue |
int |
percentDone |
protected java.net.Proxy |
serverProxy |
Profiler |
theProfiler |
long[] |
tickTimeArray |
static java.io.File |
USER_CACHE_FILE |
WorldServer[] |
worldServers |
java.util.Hashtable<java.lang.Integer,long[]> |
worldTickTimes |
Constructor and Description |
---|
MinecraftServer(java.io.File anvilFileIn,
java.net.Proxy proxyIn,
DataFixer dataFixerIn,
com.mojang.authlib.yggdrasil.YggdrasilAuthenticationService authServiceIn,
com.mojang.authlib.minecraft.MinecraftSessionService sessionServiceIn,
com.mojang.authlib.GameProfileRepository profileRepoIn,
PlayerProfileCache profileCacheIn) |
Modifier and Type | Method and Description |
---|---|
void |
addChatMessage(ITextComponent component) |
com.google.common.util.concurrent.ListenableFuture<java.lang.Object> |
addScheduledTask(java.lang.Runnable runnableToSchedule) |
CrashReport |
addServerInfoToCrashReport(CrashReport report) |
void |
addServerStatsToSnooper(Snooper playerSnooper) |
void |
addServerTypeToSnooper(Snooper playerSnooper) |
protected boolean |
allowSpawnMonsters() |
void |
applyServerIconToResponse(ServerStatusResponse response) |
<V> com.google.common.util.concurrent.ListenableFuture<V> |
callFromMainThread(java.util.concurrent.Callable<V> callable) |
boolean |
canCommandSenderUseCommand(int permLevel,
java.lang.String commandName) |
void |
canCreateBonusChest(boolean enable) |
abstract boolean |
canStructuresSpawn() |
protected void |
clearCurrentTask() |
protected void |
convertMapIfNeeded(java.lang.String worldNameIn) |
protected ServerCommandManager |
createNewCommandManager() |
void |
enableProfiling() |
protected void |
finalTick(CrashReport report) |
ISaveFormat |
getActiveAnvilConverter() |
boolean |
getAllowNether() |
java.lang.String[] |
getAllUsernames() |
int |
getBuildLimit() |
boolean |
getCanSpawnAnimals() |
boolean |
getCanSpawnNPCs() |
ICommandManager |
getCommandManager() |
Entity |
getCommandSenderEntity() |
int |
getCurrentPlayerCount() |
long |
getCurrentTime() |
static long |
getCurrentTimeMillis() |
java.io.File |
getDataDirectory() |
DataFixer |
getDataFixer() |
abstract EnumDifficulty |
getDifficulty() |
ITextComponent |
getDisplayName() |
Entity |
getEntityFromUuid(java.util.UUID uuid) |
World |
getEntityWorld() |
java.io.File |
getFile(java.lang.String fileName) |
java.lang.String |
getFolderName() |
boolean |
getForceGamemode() |
com.mojang.authlib.GameProfileRepository |
getGameProfileRepository() |
com.mojang.authlib.GameProfile[] |
getGameProfiles() |
abstract WorldSettings.GameType |
getGameType() |
boolean |
getGuiEnabled() |
java.security.KeyPair |
getKeyPair() |
int |
getMaxPlayerIdleMinutes() |
int |
getMaxPlayers() |
int |
getMaxWorldSize() |
com.mojang.authlib.minecraft.MinecraftSessionService |
getMinecraftSessionService() |
java.lang.String |
getMinecraftVersion() |
java.lang.String |
getMOTD() |
java.lang.String |
getName() |
int |
getNetworkCompressionThreshold() |
NetworkSystem |
getNetworkSystem() |
abstract int |
getOpPermissionLevel() |
PlayerList |
getPlayerList() |
PlayerProfileCache |
getPlayerProfileCache() |
Snooper |
getPlayerUsageSnooper() |
BlockPos |
getPosition() |
Vec3d |
getPositionVector() |
java.lang.String |
getResourcePackHash() |
java.lang.String |
getResourcePackUrl() |
MinecraftServer |
getServer() |
java.lang.String |
getServerHostname() |
java.lang.String |
getServerModName() |
java.lang.String |
getServerOwner() |
int |
getServerPort() |
java.net.Proxy |
getServerProxy() |
ServerStatusResponse |
getServerStatusResponse() |
java.lang.Thread |
getServerThread() |
int |
getSpawnProtectionSize() |
int |
getSpawnRadius(WorldServer worldIn) |
java.util.List<java.lang.String> |
getTabCompletions(ICommandSender sender,
java.lang.String input,
BlockPos pos,
boolean hasTargetBlock) |
int |
getTickCounter() |
java.lang.String |
getUserMessage() |
java.io.File |
getWorldIconFile() |
java.lang.String |
getWorldName() |
protected void |
initialWorldChunkLoad() |
void |
initiateShutdown() |
boolean |
isAnnouncingPlayerAchievements() |
boolean |
isAnvilFileSet() |
boolean |
isBlockProtected(World worldIn,
BlockPos pos,
EntityPlayer playerIn) |
boolean |
isCallingFromMinecraftThread() |
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() |
boolean |
isWorldIconSet() |
protected void |
loadAllWorlds(java.lang.String saveName,
java.lang.String worldNameIn,
long seed,
WorldType type,
java.lang.String generatorOptions) |
void |
logDebug(java.lang.String msg) |
void |
logInfo(java.lang.String msg) |
void |
logSevere(java.lang.String msg) |
void |
logWarning(java.lang.String msg) |
static void |
main(java.lang.String[] p_main_0_) |
protected void |
outputPercentRemaining(java.lang.String message,
int percent) |
void |
refreshStatusNextTick() |
void |
registerTickable(ITickable tickable) |
void |
run() |
void |
saveAllWorlds(boolean dontLog) |
boolean |
sendCommandFeedback() |
boolean |
serverIsInRunLoop() |
void |
setAllowFlight(boolean allow) |
void |
setAllowPvp(boolean allowPvp) |
void |
setBuildLimit(int maxBuildHeight) |
void |
setCanSpawnAnimals(boolean spawnAnimals) |
void |
setCanSpawnNPCs(boolean spawnNpcs) |
void |
setCommandStat(CommandResultStats.Type type,
int amount) |
void |
setDemo(boolean demo) |
void |
setDifficultyForAllWorlds(EnumDifficulty difficulty) |
void |
setFolderName(java.lang.String name) |
void |
setForceGamemode(boolean force) |
void |
setGameType(WorldSettings.GameType gameMode) |
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 |
setResourcePack(java.lang.String url,
java.lang.String hash) |
protected void |
setResourcePackFromWorld(java.lang.String worldNameIn,
ISaveHandler saveHandlerIn) |
void |
setServerOwner(java.lang.String owner) |
void |
setServerPort(int port) |
protected void |
setUserMessage(java.lang.String message) |
void |
setWorldName(java.lang.String worldNameIn) |
abstract java.lang.String |
shareToLAN(WorldSettings.GameType type,
boolean allowCheats) |
abstract boolean |
shouldBroadcastConsoleToOps() |
abstract boolean |
shouldBroadcastRconToOps() |
abstract boolean |
shouldUseNativeTransport() |
protected abstract boolean |
startServer() |
void |
startServerThread() |
void |
stopServer() |
protected void |
systemExitNow() |
void |
tick() |
void |
updateTimeLightAndEntities() |
WorldServer |
worldServerForDimension(int dimension) |
public static final java.io.File USER_CACHE_FILE
protected final ICommandManager commandManager
public final Profiler theProfiler
public WorldServer[] worldServers
protected final java.net.Proxy serverProxy
public java.lang.String currentTask
public int percentDone
public final long[] tickTimeArray
public java.util.Hashtable<java.lang.Integer,long[]> worldTickTimes
protected final java.util.Queue<java.util.concurrent.FutureTask<?>> futureTaskQueue
public MinecraftServer(java.io.File anvilFileIn, java.net.Proxy proxyIn, DataFixer dataFixerIn, com.mojang.authlib.yggdrasil.YggdrasilAuthenticationService authServiceIn, com.mojang.authlib.minecraft.MinecraftSessionService sessionServiceIn, com.mojang.authlib.GameProfileRepository profileRepoIn, PlayerProfileCache profileCacheIn)
protected ServerCommandManager createNewCommandManager()
protected abstract boolean startServer() throws java.io.IOException
java.io.IOException
protected void convertMapIfNeeded(java.lang.String worldNameIn)
protected void setUserMessage(java.lang.String message)
public java.lang.String getUserMessage()
protected void loadAllWorlds(java.lang.String saveName, java.lang.String worldNameIn, long seed, WorldType type, java.lang.String generatorOptions)
protected void initialWorldChunkLoad()
protected void setResourcePackFromWorld(java.lang.String worldNameIn, ISaveHandler saveHandlerIn)
public abstract boolean canStructuresSpawn()
public abstract WorldSettings.GameType getGameType()
public abstract EnumDifficulty getDifficulty()
public abstract boolean isHardcore()
public abstract int getOpPermissionLevel()
public abstract boolean shouldBroadcastRconToOps()
public abstract boolean shouldBroadcastConsoleToOps()
protected void outputPercentRemaining(java.lang.String message, int percent)
protected void clearCurrentTask()
public void saveAllWorlds(boolean dontLog)
public void stopServer()
public boolean isServerRunning()
public void initiateShutdown()
public void run()
run
in interface java.lang.Runnable
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()
public void tick()
public void updateTimeLightAndEntities()
public boolean getAllowNether()
public void startServerThread()
public java.io.File getFile(java.lang.String fileName)
public void logWarning(java.lang.String msg)
public WorldServer worldServerForDimension(int dimension)
public java.lang.String getMinecraftVersion()
public int getCurrentPlayerCount()
public int getMaxPlayers()
public java.lang.String[] getAllUsernames()
public com.mojang.authlib.GameProfile[] getGameProfiles()
public java.lang.String getServerModName()
public CrashReport addServerInfoToCrashReport(CrashReport report)
public java.util.List<java.lang.String> getTabCompletions(ICommandSender sender, java.lang.String input, @Nullable BlockPos pos, boolean hasTargetBlock)
public boolean isAnvilFileSet()
public java.lang.String getName()
getName
in interface ICommandSender
public void addChatMessage(ITextComponent component)
addChatMessage
in interface ICommandSender
public boolean canCommandSenderUseCommand(int permLevel, java.lang.String commandName)
canCommandSenderUseCommand
in interface ICommandSender
public ICommandManager getCommandManager()
public java.security.KeyPair getKeyPair()
public java.lang.String getServerOwner()
public void setServerOwner(java.lang.String owner)
public boolean isSinglePlayer()
public java.lang.String getFolderName()
public void setFolderName(java.lang.String name)
public void setWorldName(java.lang.String worldNameIn)
public java.lang.String getWorldName()
public void setKeyPair(java.security.KeyPair keyPair)
public void setDifficultyForAllWorlds(EnumDifficulty difficulty)
protected boolean allowSpawnMonsters()
public boolean isDemo()
public void setDemo(boolean demo)
public void canCreateBonusChest(boolean enable)
public ISaveFormat getActiveAnvilConverter()
public java.lang.String getResourcePackUrl()
public java.lang.String getResourcePackHash()
public void setResourcePack(java.lang.String url, java.lang.String hash)
public void addServerStatsToSnooper(Snooper playerSnooper)
addServerStatsToSnooper
in interface ISnooperInfo
public void addServerTypeToSnooper(Snooper playerSnooper)
addServerTypeToSnooper
in interface ISnooperInfo
public boolean isSnooperEnabled()
isSnooperEnabled
in interface ISnooperInfo
public abstract boolean isDedicatedServer()
public boolean isServerInOnlineMode()
public void setOnlineMode(boolean online)
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 void setGameType(WorldSettings.GameType gameMode)
public NetworkSystem getNetworkSystem()
public boolean serverIsInRunLoop()
public boolean getGuiEnabled()
public abstract java.lang.String shareToLAN(WorldSettings.GameType type, boolean allowCheats)
public int getTickCounter()
public void enableProfiling()
public Snooper getPlayerUsageSnooper()
public BlockPos getPosition()
getPosition
in interface ICommandSender
public Vec3d getPositionVector()
getPositionVector
in interface ICommandSender
public World getEntityWorld()
getEntityWorld
in interface ICommandSender
public Entity getCommandSenderEntity()
getCommandSenderEntity
in interface ICommandSender
public boolean isBlockProtected(World worldIn, BlockPos pos, EntityPlayer playerIn)
public boolean getForceGamemode()
public java.net.Proxy getServerProxy()
public static long getCurrentTimeMillis()
public int getMaxPlayerIdleMinutes()
public void setPlayerIdleTimeout(int idleTimeout)
public ITextComponent getDisplayName()
getDisplayName
in interface ICommandSender
public boolean isAnnouncingPlayerAchievements()
public com.mojang.authlib.minecraft.MinecraftSessionService getMinecraftSessionService()
public com.mojang.authlib.GameProfileRepository getGameProfileRepository()
public PlayerProfileCache getPlayerProfileCache()
public ServerStatusResponse getServerStatusResponse()
public void refreshStatusNextTick()
@Nullable public Entity getEntityFromUuid(java.util.UUID uuid)
public boolean sendCommandFeedback()
sendCommandFeedback
in interface ICommandSender
public void setCommandStat(CommandResultStats.Type type, int amount)
setCommandStat
in interface ICommandSender
public MinecraftServer getServer()
getServer
in interface ICommandSender
public int getMaxWorldSize()
public <V> com.google.common.util.concurrent.ListenableFuture<V> callFromMainThread(java.util.concurrent.Callable<V> callable)
public com.google.common.util.concurrent.ListenableFuture<java.lang.Object> addScheduledTask(java.lang.Runnable runnableToSchedule)
addScheduledTask
in interface IThreadListener
public boolean isCallingFromMinecraftThread()
isCallingFromMinecraftThread
in interface IThreadListener
public int getNetworkCompressionThreshold()
public DataFixer getDataFixer()
public int getSpawnRadius(@Nullable WorldServer worldIn)
public java.lang.String getServerHostname()
public void setHostname(java.lang.String host)
public void registerTickable(ITickable tickable)
public static void main(java.lang.String[] p_main_0_)
public void logInfo(java.lang.String msg)
public boolean isDebuggingEnabled()
public void logSevere(java.lang.String msg)
public void logDebug(java.lang.String msg)
public int getServerPort()
public void setServerPort(int port)
public int getSpawnProtectionSize()
public void setForceGamemode(boolean force)
public long getCurrentTime()
public java.lang.Thread getServerThread()