Class Minecraft

All Implemented Interfaces:
WindowEventHandler, AutoCloseable, Executor, ProfilerMeasured, ProcessorHandle<Runnable>, IMinecraftExtension

  • Field Details

    • instance

      static Minecraft 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

      public static final ResourceLocation DEFAULT_FONT
    • UNIFORM_FONT

      public static final ResourceLocation UNIFORM_FONT
    • ALT_FONT

      public static final ResourceLocation ALT_FONT
    • REGIONAL_COMPLIANCIES

      private static final ResourceLocation REGIONAL_COMPLIANCIES
    • RESOURCE_RELOAD_INITIAL_TASK

      private static final CompletableFuture<Unit> RESOURCE_RELOAD_INITIAL_TASK
    • SOCIAL_INTERACTIONS_NOT_AVAILABLE

      private static final Component SOCIAL_INTERACTIONS_NOT_AVAILABLE
    • UPDATE_DRIVERS_ADVICE

      public static final String UPDATE_DRIVERS_ADVICE
      See Also:
    • canary

      private final long canary
    • resourcePackDirectory

      private final Path resourcePackDirectory
    • profileFuture

      private final CompletableFuture<com.mojang.authlib.yggdrasil.ProfileResult> profileFuture
    • textureManager

      private final TextureManager textureManager
    • fixerUpper

      private final com.mojang.datafixers.DataFixer fixerUpper
    • virtualScreen

      private final VirtualScreen virtualScreen
    • window

      private final Window window
    • timer

      private final DeltaTracker.Timer timer
    • renderBuffers

      private final RenderBuffers renderBuffers
    • levelRenderer

      public final LevelRenderer levelRenderer
    • entityRenderDispatcher

      private final EntityRenderDispatcher entityRenderDispatcher
    • itemRenderer

      private final ItemRenderer itemRenderer
    • particleEngine

      public final ParticleEngine particleEngine
    • user

      private final User user
    • font

      public final Font font
    • fontFilterFishy

      public final Font fontFilterFishy
    • gameRenderer

      public final GameRenderer gameRenderer
    • debugRenderer

      public final DebugRenderer debugRenderer
    • progressListener

      private final AtomicReference<StoringChunkProgressListener> progressListener
    • gui

      public final Gui gui
    • options

      public final Options options
    • hotbarManager

      private final HotbarManager hotbarManager
    • mouseHandler

      public final MouseHandler mouseHandler
    • keyboardHandler

      public final KeyboardHandler keyboardHandler
    • lastInputType

      private InputType lastInputType
    • gameDirectory

      public final File gameDirectory
    • launchedVersion

      private final String launchedVersion
    • versionType

      private final String versionType
    • proxy

      private final Proxy proxy
    • levelSource

      private final LevelStorageSource levelSource
    • demo

      private final boolean demo
    • allowsMultiplayer

      private final boolean allowsMultiplayer
    • allowsChat

      private final boolean allowsChat
    • resourceManager

      private final ReloadableResourceManager resourceManager
    • vanillaPackResources

      private final VanillaPackResources vanillaPackResources
    • downloadedPackSource

      private final DownloadedPackSource downloadedPackSource
    • resourcePackRepository

      private final PackRepository resourcePackRepository
    • languageManager

      private final LanguageManager languageManager
    • blockColors

      private final BlockColors blockColors
    • itemColors

      private final ItemColors itemColors
    • mainRenderTarget

      private final RenderTarget mainRenderTarget
    • soundManager

      private final SoundManager soundManager
    • musicManager

      private final MusicManager musicManager
    • fontManager

      private final FontManager fontManager
    • splashManager

      private final SplashManager splashManager
    • gpuWarnlistManager

      private final GpuWarnlistManager gpuWarnlistManager
    • regionalCompliancies

      private final PeriodicNotificationManager 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

      private final SkinManager skinManager
    • modelManager

      private final ModelManager modelManager
    • blockRenderer

      private final BlockRenderDispatcher blockRenderer
    • paintingTextures

      private final PaintingTextureManager paintingTextures
    • mobEffectTextures

      private final MobEffectTextureManager mobEffectTextures
    • mapDecorationTextures

      private final MapDecorationTextureManager mapDecorationTextures
    • guiSprites

      private final GuiSpriteManager guiSprites
    • toast

      private final ToastComponent toast
    • tutorial

      private final Tutorial tutorial
    • playerSocialManager

      private final PlayerSocialManager playerSocialManager
    • entityModels

      private final EntityModelSet entityModels
    • blockEntityRenderDispatcher

      private final BlockEntityRenderDispatcher blockEntityRenderDispatcher
    • telemetryManager

      private final ClientTelemetryManager telemetryManager
    • profileKeyPairManager

      private final ProfileKeyPairManager profileKeyPairManager
    • realmsDataFetcher

      private final RealmsDataFetcher realmsDataFetcher
    • quickPlayLog

      private final QuickPlayLog quickPlayLog
    • gameMode

      @Nullable public MultiPlayerGameMode gameMode
    • level

      @Nullable public ClientLevel level
    • player

      @Nullable public LocalPlayer player
    • singleplayerServer

      @Nullable private IntegratedServer singleplayerServer
    • pendingConnection

      @Nullable private Connection pendingConnection
    • isLocalServer

      private boolean isLocalServer
    • cameraEntity

      @Nullable public Entity cameraEntity
    • crosshairPickEntity

      @Nullable public Entity crosshairPickEntity
    • hitResult

      @Nullable public HitResult 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
    • noRender

      public boolean noRender
    • screen

      @Nullable public Screen screen
    • overlay

      @Nullable private Overlay overlay
    • clientLevelTeardownInProgress

      private boolean clientLevelTeardownInProgress
    • gameThread

      private Thread gameThread
    • running

      private volatile boolean running
    • delayedCrash

      @Nullable private Supplier<CrashReport> delayedCrash
    • fps

      private static int fps
    • fpsString

      public String 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

      private final Queue<Runnable> progressTasks
    • pendingReload

      @Nullable private CompletableFuture<Void> pendingReload
    • socialInteractionsToast

      @Nullable private TutorialToast socialInteractionsToast
    • profiler

      private ProfilerFiller profiler
    • fpsPieRenderTicks

      private int fpsPieRenderTicks
    • fpsPieProfiler

      private final ContinuousProfiler fpsPieProfiler
    • fpsPieResults

      @Nullable private ProfileResults fpsPieResults
    • metricsRecorder

      private MetricsRecorder metricsRecorder
    • reloadStateTracker

      private final ResourceLoadStateTracker reloadStateTracker
    • savedCpuDuration

      private long savedCpuDuration
    • gpuUtilization

      private double gpuUtilization
    • currentFrameProfile

      @Nullable private TimerQuery.FrameProfile currentFrameProfile
    • narrator

      private final GameNarrator narrator
    • chatListener

      private final ChatListener chatListener
    • reportingContext

      private ReportingContext reportingContext
    • commandHistory

      private final CommandHistory commandHistory
    • directoryValidator

      private final DirectoryValidator directoryValidator
    • gameLoadFinished

      private boolean gameLoadFinished
    • clientStartTimeMs

      private final long clientStartTimeMs
    • clientTickCount

      private long clientTickCount
    • debugPath

      private String debugPath
  • Constructor Details

    • Minecraft

      public Minecraft(GameConfig p_91084_)
  • Method Details

    • onResourceLoadFinished

      private void onResourceLoadFinished(@Nullable Minecraft.GameLoadCookie p_299896_)
    • onGameLoadFinished

      private void onGameLoadFinished(@Nullable Minecraft.GameLoadCookie p_299836_)
    • isGameLoadFinished

      public boolean isGameLoadFinished()
    • buildInitialScreens

      private Runnable buildInitialScreens(@Nullable Minecraft.GameLoadCookie p_299894_)
    • addInitialScreens

      private void addInitialScreens(List<Function<Runnable,Screen>> p_300000_)
    • countryEqualsISO3

      private static boolean countryEqualsISO3(Object p_210783_)
    • updateTitle

      public void updateTitle()
    • createTitle

      private String createTitle()
    • createUserApiService

      private com.mojang.authlib.minecraft.UserApiService createUserApiService(com.mojang.authlib.yggdrasil.YggdrasilAuthenticationService p_193586_, GameConfig p_193587_)
    • checkModStatus

      public static ModCheck 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

      private void addResourcePackLoadFailToast(@Nullable Component p_273566_)
    • run

      public void run()
    • updateFontOptions

      void updateFontOptions()
    • onFullscreenError

      private void onFullscreenError(int p_91114_, long p_91115_)
    • getMainRenderTarget

      public RenderTarget getMainRenderTarget()
    • getLaunchedVersion

      public String getLaunchedVersion()
    • getVersionType

      public String getVersionType()
    • delayCrash

      public void delayCrash(CrashReport p_231413_)
    • delayCrashRaw

      public void delayCrashRaw(CrashReport p_231440_)
    • handleDelayedCrash

      private void handleDelayedCrash()
    • emergencySaveAndCrash

      public void emergencySaveAndCrash(CrashReport p_307515_)
    • crash

      public static void crash(@Nullable Minecraft p_307414_, File p_307228_, CrashReport p_91333_)
    • isEnforceUnicode

      public boolean isEnforceUnicode()
    • reloadResourcePacks

      public CompletableFuture<Void> reloadResourcePacks()
    • reloadResourcePacks

      private CompletableFuture<Void> reloadResourcePacks(boolean p_168020_, @Nullable Minecraft.GameLoadCookie p_299856_)
    • selfTest

      private void selfTest()
    • getLevelSource

      public LevelStorageSource getLevelSource()
    • openChatScreen

      private void openChatScreen(String p_91327_)
    • setScreen

      public void setScreen(@Nullable Screen p_91153_)
    • setOverlay

      public void setOverlay(@Nullable Overlay p_91151_)
    • destroy

      public void destroy()
    • close

      public void close()
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface ProcessorHandle<Runnable>
    • runTick

      private void runTick(boolean p_91384_)
    • constructProfiler

      private ProfilerFiller constructProfiler(boolean p_167971_, @Nullable SingleTickProfiler p_167972_)
    • finishProfilers

      private void finishProfilers(boolean p_91339_, @Nullable SingleTickProfiler p_91340_)
    • resizeDisplay

      public void resizeDisplay()
      Specified by:
      resizeDisplay in interface WindowEventHandler
    • cursorEntered

      public void cursorEntered()
      Specified by:
      cursorEntered in interface WindowEventHandler
    • getFps

      public int getFps()
    • getFrameTimeNs

      public long getFrameTimeNs()
    • getFramerateLimit

      private int getFramerateLimit()
    • emergencySave

      private void emergencySave()
    • debugClientMetricsStart

      public boolean debugClientMetricsStart(Consumer<Component> p_167947_)
    • debugClientMetricsStop

      private void debugClientMetricsStop()
    • debugClientMetricsCancel

      private void debugClientMetricsCancel()
    • archiveProfilingReport

      private Path archiveProfilingReport(SystemReport p_167857_, List<Path> p_167858_)
    • debugFpsMeterKeyPress

      public void debugFpsMeterKeyPress(int p_91112_)
    • renderFpsMeter

      private void renderFpsMeter(GuiGraphics p_281277_, ProfileResults p_281574_)
    • 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

      public MusicManager getMusicManager()
    • tick

      public void tick()
    • isLevelRunningNormally

      private boolean isLevelRunningNormally()
    • isMultiplayerServer

      private boolean isMultiplayerServer()
    • handleKeybinds

      private void handleKeybinds()
    • getTelemetryManager

      public ClientTelemetryManager getTelemetryManager()
    • getGpuUtilization

      public double getGpuUtilization()
    • getProfileKeyPairManager

      public ProfileKeyPairManager getProfileKeyPairManager()
    • createWorldOpenFlows

      public WorldOpenFlows createWorldOpenFlows()
    • doWorldLoad

      public void doWorldLoad(LevelStorageSource.LevelStorageAccess p_261564_, PackRepository p_261826_, WorldStem p_261470_, boolean p_261465_)
    • setLevel

      public void setLevel(ClientLevel p_91157_, ReceivingLevelScreen.Reason p_341652_)
    • disconnect

      public void disconnect()
    • disconnect

      public void disconnect(Screen p_91321_)
    • disconnect

      public void disconnect(Screen p_320248_, boolean p_319814_)
    • clearDownloadedResourcePacks

      public void clearDownloadedResourcePacks()
    • clearClientLevel

      public void clearClientLevel(Screen p_294558_)
    • updateScreenAndTick

      private void updateScreenAndTick(Screen p_91363_)
    • forceSetScreen

      public void forceSetScreen(Screen p_91347_)
    • updateLevelInEngines

      private void updateLevelInEngines(@Nullable ClientLevel p_91325_)
    • 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

      public boolean isBlocked(UUID p_91247_)
    • getChatStatus

      public Minecraft.ChatStatus getChatStatus()
    • isDemo

      public final boolean isDemo()
    • getConnection

      @Nullable public ClientPacketListener 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

      private void addCustomNbtData(ItemStack p_263370_, BlockEntity p_263368_, RegistryAccess p_323897_)
    • fillReport

      public CrashReport fillReport(CrashReport p_91355_)
    • fillReport

      public static void fillReport(@Nullable Minecraft p_167873_, @Nullable LanguageManager p_167874_, String p_167875_, @Nullable Options p_167876_, CrashReport p_167877_)
    • formatSeconds

      private static String formatSeconds(double p_304493_)
    • fillUptime

      private void fillUptime(CrashReportCategory p_304858_)
    • fillSystemReport

      private static SystemReport fillSystemReport(SystemReport p_167851_, @Nullable Minecraft p_167852_, @Nullable LanguageManager p_167853_, String p_167854_, @Nullable Options p_167855_)
    • getInstance

      public static Minecraft getInstance()
    • delayTextureReload

      public CompletableFuture<Void> delayTextureReload()
    • updateReportEnvironment

      public void updateReportEnvironment(ReportEnvironment p_239477_)
    • getCurrentServer

      @Nullable public ServerData getCurrentServer()
    • isLocalServer

      public boolean isLocalServer()
    • hasSingleplayerServer

      public boolean hasSingleplayerServer()
    • getSingleplayerServer

      @Nullable public IntegratedServer getSingleplayerServer()
    • isSingleplayer

      public boolean isSingleplayer()
    • isLocalPlayer

      public boolean isLocalPlayer(UUID p_295141_)
    • getUser

      public User getUser()
    • getGameProfile

      public com.mojang.authlib.GameProfile getGameProfile()
    • getProxy

      public Proxy getProxy()
    • getTextureManager

      public TextureManager getTextureManager()
    • getResourceManager

      public ResourceManager getResourceManager()
    • getResourcePackRepository

      public PackRepository getResourcePackRepository()
    • getVanillaPackResources

      public VanillaPackResources getVanillaPackResources()
    • getDownloadedPackSource

      public DownloadedPackSource getDownloadedPackSource()
    • getResourcePackDirectory

      public Path getResourcePackDirectory()
    • getLanguageManager

      public LanguageManager getLanguageManager()
    • getTextureAtlas

      public Function<ResourceLocation,TextureAtlasSprite> getTextureAtlas(ResourceLocation p_91259_)
    • isPaused

      public boolean isPaused()
    • getGpuWarnlistManager

      public GpuWarnlistManager getGpuWarnlistManager()
    • getSoundManager

      public SoundManager getSoundManager()
    • getSituationalMusic

      public Music getSituationalMusic()
    • getMinecraftSessionService

      public com.mojang.authlib.minecraft.MinecraftSessionService getMinecraftSessionService()
    • getSkinManager

      public SkinManager getSkinManager()
    • getCameraEntity

      @Nullable public Entity getCameraEntity()
    • setCameraEntity

      public void setCameraEntity(Entity p_91119_)
    • shouldEntityAppearGlowing

      public boolean shouldEntityAppearGlowing(Entity p_91315_)
    • getRunningThread

      protected Thread getRunningThread()
      Specified by:
      getRunningThread in class BlockableEventLoop<Runnable>
    • wrapRunnable

      protected Runnable wrapRunnable(Runnable p_91376_)
      Specified by:
      wrapRunnable in class BlockableEventLoop<Runnable>
    • shouldRun

      protected boolean shouldRun(Runnable p_91365_)
      Specified by:
      shouldRun in class BlockableEventLoop<Runnable>
    • getBlockRenderer

      public BlockRenderDispatcher getBlockRenderer()
    • getEntityRenderDispatcher

      public EntityRenderDispatcher getEntityRenderDispatcher()
    • getBlockEntityRenderDispatcher

      public BlockEntityRenderDispatcher getBlockEntityRenderDispatcher()
    • getItemRenderer

      public ItemRenderer getItemRenderer()
    • getFixerUpper

      public com.mojang.datafixers.DataFixer getFixerUpper()
    • getTimer

      public DeltaTracker getTimer()
    • getBlockColors

      public BlockColors getBlockColors()
    • showOnlyReducedInfo

      public boolean showOnlyReducedInfo()
    • getToasts

      public ToastComponent getToasts()
    • getTutorial

      public Tutorial getTutorial()
    • isWindowActive

      public boolean isWindowActive()
    • getHotbarManager

      public HotbarManager getHotbarManager()
    • getModelManager

      public ModelManager getModelManager()
    • getPaintingTextures

      public PaintingTextureManager getPaintingTextures()
    • getMobEffectTextures

      public MobEffectTextureManager getMobEffectTextures()
    • getMapDecorationTextures

      public MapDecorationTextureManager getMapDecorationTextures()
    • getGuiSprites

      public GuiSpriteManager getGuiSprites()
    • setWindowActive

      public void setWindowActive(boolean p_91261_)
      Specified by:
      setWindowActive in interface WindowEventHandler
    • grabPanoramixScreenshot

      public Component grabPanoramixScreenshot(File p_167900_, int p_167901_, int p_167902_)
    • grabHugeScreenshot

      private Component grabHugeScreenshot(File p_167904_, int p_167905_, int p_167906_, int p_167907_, int p_167908_)
    • getProfiler

      public ProfilerFiller getProfiler()
    • getProgressListener

      @Nullable public StoringChunkProgressListener getProgressListener()
    • getSplashManager

      public SplashManager getSplashManager()
    • getOverlay

      @Nullable public Overlay getOverlay()
    • getPlayerSocialManager

      public PlayerSocialManager getPlayerSocialManager()
    • getWindow

      public Window getWindow()
    • getDebugOverlay

      public DebugScreenOverlay getDebugOverlay()
    • renderBuffers

      public RenderBuffers renderBuffers()
    • updateMaxMipLevel

      public void updateMaxMipLevel(int p_91313_)
    • getItemColors

      public ItemColors getItemColors()
    • getEntityModels

      public EntityModelSet getEntityModels()
    • isTextFilteringEnabled

      public boolean isTextFilteringEnabled()
    • prepareForMultiplayer

      public void prepareForMultiplayer()
    • getProfileKeySignatureValidator

      @Nullable public SignatureValidator getProfileKeySignatureValidator()
    • canValidateProfileKeys

      public boolean canValidateProfileKeys()
    • getLastInputType

      public InputType getLastInputType()
    • setLastInputType

      public void setLastInputType(InputType p_265509_)
    • getNarrator

      public GameNarrator getNarrator()
    • getChatListener

      public ChatListener getChatListener()
    • getReportingContext

      public ReportingContext getReportingContext()
    • realmsDataFetcher

      public RealmsDataFetcher realmsDataFetcher()
    • quickPlayLog

      public QuickPlayLog quickPlayLog()
    • commandHistory

      public CommandHistory commandHistory()
    • directoryValidator

      public DirectoryValidator directoryValidator()
    • getTickTargetMillis

      private float getTickTargetMillis(float p_308953_)
    • getLauncherBrand

      @Nullable public static String getLauncherBrand()