public class RenderChunk
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
AxisAlignedBB |
boundingBox |
CompiledChunk |
compiledChunk |
private ChunkCompileTaskGenerator |
compileTask |
private int |
frameIndex |
private int |
index |
private java.util.concurrent.locks.ReentrantLock |
lockCompiledChunk |
private java.util.concurrent.locks.ReentrantLock |
lockCompileTask |
private BlockPos.MutableBlockPos[] |
mapEnumFacing |
private java.nio.FloatBuffer |
modelviewMatrix |
private boolean |
needsImmediateUpdate |
private boolean |
needsUpdate |
private BlockPos.MutableBlockPos |
position |
static int |
renderChunksUpdated |
private RenderGlobal |
renderGlobal |
private java.util.Set<TileEntity> |
setTileEntities |
private VertexBuffer[] |
vertexBuffers |
private World |
world |
private ChunkCache |
worldView |
Constructor and Description |
---|
RenderChunk(World worldIn,
RenderGlobal renderGlobalIn,
int indexIn) |
Modifier and Type | Method and Description |
---|---|
void |
clearNeedsUpdate() |
protected ChunkCache |
createRegionRenderCache(World world,
BlockPos from,
BlockPos to,
int subtract)
Creates a new RegionRenderCache instance.
Extending classes can change the behavior of the cache, allowing to visually change blocks (schematics etc). |
void |
deleteGlResources() |
protected void |
finishCompileTask() |
BlockPos |
getBlockPosOffset16(EnumFacing facing) |
CompiledChunk |
getCompiledChunk() |
protected double |
getDistanceSq() |
java.util.concurrent.locks.ReentrantLock |
getLockCompileTask() |
BlockPos |
getPosition() |
VertexBuffer |
getVertexBufferByLayer(int layer) |
World |
getWorld() |
private void |
initModelviewMatrix() |
ChunkCompileTaskGenerator |
makeCompileTaskChunk() |
ChunkCompileTaskGenerator |
makeCompileTaskTransparency() |
void |
multModelviewMatrix() |
boolean |
needsImmediateUpdate() |
boolean |
needsUpdate() |
private void |
postRenderBlocks(BlockRenderLayer layer,
float x,
float y,
float z,
BufferBuilder bufferBuilderIn,
CompiledChunk compiledChunkIn) |
private void |
preRenderBlocks(BufferBuilder bufferBuilderIn,
BlockPos pos) |
void |
rebuildChunk(float x,
float y,
float z,
ChunkCompileTaskGenerator generator) |
private void |
rebuildWorldView() |
void |
resortTransparency(float x,
float y,
float z,
ChunkCompileTaskGenerator generator) |
void |
setCompiledChunk(CompiledChunk compiledChunkIn) |
boolean |
setFrameIndex(int frameIndexIn) |
void |
setNeedsUpdate(boolean immediate) |
void |
setPosition(int x,
int y,
int z) |
void |
stopCompileTask() |
private World world
private final RenderGlobal renderGlobal
public static int renderChunksUpdated
public CompiledChunk compiledChunk
private final java.util.concurrent.locks.ReentrantLock lockCompileTask
private final java.util.concurrent.locks.ReentrantLock lockCompiledChunk
private ChunkCompileTaskGenerator compileTask
private final java.util.Set<TileEntity> setTileEntities
private final int index
private final java.nio.FloatBuffer modelviewMatrix
private final VertexBuffer[] vertexBuffers
public AxisAlignedBB boundingBox
private int frameIndex
private boolean needsUpdate
private final BlockPos.MutableBlockPos position
private final BlockPos.MutableBlockPos[] mapEnumFacing
private boolean needsImmediateUpdate
private ChunkCache worldView
public RenderChunk(World worldIn, RenderGlobal renderGlobalIn, int indexIn)
public boolean setFrameIndex(int frameIndexIn)
public VertexBuffer getVertexBufferByLayer(int layer)
public void setPosition(int x, int y, int z)
public void resortTransparency(float x, float y, float z, ChunkCompileTaskGenerator generator)
public void rebuildChunk(float x, float y, float z, ChunkCompileTaskGenerator generator)
protected void finishCompileTask()
public java.util.concurrent.locks.ReentrantLock getLockCompileTask()
public ChunkCompileTaskGenerator makeCompileTaskChunk()
private void rebuildWorldView()
@Nullable public ChunkCompileTaskGenerator makeCompileTaskTransparency()
protected double getDistanceSq()
private void preRenderBlocks(BufferBuilder bufferBuilderIn, BlockPos pos)
private void postRenderBlocks(BlockRenderLayer layer, float x, float y, float z, BufferBuilder bufferBuilderIn, CompiledChunk compiledChunkIn)
private void initModelviewMatrix()
public void multModelviewMatrix()
public CompiledChunk getCompiledChunk()
public void setCompiledChunk(CompiledChunk compiledChunkIn)
public void stopCompileTask()
public void deleteGlResources()
public BlockPos getPosition()
public void setNeedsUpdate(boolean immediate)
public void clearNeedsUpdate()
public boolean needsUpdate()
public boolean needsImmediateUpdate()
protected ChunkCache createRegionRenderCache(World world, BlockPos from, BlockPos to, int subtract)
world
- The world to cache.from
- The starting position of the chunk minus one on each axis.to
- The ending position of the chunk plus one on each axis.subtract
- Padding used internally by the RegionRenderCache constructor to make
the cache a 20x20x20 cube, for a total of 8000 states in the cache.RegionRenderCache
public BlockPos getBlockPosOffset16(EnumFacing facing)
public World getWorld()