Skip to content

Commit 84d1849

Browse files
committed
ChestESP Performance Improvements
1 parent 2725ec0 commit 84d1849

16 files changed

+814
-161
lines changed

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -939,6 +939,8 @@ Purpose: helps you avoid and debug anticheat flags by cleaning risky movement pa
939939
- Added anti-ESP detection
940940
- Option to suppress single chests in favor of double
941941
- Optional alert for shulkerboxes in chat
942+
- Added render limit which helps reduce update overhead by throttling DB refresh and how it selects and updates targets.
943+
- Prioritises rendering by closest to user
942944

943945
### ItemESP (Expanded)
944946
Highlights dropped, equipped, and framed items with powerful filters and customization.
@@ -1229,6 +1231,9 @@ Examples:
12291231
- Added search thread priority slider for tuning background scan speed vs CPU usage.
12301232
- Optimized Search when using corners only ESP to avoid unnecessary heavy mesh work making detection faster.
12311233
- Reduced lag spikes on large scans by using cheaper nearest-result selection paths.
1234+
- Added global ESP limiter in GlobalToggle which takes over the shared ESP render and mesh paths
1235+
- Extends update/selection work in ESP hacks not just pure rendering
1236+
- Capped selection is based on nearest-first
12321237

12331238
### Global ESP Render Modes
12341239
- Added a global ESP pipeline toggle in GlobalToggle:

src/main/java/net/wurstclient/hacks/CaveFinderHack.java

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -226,10 +226,11 @@ private void startGetMatchingBlocksTask()
226226
Comparator<BlockPos> comparator =
227227
Comparator.comparingInt(pos -> eyesPos.distManhattan(pos));
228228
currentBuildGeneration = buildGeneration;
229+
int effectiveLimit = getEffectiveRenderLimit();
229230

230231
getMatchingBlocksTask = forkJoinPool.submit(() -> coordinator
231232
.getMatches().parallel().map(ChunkSearcher.Result::pos)
232-
.sorted(comparator).limit(limit.getValueLog())
233+
.sorted(comparator).limit(effectiveLimit)
233234
.collect(Collectors.toCollection(HashSet::new)));
234235
}
235236

@@ -243,13 +244,14 @@ private void startCompileVerticesTask()
243244

244245
HashSet<BlockPos> matchingBlocks = getMatchingBlocksTask.join();
245246

246-
if(matchingBlocks.size() < limit.getValueLog())
247+
int effectiveLimit = getEffectiveRenderLimit();
248+
if(matchingBlocks.size() < effectiveLimit)
247249
notify = true;
248250
else if(notify)
249251
{
250252
ChatUtils.warning("CaveFinder found \u00a7lA LOT\u00a7r of blocks!"
251253
+ " To prevent lag, it will only show the closest \u00a76"
252-
+ limit.getValueString() + "\u00a7r results.");
254+
+ effectiveLimit + "\u00a7r results.");
253255
notify = false;
254256
}
255257

@@ -268,21 +270,22 @@ private void buildBufferSafeMode()
268270
BlockPos eyesPos = BlockPos.containing(RotationUtils.getEyesPos());
269271
Comparator<BlockPos> comparator =
270272
Comparator.comparingInt(pos -> eyesPos.distManhattan(pos));
273+
int effectiveLimit = getEffectiveRenderLimit();
271274
java.util.ArrayList<ChunkSearcher.Result> matches =
272275
coordinator.getMatches().collect(
273276
java.util.stream.Collectors.toCollection(ArrayList::new));
274277
HashSet<BlockPos> matchingBlocks =
275278
matches.stream().map(ChunkSearcher.Result::pos).sorted(comparator)
276-
.limit(limit.getValueLog())
279+
.limit(effectiveLimit)
277280
.collect(Collectors.toCollection(HashSet::new));
278281

279-
if(matchingBlocks.size() < limit.getValueLog())
282+
if(matchingBlocks.size() < effectiveLimit)
280283
notify = true;
281284
else if(notify)
282285
{
283286
ChatUtils.warning("CaveFinder found \u00a7lA LOT\u00a7r of blocks!"
284287
+ " To prevent lag, it will only show the closest \u00a76"
285-
+ limit.getValueString() + "\u00a7r results.");
288+
+ effectiveLimit + "\u00a7r results.");
286289
notify = false;
287290
}
288291

@@ -319,4 +322,12 @@ private void setBufferFromVertices(ArrayList<int[]> vertices)
319322
bufferUpToDate = true;
320323
bufferRegion = region;
321324
}
325+
326+
private int getEffectiveRenderLimit()
327+
{
328+
int localLimit = limit.getValueLog();
329+
int effective = WURST.getHax().globalToggleHack
330+
.applyGlobalEspRenderLimit(localLimit);
331+
return Math.max(1, effective);
332+
}
322333
}

0 commit comments

Comments
 (0)