@@ -85,6 +85,11 @@ private enum SearchMode
8585 private final net .wurstclient .settings .ColorSetting fixedColor =
8686 new net .wurstclient .settings .ColorSetting ("Fixed color" ,
8787 "Color used when \" Use fixed color\" is enabled." , Color .RED );
88+ // New: optionally show detected count in HackList
89+ private final net .wurstclient .settings .CheckboxSetting showCountInHackList =
90+ new net .wurstclient .settings .CheckboxSetting ("HackList count" ,
91+ "Appends the number of found blocks to this hack's entry in the HackList." ,
92+ false );
8893 private Block lastBlock ;
8994 private String lastQuery = "" ;
9095 private ChunkAreaSetting .ChunkArea lastAreaSelection ;
@@ -124,6 +129,8 @@ private enum SearchMode
124129 private java .util .Set <String > listExactIds ;
125130 private String [] listKeywords ;
126131
132+ private int foundCount ; // number of currently displayed matches (clamped)
133+
127134 public SearchHack ()
128135 {
129136 super ("Search" );
@@ -138,29 +145,38 @@ public SearchHack()
138145 addSetting (fixedColor );
139146 addSetting (area );
140147 addSetting (limit );
148+ // new setting
149+ addSetting (showCountInHackList );
141150 }
142151
143152 @ Override
144153 public String getRenderName ()
145154 {
146155 String colorMode = useFixedColor .isChecked () ? "Fixed" : "Rainbow" ;
156+ String base ;
147157 switch (mode .getSelected ())
148158 {
149159 case LIST :
150- return getName () + " [List:" + blockList .size () + "] (" + colorMode
160+ base = getName () + " [List:" + blockList .size () + "] (" + colorMode
151161 + ")" ;
162+ break ;
152163 case QUERY :
153164 String rawQuery = query .getValue ().trim ();
154165 if (!rawQuery .isEmpty ())
155- return getName () + " [" + abbreviate (rawQuery ) + "] ("
166+ base = getName () + " [" + abbreviate (rawQuery ) + "] ("
156167 + colorMode + ")" ;
157- return getName () + " [query] (" + colorMode + ")" ;
168+ else
169+ base = getName () + " [query] (" + colorMode + ")" ;
170+ break ;
158171 case BLOCK_ID :
159172 default :
160- return getName () + " ["
173+ base = getName () + " ["
161174 + block .getBlockName ().replace ("minecraft:" , "" ) + "] ("
162175 + colorMode + ")" ;
163176 }
177+ if (showCountInHackList .isChecked () && foundCount > 0 )
178+ return base + " [" + Math .min (foundCount , 999 ) + "]" ;
179+ return base ;
164180 }
165181
166182 @ Override
@@ -198,6 +214,7 @@ protected void onDisable()
198214 lastMatchingBlocks = null ;
199215 tracerEnds = null ;
200216 lastPlayerChunk = null ;
217+ foundCount = 0 ; // reset count
201218 }
202219
203220 @ Override
@@ -510,6 +527,11 @@ private void setBufferFromTask()
510527 .getCenter ();
511528 return pos .toCenterPos ();
512529 }).collect (java .util .stream .Collectors .toList ());
530+ // update count for HUD (clamped to 999)
531+ foundCount = Math .min (lastMatchingBlocks .size (), 999 );
532+ }else
533+ {
534+ foundCount = 0 ;
513535 }
514536 }
515537
0 commit comments