Class LevelRenderer

java.lang.Object
net.minecraft.client.renderer.LevelRenderer
All Implemented Interfaces:
AutoCloseable, PreparableReloadListener, ResourceManagerReloadListener

public class LevelRenderer extends Object implements ResourceManagerReloadListener, AutoCloseable
  • Field Details

    • LOGGER

      private static final org.slf4j.Logger LOGGER
    • TRANSPARENCY_POST_CHAIN_ID

      private static final ResourceLocation TRANSPARENCY_POST_CHAIN_ID
    • ENTITY_OUTLINE_POST_CHAIN_ID

      private static final ResourceLocation ENTITY_OUTLINE_POST_CHAIN_ID
    • SECTION_SIZE

      public static final int SECTION_SIZE
      See Also:
    • HALF_SECTION_SIZE

      public static final int HALF_SECTION_SIZE
      See Also:
    • NEARBY_SECTION_DISTANCE_IN_BLOCKS

      public static final int NEARBY_SECTION_DISTANCE_IN_BLOCKS
      See Also:
    • MINIMUM_TRANSPARENT_SORT_COUNT

      private static final int MINIMUM_TRANSPARENT_SORT_COUNT
      See Also:
    • minecraft

      private final Minecraft minecraft
    • entityRenderDispatcher

      private final EntityRenderDispatcher entityRenderDispatcher
    • blockEntityRenderDispatcher

      private final BlockEntityRenderDispatcher blockEntityRenderDispatcher
    • renderBuffers

      private final RenderBuffers renderBuffers
    • skyRenderer

      private final SkyRenderer skyRenderer
    • cloudRenderer

      private final CloudRenderer cloudRenderer
    • worldBorderRenderer

      private final WorldBorderRenderer worldBorderRenderer
    • weatherEffectRenderer

      private final WeatherEffectRenderer weatherEffectRenderer
    • level

      @Nullable private ClientLevel level
    • sectionOcclusionGraph

      private final SectionOcclusionGraph sectionOcclusionGraph
    • visibleSections

      private final it.unimi.dsi.fastutil.objects.ObjectArrayList<SectionRenderDispatcher.RenderSection> visibleSections
    • nearbyVisibleSections

      private final it.unimi.dsi.fastutil.objects.ObjectArrayList<SectionRenderDispatcher.RenderSection> nearbyVisibleSections
    • globalBlockEntities

      private final Set<BlockEntity> globalBlockEntities
    • viewArea

      @Nullable private ViewArea viewArea
    • ticks

      private int ticks
    • destroyingBlocks

      private final it.unimi.dsi.fastutil.ints.Int2ObjectMap<BlockDestructionProgress> destroyingBlocks
    • destructionProgress

      private final it.unimi.dsi.fastutil.longs.Long2ObjectMap<SortedSet<BlockDestructionProgress>> destructionProgress
    • entityOutlineTarget

      @Nullable private RenderTarget entityOutlineTarget
    • targets

      private final LevelTargetBundle targets
    • lastCameraSectionX

      private int lastCameraSectionX
    • lastCameraSectionY

      private int lastCameraSectionY
    • lastCameraSectionZ

      private int lastCameraSectionZ
    • prevCamX

      private double prevCamX
    • prevCamY

      private double prevCamY
    • prevCamZ

      private double prevCamZ
    • prevCamRotX

      private double prevCamRotX
    • prevCamRotY

      private double prevCamRotY
    • sectionRenderDispatcher

      @Nullable private SectionRenderDispatcher sectionRenderDispatcher
    • lastViewDistance

      private int lastViewDistance
    • visibleEntities

      private final List<Entity> visibleEntities
    • visibleEntityCount

      private int visibleEntityCount
    • cullingFrustum

      private Frustum cullingFrustum
    • captureFrustum

      private boolean captureFrustum
    • capturedFrustum

      @Nullable private Frustum capturedFrustum
    • lastTranslucentSortBlockPos

      @Nullable private BlockPos lastTranslucentSortBlockPos
    • translucencyResortIterationIndex

      private int translucencyResortIterationIndex
  • Constructor Details

  • Method Details

    • tickParticles

      public void tickParticles(Camera p_363405_)
    • close

      public void close()
      Specified by:
      close in interface AutoCloseable
    • onResourceManagerReload

      public void onResourceManagerReload(ResourceManager p_109513_)
      Specified by:
      onResourceManagerReload in interface ResourceManagerReloadListener
    • initOutline

      public void initOutline()
    • getTransparencyChain

      @Nullable private PostChain getTransparencyChain()
    • doEntityOutline

      public void doEntityOutline()
    • shouldShowEntityOutlines

      public boolean shouldShowEntityOutlines()
    • setLevel

      public void setLevel(@Nullable ClientLevel p_109702_)
    • clearVisibleSections

      private void clearVisibleSections()
    • allChanged

      public void allChanged()
    • resize

      public void resize(int p_109488_, int p_109489_)
    • getSectionStatistics

      public String getSectionStatistics()
    • getSectionRenderDispatcher

      public SectionRenderDispatcher getSectionRenderDispatcher()
    • getTotalSections

      public double getTotalSections()
    • getLastViewDistance

      public double getLastViewDistance()
    • countRenderedSections

      public int countRenderedSections()
    • getEntityStatistics

      public String getEntityStatistics()
    • setupRender

      private void setupRender(Camera p_194339_, Frustum p_194340_, boolean p_194341_, boolean p_194342_)
    • offsetFrustum

      public static Frustum offsetFrustum(Frustum p_296151_)
    • applyFrustum

      private void applyFrustum(Frustum p_194355_)
    • addRecentlyCompiledSection

      public void addRecentlyCompiledSection(SectionRenderDispatcher.RenderSection p_295462_)
    • prepareCullFrustum

      public void prepareCullFrustum(Vec3 p_253766_, org.joml.Matrix4f p_254341_, org.joml.Matrix4f p_323487_)
    • renderLevel

      public void renderLevel(GraphicsResourceAllocator p_361796_, DeltaTracker p_348530_, boolean p_109603_, Camera p_109604_, GameRenderer p_109605_, org.joml.Matrix4f p_254120_, org.joml.Matrix4f p_323920_)
    • addMainPass

      private void addMainPass(FrameGraphBuilder p_361593_, Frustum p_366590_, Camera p_363453_, org.joml.Matrix4f p_362420_, org.joml.Matrix4f p_361272_, FogParameters p_363661_, boolean p_363964_, boolean p_362137_, DeltaTracker p_360931_, ProfilerFiller p_362234_)
    • addParticlesPass

      @Deprecated private void addParticlesPass(FrameGraphBuilder p_363357_, Camera p_365299_, float p_364282_, FogParameters p_362149_)
    • addParticlesPass

      private void addParticlesPass(FrameGraphBuilder p_363357_, Camera p_365299_, float p_364282_, FogParameters p_362149_, Frustum frustum, org.joml.Matrix4f modelViewMatrix, org.joml.Matrix4f projectionMatrix)
    • addCloudsPass

      @Deprecated private void addCloudsPass(FrameGraphBuilder p_361907_, CloudStatus p_364196_, Vec3 p_362985_, float p_365209_, int p_362342_, float p_362337_)
    • addCloudsPass

      private void addCloudsPass(FrameGraphBuilder p_361907_, CloudStatus p_364196_, Vec3 p_362985_, float p_365209_, int p_362342_, float p_362337_, org.joml.Matrix4f modelViewMatrix, org.joml.Matrix4f projectionMatrix)
    • addWeatherPass

      @Deprecated private void addWeatherPass(FrameGraphBuilder p_364025_, Vec3 p_360771_, float p_362434_, FogParameters p_360974_)
    • addWeatherPass

      private void addWeatherPass(FrameGraphBuilder p_364025_, Vec3 p_360771_, float p_362434_, FogParameters p_360974_, org.joml.Matrix4f modelViewMatrix, org.joml.Matrix4f projectionMatrix, Camera camera)
    • addLateDebugPass

      private void addLateDebugPass(FrameGraphBuilder p_361973_, Vec3 p_363812_, FogParameters p_362448_)
    • collectVisibleEntities

      private boolean collectVisibleEntities(Camera p_363510_, Frustum p_361275_, List<Entity> p_363380_)
    • renderEntities

      private void renderEntities(PoseStack p_363182_, MultiBufferSource.BufferSource p_360990_, Camera p_360717_, DeltaTracker p_362965_, List<Entity> p_362298_)
    • renderBlockEntities

      private void renderBlockEntities(PoseStack p_362832_, MultiBufferSource.BufferSource p_363819_, MultiBufferSource.BufferSource p_361830_, Camera p_362042_, float p_362089_)
    • renderBlockDestroyAnimation

      private void renderBlockDestroyAnimation(PoseStack p_363901_, Camera p_361175_, MultiBufferSource.BufferSource p_365216_)
    • renderBlockOutline

      private void renderBlockOutline(Camera p_363911_, MultiBufferSource.BufferSource p_362782_, PoseStack p_361893_, boolean p_361698_)
    • checkPoseStack

      private void checkPoseStack(PoseStack p_109589_)
    • 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_)
    • scheduleTranslucentSectionResort

      private void scheduleTranslucentSectionResort(Vec3 p_361632_)
    • scheduleResort

      private void scheduleResort(SectionRenderDispatcher.RenderSection p_371775_, SectionRenderDispatcher.TranslucencyPointOfView p_371652_, Vec3 p_371372_, boolean p_371855_, boolean p_371355_)
    • renderSectionLayer

      private void renderSectionLayer(RenderType p_294513_, double p_295577_, double p_294761_, double p_294297_, org.joml.Matrix4f p_294782_, org.joml.Matrix4f p_324517_)
    • captureFrustum

      public void captureFrustum()
    • killFrustum

      public void killFrustum()
    • tick

      public void tick()
    • removeProgress

      private void removeProgress(BlockDestructionProgress p_109766_)
    • addSkyPass

      @Deprecated private void addSkyPass(FrameGraphBuilder p_362870_, Camera p_362177_, float p_363799_, FogParameters p_364999_)
    • addSkyPass

      private void addSkyPass(FrameGraphBuilder p_362870_, Camera p_362177_, float p_363799_, FogParameters p_364999_, org.joml.Matrix4f modelViewMatrix, org.joml.Matrix4f projectionMatrix)
    • shouldRenderDarkDisc

      private boolean shouldRenderDarkDisc(float p_362498_)
    • doesMobEffectBlockSky

      private boolean doesMobEffectBlockSky(Camera p_234311_)
    • compileSections

      private void compileSections(Camera p_194371_)
    • 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_, int p_380403_)
    • blockChanged

      public void blockChanged(BlockGetter p_109545_, BlockPos p_109546_, BlockState p_109547_, BlockState p_109548_, int p_109549_)
    • setBlockDirty

      private void setBlockDirty(BlockPos p_109733_, boolean p_109734_)
    • setBlocksDirty

      public void setBlocksDirty(int p_109495_, int p_109496_, int p_109497_, int p_109498_, int p_109499_, int p_109500_)
    • setBlockDirty

      public void setBlockDirty(BlockPos p_109722_, BlockState p_109723_, BlockState p_109724_)
    • setSectionDirtyWithNeighbors

      public void setSectionDirtyWithNeighbors(int p_109491_, int p_109492_, int p_109493_)
    • setSectionRangeDirty

      public void setSectionRangeDirty(int p_363248_, int p_360721_, int p_360463_, int p_362591_, int p_364598_, int p_365249_)
    • 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_)
    • onSectionBecomingNonEmpty

      public void onSectionBecomingNonEmpty(long p_366463_)
    • 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

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

      private ParticleStatus calculateParticleLevel(boolean p_109768_)
    • destroyBlockProgress

      public void destroyBlockProgress(int p_109775_, BlockPos p_109776_, int p_109777_)
    • hasRenderedAllSections

      public boolean hasRenderedAllSections()
    • onChunkReadyToRender

      public void onChunkReadyToRender(ChunkPos p_383159_)
    • needsUpdate

      public void needsUpdate()
    • updateGlobalBlockEntities

      public void updateGlobalBlockEntities(Collection<BlockEntity> p_109763_, Collection<BlockEntity> p_109764_)
    • getLightColor

      public static int getLightColor(BlockAndTintGetter p_109542_, BlockPos p_109543_)
    • getLightColor

      public static int getLightColor(LevelRenderer.BrightnessGetter p_412967_, BlockAndTintGetter p_109538_, BlockState p_109539_, BlockPos p_109540_)
    • isSectionCompiled

      public boolean isSectionCompiled(BlockPos p_295788_)
    • entityOutlineTarget

      @Nullable public RenderTarget entityOutlineTarget()
    • getTranslucentTarget

      @Nullable public RenderTarget getTranslucentTarget()
    • getItemEntityTarget

      @Nullable public RenderTarget getItemEntityTarget()
    • getParticlesTarget

      @Nullable public RenderTarget getParticlesTarget()
    • getWeatherTarget

      @Nullable public RenderTarget getWeatherTarget()
    • getCloudsTarget

      @Nullable public RenderTarget getCloudsTarget()
    • getVisibleSections

      public it.unimi.dsi.fastutil.objects.ObjectArrayList<SectionRenderDispatcher.RenderSection> getVisibleSections()
    • getSectionOcclusionGraph

      public SectionOcclusionGraph getSectionOcclusionGraph()
    • getCapturedFrustum

      @Nullable public Frustum getCapturedFrustum()
    • getCloudRenderer

      public CloudRenderer getCloudRenderer()
    • getFrustum

      public Frustum getFrustum()
    • getTicks

      public int getTicks()
    • iterateVisibleBlockEntities

      public void iterateVisibleBlockEntities(Consumer<BlockEntity> blockEntityConsumer)
    • getRenderableSections

      @Internal public Iterable<? extends IRenderableSection> getRenderableSections()