Tweeks to tracker
This commit is contained in:
@@ -27,10 +27,9 @@ public class RenderDistanceTracker {
|
||||
}
|
||||
|
||||
public void setRenderDistance(int renderDistance) {
|
||||
this.tracker.unload();
|
||||
this.tracker.process(Integer.MAX_VALUE, this::add, this::rem);
|
||||
this.renderDistance = renderDistance;
|
||||
this.tracker = new RingTracker(renderDistance, ((int)this.posX)>>9, ((int)this.posZ)>>9, true);
|
||||
this.tracker.unload();//Mark all as unload
|
||||
this.tracker = new RingTracker(this.tracker, renderDistance, ((int)this.posX)>>9, ((int)this.posZ)>>9, true);//Steal from previous tracker
|
||||
}
|
||||
|
||||
public void setCenterAndProcess(double x, double z) {
|
||||
|
||||
@@ -55,7 +55,7 @@ public class VoxyRenderSystem {
|
||||
this.renderer = new RenderService(world, threadPool);
|
||||
this.postProcessing = new PostProcessing();
|
||||
|
||||
this.renderDistanceTracker = new RenderDistanceTracker(10,
|
||||
this.renderDistanceTracker = new RenderDistanceTracker(20,
|
||||
MinecraftClient.getInstance().world.getBottomSectionCoord()>>5,
|
||||
(MinecraftClient.getInstance().world.getTopSectionCoord()-1)>>5,
|
||||
this.renderer::addTopLevelNode,
|
||||
|
||||
@@ -16,10 +16,18 @@ public class RingTracker {
|
||||
private int centerZ;
|
||||
|
||||
public RingTracker(int radius, int centerX, int centerZ, boolean fill) {
|
||||
this(null, radius, centerX, centerZ, fill);
|
||||
}
|
||||
|
||||
public RingTracker(RingTracker stealFrom, int radius, int centerX, int centerZ, boolean fill) {
|
||||
this.centerX = centerX;
|
||||
this.centerZ = centerZ;
|
||||
this.radius = radius;
|
||||
this.boundDist = generateBoundingHalfCircleDistance(radius);
|
||||
if (stealFrom != null) {
|
||||
this.operations.putAll(stealFrom.operations);
|
||||
stealFrom.operations.clear();
|
||||
}
|
||||
if (fill) {
|
||||
this.fillRing(true);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user