Package net.minecraft.client.renderer
Class LevelRenderer
java.lang.Object
net.minecraft.client.renderer.LevelRenderer
- All Implemented Interfaces:
- AutoCloseable,- PreparableReloadListener,- ResourceManagerReloadListener
- 
Nested Class SummaryNested ClassesNested classes/interfaces inherited from interface net.minecraft.server.packs.resources.PreparableReloadListenerPreparableReloadListener.PreparationBarrier
- 
Field SummaryFieldsModifier and TypeFieldDescriptionprivate final BlockEntityRenderDispatcherprivate Frustumprivate booleanprivate VertexBufferprotected 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 org.joml.Vector4f[]private final org.joml.Vector3dprivate booleanprivate final Set<BlockEntity> static final intprivate RenderTargetprivate intprivate intprivate intprivate intprivate ClientLevelprivate static final org.slf4j.Loggerprivate static final intprivate final Minecraftprivate static final ResourceLocationprivate 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 RenderBuffersprivate intstatic final intprivate final SectionOcclusionGraphprivate SectionRenderDispatcherprivate static final floatprivate VertexBufferprivate static final ResourceLocationprivate VertexBufferprivate static final ResourceLocationprivate intprivate RenderTargetprivate PostChainprivate static final intprivate ViewAreaprivate final it.unimi.dsi.fastutil.objects.ObjectArrayList<SectionRenderDispatcher.RenderSection> private RenderTargetprivate doubleprivate doubleprivate double
- 
Constructor SummaryConstructorsConstructorDescriptionLevelRenderer(Minecraft p_234245_, EntityRenderDispatcher p_234246_, BlockEntityRenderDispatcher p_234247_, RenderBuffers p_234248_) 
- 
Method SummaryModifier and TypeMethodDescriptionstatic voidaddChainedFilledBoxVertices(PoseStack p_270343_, VertexConsumer p_270926_, double p_270503_, double p_270353_, double p_270642_, double p_270676_, double p_270711_, double p_270601_, float p_270523_, float p_270382_, float p_270089_, float p_270335_) static voidaddChainedFilledBoxVertices(PoseStack p_270352_, VertexConsumer p_271015_, float p_270144_, float p_270901_, float p_270546_, float p_270102_, float p_270605_, float p_271006_, float p_270864_, float p_270181_, float p_270220_, float p_270293_) private voidaddFrustumQuad(VertexConsumer p_270858_, org.joml.Matrix4f p_270341_, int p_270702_, int p_270959_, int p_270732_, int p_270363_, int p_270273_, int p_270934_, int p_270916_) private voidaddFrustumVertex(VertexConsumer p_270950_, org.joml.Matrix4f p_270118_, int p_270865_) 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 BufferBuilder.RenderedBufferbuildClouds(BufferBuilder p_234262_, double p_234263_, double p_234264_, double p_234265_, Vec3 p_234266_) private static BufferBuilder.RenderedBufferbuildSkyDisc(BufferBuilder p_234268_, float p_234269_) private ParticleStatuscalculateParticleLevel(boolean p_109768_) voidprivate voidcaptureFrustum(org.joml.Matrix4f p_253756_, org.joml.Matrix4f p_253787_, double p_254187_, double p_253833_, double p_254547_, Frustum p_253954_) private voidcheckPoseStack(PoseStack p_109589_) voidclear()voidclose()private voidcompileSections(Camera p_194371_) intprivate voidprivate voidprivate voidprivate voidvoiddestroyBlockProgress(int p_109775_, BlockPos p_109776_, int p_109777_) voidprivate booleandoesMobEffectBlockSky(Camera p_234311_) private BufferBuilder.RenderedBufferdrawStars(BufferBuilder p_234260_) doublestatic intgetLightColor(BlockAndTintGetter p_109542_, BlockPos p_109543_) static intgetLightColor(BlockAndTintGetter p_109538_, BlockState p_109539_, BlockPos p_109540_) intgetTicks()doublevoidglobalLevelEvent(int p_109507_, BlockPos p_109508_, int p_109509_) voidbooleanvoidprivate voidbooleanisSectionCompiled(BlockPos p_295788_) voiditerateVisibleBlockEntities(Consumer<BlockEntity> blockEntityConsumer) voidvoidlevelEvent(int p_234305_, BlockPos p_234306_, int p_234307_) private static Vec3mixColor(float p_286899_) voidprivate voidnotifyNearbyEntities(Level p_109551_, BlockPos p_109552_, boolean p_109553_) static FrustumoffsetFrustum(Frustum p_296151_) voidonChunkLoaded(ChunkPos p_295808_) voidonResourceManagerReload(ResourceManager p_109513_) voidplayStreamingMusic(SoundEvent p_109515_, BlockPos p_109516_) Deprecated.Forge: Use item aware function belowvoidplayStreamingMusic(SoundEvent p_109515_, BlockPos p_109516_, RecordItem musicDiscItem) voidprepareCullFrustum(Vec3 p_253766_, org.joml.Matrix4f p_254341_, org.joml.Matrix4f p_323487_) private voidremoveProgress(BlockDestructionProgress p_109766_) voidrenderClouds(PoseStack p_254145_, org.joml.Matrix4f p_254537_, org.joml.Matrix4f p_324366_, float p_254364_, double p_253843_, double p_253663_, double p_253795_) private voidrenderDebug(PoseStack p_271014_, MultiBufferSource p_270107_, Camera p_270483_) 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(float p_109601_, long p_109602_, boolean p_109603_, Camera p_109604_, GameRenderer p_109605_, LightTexture p_109606_, org.joml.Matrix4f p_254120_, org.joml.Matrix4f p_323920_) 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 voidrenderSectionLayer(RenderType p_294513_, double p_295577_, double p_294761_, double p_294297_, org.joml.Matrix4f p_294782_, org.joml.Matrix4f p_324517_) 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(org.joml.Matrix4f p_254034_, org.joml.Matrix4f p_324386_, 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_286791_, VertexConsumer p_286416_, VoxelShape p_286863_, double p_286432_, double p_286836_, double p_286774_, float p_286612_, float p_286516_, float p_286787_, float p_286300_, boolean p_286443_) 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_) private static Vec3shiftHue(float p_286907_, float p_286536_, float p_286318_, float p_286590_) private voidshootParticles(int p_307280_, BlockPos p_307603_, RandomSource p_307547_, SimpleParticleType p_307590_) booleanvoidtick()voidvoidupdateGlobalBlockEntities(Collection<BlockEntity> p_109763_, Collection<BlockEntity> p_109764_) Methods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.minecraft.server.packs.resources.PreparableReloadListenergetNameMethods inherited from interface net.minecraft.server.packs.resources.ResourceManagerReloadListenerreload
- 
Field Details- 
LOGGERprivate static final org.slf4j.Logger LOGGER
- 
SECTION_SIZEpublic static final int SECTION_SIZE- See Also:
 
- 
HALF_SECTION_SIZEpublic static final int HALF_SECTION_SIZE- See Also:
 
- 
SKY_DISC_RADIUSprivate static final float SKY_DISC_RADIUS- See Also:
 
- 
MIN_FOG_DISTANCEprivate static final int MIN_FOG_DISTANCE- See Also:
 
- 
RAIN_RADIUSprivate static final int RAIN_RADIUS- See Also:
 
- 
RAIN_DIAMETERprivate static final int RAIN_DIAMETER- See Also:
 
- 
TRANSPARENT_SORT_COUNTprivate static final int TRANSPARENT_SORT_COUNT- See Also:
 
- 
MOON_LOCATION
- 
SUN_LOCATION
- 
CLOUDS_LOCATION
- 
END_SKY_LOCATION
- 
FORCEFIELD_LOCATION
- 
RAIN_LOCATION
- 
SNOW_LOCATION
- 
DIRECTIONS
- 
minecraft
- 
entityRenderDispatcher
- 
blockEntityRenderDispatcher
- 
renderBuffers
- 
level
- 
sectionOcclusionGraph
- 
visibleSectionsprivate final it.unimi.dsi.fastutil.objects.ObjectArrayList<SectionRenderDispatcher.RenderSection> visibleSections
- 
globalBlockEntities
- 
viewArea
- 
starBuffer
- 
skyBuffer
- 
darkBuffer
- 
generateCloudsprivate boolean generateClouds
- 
cloudBuffer
- 
frameTimes
- 
ticksprivate int ticks
- 
destroyingBlocks
- 
destructionProgressprivate final it.unimi.dsi.fastutil.longs.Long2ObjectMap<SortedSet<BlockDestructionProgress>> destructionProgress
- 
playingRecords
- 
entityTarget
- 
entityEffect
- 
translucentTarget
- 
itemEntityTarget
- 
particlesTarget
- 
weatherTarget
- 
cloudsTarget
- 
transparencyChain
- 
lastCameraSectionXprivate int lastCameraSectionX
- 
lastCameraSectionYprivate int lastCameraSectionY
- 
lastCameraSectionZprivate int lastCameraSectionZ
- 
prevCamXprivate double prevCamX
- 
prevCamYprivate double prevCamY
- 
prevCamZprivate double prevCamZ
- 
prevCamRotXprivate double prevCamRotX
- 
prevCamRotYprivate double prevCamRotY
- 
prevCloudXprivate int prevCloudX
- 
prevCloudYprivate int prevCloudY
- 
prevCloudZprivate int prevCloudZ
- 
prevCloudColor
- 
prevCloudsType
- 
sectionRenderDispatcher
- 
lastViewDistanceprivate int lastViewDistance
- 
renderedEntitiesprivate int renderedEntities
- 
culledEntitiesprivate int culledEntities
- 
cullingFrustum
- 
captureFrustumprivate boolean captureFrustum
- 
capturedFrustum
- 
frustumPointsprivate final org.joml.Vector4f[] frustumPoints
- 
frustumPosprivate final org.joml.Vector3d frustumPos
- 
xTransparentOldprivate double xTransparentOld
- 
yTransparentOldprivate double yTransparentOld
- 
zTransparentOldprivate double zTransparentOld
- 
rainSoundTimeprivate int rainSoundTime
- 
rainSizeXprivate final float[] rainSizeX
- 
rainSizeZprivate final float[] rainSizeZ
 
- 
- 
Constructor Details- 
LevelRendererpublic LevelRenderer(Minecraft p_234245_, EntityRenderDispatcher p_234246_, BlockEntityRenderDispatcher p_234247_, RenderBuffers p_234248_) 
 
- 
- 
Method Details- 
renderSnowAndRainprivate void renderSnowAndRain(LightTexture p_109704_, float p_109705_, double p_109706_, double p_109707_, double p_109708_) 
- 
tickRain
- 
closepublic void close()- Specified by:
- closein interface- AutoCloseable
 
- 
onResourceManagerReload- Specified by:
- onResourceManagerReloadin interface- ResourceManagerReloadListener
 
- 
initOutlinepublic void initOutline()
- 
initTransparencyprivate void initTransparency()
- 
deinitTransparencyprivate void deinitTransparency()
- 
doEntityOutlinepublic void doEntityOutline()
- 
shouldShowEntityOutlinespublic boolean shouldShowEntityOutlines()
- 
createDarkSkyprivate void createDarkSky()
- 
createLightSkyprivate void createLightSky()
- 
buildSkyDisc
- 
createStarsprivate void createStars()
- 
drawStars
- 
setLevel
- 
graphicsChangedpublic void graphicsChanged()
- 
allChangedpublic void allChanged()
- 
resizepublic void resize(int p_109488_, int p_109489_) 
- 
getSectionStatistics
- 
getSectionRenderDispatcher
- 
getTotalSectionspublic double getTotalSections()
- 
getLastViewDistancepublic double getLastViewDistance()
- 
countRenderedSectionspublic int countRenderedSections()
- 
getEntityStatistics
- 
setupRender
- 
offsetFrustum
- 
applyFrustum
- 
addRecentlyCompiledSection
- 
captureFrustumprivate void captureFrustum(org.joml.Matrix4f p_253756_, org.joml.Matrix4f p_253787_, double p_254187_, double p_253833_, double p_254547_, Frustum p_253954_) 
- 
prepareCullFrustumpublic void prepareCullFrustum(Vec3 p_253766_, org.joml.Matrix4f p_254341_, org.joml.Matrix4f p_323487_) 
- 
renderLevelpublic void renderLevel(float p_109601_, long p_109602_, boolean p_109603_, Camera p_109604_, GameRenderer p_109605_, LightTexture p_109606_, org.joml.Matrix4f p_254120_, org.joml.Matrix4f p_323920_) 
- 
checkPoseStack
- 
renderEntityprivate void renderEntity(Entity p_109518_, double p_109519_, double p_109520_, double p_109521_, float p_109522_, PoseStack p_109523_, MultiBufferSource p_109524_) 
- 
renderSectionLayerprivate void renderSectionLayer(RenderType p_294513_, double p_295577_, double p_294761_, double p_294297_, org.joml.Matrix4f p_294782_, org.joml.Matrix4f p_324517_) 
- 
renderDebug
- 
addFrustumVertex
- 
addFrustumQuadprivate void addFrustumQuad(VertexConsumer p_270858_, org.joml.Matrix4f p_270341_, int p_270702_, int p_270959_, int p_270732_, int p_270363_, int p_270273_, int p_270934_, int p_270916_) 
- 
captureFrustumpublic void captureFrustum()
- 
killFrustumpublic void killFrustum()
- 
tickpublic void tick()
- 
removeProgress
- 
renderEndSky
- 
renderSky
- 
doesMobEffectBlockSky
- 
renderCloudspublic void renderClouds(PoseStack p_254145_, org.joml.Matrix4f p_254537_, org.joml.Matrix4f p_324366_, float p_254364_, double p_253843_, double p_253663_, double p_253795_) 
- 
buildCloudsprivate BufferBuilder.RenderedBuffer buildClouds(BufferBuilder p_234262_, double p_234263_, double p_234264_, double p_234265_, Vec3 p_234266_) 
- 
compileSections
- 
renderWorldBorder
- 
renderHitOutlineprivate 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_) 
- 
mixColor
- 
shiftHue
- 
renderVoxelShapepublic static void renderVoxelShape(PoseStack p_286791_, VertexConsumer p_286416_, VoxelShape p_286863_, double p_286432_, double p_286836_, double p_286774_, float p_286612_, float p_286516_, float p_286787_, float p_286300_, boolean p_286443_) 
- 
renderShapeprivate 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_) 
- 
renderLineBoxpublic 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_) 
- 
renderLineBoxpublic static void renderLineBox(PoseStack p_109647_, VertexConsumer p_109648_, AABB p_109649_, float p_109650_, float p_109651_, float p_109652_, float p_109653_) 
- 
renderLineBoxpublic 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_) 
- 
renderLineBoxpublic 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_) 
- 
addChainedFilledBoxVerticespublic static void addChainedFilledBoxVertices(PoseStack p_270343_, VertexConsumer p_270926_, double p_270503_, double p_270353_, double p_270642_, double p_270676_, double p_270711_, double p_270601_, float p_270523_, float p_270382_, float p_270089_, float p_270335_) 
- 
addChainedFilledBoxVerticespublic static void addChainedFilledBoxVertices(PoseStack p_270352_, VertexConsumer p_271015_, float p_270144_, float p_270901_, float p_270546_, float p_270102_, float p_270605_, float p_271006_, float p_270864_, float p_270181_, float p_270220_, float p_270293_) 
- 
blockChangedpublic void blockChanged(BlockGetter p_109545_, BlockPos p_109546_, BlockState p_109547_, BlockState p_109548_, int p_109549_) 
- 
setBlockDirty
- 
setBlocksDirtypublic void setBlocksDirty(int p_109495_, int p_109496_, int p_109497_, int p_109498_, int p_109499_, int p_109500_) 
- 
setBlockDirty
- 
setSectionDirtyWithNeighborspublic void setSectionDirtyWithNeighbors(int p_109491_, int p_109492_, int p_109493_) 
- 
setSectionDirtypublic void setSectionDirty(int p_109771_, int p_109772_, int p_109773_) 
- 
setSectionDirtyprivate void setSectionDirty(int p_109502_, int p_109503_, int p_109504_, boolean p_109505_) 
- 
getFrustum
- 
getTickspublic int getTicks()
- 
iterateVisibleBlockEntities
- 
playStreamingMusicDeprecated.Forge: Use item aware function below
- 
playStreamingMusicpublic void playStreamingMusic(@Nullable SoundEvent p_109515_, BlockPos p_109516_, @Nullable RecordItem musicDiscItem) 
- 
notifyNearbyEntities
- 
addParticlepublic 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_) 
- 
addParticlepublic 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_) 
- 
addParticleprivate <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
- 
clearpublic void clear()
- 
globalLevelEvent
- 
levelEvent
- 
destroyBlockProgress
- 
hasRenderedAllSectionspublic boolean hasRenderedAllSections()
- 
onChunkLoaded
- 
needsUpdatepublic void needsUpdate()
- 
updateGlobalBlockEntitiespublic void updateGlobalBlockEntities(Collection<BlockEntity> p_109763_, Collection<BlockEntity> p_109764_) 
- 
getLightColor
- 
getLightColorpublic static int getLightColor(BlockAndTintGetter p_109538_, BlockState p_109539_, BlockPos p_109540_) 
- 
isSectionCompiled
- 
entityTarget
- 
getTranslucentTarget
- 
getItemEntityTarget
- 
getParticlesTarget
- 
getWeatherTarget
- 
getCloudsTarget
- 
shootParticlesprivate void shootParticles(int p_307280_, BlockPos p_307603_, RandomSource p_307547_, SimpleParticleType p_307590_) 
 
-