Skip to content

Commit 62e403f

Browse files
committed
Hacklist Counters
1 parent 21e94dd commit 62e403f

File tree

8 files changed

+152
-6
lines changed

8 files changed

+152
-6
lines changed

README.md

316 Bytes

ClickGUI Improvements

  • Accidentally typing in ClickGUI just continues what you typed in the Navigator.
  • Favorites category, middle click a hack for it to be added to Favorites. Middle click when within Favorites to remove it.
  • Hacklist has font scaler, transparency, X & Y position adjustments, adjustable shadow box.
  • Hacklist has the ability to highlight entries pursuant to the selected ESP color
  • Hacklist now shows the count (of rendered boxes) of most ESP items (BedESP, SignESP, WorkstationESP, RedstoneESP, ChestESP, MobsearchESP, MobESP, ItemESP)

HackList

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

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,11 @@ public final class BedEspHack extends Hack implements UpdateListener,
5151
"Beds will be highlighted in this color.", new Color(0xFF69B4)));
5252

5353
private final List<BedEspBlockGroup> groups = Arrays.asList(beds);
54+
// New: optionally show detected count in HackList
55+
private final net.wurstclient.settings.CheckboxSetting showCountInHackList =
56+
new net.wurstclient.settings.CheckboxSetting("HackList count",
57+
"Appends the number of found beds to this hack's entry in the HackList.",
58+
false);
5459

5560
private final ChunkAreaSetting area = new ChunkAreaSetting("Area",
5661
"The area around the player to search in.\n"
@@ -64,6 +69,7 @@ public final class BedEspHack extends Hack implements UpdateListener,
6469

6570
private boolean groupsUpToDate;
6671
private ChunkPos lastPlayerChunk;
72+
private int foundCount;
6773

6874
public BedEspHack()
6975
{
@@ -72,6 +78,7 @@ public BedEspHack()
7278
addSetting(style);
7379
groups.stream().flatMap(BedEspBlockGroup::getSettings)
7480
.forEach(this::addSetting);
81+
addSetting(showCountInHackList);
7582
addSetting(area);
7683
addSetting(stickyArea);
7784
}
@@ -97,6 +104,8 @@ protected void onDisable()
97104

98105
coordinator.reset();
99106
groups.forEach(BedEspBlockGroup::clear);
107+
// reset count
108+
foundCount = 0;
100109
}
101110

102111
@Override
@@ -171,8 +180,21 @@ private void renderTracers(MatrixStack matrixStack, float partialTicks)
171180
private void updateGroupBoxes()
172181
{
173182
groups.forEach(BedEspBlockGroup::clear);
174-
coordinator.getMatches().forEach(this::addToGroupBoxes);
183+
java.util.List<Result> results = coordinator.getMatches().toList();
184+
results.forEach(this::addToGroupBoxes);
175185
groupsUpToDate = true;
186+
// update count for HUD (clamped to 999) based on displayed boxes
187+
int total = groups.stream().mapToInt(g -> g.getBoxes().size()).sum();
188+
foundCount = Math.min(total, 999);
189+
}
190+
191+
@Override
192+
public String getRenderName()
193+
{
194+
String base = getName();
195+
if(showCountInHackList.isChecked() && foundCount > 0)
196+
return base + " [" + foundCount + "]";
197+
return base;
176198
}
177199

178200
private void addToGroupBoxes(Result result)

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

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,14 @@ public class ChestEspHack extends Hack implements UpdateListener,
132132

133133
private final List<ChestEspEntityGroup> entityGroups =
134134
Arrays.asList(chestCarts, chestBoats, hopperCarts);
135+
136+
// New: optionally show detected count in HackList
137+
private final CheckboxSetting showCountInHackList = new CheckboxSetting(
138+
"HackList count",
139+
"Appends the number of detected chests/containers to this hack's entry in the HackList.",
140+
false);
141+
142+
private int foundCount;
135143

136144
public ChestEspHack()
137145
{
@@ -141,6 +149,7 @@ public ChestEspHack()
141149
addSetting(stickyArea);
142150
groups.stream().flatMap(ChestEspGroup::getSettings)
143151
.forEach(this::addSetting);
152+
addSetting(showCountInHackList);
144153
}
145154

146155
@Override
@@ -159,6 +168,8 @@ protected void onDisable()
159168
EVENTS.remove(RenderListener.class, this);
160169

161170
groups.forEach(ChestEspGroup::clear);
171+
entityGroups.forEach(ChestEspGroup::clear);
172+
foundCount = 0;
162173
}
163174

164175
@Override
@@ -202,6 +213,11 @@ else if(entity instanceof HopperMinecartEntity)
202213
else if(entity instanceof ChestBoatEntity
203214
|| entity instanceof ChestRaftEntity)
204215
chestBoats.add(entity);
216+
217+
// compute found count from enabled groups (clamped)
218+
int total = groups.stream().mapToInt(g -> g.getBoxes().size()).sum();
219+
total += entityGroups.stream().mapToInt(g -> g.getBoxes().size()).sum();
220+
foundCount = Math.min(total, 999);
205221
}
206222

207223
@Override
@@ -257,4 +273,13 @@ private void renderTracers(MatrixStack matrixStack, float partialTicks)
257273
false);
258274
}
259275
}
276+
277+
@Override
278+
public String getRenderName()
279+
{
280+
String base = getName();
281+
if(showCountInHackList.isChecked() && foundCount > 0)
282+
return base + " [" + foundCount + "]";
283+
return base;
284+
}
260285
}

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

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,14 @@ public final class MobEspHack extends Hack implements UpdateListener,
8080
FilterArmorStandsSetting.genericVision(true));
8181

8282
private final ArrayList<LivingEntity> mobs = new ArrayList<>();
83+
84+
// New: optionally show detected count in HackList
85+
private final CheckboxSetting showCountInHackList = new CheckboxSetting(
86+
"HackList count",
87+
"Appends the number of detected mobs to this hack's entry in the HackList.",
88+
false);
89+
90+
private int foundCount;
8391

8492
public MobEspHack()
8593
{
@@ -91,6 +99,7 @@ public MobEspHack()
9199
addSetting(useRainbow);
92100
addSetting(color);
93101
entityFilters.forEach(this::addSetting);
102+
addSetting(showCountInHackList);
94103
}
95104

96105
@Override
@@ -107,6 +116,7 @@ protected void onDisable()
107116
EVENTS.remove(UpdateListener.class, this);
108117
EVENTS.remove(CameraTransformViewBobbingListener.class, this);
109118
EVENTS.remove(RenderListener.class, this);
119+
foundCount = 0;
110120
}
111121

112122
@Override
@@ -123,6 +133,17 @@ public void onUpdate()
123133
stream = entityFilters.applyTo(stream);
124134

125135
mobs.addAll(stream.collect(Collectors.toList()));
136+
// update count for HUD (clamped to 999)
137+
foundCount = Math.min(mobs.size(), 999);
138+
}
139+
140+
@Override
141+
public String getRenderName()
142+
{
143+
String base = getName();
144+
if(showCountInHackList.isChecked() && foundCount > 0)
145+
return base + " [" + foundCount + "]";
146+
return base;
126147
}
127148

128149
@Override

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

Lines changed: 23 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -73,13 +73,19 @@ private enum SearchMode
7373
"Use a rainbow color instead of the fixed color.", false);
7474
private final ColorSetting color = new ColorSetting("Color",
7575
"Fixed color used when Rainbow colors is disabled.", Color.PINK);
76+
// New: optionally show detected count in HackList
77+
private final CheckboxSetting showCountInHackList = new CheckboxSetting(
78+
"HackList count",
79+
"Appends the number of matched mobs to this hack's entry in the HackList.",
80+
false);
7681

7782
private final ArrayList<LivingEntity> matches = new ArrayList<>();
7883
private SearchMode lastMode;
7984
private int lastEntityListHash;
8085
// Caches for LIST mode
8186
private java.util.Set<String> listExactIds;
8287
private String[] listKeywords;
88+
private int foundCount;
8389

8490
public MobSearchHack()
8591
{
@@ -94,6 +100,7 @@ public MobSearchHack()
94100
addSetting(query);
95101
addSetting(useRainbow);
96102
addSetting(color);
103+
addSetting(showCountInHackList);
97104
}
98105

99106
@Override
@@ -113,6 +120,7 @@ protected void onDisable()
113120
EVENTS.remove(CameraTransformViewBobbingListener.class, this);
114121
EVENTS.remove(RenderListener.class, this);
115122
matches.clear();
123+
foundCount = 0;
116124
}
117125

118126
@Override
@@ -122,18 +130,19 @@ public String getRenderName()
122130
switch(mode.getSelected())
123131
{
124132
case LIST:
125-
return getName() + " [List:" + entityList.getTypeNames().size()
126-
+ "]";
133+
return appendCountIfEnabled(
134+
getName() + " [List:" + entityList.getTypeNames().size() + "]");
127135
case QUERY:
128136
if(!q.isEmpty())
129-
return getName() + " [" + abbreviate(q) + "]";
130-
return getName() + " [query]";
137+
return appendCountIfEnabled(
138+
getName() + " [" + abbreviate(q) + "]");
139+
return appendCountIfEnabled(getName() + " [query]");
131140
case TYPE_ID:
132141
default:
133142
String t = typeId.getValue().trim();
134143
if(t.startsWith("minecraft:"))
135144
t = t.substring("minecraft:".length());
136-
return getName() + " [" + t + "]";
145+
return appendCountIfEnabled(getName() + " [" + t + "]");
137146
}
138147
}
139148

@@ -208,6 +217,15 @@ public void onUpdate()
208217
.filter(e -> !e.isRemoved() && e.getHealth() > 0).filter(predicate);
209218

210219
matches.addAll(stream.collect(Collectors.toList()));
220+
// update count for HUD (clamped to 999)
221+
foundCount = Math.min(matches.size(), 999);
222+
}
223+
224+
private String appendCountIfEnabled(String base)
225+
{
226+
if(showCountInHackList.isChecked() && foundCount > 0)
227+
return base + " [" + foundCount + "]";
228+
return base;
211229
}
212230

213231
@Override

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

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,11 @@ Blocks.BELL, new ColorSetting("Bell color", "", defaultColor),
195195
private boolean groupsUpToDate;
196196
private ChunkAreaSetting.ChunkArea lastAreaSelection;
197197
private ChunkPos lastPlayerChunk;
198+
private int foundCount;
199+
private final CheckboxSetting showCountInHackList = new CheckboxSetting(
200+
"HackList count",
201+
"Appends the number of found redstone components to this hack's entry in the HackList.",
202+
false);
198203

199204
public RedstoneEspHack()
200205
{
@@ -203,6 +208,7 @@ public RedstoneEspHack()
203208
addSetting(style);
204209
renderGroups.stream().flatMap(RenderGroup::getSettings)
205210
.forEach(this::addSetting);
211+
addSetting(showCountInHackList);
206212
addSetting(area);
207213
addSetting(stickyArea);
208214
}
@@ -243,6 +249,7 @@ protected void onDisable()
243249
coordinator);
244250
coordinator.reset();
245251
renderGroups.forEach(RenderGroup::clear);
252+
foundCount = 0;
246253
}
247254

248255
@Override
@@ -321,6 +328,9 @@ private void updateGroupBoxes()
321328
renderGroups.forEach(RenderGroup::clear);
322329
coordinator.getMatches().forEach(this::addToGroupBoxes);
323330
groupsUpToDate = true;
331+
int total =
332+
renderGroups.stream().mapToInt(g -> g.getBoxes().size()).sum();
333+
foundCount = Math.min(total, 999);
324334
}
325335

326336
private void addToGroupBoxes(Result result)
@@ -334,6 +344,15 @@ private void addToGroupBoxes(Result result)
334344
}
335345
}
336346

347+
@Override
348+
public String getRenderName()
349+
{
350+
String base = getName();
351+
if(showCountInHackList.isChecked() && foundCount > 0)
352+
return base + " [" + foundCount + "]";
353+
return base;
354+
}
355+
337356
// Common interface for rendering groups
338357
private static interface RenderGroup
339358
{

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

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,13 +72,19 @@ public final class SignEspHack extends Hack implements UpdateListener,
7272
private final ChunkAreaSetting area = new ChunkAreaSetting("Area",
7373
"The area around the player to search in.\n"
7474
+ "Higher values require a faster computer.");
75+
// New: optionally show detected count in HackList
76+
private final CheckboxSetting showCountInHackList = new CheckboxSetting(
77+
"HackList count",
78+
"Appends the number of found signs/frames to this hack's entry in the HackList.",
79+
false);
7580
private final BiPredicate<BlockPos, BlockState> query =
7681
(pos, state) -> state.getBlock() instanceof AbstractSignBlock;
7782
private final ChunkSearcherCoordinator coordinator =
7883
new ChunkSearcherCoordinator(query, area);
7984
private boolean groupsUpToDate;
8085
private ChunkAreaSetting.ChunkArea lastAreaSelection;
8186
private ChunkPos lastPlayerChunk;
87+
private int foundCount;
8288

8389
public SignEspHack()
8490
{
@@ -89,6 +95,7 @@ public SignEspHack()
8995
.forEach(this::addSetting);
9096
entityGroups.stream().flatMap(FrameEspEntityGroup::getSettings)
9197
.forEach(this::addSetting);
98+
addSetting(showCountInHackList);
9299
addSetting(area);
93100
addSetting(stickyArea);
94101
}
@@ -116,6 +123,8 @@ protected void onDisable()
116123
coordinator);
117124
coordinator.reset();
118125
groups.forEach(SignEspGroup::clear);
126+
entityGroups.forEach(FrameEspEntityGroup::clear);
127+
foundCount = 0;
119128
}
120129

121130
@Override
@@ -220,6 +229,11 @@ private void updateGroupBoxes()
220229
groups.forEach(SignEspGroup::clear);
221230
coordinator.getMatches().forEach(this::addToGroupBoxes);
222231
groupsUpToDate = true;
232+
// compute count from both sign boxes and frame boxes
233+
int signs = groups.stream().mapToInt(g -> g.getBoxes().size()).sum();
234+
int framesCount =
235+
entityGroups.stream().mapToInt(g -> g.getBoxes().size()).sum();
236+
foundCount = Math.min(signs + framesCount, 999);
223237
}
224238

225239
private void addToGroupBoxes(Result result)
@@ -231,6 +245,15 @@ private void addToGroupBoxes(Result result)
231245
}
232246
}
233247

248+
@Override
249+
public String getRenderName()
250+
{
251+
String base = getName();
252+
if(showCountInHackList.isChecked() && foundCount > 0)
253+
return base + " [" + foundCount + "]";
254+
return base;
255+
}
256+
234257
private static final class SignEspGroup
235258
{
236259
private final ArrayList<Box> boxes = new ArrayList<>();

0 commit comments

Comments
 (0)