Package net.minecraft.client.renderer
Class LevelRenderer
java.lang.Object
net.minecraft.client.renderer.LevelRenderer
- All Implemented Interfaces:
AutoCloseable,PreparableReloadListener,ResourceManagerReloadListener
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescription(package private) static class(package private) static class(package private) static classstatic classNested classes/interfaces inherited from interface net.minecraft.server.packs.resources.PreparableReloadListener
PreparableReloadListener.PreparationBarrier -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final BlockEntityRenderDispatcherprivate Frustumprivate booleanprivate static final doublestatic final intprivate ChunkRenderDispatcherprivate VertexBufferprivate static final ResourceLocationprivate RenderTargetprivate intprivate Frustumprivate VertexBufferprivate final it.unimi.dsi.fastutil.ints.Int2ObjectMap<BlockDestructionProgress>private final it.unimi.dsi.fastutil.longs.Long2ObjectMap<SortedSet<BlockDestructionProgress>>static final Direction[]private static final ResourceLocationprivate PostChainprivate final EntityRenderDispatcherprivate RenderTargetprivate static final ResourceLocationprivate final RunningTrimmedMeanprivate final Vector4f[]private final Vector3dprivate booleanprivate final Set<BlockEntity>private static final intprivate static final intprivate RenderTargetprivate intprivate intprivate intprivate doubleprivate doubleprivate doubleprivate Future<?>private intprivate ClientLevelprivate static final org.slf4j.Loggerprivate static final intprivate final Minecraftprivate static final intprivate static final ResourceLocationprivate final AtomicBooleanprivate booleanprivate final AtomicLongprivate RenderTargetprivate final Map<BlockPos,SoundInstance> private doubleprivate doubleprivate doubleprivate doubleprivate doubleprivate Vec3private CloudStatusprivate intprivate intprivate intprivate static final intprivate static final ResourceLocationprivate static final intprivate final float[]private final float[]private intprivate final BlockingQueue<ChunkRenderDispatcher.RenderChunk>private final RenderBuffersprivate final it.unimi.dsi.fastutil.objects.ObjectArrayList<LevelRenderer.RenderChunkInfo>private final AtomicReference<LevelRenderer.RenderChunkStorage>private intprivate static final floatprivate VertexBufferprivate static final ResourceLocationprivate VertexBufferprivate static final ResourceLocationprivate intprivate RenderTargetprivate PostChainprivate static final intprivate ViewAreaprivate RenderTargetprivate doubleprivate doubleprivate double -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidaddChainedFilledBoxVertices(BufferBuilder p_109557_, double p_109558_, double p_109559_, double p_109560_, double p_109561_, double p_109562_, double p_109563_, float p_109564_, float p_109565_, float p_109566_, float p_109567_) private voidaddFrustumQuad(VertexConsumer p_109669_, int p_109670_, int p_109671_, int p_109672_, int p_109673_, int p_109674_, int p_109675_, int p_109676_) private voidaddFrustumVertex(VertexConsumer p_109666_, int p_109667_) voidaddParticle(ParticleOptions p_109753_, boolean p_109754_, boolean p_109755_, double p_109756_, double p_109757_, double p_109758_, double p_109759_, double p_109760_, double p_109761_) voidaddParticle(ParticleOptions p_109744_, boolean p_109745_, double p_109746_, double p_109747_, double p_109748_, double p_109749_, double p_109750_, double p_109751_) private <T extends ParticleOptions>
voidaddParticle(T p_109736_, double p_109737_, double p_109738_, double p_109739_, double p_109740_, double p_109741_, double p_109742_) private ParticleaddParticleInternal(ParticleOptions p_109805_, boolean p_109806_, boolean p_109807_, double p_109808_, double p_109809_, double p_109810_, double p_109811_, double p_109812_, double p_109813_) private ParticleaddParticleInternal(ParticleOptions p_109796_, boolean p_109797_, double p_109798_, double p_109799_, double p_109800_, double p_109801_, double p_109802_, double p_109803_) voidvoidprivate voidapplyFrustum(Frustum p_194355_) voidblockChanged(BlockGetter p_109545_, BlockPos p_109546_, BlockState p_109547_, BlockState p_109548_, int p_109549_) private voidbuildClouds(BufferBuilder p_109579_, double p_109580_, double p_109581_, double p_109582_, Vec3 p_109583_) private static voidbuildSkyDisc(BufferBuilder p_172948_, float p_172949_) private ParticleStatuscalculateParticleLevel(boolean p_109768_) voidprivate voidcaptureFrustum(Matrix4f p_109526_, Matrix4f p_109527_, double p_109528_, double p_109529_, double p_109530_, Frustum p_109531_) private voidcheckPoseStack(PoseStack p_109589_) voidclear()voidclose()private booleancloseToBorder(BlockPos p_194360_, ChunkRenderDispatcher.RenderChunk p_194361_) private voidcompileChunks(Camera p_194371_) intprivate voidprivate voidprivate voidprivate voidvoiddestroyBlockProgress(int p_109775_, BlockPos p_109776_, int p_109777_) voidprivate voiddrawStars(BufferBuilder p_109555_) doublestatic intgetLightColor(BlockAndTintGetter p_109542_, BlockPos p_109543_) static intgetLightColor(BlockAndTintGetter p_109538_, BlockState p_109539_, BlockPos p_109540_) getRelativeFrom(BlockPos p_109729_, ChunkRenderDispatcher.RenderChunk p_109730_, Direction p_109731_) doublevoidglobalLevelEvent(int p_109507_, BlockPos p_109508_, int p_109509_) voidbooleanprivate voidinitializeQueueForFullUpdate(Camera p_194344_, Queue<LevelRenderer.RenderChunkInfo> p_194345_) voidprivate voidbooleanisChunkCompiled(BlockPos p_202431_) voidvoidlevelEvent(Player p_109533_, int p_109534_, BlockPos p_109535_, int p_109536_) voidprivate voidnotifyNearbyEntities(Level p_109551_, BlockPos p_109552_, boolean p_109553_) voidonResourceManagerReload(ResourceManager p_109513_) voidplayStreamingMusic(SoundEvent p_109515_, BlockPos p_109516_) Deprecated.voidplayStreamingMusic(SoundEvent p_109515_, BlockPos p_109516_, RecordItem musicDiscItem) voidprepareCullFrustum(PoseStack p_172962_, Vec3 p_172963_, Matrix4f p_172964_) private voidremoveProgress(BlockDestructionProgress p_109766_) private voidrenderChunkLayer(RenderType p_172994_, PoseStack p_172995_, double p_172996_, double p_172997_, double p_172998_, Matrix4f p_172999_) voidrenderClouds(PoseStack p_172955_, Matrix4f p_172956_, float p_172957_, double p_172958_, double p_172959_, double p_172960_) private voidrenderDebug(Camera p_109794_) private voidrenderEndSky(PoseStack p_109781_) private voidrenderEntity(Entity p_109518_, double p_109519_, double p_109520_, double p_109521_, float p_109522_, PoseStack p_109523_, MultiBufferSource p_109524_) private voidrenderHitOutline(PoseStack p_109638_, VertexConsumer p_109639_, Entity p_109640_, double p_109641_, double p_109642_, double p_109643_, BlockPos p_109644_, BlockState p_109645_) voidrenderLevel(PoseStack p_109600_, float p_109601_, long p_109602_, boolean p_109603_, Camera p_109604_, GameRenderer p_109605_, LightTexture p_109606_, Matrix4f p_109607_) static voidrenderLineBox(PoseStack p_109609_, VertexConsumer p_109610_, double p_109611_, double p_109612_, double p_109613_, double p_109614_, double p_109615_, double p_109616_, float p_109617_, float p_109618_, float p_109619_, float p_109620_) static voidrenderLineBox(PoseStack p_109622_, VertexConsumer p_109623_, double p_109624_, double p_109625_, double p_109626_, double p_109627_, double p_109628_, double p_109629_, float p_109630_, float p_109631_, float p_109632_, float p_109633_, float p_109634_, float p_109635_, float p_109636_) static voidrenderLineBox(PoseStack p_109647_, VertexConsumer p_109648_, AABB p_109649_, float p_109650_, float p_109651_, float p_109652_, float p_109653_) static voidrenderLineBox(VertexConsumer p_172966_, double p_172967_, double p_172968_, double p_172969_, double p_172970_, double p_172971_, double p_172972_, float p_172973_, float p_172974_, float p_172975_, float p_172976_) private static voidrenderShape(PoseStack p_109783_, VertexConsumer p_109784_, VoxelShape p_109785_, double p_109786_, double p_109787_, double p_109788_, float p_109789_, float p_109790_, float p_109791_, float p_109792_) voidrenderSky(PoseStack p_202424_, Matrix4f p_202425_, float p_202426_, Camera p_202427_, boolean p_202428_, Runnable p_202429_) private voidrenderSnowAndRain(LightTexture p_109704_, float p_109705_, double p_109706_, double p_109707_, double p_109708_) static voidrenderVoxelShape(PoseStack p_109655_, VertexConsumer p_109656_, VoxelShape p_109657_, double p_109658_, double p_109659_, double p_109660_, float p_109661_, float p_109662_, float p_109663_, float p_109664_) private voidrenderWorldBorder(Camera p_173013_) voidresize(int p_109488_, int p_109489_) private voidsetBlockDirty(BlockPos p_109733_, boolean p_109734_) voidsetBlockDirty(BlockPos p_109722_, BlockState p_109723_, BlockState p_109724_) voidsetBlocksDirty(int p_109495_, int p_109496_, int p_109497_, int p_109498_, int p_109499_, int p_109500_) voidsetLevel(ClientLevel p_109702_) voidsetSectionDirty(int p_109771_, int p_109772_, int p_109773_) private voidsetSectionDirty(int p_109502_, int p_109503_, int p_109504_, boolean p_109505_) voidsetSectionDirtyWithNeighbors(int p_109491_, int p_109492_, int p_109493_) private voidsetupRender(Camera p_194339_, Frustum p_194340_, boolean p_194341_, boolean p_194342_) protected booleanvoidtick()voidvoidupdateGlobalBlockEntities(Collection<BlockEntity> p_109763_, Collection<BlockEntity> p_109764_) private voidupdateRenderChunks(LinkedHashSet<LevelRenderer.RenderChunkInfo> p_194363_, LevelRenderer.RenderInfoMap p_194364_, Vec3 p_194365_, Queue<LevelRenderer.RenderChunkInfo> p_194366_, boolean p_194367_) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.minecraft.server.packs.resources.PreparableReloadListener
getNameMethods inherited from interface net.minecraft.server.packs.resources.ResourceManagerReloadListener
reload
-
Field Details
-
LOGGER
private static final org.slf4j.Logger LOGGER -
CHUNK_SIZE
public static final int CHUNK_SIZE- See Also:
-
HALF_CHUNK_SIZE
private static final int HALF_CHUNK_SIZE- See Also:
-
SKY_DISC_RADIUS
private static final float SKY_DISC_RADIUS- See Also:
-
MINIMUM_ADVANCED_CULLING_DISTANCE
private static final int MINIMUM_ADVANCED_CULLING_DISTANCE- See Also:
-
CEILED_SECTION_DIAGONAL
private static final double CEILED_SECTION_DIAGONAL -
MIN_FOG_DISTANCE
private static final int MIN_FOG_DISTANCE- See Also:
-
RAIN_RADIUS
private static final int RAIN_RADIUS- See Also:
-
RAIN_DIAMETER
private static final int RAIN_DIAMETER- See Also:
-
TRANSPARENT_SORT_COUNT
private static final int TRANSPARENT_SORT_COUNT- See Also:
-
HALF_A_SECOND_IN_MILLIS
private static final int HALF_A_SECOND_IN_MILLIS- See Also:
-
MOON_LOCATION
-
SUN_LOCATION
-
CLOUDS_LOCATION
-
END_SKY_LOCATION
-
FORCEFIELD_LOCATION
-
RAIN_LOCATION
-
SNOW_LOCATION
-
DIRECTIONS
-
minecraft
-
entityRenderDispatcher
-
blockEntityRenderDispatcher
-
renderBuffers
-
level
-
recentlyCompiledChunks
-
renderChunkStorage
-
renderChunksInFrustum
private final it.unimi.dsi.fastutil.objects.ObjectArrayList<LevelRenderer.RenderChunkInfo> renderChunksInFrustum -
globalBlockEntities
-
lastFullRenderChunkUpdate
-
viewArea
-
starBuffer
-
skyBuffer
-
darkBuffer
-
generateClouds
private boolean generateClouds -
cloudBuffer
-
frameTimes
-
ticks
private int ticks -
destroyingBlocks
-
destructionProgress
private final it.unimi.dsi.fastutil.longs.Long2ObjectMap<SortedSet<BlockDestructionProgress>> destructionProgress -
playingRecords
-
entityTarget
-
entityEffect
-
translucentTarget
-
itemEntityTarget
-
particlesTarget
-
weatherTarget
-
cloudsTarget
-
transparencyChain
-
lastCameraX
private double lastCameraX -
lastCameraY
private double lastCameraY -
lastCameraZ
private double lastCameraZ -
lastCameraChunkX
private int lastCameraChunkX -
lastCameraChunkY
private int lastCameraChunkY -
lastCameraChunkZ
private int lastCameraChunkZ -
prevCamX
private double prevCamX -
prevCamY
private double prevCamY -
prevCamZ
private double prevCamZ -
prevCamRotX
private double prevCamRotX -
prevCamRotY
private double prevCamRotY -
prevCloudX
private int prevCloudX -
prevCloudY
private int prevCloudY -
prevCloudZ
private int prevCloudZ -
prevCloudColor
-
prevCloudsType
-
chunkRenderDispatcher
-
lastViewDistance
private int lastViewDistance -
renderedEntities
private int renderedEntities -
culledEntities
private int culledEntities -
cullingFrustum
-
captureFrustum
private boolean captureFrustum -
capturedFrustum
-
frustumPoints
-
frustumPos
-
xTransparentOld
private double xTransparentOld -
yTransparentOld
private double yTransparentOld -
zTransparentOld
private double zTransparentOld -
needsFullRenderChunkUpdate
private boolean needsFullRenderChunkUpdate -
nextFullUpdateMillis
-
needsFrustumUpdate
-
rainSoundTime
private int rainSoundTime -
rainSizeX
private final float[] rainSizeX -
rainSizeZ
private final float[] rainSizeZ
-
-
Constructor Details
-
LevelRenderer
-
-
Method Details
-
renderSnowAndRain
private void renderSnowAndRain(LightTexture p_109704_, float p_109705_, double p_109706_, double p_109707_, double p_109708_) -
tickRain
-
close
public void close()- Specified by:
closein interfaceAutoCloseable
-
onResourceManagerReload
- Specified by:
onResourceManagerReloadin interfaceResourceManagerReloadListener
-
initOutline
public void initOutline() -
initTransparency
private void initTransparency() -
deinitTransparency
private void deinitTransparency() -
doEntityOutline
public void doEntityOutline() -
shouldShowEntityOutlines
protected boolean shouldShowEntityOutlines() -
createDarkSky
private void createDarkSky() -
createLightSky
private void createLightSky() -
buildSkyDisc
-
createStars
private void createStars() -
drawStars
-
setLevel
-
graphicsChanged
public void graphicsChanged() -
allChanged
public void allChanged() -
resize
public void resize(int p_109488_, int p_109489_) -
getChunkStatistics
-
getChunkRenderDispatcher
-
getTotalChunks
public double getTotalChunks() -
getLastViewDistance
public double getLastViewDistance() -
countRenderedChunks
public int countRenderedChunks() -
getEntityStatistics
-
setupRender
-
applyFrustum
-
initializeQueueForFullUpdate
private void initializeQueueForFullUpdate(Camera p_194344_, Queue<LevelRenderer.RenderChunkInfo> p_194345_) -
addRecentlyCompiledChunk
-
updateRenderChunks
private void updateRenderChunks(LinkedHashSet<LevelRenderer.RenderChunkInfo> p_194363_, LevelRenderer.RenderInfoMap p_194364_, Vec3 p_194365_, Queue<LevelRenderer.RenderChunkInfo> p_194366_, boolean p_194367_) -
getRelativeFrom
@Nullable private ChunkRenderDispatcher.RenderChunk getRelativeFrom(BlockPos p_109729_, ChunkRenderDispatcher.RenderChunk p_109730_, Direction p_109731_) -
closeToBorder
-
captureFrustum
-
prepareCullFrustum
-
renderLevel
public void renderLevel(PoseStack p_109600_, float p_109601_, long p_109602_, boolean p_109603_, Camera p_109604_, GameRenderer p_109605_, LightTexture p_109606_, Matrix4f p_109607_) -
checkPoseStack
-
renderEntity
private void renderEntity(Entity p_109518_, double p_109519_, double p_109520_, double p_109521_, float p_109522_, PoseStack p_109523_, MultiBufferSource p_109524_) -
renderChunkLayer
private void renderChunkLayer(RenderType p_172994_, PoseStack p_172995_, double p_172996_, double p_172997_, double p_172998_, Matrix4f p_172999_) -
renderDebug
-
addFrustumVertex
-
addFrustumQuad
private void addFrustumQuad(VertexConsumer p_109669_, int p_109670_, int p_109671_, int p_109672_, int p_109673_, int p_109674_, int p_109675_, int p_109676_) -
captureFrustum
public void captureFrustum() -
killFrustum
public void killFrustum() -
tick
public void tick() -
removeProgress
-
renderEndSky
-
renderSky
-
renderClouds
-
buildClouds
private void buildClouds(BufferBuilder p_109579_, double p_109580_, double p_109581_, double p_109582_, Vec3 p_109583_) -
compileChunks
-
renderWorldBorder
-
renderHitOutline
private void renderHitOutline(PoseStack p_109638_, VertexConsumer p_109639_, Entity p_109640_, double p_109641_, double p_109642_, double p_109643_, BlockPos p_109644_, BlockState p_109645_) -
renderVoxelShape
public static void renderVoxelShape(PoseStack p_109655_, VertexConsumer p_109656_, VoxelShape p_109657_, double p_109658_, double p_109659_, double p_109660_, float p_109661_, float p_109662_, float p_109663_, float p_109664_) -
renderShape
private static void renderShape(PoseStack p_109783_, VertexConsumer p_109784_, VoxelShape p_109785_, double p_109786_, double p_109787_, double p_109788_, float p_109789_, float p_109790_, float p_109791_, float p_109792_) -
renderLineBox
public static void renderLineBox(VertexConsumer p_172966_, double p_172967_, double p_172968_, double p_172969_, double p_172970_, double p_172971_, double p_172972_, float p_172973_, float p_172974_, float p_172975_, float p_172976_) -
renderLineBox
public static void renderLineBox(PoseStack p_109647_, VertexConsumer p_109648_, AABB p_109649_, float p_109650_, float p_109651_, float p_109652_, float p_109653_) -
renderLineBox
public static void renderLineBox(PoseStack p_109609_, VertexConsumer p_109610_, double p_109611_, double p_109612_, double p_109613_, double p_109614_, double p_109615_, double p_109616_, float p_109617_, float p_109618_, float p_109619_, float p_109620_) -
renderLineBox
public static void renderLineBox(PoseStack p_109622_, VertexConsumer p_109623_, double p_109624_, double p_109625_, double p_109626_, double p_109627_, double p_109628_, double p_109629_, float p_109630_, float p_109631_, float p_109632_, float p_109633_, float p_109634_, float p_109635_, float p_109636_) -
addChainedFilledBoxVertices
public static void addChainedFilledBoxVertices(BufferBuilder p_109557_, double p_109558_, double p_109559_, double p_109560_, double p_109561_, double p_109562_, double p_109563_, float p_109564_, float p_109565_, float p_109566_, float p_109567_) -
blockChanged
public void blockChanged(BlockGetter p_109545_, BlockPos p_109546_, BlockState p_109547_, BlockState p_109548_, int p_109549_) -
setBlockDirty
-
setBlocksDirty
public void setBlocksDirty(int p_109495_, int p_109496_, int p_109497_, int p_109498_, int p_109499_, int p_109500_) -
setBlockDirty
-
setSectionDirtyWithNeighbors
public void setSectionDirtyWithNeighbors(int p_109491_, int p_109492_, int p_109493_) -
setSectionDirty
public void setSectionDirty(int p_109771_, int p_109772_, int p_109773_) -
setSectionDirty
private void setSectionDirty(int p_109502_, int p_109503_, int p_109504_, boolean p_109505_) -
playStreamingMusic
Deprecated. -
playStreamingMusic
public void playStreamingMusic(@Nullable SoundEvent p_109515_, BlockPos p_109516_, @Nullable RecordItem musicDiscItem) -
notifyNearbyEntities
-
addParticle
public void addParticle(ParticleOptions p_109744_, boolean p_109745_, double p_109746_, double p_109747_, double p_109748_, double p_109749_, double p_109750_, double p_109751_) -
addParticle
public void addParticle(ParticleOptions p_109753_, boolean p_109754_, boolean p_109755_, double p_109756_, double p_109757_, double p_109758_, double p_109759_, double p_109760_, double p_109761_) -
addParticle
private <T extends ParticleOptions> void addParticle(T p_109736_, double p_109737_, double p_109738_, double p_109739_, double p_109740_, double p_109741_, double p_109742_) -
addParticleInternal
@Nullable private Particle addParticleInternal(ParticleOptions p_109796_, boolean p_109797_, double p_109798_, double p_109799_, double p_109800_, double p_109801_, double p_109802_, double p_109803_) -
addParticleInternal
@Nullable private Particle addParticleInternal(ParticleOptions p_109805_, boolean p_109806_, boolean p_109807_, double p_109808_, double p_109809_, double p_109810_, double p_109811_, double p_109812_, double p_109813_) -
calculateParticleLevel
-
clear
public void clear() -
globalLevelEvent
-
levelEvent
-
destroyBlockProgress
-
hasRenderedAllChunks
public boolean hasRenderedAllChunks() -
needsUpdate
public void needsUpdate() -
updateGlobalBlockEntities
public void updateGlobalBlockEntities(Collection<BlockEntity> p_109763_, Collection<BlockEntity> p_109764_) -
getLightColor
-
getLightColor
public static int getLightColor(BlockAndTintGetter p_109538_, BlockState p_109539_, BlockPos p_109540_) -
isChunkCompiled
-
entityTarget
-
getTranslucentTarget
-
getItemEntityTarget
-
getParticlesTarget
-
getWeatherTarget
-
getCloudsTarget
-