Fix distance in checkHighPriorityChunks (Fixes #4582) (#4605)

This commit is contained in:
ForceUpdate1 2020-10-12 00:24:06 +02:00
parent 6932cf79b5
commit bffa3708e8

View file

@ -1024,13 +1024,13 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+
+ double dist = MCUtil.distance(playerChunkX, 0, playerChunkZ, coord.x, 0, coord.z);
+ // Prioritize immediate
+ if (dist <= 4 * 4) {
+ updateChunkPriorityMap(priorities, coord.pair(), (int) (27 - Math.sqrt(dist)));
+ if (dist <= 4) {
+ updateChunkPriorityMap(priorities, coord.pair(), (int) (27 - dist));
+ return;
+ }
+
+ // Prioritize nearby chunks
+ updateChunkPriorityMap(priorities, coord.pair(), (int) (20 - Math.sqrt(dist) * twoThirdModifier));
+ updateChunkPriorityMap(priorities, coord.pair(), (int) (20 - dist * twoThirdModifier));
+ });
+
+ // Prioritize Frustum near 3
@ -1040,7 +1040,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ if (shouldSkipPrioritization(coord)) return;
+
+ double dist = MCUtil.distance(playerChunkX, 0, playerChunkZ, coord.x, 0, coord.z);
+ updateChunkPriorityMap(priorities, coord.pair(), (int) (25 - Math.sqrt(dist) * twoThirdModifier));
+ updateChunkPriorityMap(priorities, coord.pair(), (int) (25 - dist * twoThirdModifier));
+ });
+
+ // Prioritize Frustum near 5
@ -1051,7 +1051,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ if (shouldSkipPrioritization(coord)) return;
+
+ double dist = MCUtil.distance(playerChunkX, 0, playerChunkZ, coord.x, 0, coord.z);
+ updateChunkPriorityMap(priorities, coord.pair(), (int) (25 - Math.sqrt(dist) * twoThirdModifier));
+ updateChunkPriorityMap(priorities, coord.pair(), (int) (25 - dist * twoThirdModifier));
+ });
+ }
+
@ -1064,7 +1064,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ return;
+ }
+ double dist = MCUtil.distance(playerChunkX, 0, playerChunkZ, coord.x, 0, coord.z);
+ updateChunkPriorityMap(priorities, coord.pair(), (int) (25 - Math.sqrt(dist) * twoThirdModifier));
+ updateChunkPriorityMap(priorities, coord.pair(), (int) (25 - dist * twoThirdModifier));
+ });
+ }
+