Class Minecraft

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

public class Minecraft extends ReentrantBlockableEventLoop<Runnable> implements WindowEventHandler, IForgeMinecraft
  • 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:
    • resourcePackDirectory

      private final Path resourcePackDirectory
    • profileProperties

      private final com.mojang.authlib.properties.PropertyMap profileProperties
    • textureManager

      public final TextureManager textureManager
    • fixerUpper

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

      private final VirtualScreen virtualScreen
    • window

      private final Window window
    • timer

      private final 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
    • searchRegistry

      private final SearchRegistry searchRegistry
    • 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
    • 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
    • frameTimer

      public final FrameTimer frameTimer
    • is64bit

      private final boolean is64bit
    • 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
    • serviceSignatureValidator

      private final SignatureValidator serviceSignatureValidator
    • userApiService

      private final com.mojang.authlib.minecraft.UserApiService userApiService
    • 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
    • toast

      private final ToastComponent toast
    • game

      private final Game game
    • 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
    • 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
    • pausePartialTick

      private float pausePartialTick
    • 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
    • connectedToRealms

      private boolean connectedToRealms
    • 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
    • chunkPath

      public boolean chunkPath
    • chunkVisibility

      public boolean chunkVisibility
    • 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
    • realms32BitWarningStatus

      private final Realms32BitWarningStatus realms32BitWarningStatus
    • narrator

      private final GameNarrator narrator
    • chatListener

      private final ChatListener chatListener
    • reportingContext

      private ReportingContext reportingContext
    • debugPath

      private String debugPath
    • realPartialTick

      private float realPartialTick
  • Constructor Details

    • Minecraft

      public Minecraft(GameConfig p_91084_)
  • Method Details

    • getIconFile

      private IoSupplier<InputStream> getIconFile(String... p_250431_) throws IOException
      Throws:
      IOException
    • 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_)
    • clearResourcePacksOnError

      public void clearResourcePacksOnError(Throwable p_91242_, @Nullable Component p_91243_)
    • 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

      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_)
    • crash

      public static void crash(CrashReport p_91333_)
    • isEnforceUnicode

      public boolean isEnforceUnicode()
    • reloadResourcePacks

      public CompletableFuture<Void> reloadResourcePacks()
    • reloadResourcePacks

      private CompletableFuture<Void> reloadResourcePacks(boolean p_168020_)
    • 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_)
    • shouldRenderFpsPie

      private boolean shouldRenderFpsPie()
    • 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

      public 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(PoseStack p_91141_, ProfileResults p_91142_)
    • 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()
    • 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(String p_261891_, LevelStorageSource.LevelStorageAccess p_261564_, PackRepository p_261826_, WorldStem p_261470_, boolean p_261465_)
    • setLevel

      public void setLevel(ClientLevel p_91157_)
    • clearLevel

      public void clearLevel()
    • clearLevel

      public void clearLevel(Screen p_91321_)
    • updateScreenAndTick

      private void updateScreenAndTick(Screen p_91363_)
    • forceSetScreen

      public void forceSetScreen(Screen p_91347_)
    • updateLevelInEngines

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

      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_)
    • 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_)
    • fillSystemReport

      private static SystemReport fillSystemReport(SystemReport p_167851_, @Nullable Minecraft p_167852_, @Nullable LanguageManager p_167853_, String p_167854_, 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()
    • getUser

      public User getUser()
    • getProfileProperties

      public com.mojang.authlib.properties.PropertyMap getProfileProperties()
    • 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_)
    • is64Bit

      public boolean is64Bit()
    • 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()
    • getSearchTree

      public <T> SearchTree<T> getSearchTree(SearchRegistry.Key<T> p_231373_)
    • populateSearchTree

      public <T> void populateSearchTree(SearchRegistry.Key<T> p_231375_, List<T> p_231376_)
    • getFrameTimer

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

      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()
    • 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()
    • getGame

      public Game getGame()
    • getProgressListener

      @Nullable public StoringChunkProgressListener getProgressListener()
    • getSplashManager

      public SplashManager getSplashManager()
    • getOverlay

      @Nullable public Overlay getOverlay()
    • getPlayerSocialManager

      public PlayerSocialManager getPlayerSocialManager()
    • renderOnThread

      public boolean renderOnThread()
    • getWindow

      public Window getWindow()
    • renderBuffers

      public RenderBuffers renderBuffers()
    • updateMaxMipLevel

      public void updateMaxMipLevel(int p_91313_)
    • getItemColors

      public ItemColors getItemColors()
    • getSearchTreeManager

      public SearchRegistry getSearchTreeManager()
    • getPartialTick

      public float getPartialTick()
    • getEntityModels

      public EntityModelSet getEntityModels()
    • isTextFilteringEnabled

      public boolean isTextFilteringEnabled()
    • prepareForMultiplayer

      public void prepareForMultiplayer()
    • getRealms32BitWarningStatus

      public Realms32BitWarningStatus getRealms32BitWarningStatus()
    • getServiceSignatureValidator

      public SignatureValidator getServiceSignatureValidator()
    • getNarrator

      public GameNarrator getNarrator()
    • getChatListener

      public ChatListener getChatListener()
    • getReportingContext

      public ReportingContext getReportingContext()
    • realmsDataFetcher

      public RealmsDataFetcher realmsDataFetcher()