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 Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final booleanprivate final booleanstatic final ResourceLocationprivate final com.mojang.authlib.yggdrasil.YggdrasilAuthenticationServiceprivate final BlockColorsprivate final BlockEntityRenderDispatcherprivate final BlockRenderDispatcherprivate final ChatListenerbooleanbooleanprivate booleanprivate TimerQuery.FrameProfileprivate Stringfinal DebugRendererstatic final ResourceLocationprivate Supplier<CrashReport>private final booleanprivate final DownloadedPackSourceprivate final EntityModelSetprivate final EntityRenderDispatcherprivate final com.mojang.datafixers.DataFixerfinal Fontfinal Fontprivate final FontManagerprivate static intprivate final ContinuousProfilerprivate intprivate ProfileResultsprivate intprivate longfinal FrameTimerprivate final Gamefinal Filefinal GameRendererprivate Threadprivate doubleprivate final GpuWarnlistManagerfinal Guiprivate final HotbarManager(package private) static Minecraftprivate final booleanprivate booleanprivate final ItemColorsprivate final ItemRendererfinal KeyboardHandlerprivate final LanguageManagerprivate 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 ProfileKeyPairManagerprivate final com.mojang.authlib.properties.PropertyMapprivate ProfilerFillerprivate final AtomicReference<StoringChunkProgressListener>private final Proxyprivate 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 SearchRegistryprivate final SignatureValidatorprivate 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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate voidaddCustomNbtData(ItemStack p_263370_, BlockEntity p_263368_) booleanbooleanbooleanprivate PatharchiveProfilingReport(SystemReport p_167857_, List<Path> p_167858_) private static booleanstatic ModCheckvoidvoidclearLevel(Screen p_91321_) voidclearResourcePacksOnError(Throwable p_91242_, Component p_91243_) 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()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 intfloatlonggetGame()doubleprivate IoSupplier<InputStream>getIconFile(String... p_250431_) static Minecraftcom.mojang.authlib.minecraft.MinecraftSessionServicefloatcom.mojang.authlib.properties.PropertyMapgetProxy()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()booleanbooleanfinal booleanisDemo()booleanbooleanprivate booleanbooleanisPaused()booleanbooleanbooleanbooleancom.mojang.authlib.minecraft.BanDetailsprivate voidonFullscreenError(int p_91114_, long p_91115_) 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_) private voidrenderFpsMeter(PoseStack p_91141_, ProfileResults p_91142_) static booleanbooleanvoidprivate voidrollbackResourcePacks(Throwable p_91240_) voidrun()private voidrunTick(boolean p_91384_) (package private) voidselectMainFont(boolean p_91337_) private voidselfTest()voidsetCameraEntity(Entity p_91119_) voidsetConnectedToRealms(boolean p_91373_) voidsetLevel(ClientLevel p_91157_) voidsetOverlay(Overlay p_91151_) voidvoidsetWindowActive(boolean p_91261_) booleanshouldEntityAppearGlowing(Entity p_91315_) private booleanprotected booleanbooleanbooleanprivate 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.ReentrantBlockableEventLoop
doRunTask, runningTask, scheduleExecutablesMethods inherited from class net.minecraft.util.thread.BlockableEventLoop
dropAllTasks, execute, executeBlocking, executeIfPossible, getPendingTasksCount, isSameThread, managedBlock, name, pollTask, profiledMetrics, runAllTasks, submit, submit, submitAsync, tell, waitForTasksMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.minecraftforge.client.extensions.IForgeMinecraft
getLocale, popGuiLayer, pushGuiLayerMethods 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:
-
resourcePackDirectory
-
profileProperties
private final com.mojang.authlib.properties.PropertyMap profileProperties -
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
-
gameDirectory
-
launchedVersion
-
versionType
-
proxy
-
levelSource
-
frameTimer
-
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 -
serviceSignatureValidator
-
userApiService
private final com.mojang.authlib.minecraft.UserApiService userApiService -
skinManager
-
modelManager
-
blockRenderer
-
paintingTextures
-
mobEffectTextures
-
toast
-
game
-
tutorial
-
playerSocialManager
-
entityModels
-
blockEntityRenderDispatcher
-
telemetryManager
-
profileKeyPairManager
-
realmsDataFetcher
-
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
-
connectedToRealms
private boolean connectedToRealms -
gameThread
-
running
private volatile boolean running -
delayedCrash
-
fps
private static int fps -
fpsString
-
frameTimeNs
private long frameTimeNs -
wireframe
public boolean wireframe -
chunkPath
public boolean chunkPath -
chunkVisibility
public boolean chunkVisibility -
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
-
debugPath
-
realPartialTick
private float realPartialTick
-
-
Constructor Details
-
Minecraft
-
-
Method Details
-
getIconFile
- Throws:
IOException
-
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
-
clearResourcePacksOnError
-
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
-
crash
-
isEnforceUnicode
public boolean isEnforceUnicode() -
reloadResourcePacks
-
reloadResourcePacks
-
selfTest
private void selfTest() -
getLevelSource
-
openChatScreen
-
setScreen
-
setOverlay
-
destroy
public void destroy() -
close
public void close()- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceProcessorHandle<Runnable>
-
runTick
private void runTick(boolean p_91384_) -
shouldRenderFpsPie
private boolean shouldRenderFpsPie() -
constructProfiler
-
finishProfilers
-
resizeDisplay
public void resizeDisplay()- Specified by:
resizeDisplayin interfaceWindowEventHandler
-
cursorEntered
public void cursorEntered()- Specified by:
cursorEnteredin interfaceWindowEventHandler
-
getFps
public int getFps() -
getFrameTimeNs
public long getFrameTimeNs() -
getFramerateLimit
private int getFramerateLimit() -
emergencySave
public 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(String p_261891_, LevelStorageSource.LevelStorageAccess p_261564_, PackRepository p_261826_, WorldStem p_261470_, boolean p_261465_) -
setLevel
-
clearLevel
public void clearLevel() -
clearLevel
-
updateScreenAndTick
-
forceSetScreen
-
updateLevelInEngines
-
telemetryOptInExtra
public boolean telemetryOptInExtra() -
extraTelemetryAvailable
public boolean extraTelemetryAvailable() -
allowsTelemetry
public boolean allowsTelemetry() -
allowsMultiplayer
public boolean allowsMultiplayer() -
allowsRealms
public boolean allowsRealms() -
shouldShowBanNotice
public boolean shouldShowBanNotice() -
multiplayerBan
@Nullable public com.mojang.authlib.minecraft.BanDetails multiplayerBan() -
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_) -
fillSystemReport
private static SystemReport fillSystemReport(SystemReport p_167851_, @Nullable Minecraft p_167852_, @Nullable LanguageManager p_167853_, String p_167854_, Options p_167855_) -
getInstance
-
delayTextureReload
-
updateReportEnvironment
-
getCurrentServer
-
isLocalServer
public boolean isLocalServer() -
hasSingleplayerServer
public boolean hasSingleplayerServer() -
getSingleplayerServer
-
isSingleplayer
public boolean isSingleplayer() -
getUser
-
getProfileProperties
public com.mojang.authlib.properties.PropertyMap getProfileProperties() -
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:
getRunningThreadin classBlockableEventLoop<Runnable>
-
wrapRunnable
- Specified by:
wrapRunnablein classBlockableEventLoop<Runnable>
-
shouldRun
- Specified by:
shouldRunin classBlockableEventLoop<Runnable>
-
getBlockRenderer
-
getEntityRenderDispatcher
-
getBlockEntityRenderDispatcher
-
getItemRenderer
-
getSearchTree
-
populateSearchTree
-
getFrameTimer
-
isConnectedToRealms
public boolean isConnectedToRealms() -
setConnectedToRealms
public void setConnectedToRealms(boolean p_91373_) -
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
-
setWindowActive
public void setWindowActive(boolean p_91261_) - Specified by:
setWindowActivein interfaceWindowEventHandler
-
grabPanoramixScreenshot
-
grabHugeScreenshot
-
getProfiler
-
getGame
-
getProgressListener
-
getSplashManager
-
getOverlay
-
getPlayerSocialManager
-
renderOnThread
public boolean renderOnThread() -
getWindow
-
renderBuffers
-
updateMaxMipLevel
public void updateMaxMipLevel(int p_91313_) -
getItemColors
-
getSearchTreeManager
-
getPartialTick
public float getPartialTick() -
getEntityModels
-
isTextFilteringEnabled
public boolean isTextFilteringEnabled() -
prepareForMultiplayer
public void prepareForMultiplayer() -
getRealms32BitWarningStatus
-
getServiceSignatureValidator
-
getNarrator
-
getChatListener
-
getReportingContext
-
realmsDataFetcher
-
socialInteractionsToast