类 LevelRenderer

java.lang.Object
net.minecraft.client.renderer.LevelRenderer
所有已实现的接口:
AutoCloseable, PreparableReloadListener, ResourceManagerReloadListener

public class LevelRenderer extends Object implements ResourceManagerReloadListener, AutoCloseable
  • 字段详细资料

    • LOGGER

      private static final org.slf4j.Logger LOGGER
    • CHUNK_SIZE

      public static final int CHUNK_SIZE
      另请参阅:
    • HALF_CHUNK_SIZE

      private static final int HALF_CHUNK_SIZE
      另请参阅:
    • SKY_DISC_RADIUS

      private static final float SKY_DISC_RADIUS
      另请参阅:
    • MINIMUM_ADVANCED_CULLING_DISTANCE

      private static final int MINIMUM_ADVANCED_CULLING_DISTANCE
      另请参阅:
    • CEILED_SECTION_DIAGONAL

      private static final double CEILED_SECTION_DIAGONAL
    • MIN_FOG_DISTANCE

      private static final int MIN_FOG_DISTANCE
      另请参阅:
    • RAIN_RADIUS

      private static final int RAIN_RADIUS
      另请参阅:
    • RAIN_DIAMETER

      private static final int RAIN_DIAMETER
      另请参阅:
    • TRANSPARENT_SORT_COUNT

      private static final int TRANSPARENT_SORT_COUNT
      另请参阅:
    • HALF_A_SECOND_IN_MILLIS

      private static final int HALF_A_SECOND_IN_MILLIS
      另请参阅:
    • MOON_LOCATION

      private static final ResourceLocation MOON_LOCATION
    • SUN_LOCATION

      private static final ResourceLocation SUN_LOCATION
    • CLOUDS_LOCATION

      private static final ResourceLocation CLOUDS_LOCATION
    • END_SKY_LOCATION

      private static final ResourceLocation END_SKY_LOCATION
    • FORCEFIELD_LOCATION

      private static final ResourceLocation FORCEFIELD_LOCATION
    • RAIN_LOCATION

      private static final ResourceLocation RAIN_LOCATION
    • SNOW_LOCATION

      private static final ResourceLocation SNOW_LOCATION
    • DIRECTIONS

      public static final Direction[] DIRECTIONS
    • minecraft

      private final Minecraft minecraft
    • entityRenderDispatcher

      private final EntityRenderDispatcher entityRenderDispatcher
    • blockEntityRenderDispatcher

      private final BlockEntityRenderDispatcher blockEntityRenderDispatcher
    • renderBuffers

      private final RenderBuffers renderBuffers
    • level

      @Nullable private ClientLevel level
    • recentlyCompiledChunks

      private final BlockingQueue<ChunkRenderDispatcher.RenderChunk> recentlyCompiledChunks
    • renderChunkStorage

      private final AtomicReference<LevelRenderer.RenderChunkStorage> renderChunkStorage
    • renderChunksInFrustum

      private final it.unimi.dsi.fastutil.objects.ObjectArrayList<LevelRenderer.RenderChunkInfo> renderChunksInFrustum
    • globalBlockEntities

      private final Set<BlockEntity> globalBlockEntities
    • lastFullRenderChunkUpdate

      @Nullable private Future<?> lastFullRenderChunkUpdate
    • viewArea

      @Nullable private ViewArea viewArea
    • starBuffer

      @Nullable private VertexBuffer starBuffer
    • skyBuffer

      @Nullable private VertexBuffer skyBuffer
    • darkBuffer

      @Nullable private VertexBuffer darkBuffer
    • generateClouds

      private boolean generateClouds
    • cloudBuffer

      @Nullable private VertexBuffer cloudBuffer
    • frameTimes

      private final RunningTrimmedMean frameTimes
    • 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
    • playingRecords

      private final Map<BlockPos,SoundInstance> playingRecords
    • entityTarget

      @Nullable private RenderTarget entityTarget
    • entityEffect

      @Nullable private PostChain entityEffect
    • translucentTarget

      @Nullable private RenderTarget translucentTarget
    • itemEntityTarget

      @Nullable private RenderTarget itemEntityTarget
    • particlesTarget

      @Nullable private RenderTarget particlesTarget
    • weatherTarget

      @Nullable private RenderTarget weatherTarget
    • cloudsTarget

      @Nullable private RenderTarget cloudsTarget
    • transparencyChain

      @Nullable private PostChain 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

      private Vec3 prevCloudColor
    • prevCloudsType

      @Nullable private CloudStatus prevCloudsType
    • chunkRenderDispatcher

      @Nullable private ChunkRenderDispatcher chunkRenderDispatcher
    • lastViewDistance

      private int lastViewDistance
    • renderedEntities

      private int renderedEntities
    • culledEntities

      private int culledEntities
    • cullingFrustum

      private Frustum cullingFrustum
    • captureFrustum

      private boolean captureFrustum
    • capturedFrustum

      @Nullable private Frustum capturedFrustum
    • frustumPoints

      private final org.joml.Vector4f[] frustumPoints
    • frustumPos

      private final org.joml.Vector3d frustumPos
    • xTransparentOld

      private double xTransparentOld
    • yTransparentOld

      private double yTransparentOld
    • zTransparentOld

      private double zTransparentOld
    • needsFullRenderChunkUpdate

      private boolean needsFullRenderChunkUpdate
    • nextFullUpdateMillis

      private final AtomicLong nextFullUpdateMillis
    • needsFrustumUpdate

      private final AtomicBoolean needsFrustumUpdate
    • rainSoundTime

      private int rainSoundTime
    • rainSizeX

      private final float[] rainSizeX
    • rainSizeZ

      private final float[] rainSizeZ
  • 构造器详细资料

  • 方法详细资料

    • renderSnowAndRain

      private void renderSnowAndRain(LightTexture pLightTexture, float pPartialTick, double pCamX, double pCamY, double pCamZ)
    • tickRain

      public void tickRain(Camera pCamera)
    • close

      public void close()
      指定者:
      close 在接口中 AutoCloseable
    • onResourceManagerReload

      public void onResourceManagerReload(ResourceManager pResourceManager)
      指定者:
      onResourceManagerReload 在接口中 ResourceManagerReloadListener
    • initOutline

      public void initOutline()
    • initTransparency

      private void initTransparency()
    • deinitTransparency

      private void deinitTransparency()
    • doEntityOutline

      public void doEntityOutline()
    • shouldShowEntityOutlines

      public boolean shouldShowEntityOutlines()
    • createDarkSky

      private void createDarkSky()
    • createLightSky

      private void createLightSky()
    • buildSkyDisc

      private static BufferBuilder.RenderedBuffer buildSkyDisc(BufferBuilder pBuilder, float pY)
    • createStars

      private void createStars()
    • drawStars

      private BufferBuilder.RenderedBuffer drawStars(BufferBuilder pBuilder)
    • setLevel

      public void setLevel(@Nullable ClientLevel pLevel)
    • graphicsChanged

      public void graphicsChanged()
    • allChanged

      public void allChanged()
    • resize

      public void resize(int pWidth, int pHeight)
    • getChunkStatistics

      public String getChunkStatistics()
    • getChunkRenderDispatcher

      public ChunkRenderDispatcher getChunkRenderDispatcher()
    • getTotalChunks

      public double getTotalChunks()
    • getLastViewDistance

      public double getLastViewDistance()
    • countRenderedChunks

      public int countRenderedChunks()
    • getEntityStatistics

      public String getEntityStatistics()
    • setupRender

      private void setupRender(Camera pCamera, Frustum pFrustum, boolean pHasCapturedFrustum, boolean pIsSpectator)
    • applyFrustum

      private void applyFrustum(Frustum pFrustum)
    • initializeQueueForFullUpdate

      private void initializeQueueForFullUpdate(Camera pCamera, Queue<LevelRenderer.RenderChunkInfo> pInfoQueue)
    • addRecentlyCompiledChunk

      public void addRecentlyCompiledChunk(ChunkRenderDispatcher.RenderChunk pRenderChunk)
    • updateRenderChunks

      private void updateRenderChunks(LinkedHashSet<LevelRenderer.RenderChunkInfo> pChunkInfos, LevelRenderer.RenderInfoMap pInfoMap, Vec3 pViewVector, Queue<LevelRenderer.RenderChunkInfo> pInfoQueue, boolean pShouldCull)
    • getRelativeFrom

      @Nullable private ChunkRenderDispatcher.RenderChunk getRelativeFrom(BlockPos pCameraChunkPos, ChunkRenderDispatcher.RenderChunk pRenderChunk, Direction pFacing)
    • closeToBorder

      private boolean closeToBorder(BlockPos pPos, ChunkRenderDispatcher.RenderChunk pChunk)
    • captureFrustum

      private void captureFrustum(org.joml.Matrix4f pViewMatrix, org.joml.Matrix4f pProjectionMatrix, double pCamX, double pCamY, double pCamZ, Frustum pCapturedFrustrum)
    • prepareCullFrustum

      public void prepareCullFrustum(PoseStack pPoseStack, Vec3 pCameraPos, org.joml.Matrix4f pProjectionMatrix)
    • renderLevel

      public void renderLevel(PoseStack pPoseStack, float pPartialTick, long pFinishNanoTime, boolean pRenderBlockOutline, Camera pCamera, GameRenderer pGameRenderer, LightTexture pLightTexture, org.joml.Matrix4f pProjectionMatrix)
    • checkPoseStack

      private void checkPoseStack(PoseStack pPoseStack)
    • renderEntity

      private void renderEntity(Entity pEntity, double pCamX, double pCamY, double pCamZ, float pPartialTick, PoseStack pPoseStack, MultiBufferSource pBufferSource)
    • renderChunkLayer

      private void renderChunkLayer(RenderType pRenderType, PoseStack pPoseStack, double pCamX, double pCamY, double pCamZ, org.joml.Matrix4f pProjectionMatrix)
    • renderDebug

      private void renderDebug(PoseStack pPoseStack, MultiBufferSource pBuffer, Camera pCamera)
    • addFrustumVertex

      private void addFrustumVertex(VertexConsumer pConsumer, org.joml.Matrix4f pMatrix, int pVertexIndex)
    • addFrustumQuad

      private void addFrustumQuad(VertexConsumer pConsumer, org.joml.Matrix4f pMatrix, int pIndex1, int pIndex2, int pIndex3, int pIndex4, int pRed, int pGreen, int pBlue)
    • captureFrustum

      public void captureFrustum()
    • killFrustum

      public void killFrustum()
    • tick

      public void tick()
    • removeProgress

      private void removeProgress(BlockDestructionProgress pProgress)
    • renderEndSky

      private void renderEndSky(PoseStack pPoseStack)
    • renderSky

      public void renderSky(PoseStack pPoseStack, org.joml.Matrix4f pProjectionMatrix, float pPartialTick, Camera pCamera, boolean pIsFoggy, Runnable pSkyFogSetup)
    • doesMobEffectBlockSky

      private boolean doesMobEffectBlockSky(Camera pCamera)
    • renderClouds

      public void renderClouds(PoseStack pPoseStack, org.joml.Matrix4f pProjectionMatrix, float pPartialTick, double pCamX, double pCamY, double pCamZ)
    • buildClouds

      private BufferBuilder.RenderedBuffer buildClouds(BufferBuilder pBuilder, double pX, double pY, double pZ, Vec3 pCloudColor)
    • compileChunks

      private void compileChunks(Camera pCamera)
    • renderWorldBorder

      private void renderWorldBorder(Camera pCamera)
    • renderHitOutline

      private void renderHitOutline(PoseStack pPoseStack, VertexConsumer pConsumer, Entity pEntity, double pCamX, double pCamY, double pCamZ, BlockPos pPos, BlockState pState)
    • mixColor

      private static Vec3 mixColor(float pHue)
    • shiftHue

      private static Vec3 shiftHue(float pRed, float pGreen, float pBlue, float pHue)
    • renderVoxelShape

      public static void renderVoxelShape(PoseStack pPoseStack, VertexConsumer pConsumer, VoxelShape pShape, double pX, double pY, double pZ, float pRed, float pGreen, float pBlue, float pAlpha, boolean p_286443_)
    • renderShape

      private static void renderShape(PoseStack pPoseStack, VertexConsumer pConsumer, VoxelShape pShape, double pX, double pY, double pZ, float pRed, float pGreen, float pBlue, float pAlpha)
    • renderLineBox

      public static void renderLineBox(VertexConsumer pConsumer, double pMinX, double pMinY, double pMinZ, double pMaxX, double pMaxY, double pMaxZ, float pRed, float pGreen, float pBlue, float pAlpha)
    • renderLineBox

      public static void renderLineBox(PoseStack pPoseStack, VertexConsumer pConsumer, AABB pBox, float pRed, float pGreen, float pBlue, float pAlpha)
    • renderLineBox

      public static void renderLineBox(PoseStack pPoseStack, VertexConsumer pConsumer, double pMinX, double pMinY, double pMinZ, double pMaxX, double pMaxY, double pMaxZ, float pRed, float pGreen, float pBlue, float pAlpha)
    • renderLineBox

      public static void renderLineBox(PoseStack pPoseStack, VertexConsumer pConsumer, double pMinX, double pMinY, double pMinZ, double pMaxX, double pMaxY, double pMaxZ, float pRed, float pGreen, float pBlue, float pAlpha, float pRed2, float pGreen2, float pBlue2)
    • addChainedFilledBoxVertices

      public static void addChainedFilledBoxVertices(PoseStack pPoseStack, VertexConsumer pConsumer, double pMinX, double pMinY, double pMinZ, double pMaxX, double pMaxY, double pMaxZ, float pRed, float pGreen, float pBlue, float pAlpha)
    • addChainedFilledBoxVertices

      public static void addChainedFilledBoxVertices(PoseStack pPoseStack, VertexConsumer pConsumer, float pMinX, float pMinY, float pMinZ, float pMaxX, float pMaxY, float pMaxZ, float pRed, float pGreen, float pBlue, float pAlpha)
    • blockChanged

      public void blockChanged(BlockGetter pLevel, BlockPos pPos, BlockState pOldState, BlockState pNewState, int pFlags)
    • setBlockDirty

      private void setBlockDirty(BlockPos pPos, boolean pReRenderOnMainThread)
    • setBlocksDirty

      public void setBlocksDirty(int pMinX, int pMinY, int pMinZ, int pMaxX, int pMaxY, int pMaxZ)
    • setBlockDirty

      public void setBlockDirty(BlockPos pPos, BlockState pOldState, BlockState pNewState)
    • setSectionDirtyWithNeighbors

      public void setSectionDirtyWithNeighbors(int pSectionX, int pSectionY, int pSectionZ)
    • setSectionDirty

      public void setSectionDirty(int pSectionX, int pSectionY, int pSectionZ)
    • setSectionDirty

      private void setSectionDirty(int pSectionX, int pSectionY, int pSectionZ, boolean pReRenderOnMainThread)
    • getFrustum

      public Frustum getFrustum()
    • getTicks

      public int getTicks()
    • playStreamingMusic

      @Deprecated public void playStreamingMusic(@Nullable SoundEvent pSoundEvent, BlockPos pPos)
      已过时。
      Forge: Use item aware function below
    • playStreamingMusic

      public void playStreamingMusic(@Nullable SoundEvent pSoundEvent, BlockPos pPos, @Nullable RecordItem musicDiscItem)
    • notifyNearbyEntities

      private void notifyNearbyEntities(Level pLevel, BlockPos pPos, boolean pPlaying)
    • addParticle

      public void addParticle(ParticleOptions pOptions, boolean pForce, double pX, double pY, double pZ, double pXSpeed, double pYSpeed, double pZSpeed)
    • addParticle

      public void addParticle(ParticleOptions pOptions, boolean pForce, boolean pDecreased, double pX, double pY, double pZ, double pXSpeed, double pYSpeed, double pZSpeed)
    • addParticle

      private <T extends ParticleOptions> void addParticle(T pOptions, double pX, double pY, double pZ, double pXSpeed, double pYSpeed, double pZSpeed)
    • addParticleInternal

      @Nullable private Particle addParticleInternal(ParticleOptions pOptions, boolean pForce, double pX, double pY, double pZ, double pXSpeed, double pYSpeed, double pZSpeed)
    • addParticleInternal

      @Nullable private Particle addParticleInternal(ParticleOptions pOptions, boolean pForce, boolean pDecreased, double pX, double pY, double pZ, double pXSpeed, double pYSpeed, double pZSpeed)
    • calculateParticleLevel

      private ParticleStatus calculateParticleLevel(boolean pDecreased)
    • clear

      public void clear()
    • globalLevelEvent

      public void globalLevelEvent(int pType, BlockPos pPos, int pData)
    • levelEvent

      public void levelEvent(int pType, BlockPos pPos, int pData)
    • destroyBlockProgress

      public void destroyBlockProgress(int pBreakerId, BlockPos pPos, int pProgress)
    • hasRenderedAllChunks

      public boolean hasRenderedAllChunks()
    • needsUpdate

      public void needsUpdate()
    • updateGlobalBlockEntities

      public void updateGlobalBlockEntities(Collection<BlockEntity> pBlockEntitiesToRemove, Collection<BlockEntity> pBlockEntitiesToAdd)
    • getLightColor

      public static int getLightColor(BlockAndTintGetter pLevel, BlockPos pPos)
    • getLightColor

      public static int getLightColor(BlockAndTintGetter pLevel, BlockState pState, BlockPos pPos)
    • isChunkCompiled

      public boolean isChunkCompiled(BlockPos pPos)
    • entityTarget

      @Nullable public RenderTarget entityTarget()
    • 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()