Package net.minecraft.client
Class Minecraft
- All Implemented Interfaces:
WindowEventHandler
,AutoCloseable
,Executor
,ProfilerMeasured
,ProcessorHandle<Runnable>
,IMinecraftExtension
public class Minecraft
extends ReentrantBlockableEventLoop<Runnable>
implements WindowEventHandler, IMinecraftExtension
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic enum
(package private) static final record
-
Field Summary
Modifier and TypeFieldDescriptionprivate final boolean
private final boolean
static final ResourceLocation
private final com.mojang.authlib.yggdrasil.YggdrasilAuthenticationService
private final BlockColors
private final BlockEntityRenderDispatcher
private final BlockRenderDispatcher
private final long
private final ChatListener
private boolean
private final long
private long
private final CommandHistory
private TimerQuery.FrameProfile
private String
final DebugRenderer
static final ResourceLocation
private Supplier<CrashReport>
private final boolean
private final DirectoryValidator
private final DownloadedPackSource
private final EntityModelSet
private final EntityRenderDispatcher
private final com.mojang.datafixers.DataFixer
final Font
final Font
private final FontManager
private static int
private final ContinuousProfiler
private int
private ProfileResults
private int
private long
final File
private boolean
final GameRenderer
private Thread
private double
private final GpuWarnlistManager
final Gui
private final GuiSpriteManager
private final HotbarManager
(package private) static Minecraft
private final boolean
private boolean
private final ItemColors
private final ItemRenderer
final KeyboardHandler
private final LanguageManager
private InputType
private long
private long
private final String
final LevelRenderer
private final LevelStorageSource
private static final org.slf4j.Logger
private final RenderTarget
private static final int
private MetricsRecorder
private final com.mojang.authlib.minecraft.MinecraftSessionService
protected int
private final MobEffectTextureManager
private final ModelManager
final MouseHandler
private final MusicManager
private final GameNarrator
boolean
static final boolean
final Options
private Overlay
private final PaintingTextureManager
final ParticleEngine
private boolean
private float
private Connection
private CompletableFuture<Void>
private final PlayerSocialManager
private final CompletableFuture<com.mojang.authlib.yggdrasil.ProfileResult>
private final ProfileKeyPairManager
private ProfilerFiller
private final AtomicReference<StoringChunkProgressListener>
private final Proxy
private final QuickPlayLog
private final Realms32BitWarningStatus
private final RealmsDataFetcher
private float
private static final ResourceLocation
private final PeriodicNotificationManager
private final ResourceLoadStateTracker
private final RenderBuffers
private ReportingContext
private static final CompletableFuture<Unit>
private final ReloadableResourceManager
private final Path
private final PackRepository
private int
private boolean
private long
private final SearchRegistry
boolean
boolean
private IntegratedServer
private final SkinManager
boolean
private static final Component
private TutorialToast
private final SoundManager
private final SplashManager
private final ClientTelemetryManager
final TextureManager
private final Timer
private final ToastComponent
private final Tutorial
static final ResourceLocation
static final String
private final User
private final com.mojang.authlib.minecraft.UserApiService
private final CompletableFuture<com.mojang.authlib.minecraft.UserApiService.UserProperties>
private final VanillaPackResources
private final String
private final VirtualScreen
private final Window
private boolean
boolean
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprivate void
private void
addCustomNbtData
(ItemStack p_263370_, BlockEntity p_263368_) private void
addInitialScreens
(List<Function<Runnable, Screen>> p_300000_) private void
addResourcePackLoadFailToast
(Component p_273566_) boolean
boolean
boolean
private Path
archiveProfilingReport
(SystemReport p_167857_, List<Path> p_167858_) private Runnable
buildInitialScreens
(Minecraft.GameLoadCookie p_299894_) boolean
private static boolean
static ModCheck
void
clearClientLevel
(Screen p_294558_) void
void
clearResourcePacksOnError
(Throwable p_91242_, Component p_91243_, Minecraft.GameLoadCookie p_299892_) void
close()
private ProfilerFiller
constructProfiler
(boolean p_167971_, SingleTickProfiler p_167972_) private void
continueAttack
(boolean p_91387_) private static boolean
countryEqualsISO3
(Object p_210783_) static void
crash
(Minecraft p_307414_, File p_307228_, CrashReport p_91333_) void
private String
private com.mojang.authlib.minecraft.UserApiService
createUserApiService
(com.mojang.authlib.yggdrasil.YggdrasilAuthenticationService p_193586_, GameConfig p_193587_) void
private void
boolean
debugClientMetricsStart
(Consumer<Component> p_167947_) private void
void
debugFpsMeterKeyPress
(int p_91112_) void
delayCrash
(CrashReport p_231413_) void
delayCrashRaw
(CrashReport p_231440_) void
destroy()
void
void
disconnect
(Screen p_91321_) void
doWorldLoad
(LevelStorageSource.LevelStorageAccess p_261564_, PackRepository p_261826_, WorldStem p_261470_, boolean p_261465_) private void
void
emergencySaveAndCrash
(CrashReport p_307515_) boolean
static void
fillReport
(Minecraft p_167873_, LanguageManager p_167874_, String p_167875_, Options p_167876_, CrashReport p_167877_) fillReport
(CrashReport p_91355_) private static SystemReport
fillSystemReport
(SystemReport p_167851_, Minecraft p_167852_, LanguageManager p_167853_, String p_167854_, Options p_167855_) private void
fillUptime
(CrashReportCategory p_304858_) private void
finishProfilers
(boolean p_91339_, SingleTickProfiler p_91340_) void
forceSetScreen
(Screen p_91347_) private static String
formatSeconds
(double p_304493_) float
com.mojang.datafixers.DataFixer
int
getFps()
private int
float
long
com.mojang.authlib.GameProfile
double
static Minecraft
static String
com.mojang.authlib.minecraft.MinecraftSessionService
float
getProxy()
protected Thread
<T> SearchTree<T>
getSearchTree
(SearchRegistry.Key<T> p_231373_) getTextureAtlas
(ResourceLocation p_91259_) private float
getTickTargetMillis
(float p_308953_) getUser()
private Component
grabHugeScreenshot
(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 void
private void
boolean
boolean
is64Bit()
boolean
final boolean
isDemo()
boolean
boolean
boolean
isLocalPlayer
(UUID p_295141_) boolean
private boolean
boolean
boolean
isPaused()
boolean
boolean
boolean
boolean
com.mojang.authlib.minecraft.BanDetails
private void
onFullscreenError
(int p_91114_, long p_91115_) private void
onGameLoadFinished
(Minecraft.GameLoadCookie p_299836_) private void
onResourceLoadFinished
(Minecraft.GameLoadCookie p_299896_) private void
openChatScreen
(String p_91327_) void
pauseGame
(boolean p_91359_) private void
<T> void
populateSearchTree
(SearchRegistry.Key<T> p_231375_, List<T> p_231376_) void
private CompletableFuture<Void>
reloadResourcePacks
(boolean p_168020_, Minecraft.GameLoadCookie p_299856_) private void
renderFpsMeter
(GuiGraphics p_281277_, ProfileResults p_281574_) static boolean
boolean
void
private void
rollbackResourcePacks
(Throwable p_91240_, Minecraft.GameLoadCookie p_299846_) void
run()
private void
runTick
(boolean p_91384_) (package private) void
selectMainFont
(boolean p_91337_) private void
selfTest()
void
setCameraEntity
(Entity p_91119_) void
setLastInputType
(InputType p_265509_) void
setLevel
(ClientLevel p_91157_) void
setOverlay
(Overlay p_91151_) void
void
setWindowActive
(boolean p_91261_) boolean
shouldEntityAppearGlowing
(Entity p_91315_) protected boolean
boolean
private boolean
private void
void
stop()
boolean
void
tick()
private void
updateLevelInEngines
(ClientLevel p_91325_) void
updateMaxMipLevel
(int p_91313_) void
updateReportEnvironment
(ReportEnvironment p_239477_) private void
updateScreenAndTick
(Screen p_91363_) void
static boolean
static boolean
private com.mojang.authlib.minecraft.UserApiService.UserProperties
static boolean
protected Runnable
wrapRunnable
(Runnable p_91376_) Methods inherited from class net.minecraft.util.thread.ReentrantBlockableEventLoop
doRunTask, runningTask, scheduleExecutables
Methods inherited from class net.minecraft.util.thread.BlockableEventLoop
dropAllTasks, execute, executeBlocking, executeIfPossible, getPendingTasksCount, isSameThread, managedBlock, name, pollTask, profiledMetrics, runAllTasks, submit, submit, submitAsync, tell, waitForTasks
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface net.neoforged.neoforge.client.extensions.IMinecraftExtension
getLocale, popGuiLayer, pushGuiLayer
Methods inherited from interface net.minecraft.util.thread.ProcessorHandle
ask, askEither
-
Field Details
-
instance
-
LOGGER
private static final org.slf4j.Logger LOGGER -
ON_OSX
public static final boolean ON_OSX -
MAX_TICKS_PER_UPDATE
private 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:
-
canary
private final long canary -
resourcePackDirectory
-
profileFuture
-
textureManager
-
fixerUpper
private 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
-
is64bit
private final boolean is64bit -
demo
private final boolean demo -
allowsMultiplayer
private final boolean allowsMultiplayer -
allowsChat
private final boolean allowsChat -
resourceManager
-
vanillaPackResources
-
downloadedPackSource
-
resourcePackRepository
-
languageManager
-
blockColors
-
itemColors
-
mainRenderTarget
-
soundManager
-
musicManager
-
fontManager
-
splashManager
-
gpuWarnlistManager
-
regionalCompliancies
-
authenticationService
private final com.mojang.authlib.yggdrasil.YggdrasilAuthenticationService authenticationService -
minecraftSessionService
private final com.mojang.authlib.minecraft.MinecraftSessionService minecraftSessionService -
userApiService
private final com.mojang.authlib.minecraft.UserApiService userApiService -
userPropertiesFuture
private final CompletableFuture<com.mojang.authlib.minecraft.UserApiService.UserProperties> userPropertiesFuture -
skinManager
-
modelManager
-
blockRenderer
-
paintingTextures
-
mobEffectTextures
-
guiSprites
-
toast
-
tutorial
-
playerSocialManager
-
entityModels
-
blockEntityRenderDispatcher
-
telemetryManager
-
profileKeyPairManager
-
realmsDataFetcher
-
quickPlayLog
-
gameMode
-
level
-
player
-
singleplayerServer
-
pendingConnection
-
isLocalServer
private boolean isLocalServer -
cameraEntity
-
crosshairPickEntity
-
hitResult
-
rightClickDelay
private int rightClickDelay -
missTime
protected int missTime -
pause
private volatile boolean pause -
pausePartialTick
private float pausePartialTick -
lastNanoTime
private long lastNanoTime -
lastTime
private long lastTime -
frames
private int frames -
noRender
public boolean noRender -
screen
-
overlay
-
clientLevelTeardownInProgress
private boolean clientLevelTeardownInProgress -
gameThread
-
running
private volatile boolean running -
delayedCrash
-
fps
private static int fps -
fpsString
-
frameTimeNs
private long frameTimeNs -
wireframe
public boolean wireframe -
sectionPath
public boolean sectionPath -
sectionVisibility
public boolean sectionVisibility -
smartCull
public boolean smartCull -
windowActive
private boolean windowActive -
progressTasks
-
pendingReload
-
profiler
-
fpsPieRenderTicks
private int fpsPieRenderTicks -
fpsPieProfiler
-
fpsPieResults
-
metricsRecorder
-
reloadStateTracker
-
savedCpuDuration
private long savedCpuDuration -
gpuUtilization
private double gpuUtilization -
currentFrameProfile
-
realms32BitWarningStatus
-
narrator
-
chatListener
-
reportingContext
-
commandHistory
-
directoryValidator
-
gameLoadFinished
private boolean gameLoadFinished -
clientStartTimeMs
private final long clientStartTimeMs -
clientTickCount
private long clientTickCount -
debugPath
-
realPartialTick
private float realPartialTick
-
-
Constructor Details
-
Minecraft
-
-
Method Details
-
onResourceLoadFinished
-
onGameLoadFinished
-
isGameLoadFinished
public boolean isGameLoadFinished() -
buildInitialScreens
-
addInitialScreens
-
countryEqualsISO3
-
updateTitle
public void updateTitle() -
createTitle
-
createUserApiService
private com.mojang.authlib.minecraft.UserApiService createUserApiService(com.mojang.authlib.yggdrasil.YggdrasilAuthenticationService p_193586_, GameConfig p_193587_) -
checkModStatus
-
rollbackResourcePacks
private void rollbackResourcePacks(Throwable p_91240_, @Nullable Minecraft.GameLoadCookie p_299846_) -
clearResourcePacksOnError
public void clearResourcePacksOnError(Throwable p_91242_, @Nullable Component p_91243_, @Nullable Minecraft.GameLoadCookie p_299892_) -
abortResourcePackRecovery
private void abortResourcePackRecovery() -
addResourcePackLoadFailToast
-
run
public void run() -
selectMainFont
void selectMainFont(boolean p_91337_) -
createSearchTrees
public void createSearchTrees() -
onFullscreenError
private void onFullscreenError(int p_91114_, long p_91115_) -
checkIs64Bit
private static boolean checkIs64Bit() -
getMainRenderTarget
-
getLaunchedVersion
-
getVersionType
-
delayCrash
-
delayCrashRaw
-
handleDelayedCrash
private void handleDelayedCrash() -
emergencySaveAndCrash
-
crash
-
isEnforceUnicode
public boolean isEnforceUnicode() -
reloadResourcePacks
-
reloadResourcePacks
private CompletableFuture<Void> reloadResourcePacks(boolean p_168020_, @Nullable Minecraft.GameLoadCookie p_299856_) -
selfTest
private void selfTest() -
getLevelSource
-
openChatScreen
-
setScreen
-
setOverlay
-
destroy
public void destroy() -
close
public void close()- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceProcessorHandle<Runnable>
-
runTick
private void runTick(boolean p_91384_) -
constructProfiler
-
finishProfilers
-
resizeDisplay
public void resizeDisplay()- Specified by:
resizeDisplay
in interfaceWindowEventHandler
-
cursorEntered
public void cursorEntered()- Specified by:
cursorEntered
in interfaceWindowEventHandler
-
getFps
public int getFps() -
getFrameTimeNs
public long getFrameTimeNs() -
getFramerateLimit
private int getFramerateLimit() -
emergencySave
private void emergencySave() -
debugClientMetricsStart
-
debugClientMetricsStop
private void debugClientMetricsStop() -
debugClientMetricsCancel
private void debugClientMetricsCancel() -
archiveProfilingReport
-
debugFpsMeterKeyPress
public void debugFpsMeterKeyPress(int p_91112_) -
renderFpsMeter
-
stop
public void stop() -
isRunning
public boolean isRunning() -
pauseGame
public void pauseGame(boolean p_91359_) -
continueAttack
private void continueAttack(boolean p_91387_) -
startAttack
private boolean startAttack() -
startUseItem
private void startUseItem() -
getMusicManager
-
tick
public void tick() -
isMultiplayerServer
private boolean isMultiplayerServer() -
handleKeybinds
private void handleKeybinds() -
getTelemetryManager
-
getGpuUtilization
public double getGpuUtilization() -
getProfileKeyPairManager
-
createWorldOpenFlows
-
doWorldLoad
public void doWorldLoad(LevelStorageSource.LevelStorageAccess p_261564_, PackRepository p_261826_, WorldStem p_261470_, boolean p_261465_) -
setLevel
-
disconnect
public void disconnect() -
disconnect
-
clearDownloadedResourcePacks
public void clearDownloadedResourcePacks() -
clearClientLevel
-
updateScreenAndTick
-
forceSetScreen
-
updateLevelInEngines
-
userProperties
private com.mojang.authlib.minecraft.UserApiService.UserProperties userProperties() -
telemetryOptInExtra
public boolean telemetryOptInExtra() -
extraTelemetryAvailable
public boolean extraTelemetryAvailable() -
allowsTelemetry
public boolean allowsTelemetry() -
allowsMultiplayer
public boolean allowsMultiplayer() -
allowsRealms
public boolean allowsRealms() -
multiplayerBan
@Nullable public com.mojang.authlib.minecraft.BanDetails multiplayerBan() -
isNameBanned
public boolean isNameBanned() -
isBlocked
-
getChatStatus
-
isDemo
public final boolean isDemo() -
getConnection
-
renderNames
public static boolean renderNames() -
useFancyGraphics
public static boolean useFancyGraphics() -
useShaderTransparency
public static boolean useShaderTransparency() -
useAmbientOcclusion
public static boolean useAmbientOcclusion() -
pickBlock
private void pickBlock() -
addCustomNbtData
-
fillReport
-
fillReport
public static void fillReport(@Nullable Minecraft p_167873_, @Nullable LanguageManager p_167874_, String p_167875_, @Nullable Options p_167876_, CrashReport p_167877_) -
formatSeconds
-
fillUptime
-
fillSystemReport
private static SystemReport fillSystemReport(SystemReport p_167851_, @Nullable Minecraft p_167852_, @Nullable LanguageManager p_167853_, String p_167854_, @Nullable Options p_167855_) -
getInstance
-
delayTextureReload
-
updateReportEnvironment
-
getCurrentServer
-
isLocalServer
public boolean isLocalServer() -
hasSingleplayerServer
public boolean hasSingleplayerServer() -
getSingleplayerServer
-
isSingleplayer
public boolean isSingleplayer() -
isLocalPlayer
-
getUser
-
getGameProfile
public com.mojang.authlib.GameProfile getGameProfile() -
getProxy
-
getTextureManager
-
getResourceManager
-
getResourcePackRepository
-
getVanillaPackResources
-
getDownloadedPackSource
-
getResourcePackDirectory
-
getLanguageManager
-
getTextureAtlas
-
is64Bit
public boolean is64Bit() -
isPaused
public boolean isPaused() -
getGpuWarnlistManager
-
getSoundManager
-
getSituationalMusic
-
getMinecraftSessionService
public com.mojang.authlib.minecraft.MinecraftSessionService getMinecraftSessionService() -
getSkinManager
-
getCameraEntity
-
setCameraEntity
-
shouldEntityAppearGlowing
-
getRunningThread
- Specified by:
getRunningThread
in classBlockableEventLoop<Runnable>
-
wrapRunnable
- Specified by:
wrapRunnable
in classBlockableEventLoop<Runnable>
-
shouldRun
- Specified by:
shouldRun
in classBlockableEventLoop<Runnable>
-
getBlockRenderer
-
getEntityRenderDispatcher
-
getBlockEntityRenderDispatcher
-
getItemRenderer
-
getSearchTree
-
populateSearchTree
-
getFixerUpper
public com.mojang.datafixers.DataFixer getFixerUpper() -
getFrameTime
public float getFrameTime() -
getDeltaFrameTime
public float getDeltaFrameTime() -
getBlockColors
-
showOnlyReducedInfo
public boolean showOnlyReducedInfo() -
getToasts
-
getTutorial
-
isWindowActive
public boolean isWindowActive() -
getHotbarManager
-
getModelManager
-
getPaintingTextures
-
getMobEffectTextures
-
getGuiSprites
-
setWindowActive
public void setWindowActive(boolean p_91261_) - Specified by:
setWindowActive
in interfaceWindowEventHandler
-
grabPanoramixScreenshot
-
grabHugeScreenshot
-
getProfiler
-
getProgressListener
-
getSplashManager
-
getOverlay
-
getPlayerSocialManager
-
renderOnThread
public boolean renderOnThread() -
getWindow
-
getDebugOverlay
-
renderBuffers
-
updateMaxMipLevel
public void updateMaxMipLevel(int p_91313_) -
getItemColors
-
getSearchTreeManager
-
getPartialTick
public float getPartialTick() -
getEntityModels
-
isTextFilteringEnabled
public boolean isTextFilteringEnabled() -
prepareForMultiplayer
public void prepareForMultiplayer() -
getRealms32BitWarningStatus
-
getProfileKeySignatureValidator
-
canValidateProfileKeys
public boolean canValidateProfileKeys() -
getLastInputType
-
setLastInputType
-
getNarrator
-
getChatListener
-
getReportingContext
-
realmsDataFetcher
-
quickPlayLog
-
commandHistory
-
directoryValidator
-
getTickTargetMillis
private float getTickTargetMillis(float p_308953_) -
getLauncherBrand
-
socialInteractionsToast