public class WorldRenderer extends java.lang.Object implements java.lang.AutoCloseable, IResourceManagerReloadListener
Modifier and Type | Class and Description |
---|---|
(package private) class |
WorldRenderer.LocalRenderInformationContainer |
IFutureReloadListener.IStage
Constructor and Description |
---|
WorldRenderer(Minecraft mcIn,
RenderTypeBuffers rainTimeBuffersIn) |
Modifier and Type | Method and Description |
---|---|
static void |
addChainedFilledBoxVertices(BufferBuilder builder,
double x1,
double y1,
double z1,
double x2,
double y2,
double z2,
float red,
float green,
float blue,
float alpha) |
private void |
addDebugQuad(IVertexBuilder bufferIn,
int vertex1,
int vertex2,
int vertex3,
int vertex4,
int red,
int green,
int blue) |
private void |
addDebugVertex(IVertexBuilder bufferIn,
int vertex) |
void |
addParticle(IParticleData particleData,
boolean ignoreRange,
boolean minimizeLevel,
double x,
double y,
double z,
double xSpeed,
double ySpeed,
double zSpeed) |
void |
addParticle(IParticleData particleData,
boolean alwaysRender,
double x,
double y,
double z,
double xSpeed,
double ySpeed,
double zSpeed) |
private Particle |
addParticleUnchecked(IParticleData particleData,
boolean alwaysRender,
boolean minimizeLevel,
double x,
double y,
double z,
double xSpeed,
double ySpeed,
double zSpeed) |
private Particle |
addParticleUnchecked(IParticleData particleData,
boolean alwaysRender,
double x,
double y,
double z,
double xSpeed,
double ySpeed,
double zSpeed) |
private <T extends IParticleData> |
addParticleUnchecked(T particleData,
double x,
double y,
double z,
double xSpeed,
double ySpeed,
double zSpeed) |
void |
addRainParticles(ActiveRenderInfo activeRenderInfoIn) |
private void |
addVertex(BufferBuilder bufferIn,
double camX,
double camY,
double camZ,
double xIn,
int yIn,
double zIn,
float texU,
float texV) |
void |
broadcastSound(int soundID,
BlockPos pos,
int data) |
private ParticleStatus |
calculateParticleLevel(boolean minimiseLevel) |
private void |
captureFrustum(Matrix4f p_228419_1_,
Matrix4f p_228419_2_,
double p_228419_3_,
double p_228419_5_,
double p_228419_7_,
ClippingHelperImpl p_228419_9_) |
private void |
checkMatrixStack(MatrixStack matrixStackIn) |
void |
close() |
void |
createBindEntityOutlineFbs(int width,
int height) |
void |
deleteAllDisplayLists() |
static void |
drawBoundingBox(IVertexBuilder bufferIn,
double minX,
double minY,
double minZ,
double maxX,
double maxY,
double maxZ,
float red,
float green,
float blue,
float alpha) |
static void |
drawBoundingBox(MatrixStack matrixStackIn,
IVertexBuilder bufferIn,
AxisAlignedBB aabbIn,
float red,
float green,
float blue,
float alpha) |
static void |
drawBoundingBox(MatrixStack matrixStackIn,
IVertexBuilder bufferIn,
double minX,
double minY,
double minZ,
double maxX,
double maxY,
double maxZ,
float red,
float green,
float blue,
float alpha) |
static void |
drawBoundingBox(MatrixStack matrixStackIn,
IVertexBuilder bufferIn,
double minX,
double minY,
double minZ,
double maxX,
double maxY,
double maxZ,
float red,
float green,
float blue,
float alpha,
float red2,
float green2,
float blue2) |
private void |
drawClouds(BufferBuilder bufferIn,
double cloudsX,
double cloudsY,
double cloudsZ,
Vec3d cloudsColor) |
private void |
drawSelectionBox(MatrixStack matrixStackIn,
IVertexBuilder bufferIn,
Entity entityIn,
double xIn,
double yIn,
double zIn,
BlockPos blockPosIn,
BlockState blockStateIn) |
private static void |
drawShape(MatrixStack matrixStackIn,
IVertexBuilder bufferIn,
VoxelShape shapeIn,
double xIn,
double yIn,
double zIn,
float red,
float green,
float blue,
float alpha) |
static void |
drawVoxelShapeParts(MatrixStack matrixStackIn,
IVertexBuilder bufferIn,
VoxelShape shapeIn,
double xIn,
double yIn,
double zIn,
float red,
float green,
float blue,
float alpha) |
private void |
generateSky() |
private void |
generateSky2() |
private void |
generateStars() |
static int |
getCombinedLight(ILightReader lightReaderIn,
BlockPos blockPosIn) |
java.lang.String |
getDebugInfoEntities() |
java.lang.String |
getDebugInfoRenders() |
Framebuffer |
getEntityOutlineFramebuffer() |
static int |
getPackedLightmapCoords(ILightReader lightReaderIn,
BlockState blockStateIn,
BlockPos blockPosIn) |
private ChunkRenderDispatcher.ChunkRender |
getRenderChunkOffset(BlockPos playerPos,
ChunkRenderDispatcher.ChunkRender renderChunkBase,
Direction facing) |
protected int |
getRenderedChunks() |
IResourceType |
getResourceType() |
private java.util.Set<Direction> |
getVisibleFacings(BlockPos pos) |
boolean |
hasNoChunkUpdates() |
protected boolean |
isRenderEntityOutlines() |
void |
loadRenderers() |
void |
makeEntityOutlineShader() |
void |
markBlockRangeForRenderUpdate(BlockPos blockPosIn,
BlockState oldState,
BlockState newState) |
void |
markBlockRangeForRenderUpdate(int x1,
int y1,
int z1,
int x2,
int y2,
int z2) |
void |
markForRerender(int sectionX,
int sectionY,
int sectionZ) |
private void |
markForRerender(int sectionX,
int sectionY,
int sectionZ,
boolean rerenderOnMainThread) |
void |
markSurroundingsForRerender(int sectionX,
int sectionY,
int sectionZ) |
private void |
notifyBlockUpdate(BlockPos posIn,
boolean rerenderOnMainThread) |
void |
notifyBlockUpdate(IBlockReader worldIn,
BlockPos pos,
BlockState oldState,
BlockState newState,
int flags) |
void |
onResourceManagerReload(IResourceManager resourceManager) |
void |
playEvent(PlayerEntity player,
int type,
BlockPos blockPosIn,
int data) |
void |
playRecord(SoundEvent soundIn,
BlockPos pos)
Deprecated.
|
void |
playRecord(SoundEvent soundIn,
BlockPos pos,
MusicDiscItem musicDiscItem) |
private void |
removeDamageProgress(DestroyBlockProgress progressIn) |
private void |
renderBlockLayer(RenderType blockLayerIn,
MatrixStack matrixStackIn,
double xIn,
double yIn,
double zIn) |
void |
renderClouds(MatrixStack matrixStackIn,
float partialTicks,
double viewEntityX,
double viewEntityY,
double viewEntityZ) |
private void |
renderDebug(ActiveRenderInfo activeRenderInfoIn) |
private void |
renderEntity(Entity entityIn,
double camX,
double camY,
double camZ,
float partialTicks,
MatrixStack matrixStackIn,
IRenderTypeBuffer bufferIn) |
void |
renderEntityOutlineFramebuffer() |
private void |
renderRainSnow(LightTexture lightmapIn,
float partialTicks,
double xIn,
double yIn,
double zIn) |
private void |
renderSky(BufferBuilder bufferBuilderIn,
float posY,
boolean reverseX) |
void |
renderSky(MatrixStack matrixStackIn,
float partialTicks) |
private void |
renderSkyEnd(MatrixStack matrixStackIn) |
private void |
renderStars(BufferBuilder bufferBuilderIn) |
private void |
renderWorldBorder(ActiveRenderInfo activeRenderInfoIn) |
void |
sendBlockBreakProgress(int breakerId,
BlockPos pos,
int progress) |
void |
setDisplayListEntitiesDirty() |
private void |
setPartying(World worldIn,
BlockPos pos,
boolean isPartying) |
private void |
setupTerrain(ActiveRenderInfo activeRenderInfoIn,
ClippingHelperImpl camera,
boolean debugCamera,
int frameCount,
boolean playerSpectator) |
void |
setWorldAndLoadRenderers(ClientWorld worldClientIn) |
protected void |
stopChunkUpdates() |
void |
tick() |
void |
updateCameraAndRender(MatrixStack matrixStackIn,
float partialTicks,
long finishTimeNano,
boolean drawBlockOutline,
ActiveRenderInfo activeRenderInfoIn,
GameRenderer gameRendererIn,
LightTexture lightmapIn,
Matrix4f projectionIn) |
private void |
updateChunks(long finishTimeNano) |
void |
updateTileEntities(java.util.Collection<TileEntity> tileEntitiesToRemove,
java.util.Collection<TileEntity> tileEntitiesToAdd) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
reload
func_225594_i_
private static final org.apache.logging.log4j.Logger LOGGER
private static final ResourceLocation MOON_PHASES_TEXTURES
private static final ResourceLocation SUN_TEXTURES
private static final ResourceLocation CLOUDS_TEXTURES
private static final ResourceLocation END_SKY_TEXTURES
private static final ResourceLocation FORCEFIELD_TEXTURES
private static final ResourceLocation RAIN_TEXTURES
private static final ResourceLocation SNOW_TEXTURES
public static final Direction[] FACINGS
private final Minecraft mc
private final TextureManager textureManager
private final EntityRendererManager renderManager
private final RenderTypeBuffers renderTypeTextures
private ClientWorld world
private java.util.Set<ChunkRenderDispatcher.ChunkRender> chunksToUpdate
private final it.unimi.dsi.fastutil.objects.ObjectList<WorldRenderer.LocalRenderInformationContainer> renderInfos
private final java.util.Set<TileEntity> setTileEntities
private ViewFrustum viewFrustum
private final VertexFormat skyVertexFormat
@Nullable private VertexBuffer starVBO
@Nullable private VertexBuffer skyVBO
@Nullable private VertexBuffer sky2VBO
private boolean cloudsNeedUpdate
@Nullable private VertexBuffer cloudsVBO
private RenderTimeManager renderTimeManager
private int ticks
private final it.unimi.dsi.fastutil.ints.Int2ObjectMap<DestroyBlockProgress> damagedBlocks
private final it.unimi.dsi.fastutil.longs.Long2ObjectMap<java.util.SortedSet<DestroyBlockProgress>> damageProgress
private Framebuffer entityOutlineFramebuffer
private ShaderGroup entityOutlineShader
private double frustumUpdatePosX
private double frustumUpdatePosY
private double frustumUpdatePosZ
private int frustumUpdatePosChunkX
private int frustumUpdatePosChunkY
private int frustumUpdatePosChunkZ
private double lastViewEntityX
private double lastViewEntityY
private double lastViewEntityZ
private double lastViewEntityPitch
private double lastViewEntityYaw
private int cloudsCheckX
private int cloudsCheckY
private int cloudsCheckZ
private Vec3d cloudsCheckColor
private CloudOption cloudOption
private ChunkRenderDispatcher renderDispatcher
private final VertexFormat blockVertexFormat
private int renderDistanceChunks
private int countEntitiesRendered
private int countEntitiesHidden
private boolean debugFixTerrainFrustum
@Nullable private ClippingHelperImpl debugFixedClippingHelper
private final Vector4f[] debugTerrainMatrix
private final Vector3d debugTerrainFrustumPosition
private double prevRenderSortX
private double prevRenderSortY
private double prevRenderSortZ
private boolean displayListEntitiesDirty
private int frameId
private int rainSoundTime
private final float[] rainSizeX
private final float[] rainSizeZ
public WorldRenderer(Minecraft mcIn, RenderTypeBuffers rainTimeBuffersIn)
private void renderRainSnow(LightTexture lightmapIn, float partialTicks, double xIn, double yIn, double zIn)
public void addRainParticles(ActiveRenderInfo activeRenderInfoIn)
public void close()
close
in interface java.lang.AutoCloseable
public void onResourceManagerReload(IResourceManager resourceManager)
onResourceManagerReload
in interface IResourceManagerReloadListener
public void makeEntityOutlineShader()
public void renderEntityOutlineFramebuffer()
protected boolean isRenderEntityOutlines()
private void generateSky2()
private void generateSky()
private void renderSky(BufferBuilder bufferBuilderIn, float posY, boolean reverseX)
private void generateStars()
private void renderStars(BufferBuilder bufferBuilderIn)
public void setWorldAndLoadRenderers(@Nullable ClientWorld worldClientIn)
public void loadRenderers()
protected void stopChunkUpdates()
public void createBindEntityOutlineFbs(int width, int height)
public java.lang.String getDebugInfoRenders()
protected int getRenderedChunks()
public java.lang.String getDebugInfoEntities()
private void setupTerrain(ActiveRenderInfo activeRenderInfoIn, ClippingHelperImpl camera, boolean debugCamera, int frameCount, boolean playerSpectator)
@Nullable private ChunkRenderDispatcher.ChunkRender getRenderChunkOffset(BlockPos playerPos, ChunkRenderDispatcher.ChunkRender renderChunkBase, Direction facing)
private void captureFrustum(Matrix4f p_228419_1_, Matrix4f p_228419_2_, double p_228419_3_, double p_228419_5_, double p_228419_7_, ClippingHelperImpl p_228419_9_)
public void updateCameraAndRender(MatrixStack matrixStackIn, float partialTicks, long finishTimeNano, boolean drawBlockOutline, ActiveRenderInfo activeRenderInfoIn, GameRenderer gameRendererIn, LightTexture lightmapIn, Matrix4f projectionIn)
private void checkMatrixStack(MatrixStack matrixStackIn)
private void renderEntity(Entity entityIn, double camX, double camY, double camZ, float partialTicks, MatrixStack matrixStackIn, IRenderTypeBuffer bufferIn)
private void renderBlockLayer(RenderType blockLayerIn, MatrixStack matrixStackIn, double xIn, double yIn, double zIn)
private void renderDebug(ActiveRenderInfo activeRenderInfoIn)
private void addDebugVertex(IVertexBuilder bufferIn, int vertex)
private void addDebugQuad(IVertexBuilder bufferIn, int vertex1, int vertex2, int vertex3, int vertex4, int red, int green, int blue)
public void tick()
private void removeDamageProgress(DestroyBlockProgress progressIn)
private void renderSkyEnd(MatrixStack matrixStackIn)
public void renderSky(MatrixStack matrixStackIn, float partialTicks)
public void renderClouds(MatrixStack matrixStackIn, float partialTicks, double viewEntityX, double viewEntityY, double viewEntityZ)
private void drawClouds(BufferBuilder bufferIn, double cloudsX, double cloudsY, double cloudsZ, Vec3d cloudsColor)
private void updateChunks(long finishTimeNano)
private void renderWorldBorder(ActiveRenderInfo activeRenderInfoIn)
private void addVertex(BufferBuilder bufferIn, double camX, double camY, double camZ, double xIn, int yIn, double zIn, float texU, float texV)
private void drawSelectionBox(MatrixStack matrixStackIn, IVertexBuilder bufferIn, Entity entityIn, double xIn, double yIn, double zIn, BlockPos blockPosIn, BlockState blockStateIn)
public static void drawVoxelShapeParts(MatrixStack matrixStackIn, IVertexBuilder bufferIn, VoxelShape shapeIn, double xIn, double yIn, double zIn, float red, float green, float blue, float alpha)
private static void drawShape(MatrixStack matrixStackIn, IVertexBuilder bufferIn, VoxelShape shapeIn, double xIn, double yIn, double zIn, float red, float green, float blue, float alpha)
public static void drawBoundingBox(IVertexBuilder bufferIn, double minX, double minY, double minZ, double maxX, double maxY, double maxZ, float red, float green, float blue, float alpha)
public static void drawBoundingBox(MatrixStack matrixStackIn, IVertexBuilder bufferIn, AxisAlignedBB aabbIn, float red, float green, float blue, float alpha)
public static void drawBoundingBox(MatrixStack matrixStackIn, IVertexBuilder bufferIn, double minX, double minY, double minZ, double maxX, double maxY, double maxZ, float red, float green, float blue, float alpha)
public static void drawBoundingBox(MatrixStack matrixStackIn, IVertexBuilder bufferIn, double minX, double minY, double minZ, double maxX, double maxY, double maxZ, float red, float green, float blue, float alpha, float red2, float green2, float blue2)
public static void addChainedFilledBoxVertices(BufferBuilder builder, double x1, double y1, double z1, double x2, double y2, double z2, float red, float green, float blue, float alpha)
public void notifyBlockUpdate(IBlockReader worldIn, BlockPos pos, BlockState oldState, BlockState newState, int flags)
private void notifyBlockUpdate(BlockPos posIn, boolean rerenderOnMainThread)
public void markBlockRangeForRenderUpdate(int x1, int y1, int z1, int x2, int y2, int z2)
public void markBlockRangeForRenderUpdate(BlockPos blockPosIn, BlockState oldState, BlockState newState)
public void markSurroundingsForRerender(int sectionX, int sectionY, int sectionZ)
public void markForRerender(int sectionX, int sectionY, int sectionZ)
private void markForRerender(int sectionX, int sectionY, int sectionZ, boolean rerenderOnMainThread)
@Deprecated public void playRecord(@Nullable SoundEvent soundIn, BlockPos pos)
public void playRecord(@Nullable SoundEvent soundIn, BlockPos pos, @Nullable MusicDiscItem musicDiscItem)
public void addParticle(IParticleData particleData, boolean alwaysRender, double x, double y, double z, double xSpeed, double ySpeed, double zSpeed)
public void addParticle(IParticleData particleData, boolean ignoreRange, boolean minimizeLevel, double x, double y, double z, double xSpeed, double ySpeed, double zSpeed)
private <T extends IParticleData> void addParticleUnchecked(T particleData, double x, double y, double z, double xSpeed, double ySpeed, double zSpeed)
@Nullable private Particle addParticleUnchecked(IParticleData particleData, boolean alwaysRender, double x, double y, double z, double xSpeed, double ySpeed, double zSpeed)
@Nullable private Particle addParticleUnchecked(IParticleData particleData, boolean alwaysRender, boolean minimizeLevel, double x, double y, double z, double xSpeed, double ySpeed, double zSpeed)
private ParticleStatus calculateParticleLevel(boolean minimiseLevel)
public void deleteAllDisplayLists()
public void broadcastSound(int soundID, BlockPos pos, int data)
public void playEvent(PlayerEntity player, int type, BlockPos blockPosIn, int data)
public void sendBlockBreakProgress(int breakerId, BlockPos pos, int progress)
public boolean hasNoChunkUpdates()
public void setDisplayListEntitiesDirty()
public void updateTileEntities(java.util.Collection<TileEntity> tileEntitiesToRemove, java.util.Collection<TileEntity> tileEntitiesToAdd)
public static int getCombinedLight(ILightReader lightReaderIn, BlockPos blockPosIn)
public static int getPackedLightmapCoords(ILightReader lightReaderIn, BlockState blockStateIn, BlockPos blockPosIn)
public Framebuffer getEntityOutlineFramebuffer()
public IResourceType getResourceType()
getResourceType
in interface IResourceManagerReloadListener