public abstract class MinecraftServer extends java.lang.Object implements ICommandSender, java.lang.Runnable, IThreadListener, ISnooperInfo
Modifier and Type | Field and Description |
---|---|
private boolean |
allowFlight |
private ISaveFormat |
anvilConverterForAnvilFile |
private java.io.File |
anvilFile |
private com.mojang.authlib.yggdrasil.YggdrasilAuthenticationService |
authService |
private int |
buildLimit |
private boolean |
canSpawnAnimals |
private boolean |
canSpawnNPCs |
ICommandManager |
commandManager |
java.lang.String |
currentTask |
protected long |
currentTime |
private DataFixer |
dataFixer |
private boolean |
enableBonusChest |
private java.lang.String |
folderName |
java.util.Queue<java.util.concurrent.FutureTask<?>> |
futureTaskQueue |
private java.lang.String |
hostname |
private boolean |
isDemo |
private boolean |
isGamemodeForced |
private static org.apache.logging.log4j.Logger |
LOGGER |
private int |
maxPlayerIdleMinutes |
private java.lang.String |
motd |
private long |
nanoTimeSinceStatusRefresh |
private NetworkSystem |
networkSystem |
private boolean |
onlineMode |
int |
percentDone |
private PlayerList |
playerList |
private boolean |
preventProxyConnections |
private PlayerProfileCache |
profileCache |
Profiler |
profiler |
private com.mojang.authlib.GameProfileRepository |
profileRepo |
private boolean |
pvpEnabled |
private java.util.Random |
random |
private java.lang.String |
resourcePackHash |
private java.lang.String |
resourcePackUrl |
private boolean |
serverIsRunning |
private java.security.KeyPair |
serverKeyPair |
private java.lang.String |
serverOwner |
private int |
serverPort |
protected java.net.Proxy |
serverProxy |
private boolean |
serverRunning |
private boolean |
serverStopped |
private java.lang.Thread |
serverThread |
private com.mojang.authlib.minecraft.MinecraftSessionService |
sessionService |
private boolean |
startProfiling |
private ServerStatusResponse |
statusResponse |
private java.util.List<ITickable> |
tickables |
private int |
tickCounter |
long[] |
tickTimeArray |
private long |
timeOfLastWarning |
private Snooper |
usageSnooper |
static java.io.File |
USER_CACHE_FILE |
private java.lang.String |
userMessage |
private boolean |
worldIconSet |
private java.lang.String |
worldName |
WorldServer[] |
worlds |
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 |
---|---|
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) |
boolean |
allowSpawnMonsters() |
void |
applyServerIconToResponse(ServerStatusResponse response) |
<V> com.google.common.util.concurrent.ListenableFuture<V> |
callFromMainThread(java.util.concurrent.Callable<V> callable) |
void |
canCreateBonusChest(boolean enable) |
abstract boolean |
canStructuresSpawn() |
boolean |
canUseCommand(int permLevel,
java.lang.String commandName) |
protected void |
clearCurrentTask() |
void |
convertMapIfNeeded(java.lang.String worldNameIn) |
ServerCommandManager |
createCommandManager() |
void |
enableProfiling() |
void |
finalTick(CrashReport report) |
ISaveFormat |
getActiveAnvilConverter() |
AdvancementManager |
getAdvancementManager() |
boolean |
getAllowNether() |
int |
getBuildLimit() |
boolean |
getCanSpawnAnimals() |
boolean |
getCanSpawnNPCs() |
ICommandManager |
getCommandManager() |
int |
getCurrentPlayerCount() |
long |
getCurrentTime() |
static long |
getCurrentTimeMillis() |
java.io.File |
getDataDirectory() |
DataFixer |
getDataFixer() |
abstract EnumDifficulty |
getDifficulty() |
Entity |
getEntityFromUuid(java.util.UUID uuid) |
World |
getEntityWorld() |
java.io.File |
getFile(java.lang.String fileName) |
java.lang.String |
getFolderName() |
boolean |
getForceGamemode() |
FunctionManager |
getFunctionManager() |
com.mojang.authlib.GameProfileRepository |
getGameProfileRepository() |
abstract 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() |
java.lang.String[] |
getOnlinePlayerNames() |
com.mojang.authlib.GameProfile[] |
getOnlinePlayerProfiles() |
abstract int |
getOpPermissionLevel() |
PlayerList |
getPlayerList() |
PlayerProfileCache |
getPlayerProfileCache() |
Snooper |
getPlayerUsageSnooper() |
boolean |
getPreventProxyConnections() |
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() |
WorldServer |
getWorld(int dimension) |
java.io.File |
getWorldIconFile() |
java.lang.String |
getWorldName() |
abstract boolean |
init() |
void |
initialWorldChunkLoad() |
void |
initiateShutdown() |
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() |
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 |
reload() |
void |
run() |
void |
saveAllWorlds(boolean isSilent) |
boolean |
sendCommandFeedback() |
void |
sendMessage(ITextComponent component) |
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) |
void |
setDifficultyForAllWorlds(EnumDifficulty difficulty) |
void |
setFolderName(java.lang.String name) |
void |
setForceGamemode(boolean force) |
void |
setGameType(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 |
setPreventProxyConnections(boolean p_190517_1_) |
void |
setResourcePack(java.lang.String url,
java.lang.String hash) |
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(GameType type,
boolean allowCheats) |
abstract boolean |
shouldBroadcastConsoleToOps() |
abstract boolean |
shouldBroadcastRconToOps() |
abstract boolean |
shouldUseNativeTransport() |
void |
startServerThread() |
void |
stopServer() |
void |
systemExitNow() |
void |
tick() |
void |
updateTimeLightAndEntities() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getCommandSenderEntity, getDisplayName, getPosition, getPositionVector, setCommandStat
private static final org.apache.logging.log4j.Logger LOGGER
public static final java.io.File USER_CACHE_FILE
private final ISaveFormat anvilConverterForAnvilFile
private final Snooper usageSnooper
private final java.io.File anvilFile
private final java.util.List<ITickable> tickables
public final ICommandManager commandManager
public final Profiler profiler
private final NetworkSystem networkSystem
private final ServerStatusResponse statusResponse
private final java.util.Random random
private final DataFixer dataFixer
private java.lang.String hostname
private int serverPort
public WorldServer[] worlds
private PlayerList playerList
private boolean serverRunning
private boolean serverStopped
private int tickCounter
protected final java.net.Proxy serverProxy
public java.lang.String currentTask
public int percentDone
private boolean onlineMode
private boolean preventProxyConnections
private boolean canSpawnAnimals
private boolean canSpawnNPCs
private boolean pvpEnabled
private boolean allowFlight
private java.lang.String motd
private int buildLimit
private int maxPlayerIdleMinutes
public final long[] tickTimeArray
public java.util.Hashtable<java.lang.Integer,long[]> worldTickTimes
private java.security.KeyPair serverKeyPair
private java.lang.String serverOwner
private java.lang.String folderName
private java.lang.String worldName
private boolean isDemo
private boolean enableBonusChest
private java.lang.String resourcePackUrl
private java.lang.String resourcePackHash
private boolean serverIsRunning
private long timeOfLastWarning
private java.lang.String userMessage
private boolean startProfiling
private boolean isGamemodeForced
private final com.mojang.authlib.yggdrasil.YggdrasilAuthenticationService authService
private final com.mojang.authlib.minecraft.MinecraftSessionService sessionService
private final com.mojang.authlib.GameProfileRepository profileRepo
private final PlayerProfileCache profileCache
private long nanoTimeSinceStatusRefresh
public final java.util.Queue<java.util.concurrent.FutureTask<?>> futureTaskQueue
private java.lang.Thread serverThread
protected long currentTime
private boolean worldIconSet
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)
public ServerCommandManager createCommandManager()
public abstract boolean init() throws java.io.IOException
java.io.IOException
public void convertMapIfNeeded(java.lang.String worldNameIn)
protected void setUserMessage(java.lang.String message)
@Nullable public java.lang.String getUserMessage()
public void loadAllWorlds(java.lang.String saveName, java.lang.String worldNameIn, long seed, WorldType type, java.lang.String generatorOptions)
public void initialWorldChunkLoad()
public void setResourcePackFromWorld(java.lang.String worldNameIn, ISaveHandler saveHandlerIn)
public abstract boolean canStructuresSpawn()
public abstract 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 isSilent)
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()
public void finalTick(CrashReport report)
public 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 getWorld(int dimension)
public java.lang.String getMinecraftVersion()
public int getCurrentPlayerCount()
public int getMaxPlayers()
public java.lang.String[] getOnlinePlayerNames()
public com.mojang.authlib.GameProfile[] getOnlinePlayerProfiles()
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 sendMessage(ITextComponent component)
sendMessage
in interface ICommandSender
public boolean canUseCommand(int permLevel, java.lang.String commandName)
canUseCommand
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)
public 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 getPreventProxyConnections()
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(GameType gameMode)
public NetworkSystem getNetworkSystem()
public boolean serverIsInRunLoop()
public boolean getGuiEnabled()
public abstract java.lang.String shareToLAN(GameType type, boolean allowCheats)
public int getTickCounter()
public void enableProfiling()
public Snooper getPlayerUsageSnooper()
public World getEntityWorld()
getEntityWorld
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 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 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 int getSpawnRadius(@Nullable WorldServer worldIn)
public AdvancementManager getAdvancementManager()
public FunctionManager getFunctionManager()
public void reload()
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 void setPreventProxyConnections(boolean p_190517_1_)
public int getSpawnProtectionSize()
public void setForceGamemode(boolean force)
public long getCurrentTime()
public java.lang.Thread getServerThread()
public DataFixer getDataFixer()