Package net.minecraft.client.render
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
-
Nested Class Summary
Nested Classes Modifier and Type Class Description (package private) class
WorldRenderer.ChunkInfo
static class
WorldRenderer.ShaderException
Nested classes/interfaces inherited from interface net.minecraft.resource.ResourceReloadListener
ResourceReloadListener.Synchronizer
-
Field Summary
-
Constructor Summary
Constructors Constructor Description WorldRenderer(MinecraftClient client, BufferBuilderStorage bufferBuilders)
-
Method Summary
Modifier and Type Method Description void
addParticle(ParticleEffect parameters, boolean shouldAlwaysSpawn, boolean important, double x, double y, double z, double velocityX, double velocityY, double velocityZ)
void
addParticle(ParticleEffect parameters, boolean shouldAlwaysSpawn, double x, double y, double z, double velocityX, double velocityY, double velocityZ)
private <T extends ParticleEffect>
voidaddParticle(T parameters, double x, double y, double z, double velocityX, double velocityY, double velocityZ)
void
apply(ResourceManager manager)
protected boolean
canDrawEntityOutlines()
private void
captureFrustum(Matrix4f modelMatrix, Matrix4f matrix4f, double x, double y, double z, Frustum frustum)
private void
checkEmpty(MatrixStack matrices)
protected void
clearChunkRenderers()
void
close()
private void
drawBlockOutline(MatrixStack matrixStack, VertexConsumer vertexConsumer, Entity entity, double double2, double double3, double double4, BlockPos blockPos, BlockState blockState)
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)
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].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].static void
drawBox(MatrixStack matrices, VertexConsumer vertexConsumer, Box box, float red, float green, float blue, float alpha)
Draws a box.void
drawEntityOutlinesFramebuffer()
private static void
drawShapeOutline(MatrixStack matrixStack, VertexConsumer vertexConsumer, VoxelShape voxelShape, double double2, double double3, double double4, float float2, float float3, float float4, float float5)
private ChunkBuilder.BuiltChunk
getAdjacentChunk(BlockPos pos, ChunkBuilder.BuiltChunk chunk, Direction direction)
String
getChunksDebugString()
Framebuffer
getCloudsFramebuffer()
protected int
getCompletedChunkCount()
String
getEntitiesDebugString()
Framebuffer
getEntityFramebuffer()
Framebuffer
getEntityOutlinesFramebuffer()
static int
getLightmapCoordinates(BlockRenderView world, BlockState state, BlockPos pos)
static int
getLightmapCoordinates(BlockRenderView world, BlockPos pos)
Framebuffer
getParticlesFramebuffer()
private ParticlesMode
getRandomParticleSpawnChance(boolean canSpawnOnMinimal)
Framebuffer
getTranslucentFramebuffer()
Framebuffer
getWeatherFramebuffer()
boolean
isTerrainRenderComplete()
void
loadEntityOutlineShader()
private void
loadTransparencyShader()
private void
method_22978(BufferBuilder bufferBuilder, double double2, double double3, double double4, double double5, int int2, double double6, float float2, float float3)
static void
method_22983(MatrixStack matrixStack, VertexConsumer vertexConsumer, VoxelShape voxelShape, double double2, double double3, double double4, float float2, float float3, float float4, float float5)
private void
method_22984(VertexConsumer vertexConsumer, int int2)
private void
method_22985(VertexConsumer vertexConsumer, int int2, int int3, int int4, int int5, int int6, int int7, int int8)
void
method_3267()
void
onResized(int int2, int int3)
void
playSong(SoundEvent song, BlockPos songPosition)
void
processGlobalEvent(int eventId, BlockPos pos, int int2)
void
processWorldEvent(PlayerEntity source, int eventId, BlockPos pos, int data)
void
reload()
private void
removeBlockBreakingInfo(BlockBreakingInfo blockBreakingInfo)
void
render(MatrixStack matrices, float tickDelta, long limitTime, boolean renderBlockOutline, Camera camera, GameRenderer gameRenderer, LightmapTextureManager lightmapTextureManager, Matrix4f matrix4f)
private void
renderChunkDebugInfo(Camera camera)
private void
renderClouds(BufferBuilder builder, double x, double y, double z, Vec3d color)
void
renderClouds(MatrixStack matrices, float tickDelta, double cameraX, double cameraY, double cameraZ)
private void
renderDarkSky()
private void
renderEndSky(MatrixStack matrices)
private void
renderEntity(Entity entity, double cameraX, double cameraY, double cameraZ, float tickDelta, MatrixStack matrices, VertexConsumerProvider vertexConsumers)
private void
renderLayer(RenderLayer renderLayer, MatrixStack matrixStack, double double2, double double3, double double4)
private void
renderLightSky()
void
renderSky(MatrixStack matrices, float tickDelta)
private void
renderSkyHalf(BufferBuilder buffer, float y, boolean bottom)
private void
renderStars()
private void
renderStars(BufferBuilder buffer)
private void
renderWeather(LightmapTextureManager manager, float float2, double double2, double double3, double double4)
private void
renderWorldBorder(Camera camera)
private void
resetTransparencyShader()
void
scheduleBlockRender(int x, int y, int z)
void
scheduleBlockRenders(int x, int y, int z)
void
scheduleBlockRenders(int minX, int minY, int minZ, int maxX, int maxY, int maxZ)
void
scheduleBlockRerenderIfNeeded(BlockPos pos, BlockState old, BlockState updated)
private void
scheduleChunkRender(int x, int y, int z, boolean important)
private void
scheduleSectionRender(BlockPos pos, boolean important)
void
scheduleTerrainUpdate()
void
setBlockBreakingInfo(int entityId, BlockPos pos, int stage)
private void
setupTerrain(Camera camera, Frustum frustum, boolean hasForcedFrustum, int frame, boolean spectator)
void
setWorld(ClientWorld clientWorld)
private Particle
spawnParticle(ParticleEffect parameters, boolean alwaysSpawn, boolean canSpawnOnMinimal, double x, double y, double z, double velocityX, double velocityY, double velocityZ)
private Particle
spawnParticle(ParticleEffect parameters, boolean alwaysSpawn, double x, double y, double z, double velocityX, double velocityY, double velocityZ)
void
tick()
void
tickRainSplashing(Camera camera)
void
updateBlock(BlockView world, BlockPos pos, BlockState oldState, BlockState newState, int flags)
private void
updateChunks(long limitTime)
private void
updateEntitiesForSong(World world, BlockPos pos, boolean playing)
void
updateNoCullingBlockEntities(Collection<BlockEntity> removed, Collection<BlockEntity> added)
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface net.minecraft.resource.ResourceReloadListener
getName
Methods inherited from interface net.minecraft.resource.SynchronousResourceReloadListener
reload
-
Field Details
-
LOGGER
-
MOON_PHASES
-
SUN
-
CLOUDS
-
END_SKY
-
FORCEFIELD
-
RAIN
-
SNOW
-
DIRECTIONS
-
client
-
textureManager
-
entityRenderDispatcher
-
bufferBuilders
-
world
-
chunksToRebuild
-
visibleChunks
-
noCullingBlockEntities
-
chunks
-
skyVertexFormat
-
starsBuffer
-
lightSkyBuffer
-
darkSkyBuffer
-
cloudsDirty
private boolean cloudsDirty -
cloudsBuffer
-
chunkUpdateSmoother
-
ticks
private int ticks -
blockBreakingInfos
-
blockBreakingProgressions
-
playingSongs
-
entityOutlinesFramebuffer
-
entityOutlineShader
-
translucentFramebuffer
-
entityFramebuffer
-
particlesFramebuffer
-
weatherFramebuffer
-
cloudsFramebuffer
-
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
-
lastCloudsRenderMode
-
chunkBuilder
-
vertexFormat
-
renderDistance
private int renderDistance -
regularEntityCount
private int regularEntityCount -
blockEntityCount
private int blockEntityCount -
shouldCaptureFrustum
private boolean shouldCaptureFrustum -
capturedFrustum
-
capturedFrustumOrientation
-
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
-
WorldRenderer
-
-
Method Details
-
renderWeather
private void renderWeather(LightmapTextureManager manager, float float2, double double2, double double3, double double4) -
tickRainSplashing
-
close
public void close()- Specified by:
close
in interfaceAutoCloseable
-
apply
- Specified by:
apply
in interfaceSynchronousResourceReloadListener
-
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
-
renderStars
private void renderStars() -
renderStars
-
setWorld
-
reload
public void reload() -
clearChunkRenderers
protected void clearChunkRenderers() -
onResized
public void onResized(int int2, int int3) -
getChunksDebugString
-
getCompletedChunkCount
protected int getCompletedChunkCount() -
getEntitiesDebugString
-
setupTerrain
-
getAdjacentChunk
@Nullable private ChunkBuilder.BuiltChunk getAdjacentChunk(BlockPos pos, ChunkBuilder.BuiltChunk chunk, Direction direction) -
captureFrustum
-
render
public void render(MatrixStack matrices, float tickDelta, long limitTime, boolean renderBlockOutline, Camera camera, GameRenderer gameRenderer, LightmapTextureManager lightmapTextureManager, Matrix4f matrix4f) -
checkEmpty
-
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
-
method_22984
-
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
-
renderEndSky
-
renderSky
-
renderClouds
public void renderClouds(MatrixStack matrices, float tickDelta, double cameraX, double cameraY, double cameraZ) -
renderClouds
-
updateChunks
private void updateChunks(long limitTime) -
renderWorldBorder
-
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
-
scheduleBlockRenders
public void scheduleBlockRenders(int minX, int minY, int minZ, int maxX, int maxY, int maxZ) -
scheduleBlockRerenderIfNeeded
-
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
-
updateEntitiesForSong
-
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
-
method_3267
public void method_3267() -
processGlobalEvent
-
processWorldEvent
-
setBlockBreakingInfo
-
isTerrainRenderComplete
public boolean isTerrainRenderComplete() -
scheduleTerrainUpdate
public void scheduleTerrainUpdate() -
updateNoCullingBlockEntities
public void updateNoCullingBlockEntities(Collection<BlockEntity> removed, Collection<BlockEntity> added) -
getLightmapCoordinates
-
getLightmapCoordinates
-
getEntityOutlinesFramebuffer
-
getTranslucentFramebuffer
-
getEntityFramebuffer
-
getParticlesFramebuffer
-
getWeatherFramebuffer
-
getCloudsFramebuffer
-