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 ClassesNested classes/interfaces inherited from interface net.minecraft.server.packs.resources.PreparableReloadListener
PreparableReloadListener.PreparationBarrier
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final BlockEntityRenderDispatcher
private Frustum
private boolean
private final CloudRenderer
private Frustum
private final it.unimi.dsi.fastutil.ints.Int2ObjectMap
<BlockDestructionProgress> private final it.unimi.dsi.fastutil.longs.Long2ObjectMap
<SortedSet<BlockDestructionProgress>> private static final ResourceLocation
private RenderTarget
private final EntityRenderDispatcher
private final Set
<BlockEntity> static final int
private int
private int
private int
private BlockPos
private int
private ClientLevel
private static final org.slf4j.Logger
private final Minecraft
private static final int
static final int
private final it.unimi.dsi.fastutil.objects.ObjectArrayList
<SectionRenderDispatcher.RenderSection> private double
private double
private double
private double
private double
private final RenderBuffers
static final int
private final SectionOcclusionGraph
private SectionRenderDispatcher
private final SkyRenderer
private final LevelTargetBundle
private int
private int
private static final ResourceLocation
private ViewArea
private int
private final it.unimi.dsi.fastutil.objects.ObjectArrayList
<SectionRenderDispatcher.RenderSection> private final WeatherEffectRenderer
private final WorldBorderRenderer
-
Constructor Summary
ConstructorsConstructorDescriptionLevelRenderer
(Minecraft p_234245_, EntityRenderDispatcher p_234246_, BlockEntityRenderDispatcher p_234247_, RenderBuffers p_234248_) -
Method Summary
Modifier and TypeMethodDescriptionprivate void
addCloudsPass
(FrameGraphBuilder p_361907_, CloudStatus p_364196_, Vec3 p_362985_, float p_365209_, int p_362342_, float p_362337_) Deprecated.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) private void
addLateDebugPass
(FrameGraphBuilder p_361973_, Vec3 p_363812_, FogParameters p_362448_) 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_) 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_) 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_) <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 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_) (package 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_) private void
addParticlesPass
(FrameGraphBuilder p_363357_, Camera p_365299_, float p_364282_, FogParameters p_362149_) Deprecated.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) void
private void
addSkyPass
(FrameGraphBuilder p_362870_, Camera p_362177_, float p_363799_, FogParameters p_364999_) Deprecated.private void
addSkyPass
(FrameGraphBuilder p_362870_, Camera p_362177_, float p_363799_, FogParameters p_364999_, org.joml.Matrix4f modelViewMatrix, org.joml.Matrix4f projectionMatrix) private void
addWeatherPass
(FrameGraphBuilder p_364025_, Vec3 p_360771_, float p_362434_, FogParameters p_360974_) Deprecated.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) void
private void
applyFrustum
(Frustum p_194355_) void
blockChanged
(BlockGetter p_109545_, BlockPos p_109546_, BlockState p_109547_, BlockState p_109548_, int p_109549_) private ParticleStatus
calculateParticleLevel
(boolean p_109768_) void
private void
checkPoseStack
(PoseStack p_109589_) private void
void
close()
private boolean
collectVisibleEntities
(Camera p_363510_, Frustum p_361275_, List<Entity> p_363380_) private void
compileSections
(Camera p_194371_) int
void
destroyBlockProgress
(int p_109775_, BlockPos p_109776_, int p_109777_) void
private boolean
doesMobEffectBlockSky
(Camera p_234311_) double
static int
getLightColor
(LevelRenderer.BrightnessGetter p_412967_, BlockAndTintGetter p_109538_, BlockState p_109539_, BlockPos p_109540_) static int
getLightColor
(BlockAndTintGetter p_109542_, BlockPos p_109543_) Iterable
<? extends IRenderableSection> int
getTicks()
double
private PostChain
it.unimi.dsi.fastutil.objects.ObjectArrayList
<SectionRenderDispatcher.RenderSection> boolean
void
boolean
isSectionCompiled
(BlockPos p_295788_) void
iterateVisibleBlockEntities
(Consumer<BlockEntity> blockEntityConsumer) void
void
static Frustum
offsetFrustum
(Frustum p_296151_) void
onChunkReadyToRender
(ChunkPos p_383159_) void
onResourceManagerReload
(ResourceManager p_109513_) void
onSectionBecomingNonEmpty
(long p_366463_) void
prepareCullFrustum
(Vec3 p_253766_, org.joml.Matrix4f p_254341_, org.joml.Matrix4f p_323487_) private void
removeProgress
(BlockDestructionProgress p_109766_) private void
renderBlockDestroyAnimation
(PoseStack p_363901_, Camera p_361175_, MultiBufferSource.BufferSource p_365216_) private void
renderBlockEntities
(PoseStack p_362832_, MultiBufferSource.BufferSource p_363819_, MultiBufferSource.BufferSource p_361830_, Camera p_362042_, float p_362089_) private void
renderBlockOutline
(Camera p_363911_, MultiBufferSource.BufferSource p_362782_, PoseStack p_361893_, boolean p_361698_) private void
renderEntities
(PoseStack p_363182_, MultiBufferSource.BufferSource p_360990_, Camera p_360717_, DeltaTracker p_362965_, List<Entity> p_362298_) private void
renderEntity
(Entity p_109518_, double p_109519_, double p_109520_, double p_109521_, float p_109522_, PoseStack p_109523_, MultiBufferSource p_109524_) 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_) 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_) 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_) void
resize
(int p_109488_, int p_109489_) private void
scheduleResort
(SectionRenderDispatcher.RenderSection p_371775_, SectionRenderDispatcher.TranslucencyPointOfView p_371652_, Vec3 p_371372_, boolean p_371855_, boolean p_371355_) private void
scheduleTranslucentSectionResort
(Vec3 p_361632_) private void
setBlockDirty
(BlockPos p_109733_, boolean p_109734_) void
setBlockDirty
(BlockPos p_109722_, BlockState p_109723_, BlockState p_109724_) void
setBlocksDirty
(int p_109495_, int p_109496_, int p_109497_, int p_109498_, int p_109499_, int p_109500_) void
setLevel
(ClientLevel p_109702_) void
setSectionDirty
(int p_109771_, int p_109772_, int p_109773_) private void
setSectionDirty
(int p_109502_, int p_109503_, int p_109504_, boolean p_109505_) void
setSectionDirtyWithNeighbors
(int p_109491_, int p_109492_, int p_109493_) void
setSectionRangeDirty
(int p_363248_, int p_360721_, int p_360463_, int p_362591_, int p_364598_, int p_365249_) private void
setupRender
(Camera p_194339_, Frustum p_194340_, boolean p_194341_, boolean p_194342_) private boolean
shouldRenderDarkDisc
(float p_362498_) boolean
void
tick()
void
tickParticles
(Camera p_363405_) void
updateGlobalBlockEntities
(Collection<BlockEntity> p_109763_, Collection<BlockEntity> p_109764_) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface net.minecraft.server.packs.resources.PreparableReloadListener
getName
Methods inherited from interface net.minecraft.server.packs.resources.ResourceManagerReloadListener
reload
-
Field Details
-
LOGGER
private static final org.slf4j.Logger LOGGER -
TRANSPARENCY_POST_CHAIN_ID
-
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
-
entityRenderDispatcher
-
blockEntityRenderDispatcher
-
renderBuffers
-
skyRenderer
-
cloudRenderer
-
worldBorderRenderer
-
weatherEffectRenderer
-
level
-
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
-
viewArea
-
ticks
private int ticks -
destroyingBlocks
-
destructionProgress
private final it.unimi.dsi.fastutil.longs.Long2ObjectMap<SortedSet<BlockDestructionProgress>> destructionProgress -
entityOutlineTarget
-
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
-
lastViewDistance
private int lastViewDistance -
visibleEntities
-
visibleEntityCount
private int visibleEntityCount -
cullingFrustum
-
captureFrustum
private boolean captureFrustum -
capturedFrustum
-
lastTranslucentSortBlockPos
-
translucencyResortIterationIndex
private int translucencyResortIterationIndex
-
-
Constructor Details
-
LevelRenderer
public LevelRenderer(Minecraft p_234245_, EntityRenderDispatcher p_234246_, BlockEntityRenderDispatcher p_234247_, RenderBuffers p_234248_)
-
-
Method Details
-
tickParticles
-
close
public void close()- Specified by:
close
in interfaceAutoCloseable
-
onResourceManagerReload
- Specified by:
onResourceManagerReload
in interfaceResourceManagerReloadListener
-
initOutline
public void initOutline() -
getTransparencyChain
-
doEntityOutline
public void doEntityOutline() -
shouldShowEntityOutlines
public boolean shouldShowEntityOutlines() -
setLevel
-
clearVisibleSections
private void clearVisibleSections() -
allChanged
public void allChanged() -
resize
public void resize(int p_109488_, int p_109489_) -
getSectionStatistics
-
getSectionRenderDispatcher
-
getTotalSections
public double getTotalSections() -
getLastViewDistance
public double getLastViewDistance() -
countRenderedSections
public int countRenderedSections() -
getEntityStatistics
-
setupRender
-
offsetFrustum
-
applyFrustum
-
addRecentlyCompiledSection
-
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_) Deprecated. -
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_) Deprecated. -
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_) Deprecated. -
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
-
collectVisibleEntities
-
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
-
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
-
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
-
addSkyPass
@Deprecated private void addSkyPass(FrameGraphBuilder p_362870_, Camera p_362177_, float p_363799_, FogParameters p_364999_) Deprecated. -
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
-
compileSections
-
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
-
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_) -
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
-
destroyBlockProgress
-
hasRenderedAllSections
public boolean hasRenderedAllSections() -
onChunkReadyToRender
-
needsUpdate
public void needsUpdate() -
updateGlobalBlockEntities
public void updateGlobalBlockEntities(Collection<BlockEntity> p_109763_, Collection<BlockEntity> p_109764_) -
getLightColor
-
getLightColor
public static int getLightColor(LevelRenderer.BrightnessGetter p_412967_, BlockAndTintGetter p_109538_, BlockState p_109539_, BlockPos p_109540_) -
isSectionCompiled
-
entityOutlineTarget
-
getTranslucentTarget
-
getItemEntityTarget
-
getParticlesTarget
-
getWeatherTarget
-
getCloudsTarget
-
getVisibleSections
public it.unimi.dsi.fastutil.objects.ObjectArrayList<SectionRenderDispatcher.RenderSection> getVisibleSections() -
getSectionOcclusionGraph
-
getCapturedFrustum
-
getCloudRenderer
-
getFrustum
-
getTicks
public int getTicks() -
iterateVisibleBlockEntities
-
getRenderableSections
-
addCloudsPass(FrameGraphBuilder, CloudStatus, Vec3, float, int, float, Matrix4f, Matrix4f)
instead