Package net.minecraft.client
Class Minecraft
- All Implemented Interfaces:
- WindowEventHandler,- AutoCloseable,- Executor,- ProfilerMeasured,- ProcessorHandle<Runnable>,- IForgeMinecraft
public class Minecraft
extends ReentrantBlockableEventLoop<Runnable>
implements WindowEventHandler, IForgeMinecraft
- 
Nested Class SummaryNested ClassesModifier and TypeClassDescriptionstatic enum(package private) static final record
- 
Field SummaryFieldsModifier and TypeFieldDescriptionprivate final booleanprivate final booleanstatic final ResourceLocationprivate final com.mojang.authlib.yggdrasil.YggdrasilAuthenticationServiceprivate final BlockColorsprivate final BlockEntityRenderDispatcherprivate final BlockRenderDispatcherprivate final ChatListenerprivate final CommandHistoryprivate TimerQuery.FrameProfileprivate Stringfinal DebugRendererstatic final ResourceLocationprivate Supplier<CrashReport>private final booleanprivate final DirectoryValidatorprivate final DownloadedPackSourceprivate final EntityModelSetprivate final EntityRenderDispatcherprivate final com.mojang.datafixers.DataFixerfinal Fontfinal Fontprivate final FontManagerprivate static intprivate final ContinuousProfilerprivate intprivate ProfileResultsprivate intprivate longfinal Fileprivate booleanfinal GameRendererprivate Threadprivate doubleprivate final GpuWarnlistManagerfinal Guiprivate final GuiSpriteManagerprivate final HotbarManager(package private) static Minecraftprivate final booleanprivate booleanprivate final ItemColorsprivate final ItemRendererfinal KeyboardHandlerprivate final LanguageManagerprivate InputTypeprivate longprivate longprivate final Stringfinal LevelRendererprivate final LevelStorageSourceprivate static final org.slf4j.Loggerprivate final RenderTargetprivate static final intprivate MetricsRecorderprivate final com.mojang.authlib.minecraft.MinecraftSessionServiceprotected intprivate final MobEffectTextureManagerprivate final ModelManagerfinal MouseHandlerprivate final MusicManagerprivate final GameNarratorbooleanstatic final booleanfinal Optionsprivate Overlayprivate final PaintingTextureManagerfinal ParticleEngineprivate booleanprivate floatprivate Connectionprivate CompletableFuture<Void>private final PlayerSocialManagerprivate final CompletableFuture<com.mojang.authlib.yggdrasil.ProfileResult>private final ProfileKeyPairManagerprivate ProfilerFillerprivate final AtomicReference<StoringChunkProgressListener>private final Proxyprivate final QuickPlayLogprivate final Realms32BitWarningStatusprivate final RealmsDataFetcherprivate floatprivate static final ResourceLocationprivate final PeriodicNotificationManagerprivate final ResourceLoadStateTrackerprivate final RenderBuffersprivate ReportingContextprivate static final CompletableFuture<Unit>private final ReloadableResourceManagerprivate final Pathprivate final PackRepositoryprivate intprivate booleanprivate longprivate final SearchRegistrybooleanbooleanprivate IntegratedServerprivate final SkinManagerbooleanprivate static final Componentprivate TutorialToastprivate final SoundManagerprivate final SplashManagerprivate final ClientTelemetryManagerfinal TextureManagerprivate final Timerprivate final ToastComponentprivate final Tutorialstatic final ResourceLocationstatic final Stringprivate final Userprivate final com.mojang.authlib.minecraft.UserApiServiceprivate final VanillaPackResourcesprivate final Stringprivate final VirtualScreenprivate final Windowprivate booleanboolean
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionprivate voidprivate voidaddCustomNbtData(ItemStack p_263370_, BlockEntity p_263368_) private voidaddInitialScreens(List<Function<Runnable, Screen>> p_297818_) private voidaddResourcePackLoadFailToast(Component p_273566_) booleanbooleanbooleanprivate PatharchiveProfilingReport(SystemReport p_167857_, List<Path> p_167858_) private RunnablebuildInitialScreens(Minecraft.GameLoadCookie p_299870_) private static booleanstatic ModCheckvoidclearClientLevel(Screen p_297406_) voidclearResourcePacksOnError(Throwable p_91242_, Component p_91243_, Minecraft.GameLoadCookie p_299857_) voidclose()private ProfilerFillerconstructProfiler(boolean p_167971_, SingleTickProfiler p_167972_) private voidcontinueAttack(boolean p_91387_) private static booleancountryEqualsISO3(Object p_210783_) static voidcrash(CrashReport p_91333_) voidprivate Stringprivate com.mojang.authlib.minecraft.UserApiServicecreateUserApiService(com.mojang.authlib.yggdrasil.YggdrasilAuthenticationService p_193586_, GameConfig p_193587_) voidprivate voidbooleandebugClientMetricsStart(Consumer<Component> p_167947_) private voidvoiddebugFpsMeterKeyPress(int p_91112_) voiddelayCrash(CrashReport p_231413_) voiddelayCrashRaw(CrashReport p_231440_) voiddestroy()voidvoiddisconnect(Screen p_91321_) voiddoWorldLoad(String p_261891_, LevelStorageSource.LevelStorageAccess p_261564_, PackRepository p_261826_, WorldStem p_261470_, boolean p_261465_) voidbooleanstatic voidfillReport(Minecraft p_167873_, LanguageManager p_167874_, String p_167875_, Options p_167876_, CrashReport p_167877_) fillReport(CrashReport p_91355_) private static SystemReportfillSystemReport(SystemReport p_167851_, Minecraft p_167852_, LanguageManager p_167853_, String p_167854_, Options p_167855_) private voidfinishProfilers(boolean p_91339_, SingleTickProfiler p_91340_) voidforceSetScreen(Screen p_91347_) floatcom.mojang.datafixers.DataFixerintgetFps()private intfloatlongcom.mojang.authlib.GameProfiledoublestatic Minecraftcom.mojang.authlib.minecraft.MinecraftSessionServicefloatgetProxy()protected Thread<T> SearchTree<T>getSearchTree(SearchRegistry.Key<T> p_231373_) getTextureAtlas(ResourceLocation p_91259_) getUser()private ComponentgrabHugeScreenshot(File p_167904_, int p_167905_, int p_167906_, int p_167907_, int p_167908_) grabPanoramixScreenshot(File p_167900_, int p_167901_, int p_167902_) private voidbooleanbooleanis64Bit()booleanfinal booleanisDemo()booleanbooleanbooleanisLocalPlayer(UUID p_298914_) booleanprivate booleanbooleanbooleanisPaused()booleanbooleanbooleanbooleancom.mojang.authlib.minecraft.BanDetailsprivate voidonFullscreenError(int p_91114_, long p_91115_) private voidonGameLoadFinished(Minecraft.GameLoadCookie p_300808_) private voidonResourceLoadFinished(Minecraft.GameLoadCookie p_299693_) private voidopenChatScreen(String p_91327_) voidpauseGame(boolean p_91359_) private void<T> voidpopulateSearchTree(SearchRegistry.Key<T> p_231375_, List<T> p_231376_) voidprivate CompletableFuture<Void>reloadResourcePacks(boolean p_168020_, Minecraft.GameLoadCookie p_300647_) private voidrenderFpsMeter(GuiGraphics p_281277_, ProfileResults p_281574_) static booleanbooleanvoidprivate voidrollbackResourcePacks(Throwable p_91240_, Minecraft.GameLoadCookie p_299515_) voidrun()private voidrunTick(boolean p_91384_) (package private) voidselectMainFont(boolean p_91337_) private voidselfTest()voidsetCameraEntity(Entity p_91119_) voidsetLastInputType(InputType p_265509_) voidsetLevel(ClientLevel p_91157_) voidsetOverlay(Overlay p_91151_) voidvoidsetWindowActive(boolean p_91261_) booleanshouldEntityAppearGlowing(Entity p_91315_) protected booleanbooleanprivate booleanprivate voidvoidstop()booleanvoidtick()private voidupdateLevelInEngines(ClientLevel p_91325_) voidupdateMaxMipLevel(int p_91313_) voidupdateReportEnvironment(ReportEnvironment p_239477_) private voidupdateScreenAndTick(Screen p_91363_) voidstatic booleanstatic booleanstatic booleanprotected RunnablewrapRunnable(Runnable p_91376_) Methods inherited from class net.minecraft.util.thread.ReentrantBlockableEventLoopdoRunTask, runningTask, scheduleExecutablesMethods inherited from class net.minecraft.util.thread.BlockableEventLoopdropAllTasks, execute, executeBlocking, executeIfPossible, getPendingTasksCount, isSameThread, managedBlock, name, pollTask, profiledMetrics, runAllTasks, submit, submit, submitAsync, tell, waitForTasksMethods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.minecraftforge.client.extensions.IForgeMinecraftgetLocale, popGuiLayer, pushGuiLayerMethods inherited from interface net.minecraft.util.thread.ProcessorHandleask, askEither
- 
Field Details- 
instance
- 
LOGGERprivate static final org.slf4j.Logger LOGGER
- 
ON_OSXpublic static final boolean ON_OSX
- 
MAX_TICKS_PER_UPDATEprivate static final int MAX_TICKS_PER_UPDATE- See Also:
 
- 
DEFAULT_FONT
- 
UNIFORM_FONT
- 
ALT_FONT
- 
REGIONAL_COMPLIANCIES
- 
RESOURCE_RELOAD_INITIAL_TASK
- 
SOCIAL_INTERACTIONS_NOT_AVAILABLE
- 
UPDATE_DRIVERS_ADVICE- See Also:
 
- 
resourcePackDirectory
- 
profileFuture
- 
textureManager
- 
fixerUpperprivate final com.mojang.datafixers.DataFixer fixerUpper
- 
virtualScreen
- 
window
- 
timer
- 
renderBuffers
- 
levelRenderer
- 
entityRenderDispatcher
- 
itemRenderer
- 
particleEngine
- 
searchRegistry
- 
user
- 
font
- 
fontFilterFishy
- 
gameRenderer
- 
debugRenderer
- 
progressListener
- 
gui
- 
options
- 
hotbarManager
- 
mouseHandler
- 
keyboardHandler
- 
lastInputType
- 
gameDirectory
- 
launchedVersion
- 
versionType
- 
proxy
- 
levelSource
- 
is64bitprivate final boolean is64bit
- 
demoprivate final boolean demo
- 
allowsMultiplayerprivate final boolean allowsMultiplayer
- 
allowsChatprivate final boolean allowsChat
- 
resourceManager
- 
vanillaPackResources
- 
downloadedPackSource
- 
resourcePackRepository
- 
languageManager
- 
blockColors
- 
itemColors
- 
mainRenderTarget
- 
soundManager
- 
musicManager
- 
fontManager
- 
splashManager
- 
gpuWarnlistManager
- 
regionalCompliancies
- 
authenticationServiceprivate final com.mojang.authlib.yggdrasil.YggdrasilAuthenticationService authenticationService
- 
minecraftSessionServiceprivate final com.mojang.authlib.minecraft.MinecraftSessionService minecraftSessionService
- 
userApiServiceprivate final com.mojang.authlib.minecraft.UserApiService userApiService
- 
skinManager
- 
modelManager
- 
blockRenderer
- 
paintingTextures
- 
mobEffectTextures
- 
guiSprites
- 
toast
- 
tutorial
- 
playerSocialManager
- 
entityModels
- 
blockEntityRenderDispatcher
- 
telemetryManager
- 
profileKeyPairManager
- 
realmsDataFetcher
- 
quickPlayLog
- 
gameMode
- 
level
- 
player
- 
singleplayerServer
- 
pendingConnection
- 
isLocalServerprivate boolean isLocalServer
- 
cameraEntity
- 
crosshairPickEntity
- 
hitResult
- 
rightClickDelayprivate int rightClickDelay
- 
missTimeprotected int missTime
- 
pauseprivate volatile boolean pause
- 
pausePartialTickprivate float pausePartialTick
- 
lastNanoTimeprivate long lastNanoTime
- 
lastTimeprivate long lastTime
- 
framesprivate int frames
- 
noRenderpublic boolean noRender
- 
screen
- 
overlay
- 
gameThread
- 
runningprivate volatile boolean running
- 
delayedCrash
- 
fpsprivate static int fps
- 
fpsString
- 
frameTimeNsprivate long frameTimeNs
- 
wireframepublic boolean wireframe
- 
sectionPathpublic boolean sectionPath
- 
sectionVisibilitypublic boolean sectionVisibility
- 
smartCullpublic boolean smartCull
- 
windowActiveprivate boolean windowActive
- 
progressTasks
- 
pendingReload
- 
profiler
- 
fpsPieRenderTicksprivate int fpsPieRenderTicks
- 
fpsPieProfiler
- 
fpsPieResults
- 
metricsRecorder
- 
reloadStateTracker
- 
savedCpuDurationprivate long savedCpuDuration
- 
gpuUtilizationprivate double gpuUtilization
- 
currentFrameProfile
- 
realms32BitWarningStatus
- 
narrator
- 
chatListener
- 
reportingContext
- 
commandHistory
- 
directoryValidator
- 
gameLoadFinishedprivate boolean gameLoadFinished
- 
debugPath
- 
realPartialTickprivate float realPartialTick
 
- 
- 
Constructor Details- 
Minecraft
 
- 
- 
Method Details- 
onResourceLoadFinished
- 
onGameLoadFinished
- 
isGameLoadFinishedpublic boolean isGameLoadFinished()
- 
buildInitialScreens
- 
addInitialScreens
- 
countryEqualsISO3
- 
updateTitlepublic void updateTitle()
- 
createTitle
- 
createUserApiServiceprivate com.mojang.authlib.minecraft.UserApiService createUserApiService(com.mojang.authlib.yggdrasil.YggdrasilAuthenticationService p_193586_, GameConfig p_193587_) 
- 
checkModStatus
- 
rollbackResourcePacksprivate void rollbackResourcePacks(Throwable p_91240_, @Nullable Minecraft.GameLoadCookie p_299515_) 
- 
clearResourcePacksOnErrorpublic void clearResourcePacksOnError(Throwable p_91242_, @Nullable Component p_91243_, @Nullable Minecraft.GameLoadCookie p_299857_) 
- 
abortResourcePackRecoveryprivate void abortResourcePackRecovery()
- 
addResourcePackLoadFailToast
- 
runpublic void run()
- 
selectMainFontvoid selectMainFont(boolean p_91337_) 
- 
createSearchTreespublic void createSearchTrees()
- 
onFullscreenErrorprivate void onFullscreenError(int p_91114_, long p_91115_) 
- 
checkIs64Bitprivate static boolean checkIs64Bit()
- 
getMainRenderTarget
- 
getLaunchedVersion
- 
getVersionType
- 
delayCrash
- 
delayCrashRaw
- 
crash
- 
isEnforceUnicodepublic boolean isEnforceUnicode()
- 
reloadResourcePacks
- 
reloadResourcePacksprivate CompletableFuture<Void> reloadResourcePacks(boolean p_168020_, @Nullable Minecraft.GameLoadCookie p_300647_) 
- 
selfTestprivate void selfTest()
- 
getLevelSource
- 
openChatScreen
- 
setScreen
- 
setOverlay
- 
destroypublic void destroy()
- 
closepublic void close()- Specified by:
- closein interface- AutoCloseable
- Specified by:
- closein interface- ProcessorHandle<Runnable>
 
- 
runTickprivate void runTick(boolean p_91384_) 
- 
constructProfiler
- 
finishProfilers
- 
resizeDisplaypublic void resizeDisplay()- Specified by:
- resizeDisplayin interface- WindowEventHandler
 
- 
cursorEnteredpublic void cursorEntered()- Specified by:
- cursorEnteredin interface- WindowEventHandler
 
- 
getFpspublic int getFps()
- 
getFrameTimeNspublic long getFrameTimeNs()
- 
getFramerateLimitprivate int getFramerateLimit()
- 
emergencySavepublic void emergencySave()
- 
debugClientMetricsStart
- 
debugClientMetricsStopprivate void debugClientMetricsStop()
- 
debugClientMetricsCancelprivate void debugClientMetricsCancel()
- 
archiveProfilingReport
- 
debugFpsMeterKeyPresspublic void debugFpsMeterKeyPress(int p_91112_) 
- 
renderFpsMeter
- 
stoppublic void stop()
- 
isRunningpublic boolean isRunning()
- 
pauseGamepublic void pauseGame(boolean p_91359_) 
- 
continueAttackprivate void continueAttack(boolean p_91387_) 
- 
startAttackprivate boolean startAttack()
- 
startUseItemprivate void startUseItem()
- 
getMusicManager
- 
tickpublic void tick()
- 
isMultiplayerServerprivate boolean isMultiplayerServer()
- 
handleKeybindsprivate void handleKeybinds()
- 
getTelemetryManager
- 
getGpuUtilizationpublic double getGpuUtilization()
- 
getProfileKeyPairManager
- 
createWorldOpenFlows
- 
doWorldLoadpublic void doWorldLoad(String p_261891_, LevelStorageSource.LevelStorageAccess p_261564_, PackRepository p_261826_, WorldStem p_261470_, boolean p_261465_) 
- 
setLevel
- 
disconnectpublic void disconnect()
- 
disconnect
- 
clearClientLevel
- 
updateScreenAndTick
- 
forceSetScreen
- 
updateLevelInEngines
- 
telemetryOptInExtrapublic boolean telemetryOptInExtra()
- 
extraTelemetryAvailablepublic boolean extraTelemetryAvailable()
- 
allowsTelemetrypublic boolean allowsTelemetry()
- 
allowsMultiplayerpublic boolean allowsMultiplayer()
- 
allowsRealmspublic boolean allowsRealms()
- 
multiplayerBan@Nullable public com.mojang.authlib.minecraft.BanDetails multiplayerBan()
- 
isNameBannedpublic boolean isNameBanned()
- 
isBlocked
- 
getChatStatus
- 
isDemopublic final boolean isDemo()
- 
getConnection
- 
renderNamespublic static boolean renderNames()
- 
useFancyGraphicspublic static boolean useFancyGraphics()
- 
useShaderTransparencypublic static boolean useShaderTransparency()
- 
useAmbientOcclusionpublic static boolean useAmbientOcclusion()
- 
pickBlockprivate void pickBlock()
- 
addCustomNbtData
- 
fillReport
- 
fillReportpublic static void fillReport(@Nullable Minecraft p_167873_, @Nullable LanguageManager p_167874_, String p_167875_, @Nullable Options p_167876_, CrashReport p_167877_) 
- 
fillSystemReportprivate static SystemReport fillSystemReport(SystemReport p_167851_, @Nullable Minecraft p_167852_, @Nullable LanguageManager p_167853_, String p_167854_, Options p_167855_) 
- 
getInstance
- 
delayTextureReload
- 
updateReportEnvironment
- 
getCurrentServer
- 
isLocalServerpublic boolean isLocalServer()
- 
hasSingleplayerServerpublic boolean hasSingleplayerServer()
- 
getSingleplayerServer
- 
isSingleplayerpublic boolean isSingleplayer()
- 
isLocalPlayer
- 
getUser
- 
getGameProfilepublic com.mojang.authlib.GameProfile getGameProfile()
- 
getProxy
- 
getTextureManager
- 
getResourceManager
- 
getResourcePackRepository
- 
getVanillaPackResources
- 
getDownloadedPackSource
- 
getResourcePackDirectory
- 
getLanguageManager
- 
getTextureAtlas
- 
is64Bitpublic boolean is64Bit()
- 
isPausedpublic boolean isPaused()
- 
getGpuWarnlistManager
- 
getSoundManager
- 
getSituationalMusic
- 
getMinecraftSessionServicepublic com.mojang.authlib.minecraft.MinecraftSessionService getMinecraftSessionService()
- 
getSkinManager
- 
getCameraEntity
- 
setCameraEntity
- 
shouldEntityAppearGlowing
- 
getRunningThread- Specified by:
- getRunningThreadin class- BlockableEventLoop<Runnable>
 
- 
wrapRunnable- Specified by:
- wrapRunnablein class- BlockableEventLoop<Runnable>
 
- 
shouldRun- Specified by:
- shouldRunin class- BlockableEventLoop<Runnable>
 
- 
getBlockRenderer
- 
getEntityRenderDispatcher
- 
getBlockEntityRenderDispatcher
- 
getItemRenderer
- 
getSearchTree
- 
populateSearchTree
- 
getFixerUpperpublic com.mojang.datafixers.DataFixer getFixerUpper()
- 
getFrameTimepublic float getFrameTime()
- 
getDeltaFrameTimepublic float getDeltaFrameTime()
- 
getBlockColors
- 
showOnlyReducedInfopublic boolean showOnlyReducedInfo()
- 
getToasts
- 
getTutorial
- 
isWindowActivepublic boolean isWindowActive()
- 
getHotbarManager
- 
getModelManager
- 
getPaintingTextures
- 
getMobEffectTextures
- 
getGuiSprites
- 
setWindowActivepublic void setWindowActive(boolean p_91261_) - Specified by:
- setWindowActivein interface- WindowEventHandler
 
- 
grabPanoramixScreenshot
- 
grabHugeScreenshot
- 
getProfiler
- 
getProgressListener
- 
getSplashManager
- 
getOverlay
- 
getPlayerSocialManager
- 
renderOnThreadpublic boolean renderOnThread()
- 
getWindow
- 
getDebugOverlay
- 
renderBuffers
- 
updateMaxMipLevelpublic void updateMaxMipLevel(int p_91313_) 
- 
getItemColors
- 
getSearchTreeManager
- 
getPartialTickpublic float getPartialTick()
- 
getEntityModels
- 
isTextFilteringEnabledpublic boolean isTextFilteringEnabled()
- 
prepareForMultiplayerpublic void prepareForMultiplayer()
- 
getRealms32BitWarningStatus
- 
getProfileKeySignatureValidator
- 
getLastInputType
- 
setLastInputType
- 
getNarrator
- 
getChatListener
- 
getReportingContext
- 
realmsDataFetcher
- 
quickPlayLog
- 
commandHistory
- 
directoryValidator
 
- 
socialInteractionsToast