Files
CatServer/patches/net/minecraft/client/renderer/chunk/ChunkRenderDispatcher.java.patch
2019-02-24 22:29:41 +08:00

53 lines
2.3 KiB
Diff

--- ../src-base/minecraft/net/minecraft/client/renderer/chunk/ChunkRenderDispatcher.java
+++ ../src-work/minecraft/net/minecraft/client/renderer/chunk/ChunkRenderDispatcher.java
@@ -39,14 +39,20 @@
private final BlockingQueue<RegionRenderCacheBuilder> queueFreeRenderBuilders;
private final WorldVertexBufferUploader worldVertexUploader = new WorldVertexBufferUploader();
private final VertexBufferUploader vertexUploader = new VertexBufferUploader();
- private final Queue<ChunkRenderDispatcher.PendingUpload> queueChunkUploads = Queues.<ChunkRenderDispatcher.PendingUpload>newPriorityQueue();
+ private final Queue<PendingUpload> queueChunkUploads = Queues.<PendingUpload>newPriorityQueue();
private final ChunkRenderWorker renderWorker;
public ChunkRenderDispatcher()
{
+ this(-1);
+ }
+
+ public ChunkRenderDispatcher(int countRenderBuilders)
+ {
int i = Math.max(1, (int)((double)Runtime.getRuntime().maxMemory() * 0.3D) / 10485760);
int j = Math.max(1, MathHelper.clamp(Runtime.getRuntime().availableProcessors(), 1, i / 5));
- this.countRenderBuilders = MathHelper.clamp(j * 10, 1, i);
+ if(countRenderBuilders < 0) countRenderBuilders = MathHelper.clamp(j * 10, 1, i);
+ this.countRenderBuilders = countRenderBuilders;
if (j > 1)
{
@@ -277,7 +283,7 @@
synchronized (this.queueChunkUploads)
{
- this.queueChunkUploads.add(new ChunkRenderDispatcher.PendingUpload(listenablefuturetask, p_188245_5_));
+ this.queueChunkUploads.add(new PendingUpload(listenablefuturetask, p_188245_5_));
return listenablefuturetask;
}
}
@@ -348,7 +354,7 @@
}
@SideOnly(Side.CLIENT)
- class PendingUpload implements Comparable<ChunkRenderDispatcher.PendingUpload>
+ class PendingUpload implements Comparable<PendingUpload>
{
private final ListenableFutureTask<Object> uploadTask;
private final double distanceSq;
@@ -359,7 +365,7 @@
this.distanceSq = distanceSqIn;
}
- public int compareTo(ChunkRenderDispatcher.PendingUpload p_compareTo_1_)
+ public int compareTo(PendingUpload p_compareTo_1_)
{
return Doubles.compare(this.distanceSq, p_compareTo_1_.distanceSq);
}