@Environment(value=CLIENT) public class MinecraftClient extends ReentrantThreadExecutor<Runnable> implements SnooperListener, WindowEventHandler
Modifier and Type | Class and Description |
---|---|
static class |
MinecraftClient.IntegratedResourceManager |
(package private) static class |
MinecraftClient.WorldLoadAction |
Constructor and Description |
---|
MinecraftClient(RunArgs args) |
executeTask, hasRunningTasks, shouldExecuteAsync
cancelTasks, execute, getName, getTaskCount, isOnThread, runTask, runTasks, runTasks, send, submit, submit, submitAndJoin, waitForTasks
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
ask, create, method_27918
private static MinecraftClient instance
private static final Logger LOGGER
public static final boolean IS_SYSTEM_MAC
public static final Identifier DEFAULT_FONT_ID
public static final Identifier UNICODE_FONT_ID
public static final Identifier ALT_TEXT_RENDERER_ID
private static final CompletableFuture<Unit> COMPLETED_UNIT_FUTURE
private static final Text field_26841
public static byte[] memoryReservedForCrash
private static int currentFps
private final File resourcePackDir
private final com.mojang.authlib.properties.PropertyMap sessionPropertyMap
private final TextureManager textureManager
private final com.mojang.datafixers.DataFixer dataFixer
private final WindowProvider windowProvider
private final Window window
private final RenderTickCounter renderTickCounter
private final Snooper snooper
private final BufferBuilderStorage bufferBuilders
public final WorldRenderer worldRenderer
private final EntityRenderDispatcher entityRenderDispatcher
private final ItemRenderer itemRenderer
private final HeldItemRenderer heldItemRenderer
public final ParticleManager particleManager
private final SearchManager searchManager
private final Session session
public final TextRenderer textRenderer
public final GameRenderer gameRenderer
public final DebugRenderer debugRenderer
private final AtomicReference<WorldGenerationProgressTracker> worldGenProgressTracker
public final InGameHud inGameHud
public final GameOptions options
private final HotbarStorage creativeHotbarStorage
public final Mouse mouse
public final Keyboard keyboard
public final File runDirectory
private final String gameVersion
private final String versionType
private final Proxy netProxy
private final LevelStorage levelStorage
public final MetricsData metricsData
private final boolean is64Bit
private final boolean isDemo
private final boolean multiplayerEnabled
private final boolean onlineChatEnabled
private final ReloadableResourceManager resourceManager
private final ClientBuiltinResourcePackProvider builtinPackProvider
private final ResourcePackManager resourcePackManager
private final LanguageManager languageManager
private final BlockColors blockColors
private final ItemColors itemColors
private final Framebuffer framebuffer
private final SoundManager soundManager
private final MusicTracker musicTracker
private final FontManager fontManager
private final SplashTextResourceSupplier splashTextLoader
private final VideoWarningManager videoWarningManager
private final com.mojang.authlib.minecraft.MinecraftSessionService sessionService
private final com.mojang.authlib.minecraft.SocialInteractionsService field_26902
private final PlayerSkinProvider skinProvider
private final BakedModelManager bakedModelManager
private final BlockRenderManager blockRenderManager
private final PaintingManager paintingManager
private final StatusEffectSpriteManager statusEffectSpriteManager
private final ToastManager toastManager
private final MinecraftClientGame game
private final TutorialManager tutorialManager
private final SocialInteractionsManager socialInteractionsManager
@Nullable public ClientPlayerInteractionManager interactionManager
@Nullable public ClientWorld world
@Nullable public ClientPlayerEntity player
@Nullable private IntegratedServer server
@Nullable private ServerInfo currentServerEntry
@Nullable private ClientConnection connection
private boolean integratedServerRunning
private int itemUseCooldown
protected int attackCooldown
private boolean paused
private float pausedTickDelta
private long lastMetricsSampleTime
private long nextDebugInfoUpdateTime
private int fpsCounter
public boolean skipGameRender
private boolean connectedToRealms
private Thread thread
private volatile boolean running
@Nullable private CrashReport crashReport
public String fpsDebugString
public boolean debugChunkInfo
public boolean debugChunkOcclusion
public boolean chunkCullingEnabled
private boolean windowFocused
@Nullable private CompletableFuture<Void> resourceReloadFuture
@Nullable private TutorialToast field_26843
private Profiler profiler
private int trackingTick
private final TickTimeTracker tickTimeTracker
@Nullable private ProfileResult tickProfilerResult
private String openProfilerSection
public MinecraftClient(RunArgs args)
public void updateWindowTitle()
private String getWindowTitle()
private com.mojang.authlib.minecraft.SocialInteractionsService method_31382(com.mojang.authlib.yggdrasil.YggdrasilAuthenticationService yggdrasilAuthenticationService, RunArgs runArgs)
public boolean isModded()
This checks the client's brand and if the MinecraftClient's class is still signed.
private void handleResourceReloadException(Throwable throwable)
public void run()
void initFont(boolean forcesUnicode)
private void initializeSearchableContainers()
private void handleGlErrorByDisableVsync(int error, long description)
private static boolean checkIs64Bit()
public Framebuffer getFramebuffer()
public String getGameVersion()
public String getVersionType()
public void setCrashReport(CrashReport report)
public static void printCrashReport(CrashReport report)
public boolean forcesUnicodeFont()
public CompletableFuture<Void> reloadResources()
private void checkGameData()
public LevelStorage getLevelStorage()
private void openChatScreen(String text)
public void stop()
public void close()
close
in interface AutoCloseable
close
in interface MessageListener<Runnable>
private void render(boolean tick)
private boolean shouldMonitorTickDuration()
private void startMonitor(boolean active, @Nullable TickDurationMonitor monitor)
private void endMonitor(boolean active, @Nullable TickDurationMonitor monitor)
public void onResolutionChanged()
onResolutionChanged
in interface WindowEventHandler
public void onCursorEnterChanged()
onCursorEnterChanged
in interface WindowEventHandler
private int getFramerateLimit()
public void cleanUpAfterCrash()
void handleProfilerKeyPress(int digit)
private void drawProfilerResults(MatrixStack matrices, ProfileResult profileResult)
public void scheduleStop()
public boolean isRunning()
public void openPauseMenu(boolean pause)
private void handleBlockBreaking(boolean bool)
private void doAttack()
private void doItemUse()
public MusicTracker getMusicTracker()
public void tick()
private boolean method_31321()
private void handleInputEvents()
public static DataPackSettings method_29598(LevelStorage.Session session)
public static SaveProperties createSaveProperties(LevelStorage.Session session, DynamicRegistryManager.Impl registryTracker, ResourceManager resourceManager, DataPackSettings dataPackSettings)
public void startIntegratedServer(String worldName)
public void method_29607(String worldName, LevelInfo levelInfo, DynamicRegistryManager.Impl registryTracker, GeneratorOptions generatorOptions)
private void startIntegratedServer(String worldName, DynamicRegistryManager.Impl registryTracker, Function<LevelStorage.Session,DataPackSettings> function, com.mojang.datafixers.util.Function4<LevelStorage.Session,DynamicRegistryManager.Impl,ResourceManager,DataPackSettings,SaveProperties> function4, boolean safeMode, MinecraftClient.WorldLoadAction worldLoadAction)
private void method_29601(MinecraftClient.WorldLoadAction worldLoadAction, String string, boolean bool, Runnable runnable)
public MinecraftClient.IntegratedResourceManager method_29604(DynamicRegistryManager.Impl impl, Function<LevelStorage.Session,DataPackSettings> function, com.mojang.datafixers.util.Function4<LevelStorage.Session,DynamicRegistryManager.Impl,ResourceManager,DataPackSettings,SaveProperties> function4, boolean bool, LevelStorage.Session session)
public void joinWorld(ClientWorld world)
public void disconnect()
public void disconnect(Screen screen)
private void reset(Screen screen)
public void method_29970(Screen screen)
private void setWorld(@Nullable ClientWorld world)
public boolean isMultiplayerEnabled()
public boolean shouldBlockMessages(UUID sender)
sender
.
If true, messages will not be displayed in chat and narrator will not process them.
public boolean isOnlineChatEnabled()
public final boolean isDemo()
@Nullable public ClientPlayNetworkHandler getNetworkHandler()
public static boolean isHudEnabled()
public static boolean isFancyGraphicsOrBetter()
public static boolean isFabulousGraphicsOrBetter()
public static boolean isAmbientOcclusionEnabled()
private void doItemPick()
private ItemStack addBlockEntityNbt(ItemStack stack, BlockEntity blockEntity)
public CrashReport addDetailsToCrashReport(CrashReport report)
public static void addSystemDetailsToCrashReport(@Nullable LanguageManager languageManager, String version, @Nullable GameOptions options, CrashReport report)
public static MinecraftClient getInstance()
public CompletableFuture<Void> reloadResourcesConcurrently()
public void addSnooperInfo(Snooper snooper)
addSnooperInfo
in interface SnooperListener
private String getCurrentAction()
public void setCurrentServerEntry(@Nullable ServerInfo serverInfo)
@Nullable public ServerInfo getCurrentServerEntry()
public boolean isInSingleplayer()
public boolean isIntegratedServerRunning()
@Nullable public IntegratedServer getServer()
The integrated server is only present when a local single player world is open.
public Snooper getSnooper()
public Session getSession()
public com.mojang.authlib.properties.PropertyMap getSessionProperties()
public Proxy getNetworkProxy()
public TextureManager getTextureManager()
public ResourceManager getResourceManager()
public ResourcePackManager getResourcePackManager()
public ClientBuiltinResourcePackProvider getResourcePackDownloader()
public File getResourcePackDir()
public LanguageManager getLanguageManager()
public Function<Identifier,Sprite> getSpriteAtlas(Identifier id)
public boolean is64Bit()
public boolean isPaused()
public VideoWarningManager getVideoWarningManager()
public SoundManager getSoundManager()
public MusicSound getMusicType()
public com.mojang.authlib.minecraft.MinecraftSessionService getSessionService()
public PlayerSkinProvider getSkinProvider()
public void setCameraEntity(Entity entity)
public boolean hasOutline(Entity entity)
entity
should display an outline around its model.protected Thread getThread()
getThread
in class ThreadExecutor<Runnable>
protected Runnable createTask(Runnable runnable)
createTask
in class ThreadExecutor<Runnable>
protected boolean canExecute(Runnable task)
canExecute
in class ThreadExecutor<Runnable>
public BlockRenderManager getBlockRenderManager()
public EntityRenderDispatcher getEntityRenderDispatcher()
public ItemRenderer getItemRenderer()
public HeldItemRenderer getHeldItemRenderer()
public <T> SearchableContainer<T> getSearchableContainer(SearchManager.Key<T> key)
public MetricsData getMetricsData()
public boolean isConnectedToRealms()
public void setConnectedToRealms(boolean connectedToRealms)
public com.mojang.datafixers.DataFixer getDataFixer()
public float getTickDelta()
public float getLastFrameDuration()
public BlockColors getBlockColors()
public boolean hasReducedDebugInfo()
public ToastManager getToastManager()
public TutorialManager getTutorialManager()
public boolean isWindowFocused()
public HotbarStorage getCreativeHotbarStorage()
public BakedModelManager getBakedModelManager()
public PaintingManager getPaintingManager()
public StatusEffectSpriteManager getStatusEffectSpriteManager()
public void onWindowFocusChanged(boolean focused)
onWindowFocusChanged
in interface WindowEventHandler
public Profiler getProfiler()
public MinecraftClientGame getGame()
public SplashTextResourceSupplier getSplashTextLoader()
public SocialInteractionsManager getSocialInteractionsManager()
public boolean shouldRenderAsync()
public Window getWindow()
public BufferBuilderStorage getBufferBuilders()
private static ResourcePackProfile createResourcePackProfile(String name, boolean alwaysEnabled, Supplier<ResourcePack> packFactory, ResourcePack pack, PackResourceMetadata metadata, ResourcePackProfile.InsertionPosition insertionPosition, ResourcePackSource source)
private static Supplier<ResourcePack> createV3ResourcePackFactory(Supplier<ResourcePack> packFactory)
private static Supplier<ResourcePack> createV4ResourcePackFactory(Supplier<ResourcePack> packFactory)
public void resetMipmapLevels(int mipmapLevels)