Class WorldRenderer

java.lang.Object
net.minecraft.client.render.WorldRenderer
All Implemented Interfaces:
AutoCloseable, ResourceReloadListener, SynchronousResourceReloadListener

@Environment(CLIENT)
public class WorldRenderer
extends Object
implements SynchronousResourceReloadListener, AutoCloseable
  • Field Details

    • LOGGER

      private static final Logger LOGGER
    • MOON_PHASES

      private static final Identifier MOON_PHASES
    • SUN

      private static final Identifier SUN
    • CLOUDS

      private static final Identifier CLOUDS
    • END_SKY

      private static final Identifier END_SKY
    • FORCEFIELD

      private static final Identifier FORCEFIELD
    • RAIN

      private static final Identifier RAIN
    • SNOW

      private static final Identifier SNOW
    • DIRECTIONS

      public static final Direction[] DIRECTIONS
    • client

      private final MinecraftClient client
    • textureManager

      private final TextureManager textureManager
    • entityRenderDispatcher

      private final EntityRenderDispatcher entityRenderDispatcher
    • bufferBuilders

      private final BufferBuilderStorage bufferBuilders
    • world

      private ClientWorld world
    • chunksToRebuild

      private Set<ChunkBuilder.BuiltChunk> chunksToRebuild
    • visibleChunks

      private final ObjectList<WorldRenderer.ChunkInfo> visibleChunks
    • noCullingBlockEntities

      private final Set<BlockEntity> noCullingBlockEntities
    • chunks

      private BuiltChunkStorage chunks
    • skyVertexFormat

      private final VertexFormat skyVertexFormat
    • starsBuffer

      @Nullable private VertexBuffer starsBuffer
    • lightSkyBuffer

      @Nullable private VertexBuffer lightSkyBuffer
    • darkSkyBuffer

      @Nullable private VertexBuffer darkSkyBuffer
    • cloudsDirty

      private boolean cloudsDirty
    • cloudsBuffer

      @Nullable private VertexBuffer cloudsBuffer
    • chunkUpdateSmoother

      private final FpsSmoother chunkUpdateSmoother
    • ticks

      private int ticks
    • blockBreakingInfos

      private final Int2ObjectMap<BlockBreakingInfo> blockBreakingInfos
    • blockBreakingProgressions

      private final Long2ObjectMap<SortedSet<BlockBreakingInfo>> blockBreakingProgressions
    • playingSongs

      private final Map<BlockPos,​SoundInstance> playingSongs
    • entityOutlinesFramebuffer

      @Nullable private Framebuffer entityOutlinesFramebuffer
    • entityOutlineShader

      @Nullable private ShaderEffect entityOutlineShader
    • translucentFramebuffer

      @Nullable private Framebuffer translucentFramebuffer
    • entityFramebuffer

      @Nullable private Framebuffer entityFramebuffer
    • particlesFramebuffer

      @Nullable private Framebuffer particlesFramebuffer
    • weatherFramebuffer

      @Nullable private Framebuffer weatherFramebuffer
    • cloudsFramebuffer

      @Nullable private Framebuffer cloudsFramebuffer
    • transparencyShader

      @Nullable private ShaderEffect transparencyShader
    • lastCameraChunkUpdateX

      private double lastCameraChunkUpdateX
    • lastCameraChunkUpdateY

      private double lastCameraChunkUpdateY
    • lastCameraChunkUpdateZ

      private double lastCameraChunkUpdateZ
    • cameraChunkX

      private int cameraChunkX
    • cameraChunkY

      private int cameraChunkY
    • cameraChunkZ

      private int cameraChunkZ
    • lastCameraX

      private double lastCameraX
    • lastCameraY

      private double lastCameraY
    • lastCameraZ

      private double lastCameraZ
    • lastCameraPitch

      private double lastCameraPitch
    • lastCameraYaw

      private double lastCameraYaw
    • lastCloudsBlockX

      private int lastCloudsBlockX
    • lastCloudsBlockY

      private int lastCloudsBlockY
    • lastCloudsBlockZ

      private int lastCloudsBlockZ
    • lastCloudsColor

      private Vec3d lastCloudsColor
    • lastCloudsRenderMode

      private CloudRenderMode lastCloudsRenderMode
    • chunkBuilder

      private ChunkBuilder chunkBuilder
    • vertexFormat

      private final VertexFormat vertexFormat
    • renderDistance

      private int renderDistance
    • regularEntityCount

      private int regularEntityCount
    • blockEntityCount

      private int blockEntityCount
    • shouldCaptureFrustum

      private boolean shouldCaptureFrustum
    • capturedFrustum

      @Nullable private Frustum capturedFrustum
    • capturedFrustumOrientation

      private final Vector4f[] capturedFrustumOrientation
    • capturedFrustumPosition

      private final Vector3d capturedFrustumPosition
    • lastTranslucentSortX

      private double lastTranslucentSortX
    • lastTranslucentSortY

      private double lastTranslucentSortY
    • lastTranslucentSortZ

      private double lastTranslucentSortZ
    • needsTerrainUpdate

      private boolean needsTerrainUpdate
    • frame

      private int frame
    • field_20793

      private int field_20793
    • field_20794

      private final float[] field_20794
    • field_20795

      private final float[] field_20795
  • Constructor Details

  • Method Details

    • renderWeather

      private void renderWeather​(LightmapTextureManager manager, float float2, double double2, double double3, double double4)
    • tickRainSplashing

      public void tickRainSplashing​(Camera camera)
    • close

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

      public void apply​(ResourceManager manager)
      Specified by:
      apply in interface SynchronousResourceReloadListener
    • loadEntityOutlineShader

      public void loadEntityOutlineShader()
    • loadTransparencyShader

      private void loadTransparencyShader()
    • resetTransparencyShader

      private void resetTransparencyShader()
    • drawEntityOutlinesFramebuffer

      public void drawEntityOutlinesFramebuffer()
    • canDrawEntityOutlines

      protected boolean canDrawEntityOutlines()
    • renderDarkSky

      private void renderDarkSky()
    • renderLightSky

      private void renderLightSky()
    • renderSkyHalf

      private void renderSkyHalf​(BufferBuilder buffer, float y, boolean bottom)
    • renderStars

      private void renderStars()
    • renderStars

      private void renderStars​(BufferBuilder buffer)
    • setWorld

      public void setWorld​(@Nullable ClientWorld clientWorld)
    • reload

      public void reload()
    • clearChunkRenderers

      protected void clearChunkRenderers()
    • onResized

      public void onResized​(int int2, int int3)
    • getChunksDebugString

      public String getChunksDebugString()
    • getCompletedChunkCount

      protected int getCompletedChunkCount()
    • getEntitiesDebugString

      public String getEntitiesDebugString()
    • setupTerrain

      private void setupTerrain​(Camera camera, Frustum frustum, boolean hasForcedFrustum, int frame, boolean spectator)
    • getAdjacentChunk

      @Nullable private ChunkBuilder.BuiltChunk getAdjacentChunk​(BlockPos pos, ChunkBuilder.BuiltChunk chunk, Direction direction)
    • captureFrustum

      private void captureFrustum​(Matrix4f modelMatrix, Matrix4f matrix4f, double x, double y, double z, Frustum frustum)
    • render

      public void render​(MatrixStack matrices, float tickDelta, long limitTime, boolean renderBlockOutline, Camera camera, GameRenderer gameRenderer, LightmapTextureManager lightmapTextureManager, Matrix4f matrix4f)
    • checkEmpty

      private void checkEmpty​(MatrixStack matrices)
    • renderEntity

      private void renderEntity​(Entity entity, double cameraX, double cameraY, double cameraZ, float tickDelta, MatrixStack matrices, VertexConsumerProvider vertexConsumers)
    • renderLayer

      private void renderLayer​(RenderLayer renderLayer, MatrixStack matrixStack, double double2, double double3, double double4)
    • renderChunkDebugInfo

      private void renderChunkDebugInfo​(Camera camera)
    • method_22984

      private void method_22984​(VertexConsumer vertexConsumer, int int2)
    • method_22985

      private void method_22985​(VertexConsumer vertexConsumer, int int2, int int3, int int4, int int5, int int6, int int7, int int8)
    • tick

      public void tick()
    • removeBlockBreakingInfo

      private void removeBlockBreakingInfo​(BlockBreakingInfo blockBreakingInfo)
    • renderEndSky

      private void renderEndSky​(MatrixStack matrices)
    • renderSky

      public void renderSky​(MatrixStack matrices, float tickDelta)
    • renderClouds

      public void renderClouds​(MatrixStack matrices, float tickDelta, double cameraX, double cameraY, double cameraZ)
    • renderClouds

      private void renderClouds​(BufferBuilder builder, double x, double y, double z, Vec3d color)
    • updateChunks

      private void updateChunks​(long limitTime)
    • renderWorldBorder

      private void renderWorldBorder​(Camera camera)
    • method_22978

      private void method_22978​(BufferBuilder bufferBuilder, double double2, double double3, double double4, double double5, int int2, double double6, float float2, float float3)
    • drawBlockOutline

      private void drawBlockOutline​(MatrixStack matrixStack, VertexConsumer vertexConsumer, Entity entity, double double2, double double3, double double4, BlockPos blockPos, BlockState blockState)
    • method_22983

      public static void method_22983​(MatrixStack matrixStack, VertexConsumer vertexConsumer, VoxelShape voxelShape, double double2, double double3, double double4, float float2, float float3, float float4, float float5)
    • drawShapeOutline

      private static void drawShapeOutline​(MatrixStack matrixStack, VertexConsumer vertexConsumer, VoxelShape voxelShape, double double2, double double3, double double4, float float2, float float3, float float4, float float5)
    • drawBox

      public static void drawBox​(MatrixStack matrices, VertexConsumer vertexConsumer, Box box, float red, float green, float blue, float alpha)
      Draws a box.

      Note the coordinates the box spans are relative to current translation of the matrices.

    • drawBox

      public static void drawBox​(MatrixStack matrices, VertexConsumer vertexConsumer, double x1, double y1, double z1, double x2, double y2, double z2, float red, float green, float blue, float alpha)
      Draws a box spanning from [x1,y1,z1] to [x2,y2,z2].

      Note the coordinates the box spans are relative to current translation of the matrices.

    • drawBox

      public static void drawBox​(MatrixStack matrices, VertexConsumer vertexConsumer, double x1, double y1, double z1, double x2, double y2, double z2, float red, float green, float blue, float alpha, float xAxisRed, float yAxisGreen, float zAxisBlue)
      Draws a box spanning from [x1,y1,z1] to [x2,y2,z2]. The 3 axes centered at [x1,y1,z1] may be colored differently using xAxisRed, yAxisGreen, and zAxisBlue.

      Note the coordinates the box spans are relative to current translation of the matrices.

    • drawBox

      public static void drawBox​(BufferBuilder buffer, double x1, double y1, double z1, double x2, double y2, double z2, float red, float green, float blue, float alpha)
    • updateBlock

      public void updateBlock​(BlockView world, BlockPos pos, BlockState oldState, BlockState newState, int flags)
    • scheduleSectionRender

      private void scheduleSectionRender​(BlockPos pos, boolean important)
    • scheduleBlockRenders

      public void scheduleBlockRenders​(int minX, int minY, int minZ, int maxX, int maxY, int maxZ)
    • scheduleBlockRerenderIfNeeded

      public void scheduleBlockRerenderIfNeeded​(BlockPos pos, BlockState old, BlockState updated)
    • scheduleBlockRenders

      public void scheduleBlockRenders​(int x, int y, int z)
    • scheduleBlockRender

      public void scheduleBlockRender​(int x, int y, int z)
    • scheduleChunkRender

      private void scheduleChunkRender​(int x, int y, int z, boolean important)
    • playSong

      public void playSong​(@Nullable SoundEvent song, BlockPos songPosition)
    • updateEntitiesForSong

      private void updateEntitiesForSong​(World world, BlockPos pos, boolean playing)
    • addParticle

      public void addParticle​(ParticleEffect parameters, boolean shouldAlwaysSpawn, double x, double y, double z, double velocityX, double velocityY, double velocityZ)
    • addParticle

      public void addParticle​(ParticleEffect parameters, boolean shouldAlwaysSpawn, boolean important, double x, double y, double z, double velocityX, double velocityY, double velocityZ)
    • addParticle

      private <T extends ParticleEffect> void addParticle​(T parameters, double x, double y, double z, double velocityX, double velocityY, double velocityZ)
    • spawnParticle

      @Nullable private Particle spawnParticle​(ParticleEffect parameters, boolean alwaysSpawn, double x, double y, double z, double velocityX, double velocityY, double velocityZ)
    • spawnParticle

      @Nullable private Particle spawnParticle​(ParticleEffect parameters, boolean alwaysSpawn, boolean canSpawnOnMinimal, double x, double y, double z, double velocityX, double velocityY, double velocityZ)
    • getRandomParticleSpawnChance

      private ParticlesMode getRandomParticleSpawnChance​(boolean canSpawnOnMinimal)
    • method_3267

      public void method_3267()
    • processGlobalEvent

      public void processGlobalEvent​(int eventId, BlockPos pos, int int2)
    • processWorldEvent

      public void processWorldEvent​(PlayerEntity source, int eventId, BlockPos pos, int data)
    • setBlockBreakingInfo

      public void setBlockBreakingInfo​(int entityId, BlockPos pos, int stage)
    • isTerrainRenderComplete

      public boolean isTerrainRenderComplete()
    • scheduleTerrainUpdate

      public void scheduleTerrainUpdate()
    • updateNoCullingBlockEntities

      public void updateNoCullingBlockEntities​(Collection<BlockEntity> removed, Collection<BlockEntity> added)
    • getLightmapCoordinates

      public static int getLightmapCoordinates​(BlockRenderView world, BlockPos pos)
    • getLightmapCoordinates

      public static int getLightmapCoordinates​(BlockRenderView world, BlockState state, BlockPos pos)
    • getEntityOutlinesFramebuffer

      @Nullable public Framebuffer getEntityOutlinesFramebuffer()
    • getTranslucentFramebuffer

      @Nullable public Framebuffer getTranslucentFramebuffer()
    • getEntityFramebuffer

      @Nullable public Framebuffer getEntityFramebuffer()
    • getParticlesFramebuffer

      @Nullable public Framebuffer getParticlesFramebuffer()
    • getWeatherFramebuffer

      @Nullable public Framebuffer getWeatherFramebuffer()
    • getCloudsFramebuffer

      @Nullable public Framebuffer getCloudsFramebuffer()