Skip to content

Commit d4131d6

Browse files
committed
Improved SignESP and BedESP tracking
1 parent 10959e3 commit d4131d6

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

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

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,7 @@ public final class BedEspHack extends Hack implements UpdateListener,
101101
private boolean groupsUpToDate;
102102
private ChunkPos lastPlayerChunk;
103103
private int foundCount;
104+
private int lastMatchesVersion;
104105
private List<BlockPos> cachedTrialSpawners = List.of();
105106
private List<Vec3d> cachedVillagerPositions = List.of();
106107
private List<Vec3d> cachedGolemPositions = List.of();
@@ -137,6 +138,7 @@ protected void onEnable()
137138
EVENTS.add(CameraTransformViewBobbingListener.class, this);
138139
EVENTS.add(RenderListener.class, this);
139140
lastPlayerChunk = new ChunkPos(MC.player.getBlockPos());
141+
lastMatchesVersion = coordinator.getMatchesVersion();
140142
lastTrialFilterState = filterTrialChambers.isChecked();
141143
lastVillageFilterState = filterVillageBeds.isChecked();
142144
}
@@ -150,6 +152,7 @@ protected void onDisable()
150152
EVENTS.remove(RenderListener.class, this);
151153

152154
coordinator.reset();
155+
lastMatchesVersion = coordinator.getMatchesVersion();
153156
groups.forEach(BedEspBlockGroup::clear);
154157
// reset count
155158
foundCount = 0;
@@ -164,6 +167,12 @@ public void onUpdate()
164167
boolean searchersChanged = coordinator.update();
165168
if(searchersChanged)
166169
groupsUpToDate = false;
170+
int matchesVersion = coordinator.getMatchesVersion();
171+
if(matchesVersion != lastMatchesVersion)
172+
{
173+
lastMatchesVersion = matchesVersion;
174+
groupsUpToDate = false;
175+
}
167176
// Recenter per chunk when sticky is off
168177
ChunkPos currentChunk = new ChunkPos(MC.player.getBlockPos());
169178
if(!stickyArea.isChecked() && !currentChunk.equals(lastPlayerChunk))

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

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ public final class SignEspHack extends Hack implements UpdateListener,
8686
private ChunkAreaSetting.ChunkArea lastAreaSelection;
8787
private ChunkPos lastPlayerChunk;
8888
private int foundCount;
89+
private int lastMatchesVersion;
8990

9091
// Above-ground filter
9192
private final CheckboxSetting onlyAboveGround = new CheckboxSetting(
@@ -116,6 +117,7 @@ protected void onEnable()
116117
groupsUpToDate = false;
117118
lastAreaSelection = area.getSelected();
118119
lastPlayerChunk = new ChunkPos(MC.player.getBlockPos());
120+
lastMatchesVersion = coordinator.getMatchesVersion();
119121
EVENTS.add(UpdateListener.class, this);
120122
EVENTS.add(CameraTransformViewBobbingListener.class, this);
121123
EVENTS.add(RenderListener.class, this);
@@ -132,6 +134,7 @@ protected void onDisable()
132134
EVENTS.remove(net.wurstclient.events.PacketInputListener.class,
133135
coordinator);
134136
coordinator.reset();
137+
lastMatchesVersion = coordinator.getMatchesVersion();
135138
groups.forEach(SignEspGroup::clear);
136139
entityGroups.forEach(FrameEspEntityGroup::clear);
137140
foundCount = 0;
@@ -158,6 +161,12 @@ public void onUpdate()
158161
boolean searchersChanged = coordinator.update();
159162
if(searchersChanged)
160163
groupsUpToDate = false;
164+
int matchesVersion = coordinator.getMatchesVersion();
165+
if(matchesVersion != lastMatchesVersion)
166+
{
167+
lastMatchesVersion = matchesVersion;
168+
groupsUpToDate = false;
169+
}
161170
if(!groupsUpToDate && coordinator.isDone())
162171
updateGroupBoxes();
163172
}

0 commit comments

Comments
 (0)