@Environment(value=CLIENT) public class ChunkBuilder extends Object
Modifier and Type | Class and Description |
---|---|
class |
ChunkBuilder.BuiltChunk |
static class |
ChunkBuilder.ChunkData |
(package private) static class |
ChunkBuilder.Result |
Modifier and Type | Field and Description |
---|---|
private int |
bufferCount |
private BlockBufferBuilderStorage |
buffers |
private Vec3d |
cameraPosition |
private Executor |
executor |
private static Logger |
LOGGER |
private TaskExecutor<Runnable> |
mailbox |
private int |
queuedTaskCount |
private PriorityQueue<ChunkBuilder.BuiltChunk.Task> |
rebuildQueue |
private Queue<BlockBufferBuilderStorage> |
threadBuffers |
private Queue<Runnable> |
uploadQueue |
private World |
world |
private WorldRenderer |
worldRenderer |
Constructor and Description |
---|
ChunkBuilder(World world,
WorldRenderer worldRenderer,
Executor executor,
boolean is64Bits,
BlockBufferBuilderStorage buffers) |
Modifier and Type | Method and Description |
---|---|
private void |
clear() |
Vec3d |
getCameraPosition() |
String |
getDebugString() |
boolean |
isEmpty() |
void |
rebuild(ChunkBuilder.BuiltChunk chunk) |
void |
reset() |
private void |
scheduleRunTasks() |
CompletableFuture<Void> |
scheduleUpload(BufferBuilder buffer,
VertexBuffer glBuffer) |
void |
send(ChunkBuilder.BuiltChunk.Task task) |
void |
setCameraPosition(Vec3d cameraPosition) |
void |
setWorld(World world) |
void |
stop() |
boolean |
upload() |
private CompletableFuture<Void> |
upload(BufferBuilder buffer,
VertexBuffer glBuffer) |
private static final Logger LOGGER
private final PriorityQueue<ChunkBuilder.BuiltChunk.Task> rebuildQueue
private final Queue<BlockBufferBuilderStorage> threadBuffers
private volatile int queuedTaskCount
private volatile int bufferCount
private final BlockBufferBuilderStorage buffers
private final TaskExecutor<Runnable> mailbox
private final Executor executor
private World world
private final WorldRenderer worldRenderer
private Vec3d cameraPosition
public ChunkBuilder(World world, WorldRenderer worldRenderer, Executor executor, boolean is64Bits, BlockBufferBuilderStorage buffers)
public void setWorld(World world)
private void scheduleRunTasks()
public String getDebugString()
public void setCameraPosition(Vec3d cameraPosition)
public Vec3d getCameraPosition()
public boolean upload()
public void rebuild(ChunkBuilder.BuiltChunk chunk)
public void reset()
public void send(ChunkBuilder.BuiltChunk.Task task)
public CompletableFuture<Void> scheduleUpload(BufferBuilder buffer, VertexBuffer glBuffer)
private CompletableFuture<Void> upload(BufferBuilder buffer, VertexBuffer glBuffer)
private void clear()
public boolean isEmpty()
public void stop()