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) classWorldRenderer.ChunkInfostatic classWorldRenderer.ShaderExceptionNested classes/interfaces inherited from interface net.minecraft.resource.ResourceReloadListener
ResourceReloadListener.Synchronizer -
Field Summary
-
Constructor Summary
Constructors Constructor Description WorldRenderer(MinecraftClient client, BufferBuilderStorage bufferBuilderStorage) -
Method Summary
Modifier and Type Method Description voidaddParticle(ParticleEffect parameters, boolean shouldAlwaysSpawn, boolean important, double x, double y, double z, double velocityX, double velocityY, double velocityZ)voidaddParticle(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)voidapply(ResourceManager manager)protected booleancanDrawEntityOutlines()private voidcaptureFrustum(Matrix4f modelMatrix, Matrix4f matrix4f, double x, double y, double z, Frustum frustum)private voidcheckEmpty(MatrixStack matrices)protected voidclearChunkRenderers()voidclose()private voiddrawBlockOutline(MatrixStack matrixStack, VertexConsumer vertexConsumer, Entity entity, double double2, double double3, double double4, BlockPos blockPos, BlockState blockState)static voiddrawBox(BufferBuilder buffer, double x1, double y1, double z1, double x2, double y2, double z2, float red, float green, float blue, float alpha)static voiddrawBox(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 voiddrawBox(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 voiddrawBox(MatrixStack matrices, VertexConsumer vertexConsumer, Box box, float red, float green, float blue, float alpha)Draws a box.voiddrawEntityOutlinesFramebuffer()private static voiddrawShapeOutline(MatrixStack matrixStack, VertexConsumer vertexConsumer, VoxelShape voxelShape, double double2, double double3, double double4, float float2, float float3, float float4, float float5)private ChunkBuilder.BuiltChunkgetAdjacentChunk(BlockPos pos, ChunkBuilder.BuiltChunk chunk, Direction direction)StringgetChunksDebugString()FramebuffergetCloudsFramebuffer()protected intgetCompletedChunkCount()StringgetEntitiesDebugString()FramebuffergetEntityFramebuffer()FramebuffergetEntityOutlinesFramebuffer()static intgetLightmapCoordinates(BlockRenderView world, BlockState state, BlockPos pos)static intgetLightmapCoordinates(BlockRenderView world, BlockPos pos)FramebuffergetParticlesFramebuffer()private ParticlesModegetRandomParticleSpawnChance(boolean canSpawnOnMinimal)FramebuffergetTranslucentFramebuffer()FramebuffergetWeatherFramebuffer()booleanisTerrainRenderComplete()voidloadEntityOutlineShader()private voidloadTransparencyShader()static voidmethod_22983(MatrixStack matrixStack, VertexConsumer vertexConsumer, VoxelShape voxelShape, double double2, double double3, double double4, float float2, float float3, float float4, float float5)private voidmethod_22984(VertexConsumer vertexConsumer, int int2)private voidmethod_22985(VertexConsumer vertexConsumer, int int2, int int3, int int4, int int5, int int6, int int7, int int8)voidmethod_32133(MatrixStack matrixStack, Vec3d vec3d, Matrix4f matrix4f)voidmethod_3267()voidonResized(int int2, int int3)voidplaySong(SoundEvent song, BlockPos songPosition)voidprocessGlobalEvent(int eventId, BlockPos pos, int int2)voidprocessWorldEvent(PlayerEntity source, int eventId, BlockPos pos, int data)voidreload()private voidremoveBlockBreakingInfo(BlockBreakingInfo blockBreakingInfo)voidrender(MatrixStack matrices, float tickDelta, long limitTime, boolean renderBlockOutline, Camera camera, GameRenderer gameRenderer, LightmapTextureManager lightmapTextureManager, Matrix4f matrix4f)private voidrenderChunkDebugInfo(Camera camera)private voidrenderClouds(BufferBuilder builder, double x, double y, double z, Vec3d color)voidrenderClouds(MatrixStack matrices, float tickDelta, double cameraX, double cameraY, double cameraZ)private voidrenderDarkSky()private voidrenderEndSky(MatrixStack matrices)private voidrenderEntity(Entity entity, double cameraX, double cameraY, double cameraZ, float tickDelta, MatrixStack matrices, VertexConsumerProvider vertexConsumers)private voidrenderLayer(RenderLayer renderLayer, MatrixStack matrixStack, double double2, double double3, double double4)private voidrenderLightSky()voidrenderSky(MatrixStack matrices, float tickDelta)private voidrenderSkyHalf(BufferBuilder buffer, float y, boolean bottom)private voidrenderStars()private voidrenderStars(BufferBuilder buffer)private voidrenderWeather(LightmapTextureManager manager, float float2, double double2, double double3, double double4)private voidrenderWorldBorder(Camera camera)private voidresetTransparencyShader()voidscheduleBlockRender(int x, int y, int z)voidscheduleBlockRenders(int x, int y, int z)voidscheduleBlockRenders(int minX, int minY, int minZ, int maxX, int maxY, int maxZ)voidscheduleBlockRerenderIfNeeded(BlockPos pos, BlockState old, BlockState updated)private voidscheduleChunkRender(int x, int y, int z, boolean important)private voidscheduleSectionRender(BlockPos pos, boolean important)voidscheduleTerrainUpdate()voidsetBlockBreakingInfo(int entityId, BlockPos pos, int stage)private voidsetupTerrain(Camera camera, Frustum frustum, boolean hasForcedFrustum, int frame, boolean spectator)voidsetWorld(ClientWorld clientWorld)private ParticlespawnParticle(ParticleEffect parameters, boolean alwaysSpawn, boolean canSpawnOnMinimal, double x, double y, double z, double velocityX, double velocityY, double velocityZ)private ParticlespawnParticle(ParticleEffect parameters, boolean alwaysSpawn, double x, double y, double z, double velocityX, double velocityY, double velocityZ)voidtick()voidtickRainSplashing(Camera camera)voidupdateBlock(BlockView world, BlockPos pos, BlockState oldState, BlockState newState, int flags)private voidupdateChunks(long limitTime)private voidupdateEntitiesForSong(World world, BlockPos pos, boolean playing)voidupdateNoCullingBlockEntities(Collection<BlockEntity> removed, Collection<BlockEntity> added)Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.minecraft.resource.ResourceReloadListener
getNameMethods inherited from interface net.minecraft.resource.SynchronousResourceReloadListener
reload
-
Field Details
-
LOGGER
-
MOON_PHASES
-
SUN
-
CLOUDS
-
END_SKY
-
FORCEFIELD
-
RAIN
-
SNOW
-
DIRECTIONS
-
client
-
textureManager
-
entityRenderDispatcher
-
field_27741
-
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 -
field_27740
-
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:
closein interfaceAutoCloseable
-
apply
- Specified by:
applyin 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
-
method_32133
-
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
-
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
-