Package net.minecraft.client
Class MinecraftClient
- All Implemented Interfaces:
AutoCloseable
,Executor
,WindowEventHandler
,SnooperListener
,MessageListener<Runnable>
@Environment(CLIENT) public class MinecraftClient extends ReentrantThreadExecutor<Runnable> implements SnooperListener, WindowEventHandler
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
MinecraftClient.IntegratedResourceManager
(package private) static class
MinecraftClient.WorldLoadAction
-
Field Summary
-
Constructor Summary
Constructors Constructor Description MinecraftClient(RunArgs args)
-
Method Summary
Methods inherited from class net.minecraft.util.thread.ReentrantThreadExecutor
executeTask, hasRunningTasks, shouldExecuteAsync
Methods inherited from class net.minecraft.util.thread.ThreadExecutor
cancelTasks, execute, getName, getTaskCount, isOnThread, runTask, runTasks, runTasks, send, submit, submit, submitAndJoin, waitForTasks
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface net.minecraft.util.thread.MessageListener
ask, method_27918
-
Field Details
-
instance
-
LOGGER
-
IS_SYSTEM_MAC
public static final boolean IS_SYSTEM_MAC -
DEFAULT_FONT_ID
-
UNICODE_FONT_ID
-
ALT_TEXT_RENDERER_ID
-
COMPLETED_UNIT_FUTURE
-
field_26841
-
memoryReservedForCrash
public static byte[] memoryReservedForCrash -
currentFps
private static int currentFps -
resourcePackDir
-
sessionPropertyMap
private final com.mojang.authlib.properties.PropertyMap sessionPropertyMap -
textureManager
-
dataFixer
private final com.mojang.datafixers.DataFixer dataFixer -
windowProvider
-
window
-
renderTickCounter
-
snooper
-
bufferBuilders
-
worldRenderer
-
entityRenderDispatcher
-
itemRenderer
-
heldItemRenderer
-
particleManager
-
searchManager
-
session
-
textRenderer
-
gameRenderer
-
debugRenderer
-
worldGenProgressTracker
-
inGameHud
-
options
-
creativeHotbarStorage
-
mouse
-
keyboard
-
runDirectory
-
gameVersion
-
versionType
-
netProxy
-
levelStorage
-
metricsData
-
is64Bit
private final boolean is64Bit -
isDemo
private final boolean isDemo -
multiplayerEnabled
private final boolean multiplayerEnabled -
onlineChatEnabled
private final boolean onlineChatEnabled -
resourceManager
-
builtinPackProvider
-
resourcePackManager
-
languageManager
-
blockColors
-
itemColors
-
framebuffer
-
soundManager
-
musicTracker
-
fontManager
-
splashTextLoader
-
videoWarningManager
-
sessionService
private final com.mojang.authlib.minecraft.MinecraftSessionService sessionService -
field_26902
private final com.mojang.authlib.minecraft.SocialInteractionsService field_26902 -
skinProvider
-
bakedModelManager
-
blockRenderManager
-
paintingManager
-
statusEffectSpriteManager
-
toastManager
-
game
-
tutorialManager
-
interactionManager
-
world
Represents the world the client is currently viewing. This field is not null when in game. -
player
Represents the client's own player. This field is not null when in game. -
server
-
currentServerEntry
-
connection
-
integratedServerRunning
private boolean integratedServerRunning -
cameraEntity
-
targetedEntity
-
crosshairTarget
-
itemUseCooldown
private int itemUseCooldown -
attackCooldown
protected int attackCooldown -
paused
private boolean paused -
pausedTickDelta
private float pausedTickDelta -
lastMetricsSampleTime
private long lastMetricsSampleTime -
nextDebugInfoUpdateTime
private long nextDebugInfoUpdateTime -
fpsCounter
private int fpsCounter -
skipGameRender
public boolean skipGameRender -
currentScreen
-
overlay
-
connectedToRealms
private boolean connectedToRealms -
thread
-
running
private volatile boolean running -
crashReport
-
fpsDebugString
-
debugChunkInfo
public boolean debugChunkInfo -
debugChunkOcclusion
public boolean debugChunkOcclusion -
chunkCullingEnabled
public boolean chunkCullingEnabled -
windowFocused
private boolean windowFocused -
renderTaskQueue
-
resourceReloadFuture
-
field_26843
-
profiler
-
trackingTick
private int trackingTick -
tickTimeTracker
-
tickProfilerResult
-
openProfilerSection
-
-
Constructor Details
-
MinecraftClient
-
-
Method Details
-
updateWindowTitle
public void updateWindowTitle() -
getWindowTitle
-
method_31382
private com.mojang.authlib.minecraft.SocialInteractionsService method_31382(com.mojang.authlib.yggdrasil.YggdrasilAuthenticationService yggdrasilAuthenticationService, RunArgs runArgs) -
isModded
public boolean isModded()Checks if this client is modded.This checks the client's brand and if the MinecraftClient's class is still signed.
-
handleResourceReloadException
-
method_31186
-
run
public void run() -
initFont
void initFont(boolean forcesUnicode) -
initializeSearchableContainers
private void initializeSearchableContainers() -
handleGlErrorByDisableVsync
private void handleGlErrorByDisableVsync(int error, long description) -
checkIs64Bit
private static boolean checkIs64Bit() -
getFramebuffer
-
getGameVersion
-
getVersionType
-
setCrashReport
-
printCrashReport
-
forcesUnicodeFont
public boolean forcesUnicodeFont() -
reloadResources
-
checkGameData
private void checkGameData() -
getLevelStorage
-
openChatScreen
-
openScreen
-
setOverlay
-
stop
public void stop() -
close
public void close()- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceMessageListener<Runnable>
-
render
private void render(boolean tick) -
shouldMonitorTickDuration
private boolean shouldMonitorTickDuration() -
startMonitor
-
endMonitor
-
onResolutionChanged
public void onResolutionChanged()- Specified by:
onResolutionChanged
in interfaceWindowEventHandler
-
onCursorEnterChanged
public void onCursorEnterChanged()- Specified by:
onCursorEnterChanged
in interfaceWindowEventHandler
-
getFramerateLimit
private int getFramerateLimit() -
cleanUpAfterCrash
public void cleanUpAfterCrash() -
handleProfilerKeyPress
void handleProfilerKeyPress(int digit) -
drawProfilerResults
-
scheduleStop
public void scheduleStop() -
isRunning
public boolean isRunning() -
openPauseMenu
public void openPauseMenu(boolean pause) -
handleBlockBreaking
private void handleBlockBreaking(boolean bool) -
doAttack
private void doAttack() -
doItemUse
private void doItemUse() -
getMusicTracker
-
tick
public void tick() -
method_31321
private boolean method_31321() -
handleInputEvents
private void handleInputEvents() -
method_29598
-
createSaveProperties
public static SaveProperties createSaveProperties(LevelStorage.Session session, DynamicRegistryManager.Impl registryTracker, ResourceManager resourceManager, DataPackSettings dataPackSettings) -
startIntegratedServer
-
method_29607
public void method_29607(String worldName, LevelInfo levelInfo, DynamicRegistryManager.Impl registryTracker, GeneratorOptions generatorOptions) -
startIntegratedServer
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) -
method_29601
private void method_29601(MinecraftClient.WorldLoadAction worldLoadAction, String string, boolean bool, Runnable runnable) -
method_29604
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) -
joinWorld
-
disconnect
public void disconnect() -
disconnect
-
reset
-
method_29970
-
setWorld
-
isMultiplayerEnabled
public boolean isMultiplayerEnabled() -
shouldBlockMessages
Checks if the client should block messages from thesender
.If true, messages will not be displayed in chat and narrator will not process them.
-
isOnlineChatEnabled
public boolean isOnlineChatEnabled() -
isDemo
public final boolean isDemo() -
getNetworkHandler
-
isHudEnabled
public static boolean isHudEnabled() -
isFancyGraphicsOrBetter
public static boolean isFancyGraphicsOrBetter() -
isFabulousGraphicsOrBetter
public static boolean isFabulousGraphicsOrBetter() -
isAmbientOcclusionEnabled
public static boolean isAmbientOcclusionEnabled() -
doItemPick
private void doItemPick() -
addBlockEntityNbt
-
addDetailsToCrashReport
-
addSystemDetailsToCrashReport
public static void addSystemDetailsToCrashReport(@Nullable LanguageManager languageManager, String version, @Nullable GameOptions options, CrashReport report) -
getInstance
-
reloadResourcesConcurrently
-
addSnooperInfo
- Specified by:
addSnooperInfo
in interfaceSnooperListener
-
getCurrentAction
-
setCurrentServerEntry
-
getCurrentServerEntry
-
isInSingleplayer
public boolean isInSingleplayer() -
isIntegratedServerRunning
public boolean isIntegratedServerRunning() -
getServer
Gets this client's own integrated server.The integrated server is only present when a local single player world is open.
-
getSnooper
-
getSession
-
getSessionProperties
public com.mojang.authlib.properties.PropertyMap getSessionProperties() -
getNetworkProxy
-
getTextureManager
-
getResourceManager
-
getResourcePackManager
-
getResourcePackDownloader
-
getResourcePackDir
-
getLanguageManager
-
getSpriteAtlas
-
is64Bit
public boolean is64Bit() -
isPaused
public boolean isPaused() -
getVideoWarningManager
-
getSoundManager
-
getMusicType
-
getSessionService
public com.mojang.authlib.minecraft.MinecraftSessionService getSessionService() -
getSkinProvider
-
getCameraEntity
-
setCameraEntity
-
hasOutline
Checks if the providedentity
should display an outline around its model. -
getThread
- Specified by:
getThread
in classThreadExecutor<Runnable>
-
createTask
- Specified by:
createTask
in classThreadExecutor<Runnable>
-
canExecute
- Specified by:
canExecute
in classThreadExecutor<Runnable>
-
getBlockRenderManager
-
getEntityRenderDispatcher
-
getItemRenderer
-
getHeldItemRenderer
-
getSearchableContainer
-
getMetricsData
-
isConnectedToRealms
public boolean isConnectedToRealms() -
setConnectedToRealms
public void setConnectedToRealms(boolean connectedToRealms) -
getDataFixer
public com.mojang.datafixers.DataFixer getDataFixer() -
getTickDelta
public float getTickDelta() -
getLastFrameDuration
public float getLastFrameDuration() -
getBlockColors
-
hasReducedDebugInfo
public boolean hasReducedDebugInfo() -
getToastManager
-
getTutorialManager
-
isWindowFocused
public boolean isWindowFocused() -
getCreativeHotbarStorage
-
getBakedModelManager
-
getPaintingManager
-
getStatusEffectSpriteManager
-
onWindowFocusChanged
public void onWindowFocusChanged(boolean focused)- Specified by:
onWindowFocusChanged
in interfaceWindowEventHandler
-
getProfiler
-
getGame
-
getSplashTextLoader
-
getOverlay
-
getSocialInteractionsManager
-
shouldRenderAsync
public boolean shouldRenderAsync() -
getWindow
-
getBufferBuilders
-
createResourcePackProfile
private static ResourcePackProfile createResourcePackProfile(String name, boolean alwaysEnabled, Supplier<ResourcePack> packFactory, ResourcePack pack, PackResourceMetadata metadata, ResourcePackProfile.InsertionPosition insertionPosition, ResourcePackSource source) -
createV3ResourcePackFactory
private static Supplier<ResourcePack> createV3ResourcePackFactory(Supplier<ResourcePack> packFactory) -
createV4ResourcePackFactory
private static Supplier<ResourcePack> createV4ResourcePackFactory(Supplier<ResourcePack> packFactory) -
resetMipmapLevels
public void resetMipmapLevels(int mipmapLevels)
-
socialInteractionsManager