Class Minecraft
- All Implemented Interfaces:
WindowEventHandler, AutoCloseable, Executor, ProfilerMeasured, TaskScheduler<Runnable>, IMinecraftExtension
public class Minecraft
extends ReentrantBlockableEventLoop<Runnable>
implements WindowEventHandler, IMinecraftExtension
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final booleanprivate final booleanstatic final Identifierprivate final AtlasManagerprivate final BlockColorsprivate final BlockEntityRenderDispatcherprivate final BlockModelResolverprivate final longprivate final ChatListenerprivate booleanprivate final longprivate longprivate final CommandHistory@Nullable Entityprivate @Nullable TimerQuery.FrameProfilefinal DebugScreenEntryListstatic final Identifierprivate final DeltaTracker.Timerprivate final booleanprivate final DirectoryValidatorprivate final DownloadedPackSourceprivate List<SimpleGizmoCollector.GizmoInstance> private final EntityRenderDispatcherprivate final DataFixerfinal Fontfinal Fontprivate final FontManagerprivate static intprivate final ContinuousProfilerprivate intprivate final FramerateLimitTrackerprivate intprivate longfinal Fileprivate boolean@Nullable MultiPlayerGameModefinal GameRendererprivate Threadprivate doubleprivate final GpuWarnlistManagerfinal Gui@Nullable HitResultprivate final HotbarManagerprivate static Minecraftprivate booleanprivate final ItemModelResolverfinal KeyboardHandlerprivate final LanguageManagerprivate longprivate InputTypeprivate longprivate longprivate final String@Nullable ClientLevelfinal LevelRendererprivate final LevelStorageSourceprivate static final org.slf4j.Loggerprivate final RenderTargetprivate final MapRendererprivate final MapTextureManagerprivate static final intprivate MetricsRecorderprotected intprivate final ModelManagerfinal MouseHandlerprivate final MusicManagerprivate final GameNarratorprivate final booleanfinal Optionsprivate @Nullable Overlayprivate final PacketProcessorfinal ParticleEngineprivate final ParticleResourcesprivate booleanprivate @Nullable Connectionprivate @Nullable CompletableFuture<Void> private final SimpleGizmoCollector@Nullable LocalPlayerprivate final PlayerSkinRenderCacheprivate final PlayerSocialManagerprivate final CompletableFuture<@Nullable ProfileResult> private final ProfileKeyPairManagerprivate final Proxyprivate final QuickPlayLogprivate final RealmsDataFetcherprivate static final Identifierprivate final PeriodicNotificationManagerprivate final ResourceLoadStateTrackerprivate final RenderBuffersprivate ReportingContextprivate static final CompletableFuture<Unit> private final ReloadableResourceManagerprivate final Pathprivate final PackRepositoryprivate intprivate booleanprivate longprivate static final Component@Nullable Screenprivate final Servicesprivate final ShaderManagerprivate @Nullable IntegratedServerprivate final SkinManagerbooleanprivate static final Componentprivate @Nullable TutorialToastprivate final SoundManagerprivate final SplashManagerprivate final ClientTelemetryManagerprivate final TextInputManagerprivate final TextureManagerprivate final ToastManagerprivate final @Nullable TracyFrameCaptureprivate final Tutorialstatic final Identifierstatic final Stringprivate final Userprivate final UserApiServiceprivate final CompletableFuture<UserApiService.UserProperties> private final VanillaPackResourcesprivate final Stringprivate final WaypointStyleManagerprivate final WindowbooleanFields inherited from class BlockableEventLoop
BLOCK_TIME_NANOS -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate voidprivate booleanaddInitialScreens(List<Function<Runnable, Screen>> screens) private voidaddResourcePackLoadFailToast(@Nullable Component message) booleanbooleanbooleanprivate PatharchiveProfilingReport(SystemReport systemReport, List<Path> profilingResultPaths) private RunnablebuildInitialScreens(@Nullable Minecraft.GameLoadCookie cookie) booleanfinal booleanstatic ModCheckvoidclearClientLevel(Screen screen) voidvoidclearResourcePacksOnError(Throwable t, @Nullable Component message, @Nullable Minecraft.GameLoadCookie loadCookie) voidclose()private ProfilerFillerconstructProfiler(boolean shouldCollectFrameProfile, @Nullable SingleTickProfiler tickProfiler) private voidcontinueAttack(boolean down) private static booleancountryEqualsISO3(Object iso3Locale) static voidcrash(@Nullable Minecraft minecraft, File gameDirectory, CrashReport crash) private Stringprivate UserApiServicecreateUserApiService(YggdrasilAuthenticationService authService, GameConfig config) voidprivate voidbooleandebugClientMetricsStart(Consumer<Component> debugFeedback) private voidvoiddelayCrash(CrashReport crash) voiddestroy()voiddisconnect(Screen screen, boolean keepResourcePacks) voiddisconnect(Screen screen, boolean keepResourcePacks, boolean stopSound) voiddisconnectFromWorld(Component message) voidvoiddisconnectWithProgressScreen(boolean stopSound) voidvoiddoWorldLoad(LevelStorageSource.LevelStorageAccess levelSourceAccess, PackRepository packRepository, WorldStem worldStem, Optional<GameRules> gameRules, boolean newWorld) private voidvoidemergencySaveAndCrash(CrashReport partialReport) booleanstatic voidfillReport(@Nullable Minecraft minecraft, @Nullable LanguageManager languageManager, String launchedVersion, @Nullable Options options, CrashReport report) fillReport(CrashReport report) private static SystemReportfillSystemReport(SystemReport systemReport, @Nullable Minecraft minecraft, @Nullable LanguageManager languageManager, String launchedVersion, @Nullable Options options) private voidfillUptime(CrashReportCategory category) private voidfinishProfilers(boolean shouldCollectFrameProfile, @Nullable SingleTickProfiler tickProfiler) private static StringformatSeconds(double timeInSeconds) @Nullable Entity@Nullable ClientPacketListener@Nullable ServerDataintgetFps()longdoublestatic Minecraftstatic @Nullable Stringfloat@Nullable OverlaygetProxy()protected Thread@Nullable IntegratedServer@Nullable Musicprivate floatgetTickTargetMillis(float defaultTickTargetMillis) getUser()grabPanoramixScreenshot(File folder) private voidbooleanbooleanbooleanbooleanbooleanfinal booleanisDemo()booleanbooleanprivate booleanprivate booleanisLocalOrUnknownPlayer(UUID uuid) booleanisLocalPlayer(UUID profileId) booleanprivate booleanbooleanbooleanbooleanisPaused()booleanbooleanbooleanboolean@Nullable BanDetailsprivate voidonFullscreenError(int error, long description) private voidonGameLoadFinished(@Nullable Minecraft.GameLoadCookie cookie) private voidonResourceLoadFinished(@Nullable Minecraft.GameLoadCookie loadCookie) voidonTextInputFocusChange(GuiEventListener element, boolean isFocused) voidopenChatScreen(ChatComponent.ChatMethod chatMethod) voidpauseGame(boolean suppressPauseMenuIfWeReallyArePausing) private voidprivate voidpick(float partialTicks) private voidvoidprivate CompletableFuture<Void> reloadResourcePacks(boolean isRecovery, @Nullable Minecraft.GameLoadCookie loadCookie) private voidrenderFrame(boolean advanceGameTime) static booleanvoidprivate voidrollbackResourcePacks(Throwable t, @Nullable Minecraft.GameLoadCookie loadCookie) voidrun()private voidrunTick(boolean advanceGameTime) static intsaveReport(File gameDirectory, CrashReport crash) private static intsaveReportAndShutdownSoundManager(@Nullable Minecraft minecraft, File gameDirectory, CrashReport crash) private voidselfTest()voidservices()voidsetCameraEntity(@Nullable Entity cameraEntity) voidsetLastInputType(InputType lastInputType) voidsetLevel(ClientLevel level) voidsetOverlay(@Nullable Overlay overlay) voidvoidsetScreenAndShow(Screen screen) booleanshouldEntityAppearGlowing(Entity entity) protected booleanbooleanprivate booleanprivate voidvoidstop()booleanvoidtick()voidtriggerResourcePackRecovery(Exception exception) (package private) voidprivate voidupdateLevelInEngines(@Nullable ClientLevel level) private voidupdateLevelInEngines(@Nullable ClientLevel level, boolean stopSound) voidupdateMaxMipLevel(int mipmapLevels) voidupdateReportEnvironment(ReportEnvironment environment) voidprivate UserApiService.UserPropertiesstatic booleanwrapRunnable(Runnable runnable) Methods inherited from class ReentrantBlockableEventLoop
doRunTask, runningTask, scheduleExecutablesMethods inherited from class BlockableEventLoop
dropAllTasks, execute, executeBlocking, executeIfPossible, getPendingTasksCount, hasDelayedCrash, isNonRecoverable, isSameThread, managedBlock, name, pollTask, profiledMetrics, relayDelayCrash, runAllTasks, schedule, shouldRunAllTasks, submit, submit, submitAsync, waitForTasksMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface IMinecraftExtension
getLocale, popGuiLayer, pushGuiLayerMethods inherited from interface TaskScheduler
scheduleWithResult
-
Field Details
-
instance
-
LOGGER
private static final org.slf4j.Logger LOGGER -
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
-
SAVING_LEVEL
-
UPDATE_DRIVERS_ADVICE
- See Also:
-
canary
private final long canary -
resourcePackDirectory
-
profileFuture
-
textureManager
-
shaderManager
-
fixerUpper
-
window
-
textInputManager
-
deltaTracker
-
renderBuffers
-
levelRenderer
-
entityRenderDispatcher
-
blockModelResolver
-
itemModelResolver
-
mapRenderer
-
particleEngine
-
particleResources
-
user
-
font
-
fontFilterFishy
-
gameRenderer
-
gui
-
options
-
debugEntries
-
hotbarManager
-
mouseHandler
-
keyboardHandler
-
lastInputType
-
gameDirectory
-
launchedVersion
-
versionType
-
proxy
-
offlineDeveloperMode
private final boolean offlineDeveloperMode -
levelSource
-
demo
private final boolean demo -
allowsMultiplayer
private final boolean allowsMultiplayer -
allowsChat
private final boolean allowsChat -
resourceManager
-
vanillaPackResources
-
downloadedPackSource
-
resourcePackRepository
-
languageManager
-
blockColors
-
mainRenderTarget
-
tracyFrameCapture
-
soundManager
-
musicManager
-
fontManager
-
splashManager
-
gpuWarnlistManager
-
regionalCompliancies
-
userApiService
-
userPropertiesFuture
-
skinManager
-
atlasManager
-
modelManager
-
mapTextureManager
-
waypointStyles
-
toastManager
-
tutorial
-
playerSocialManager
-
blockEntityRenderDispatcher
-
telemetryManager
-
profileKeyPairManager
-
realmsDataFetcher
-
quickPlayLog
-
services
-
playerSkinRenderCache
-
gameMode
-
level
-
player
-
singleplayerServer
-
pendingConnection
-
isLocalServer
private boolean isLocalServer -
crosshairPickEntity
-
hitResult
-
rightClickDelay
private int rightClickDelay -
missTime
protected int missTime -
pause
private volatile boolean pause -
lastNanoTime
private long lastNanoTime -
lastTime
private long lastTime -
frames
private int frames -
screen
-
overlay
-
clientLevelTeardownInProgress
private boolean clientLevelTeardownInProgress -
gameThread
-
running
private volatile boolean running -
fps
private static int fps -
frameTimeNs
private long frameTimeNs -
framerateLimitTracker
-
wireframe
public boolean wireframe -
smartCull
public boolean smartCull -
lastActiveTime
private long lastActiveTime -
pendingReload
-
fpsPieRenderTicks
private int fpsPieRenderTicks -
fpsPieProfiler
-
metricsRecorder
-
reloadStateTracker
-
savedCpuDuration
private long savedCpuDuration -
gpuUtilization
private double gpuUtilization -
currentFrameProfile
-
narrator
-
chatListener
-
reportingContext
-
commandHistory
-
directoryValidator
-
gameLoadFinished
private boolean gameLoadFinished -
clientStartTimeMs
private final long clientStartTimeMs -
clientTickCount
private long clientTickCount -
packetProcessor
-
perTickGizmos
-
drainedLatestTickGizmos
-
-
Constructor Details
-
Minecraft
-
-
Method Details
-
hasShiftDown
public boolean hasShiftDown() -
hasControlDown
public boolean hasControlDown() -
hasAltDown
public boolean hasAltDown() -
onResourceLoadFinished
-
onGameLoadFinished
-
isGameLoadFinished
public boolean isGameLoadFinished() -
buildInitialScreens
-
addInitialScreens
-
countryEqualsISO3
-
updateTitle
public void updateTitle() -
createTitle
-
createUserApiService
private UserApiService createUserApiService(YggdrasilAuthenticationService authService, GameConfig config) -
isOfflineDeveloperMode
public boolean isOfflineDeveloperMode() -
checkModStatus
-
rollbackResourcePacks
-
clearResourcePacksOnError
public void clearResourcePacksOnError(Throwable t, @Nullable Component message, @Nullable Minecraft.GameLoadCookie loadCookie) -
abortResourcePackRecovery
private void abortResourcePackRecovery() -
addResourcePackLoadFailToast
-
triggerResourcePackRecovery
-
run
public void run() -
updateFontOptions
void updateFontOptions() -
onFullscreenError
private void onFullscreenError(int error, long description) -
getMainRenderTarget
-
getLaunchedVersion
-
getVersionType
-
delayCrash
- Overrides:
delayCrashin classBlockableEventLoop<Runnable>
-
emergencySaveAndCrash
-
saveReport
-
crash
-
saveReportAndShutdownSoundManager
private static int saveReportAndShutdownSoundManager(@Nullable Minecraft minecraft, File gameDirectory, CrashReport crash) -
isEnforceUnicode
public boolean isEnforceUnicode() -
reloadResourcePacks
-
reloadResourcePacks
private CompletableFuture<Void> reloadResourcePacks(boolean isRecovery, @Nullable Minecraft.GameLoadCookie loadCookie) -
selfTest
private void selfTest() -
getLevelSource
-
openChatScreen
-
setScreen
-
setOverlay
-
destroy
public void destroy() -
close
public void close()- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceTaskScheduler<Runnable>
-
runTick
private void runTick(boolean advanceGameTime) -
renderFrame
private void renderFrame(boolean advanceGameTime) -
pauseIfInactive
private void pauseIfInactive() -
constructProfiler
private ProfilerFiller constructProfiler(boolean shouldCollectFrameProfile, @Nullable SingleTickProfiler tickProfiler) -
finishProfilers
private void finishProfilers(boolean shouldCollectFrameProfile, @Nullable SingleTickProfiler tickProfiler) -
resizeGui
public void resizeGui()- Specified by:
resizeGuiin interfaceWindowEventHandler
-
cursorEntered
public void cursorEntered()- Specified by:
cursorEnteredin interfaceWindowEventHandler
-
getFps
public int getFps() -
getFrameTimeNs
public long getFrameTimeNs() -
sendLowDiskSpaceWarning
public void sendLowDiskSpaceWarning() -
emergencySave
private void emergencySave() -
debugClientMetricsStart
-
debugClientMetricsStop
private void debugClientMetricsStop() -
debugClientMetricsCancel
private void debugClientMetricsCancel() -
archiveProfilingReport
-
stop
public void stop() -
isRunning
public boolean isRunning() -
pauseGame
public void pauseGame(boolean suppressPauseMenuIfWeReallyArePausing) -
continueAttack
private void continueAttack(boolean down) -
startAttack
private boolean startAttack() -
startUseItem
private void startUseItem() -
getMusicManager
-
tick
public void tick() -
isLevelRunningNormally
private boolean isLevelRunningNormally() -
isMultiplayerServer
private boolean isMultiplayerServer() -
handleKeybinds
private void handleKeybinds() -
getQuickActionsDialog
-
getTelemetryManager
-
getGpuUtilization
public double getGpuUtilization() -
getProfileKeyPairManager
-
createWorldOpenFlows
-
doWorldLoad
public void doWorldLoad(LevelStorageSource.LevelStorageAccess levelSourceAccess, PackRepository packRepository, WorldStem worldStem, Optional<GameRules> gameRules, boolean newWorld) -
setLevel
-
disconnectFromWorld
-
disconnectWithSavingScreen
public void disconnectWithSavingScreen() -
disconnectWithProgressScreen
public void disconnectWithProgressScreen() -
disconnectWithProgressScreen
public void disconnectWithProgressScreen(boolean stopSound) -
disconnect
-
disconnect
-
clearDownloadedResourcePacks
public void clearDownloadedResourcePacks() -
clearClientLevel
-
setScreenAndShow
-
updateLevelInEngines
-
updateLevelInEngines
-
userProperties
-
telemetryOptInExtra
public boolean telemetryOptInExtra() -
extraTelemetryAvailable
public boolean extraTelemetryAvailable() -
allowsTelemetry
public boolean allowsTelemetry() -
allowsMultiplayer
public boolean allowsMultiplayer() -
allowsRealms
public boolean allowsRealms() -
multiplayerBan
-
isNameBanned
public boolean isNameBanned() -
isBlocked
-
isLocalOrUnknownPlayer
-
computeChatAbilities
-
isDemo
public final boolean isDemo() -
canSwitchGameMode
public final boolean canSwitchGameMode() -
getConnection
-
renderNames
public static boolean renderNames() -
useShaderTransparency
public static boolean useShaderTransparency() -
pickBlockOrEntity
private void pickBlockOrEntity() -
fillReport
-
fillReport
public static void fillReport(@Nullable Minecraft minecraft, @Nullable LanguageManager languageManager, String launchedVersion, @Nullable Options options, CrashReport report) -
formatSeconds
-
fillUptime
-
fillSystemReport
private static SystemReport fillSystemReport(SystemReport systemReport, @Nullable Minecraft minecraft, @Nullable LanguageManager languageManager, String launchedVersion, @Nullable Options options) -
getInstance
-
delayTextureReload
-
updateReportEnvironment
-
getCurrentServer
-
isLocalServer
public boolean isLocalServer() -
hasSingleplayerServer
public boolean hasSingleplayerServer() -
getSingleplayerServer
-
isSingleplayer
public boolean isSingleplayer() -
isLocalPlayer
-
getUser
-
getGameProfile
-
getProxy
-
getTextureManager
-
getShaderManager
-
getResourceManager
-
getResourcePackRepository
-
getVanillaPackResources
-
getDownloadedPackSource
-
getResourcePackDirectory
-
getLanguageManager
-
isPaused
public boolean isPaused() -
getGpuWarnlistManager
-
getSoundManager
-
getSituationalMusic
-
getMusicVolume
public float getMusicVolume() -
services
-
getSkinManager
-
getCameraEntity
-
setCameraEntity
-
shouldEntityAppearGlowing
-
getRunningThread
- Specified by:
getRunningThreadin classBlockableEventLoop<Runnable>
-
wrapRunnable
- Specified by:
wrapRunnablein interfaceTaskScheduler<Runnable>
-
shouldRun
- Specified by:
shouldRunin classBlockableEventLoop<Runnable>
-
getEntityRenderDispatcher
-
getBlockEntityRenderDispatcher
-
getMapRenderer
-
getFixerUpper
-
getDeltaTracker
-
getBlockColors
-
showOnlyReducedInfo
public boolean showOnlyReducedInfo() -
getToastManager
-
getTutorial
-
isWindowActive
public boolean isWindowActive() -
getHotbarManager
-
getModelManager
-
getAtlasManager
-
getMapTextureManager
-
getWaypointStyles
-
grabPanoramixScreenshot
-
getSplashManager
-
getOverlay
-
getPlayerSocialManager
-
getWindow
-
textInputManager
-
onTextInputFocusChange
-
getFramerateLimitTracker
-
getDebugOverlay
-
renderBuffers
-
updateMaxMipLevel
public void updateMaxMipLevel(int mipmapLevels) -
getEntityModels
-
isTextFilteringEnabled
public boolean isTextFilteringEnabled() -
prepareForMultiplayer
public void prepareForMultiplayer() -
getLastInputType
-
setLastInputType
-
getNarrator
-
getChatListener
-
getReportingContext
-
realmsDataFetcher
-
quickPlayLog
-
commandHistory
-
directoryValidator
-
playerSkinRenderCache
-
getTickTargetMillis
private float getTickTargetMillis(float defaultTickTargetMillis) -
getBlockModelResolver
-
getItemModelResolver
-
canInterruptScreen
public boolean canInterruptScreen() -
getLauncherBrand
-
packetProcessor
-
collectPerTickGizmos
-
getPerTickGizmos
-
pick
private void pick(float partialTicks)
-
socialInteractionsToast