@@ -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 ))
0 commit comments