Skip to content

Commit f6dcbf5

Browse files
committed
ItemHandler
1 parent d67e0d8 commit f6dcbf5

File tree

15 files changed

+1437
-51797
lines changed

15 files changed

+1437
-51797
lines changed

README.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -286,6 +286,21 @@ Because so many of these mods are entirely original, I plan to release some of t
286286
### AntiBlast
287287
- Prevents push back from TNT, creeper explosions, respawn anchors, crystals, wither skulls, wither spawn explosions, ghast fireballs, breeze gusts (and wind charges) and other custom plugins/entities that use explosion physics.
288288

289+
### ItemHandler
290+
- Jade-style Popup HUD and full GUI that lists nearby dropped items grouped by item id with aggregated counts (With optional registry IDs).
291+
- Able to select or reject which item/s to pick up when moving over them:
292+
- Pick: reject (drop) everything except the selected types (only selected types will be picked up).
293+
- Reject: reject the selected types and drop them.
294+
- Trace Selected Items: toggles tracing for selected types (uses ItemESP world render pass to draw rainbow tracer lines and ESP boxes).
295+
- Adjustable distance for item detection.
296+
- Adjustable font scale setting (scales text and popup icon size).
297+
- Adjustable Popup HUD display offset X/Y
298+
- Respects ItemESP ignored list (optional) and provides link to edit the list.
299+
300+
![Popup](https://i.imgur.com/UlFRA9B.png)
301+
![GUI](https://i.imgur.com/0xtukmy.png)
302+
303+
289304
## What’s changed or improved in this fork?
290305

291306
### ItemESP (Expanded)

build.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,7 @@ tasks.configureEach {
187187
tasks.withType(JavaCompile).configureEach {
188188
// Minecraft 1.20.5 (24w14a) upwards uses Java 21.
189189
it.options.release = 21
190+
it.options.compilerArgs += "-Xlint:deprecation"
190191
}
191192

192193
java {

mojmap-migration.patch

Lines changed: 0 additions & 51788 deletions
This file was deleted.

src/main/java/net/wurstclient/command/CmdList.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,8 @@ public final class CmdList
6363
public final SettingsCmd settingsCmd = new SettingsCmd();
6464
public final NecoCmd NecoCmd = new NecoCmd();
6565
public final TCmd tCmd = new TCmd();
66+
public final net.wurstclient.commands.ItemHandlerCmd itemHandlerCmd =
67+
new net.wurstclient.commands.ItemHandlerCmd();
6668
public final TooManyHaxCmd tooManyHaxCmd = new TooManyHaxCmd();
6769
public final TpCmd tpCmd = new TpCmd();
6870
public final UnbindCmd unbindCmd = new UnbindCmd();
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
/*
2+
* Copyright (c) 2014-2025 Wurst-Imperium and contributors.
3+
*
4+
* This source code is subject to the terms of the GNU General Public
5+
* License, version 3. If a copy of the GPL was not distributed with this
6+
* file, You can obtain one at: https://www.gnu.org/licenses/gpl-3.0.txt
7+
*/
8+
package net.wurstclient.commands;
9+
10+
import net.wurstclient.command.Command;
11+
import net.wurstclient.command.CmdException;
12+
import net.wurstclient.WurstClient;
13+
14+
public final class ItemHandlerCmd extends Command
15+
{
16+
public ItemHandlerCmd()
17+
{
18+
super("itemhandler", "Opens the item handler UI.",
19+
".itemhandler [gui]");
20+
}
21+
22+
@Override
23+
public void call(String[] args) throws CmdException
24+
{
25+
// Support optional "gui" argument for clarity
26+
WurstClient.INSTANCE.getHax().itemHandlerHack.openScreen();
27+
}
28+
}

src/main/java/net/wurstclient/hack/HackList.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,8 @@ public final class HackList implements UpdateListener
128128
public final InvWalkHack invWalkHack = new InvWalkHack();
129129
public final ItemEspHack itemEspHack = new ItemEspHack();
130130
public final ItemGeneratorHack itemGeneratorHack = new ItemGeneratorHack();
131+
public final net.wurstclient.hacks.itemhandler.ItemHandlerHack itemHandlerHack =
132+
new net.wurstclient.hacks.itemhandler.ItemHandlerHack();
131133
public final SignFramePTHack signFramePTHack = new SignFramePTHack();
132134
public final JesusHack jesusHack = new JesusHack();
133135
public final JetpackHack jetpackHack = new JetpackHack();

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

Lines changed: 65 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ private enum SpecialMode
9494

9595
// Ignored items
9696
private final CheckboxSetting useIgnoredItems = new CheckboxSetting(
97-
"Use ignored items",
97+
"Toggle ignoring items",
9898
"When enabled, items from the ignored list will not be highlighted.",
9999
false);
100100
private final ItemListSetting ignoredList = new ItemListSetting(
@@ -198,6 +198,27 @@ protected void onDisable()
198198
foundCount = 0;
199199
}
200200

201+
// Expose ignored-items configuration for other features (like ItemHandler)
202+
public boolean shouldUseIgnoredItems()
203+
{
204+
return useIgnoredItems.isChecked();
205+
}
206+
207+
public ItemListSetting getIgnoredListSetting()
208+
{
209+
return ignoredList;
210+
}
211+
212+
public boolean isIgnoredId(String id)
213+
{
214+
if(id == null)
215+
return false;
216+
for(String s : ignoredList.getItemNames())
217+
if(id.equalsIgnoreCase(s.trim()))
218+
return true;
219+
return false;
220+
}
221+
201222
@Override
202223
public void onUpdate()
203224
{
@@ -284,6 +305,9 @@ public void onRender(PoseStack matrixStack, float partialTicks)
284305
ArrayList<AABB> specialBoxes = new ArrayList<>();
285306
ArrayList<Vec3> normalEnds = new ArrayList<>();
286307
ArrayList<Vec3> specialEnds = new ArrayList<>();
308+
// traced items from ItemHandler: override and rainbow-highlight
309+
ArrayList<AABB> tracedBoxes = new ArrayList<>();
310+
ArrayList<Vec3> tracedEnds = new ArrayList<>();
287311

288312
double extraSize = boxSize.getExtraSize() / 2;
289313
int visibleDrops = 0;
@@ -300,17 +324,29 @@ public void onRender(PoseStack matrixStack, float partialTicks)
300324
AABB box = EntityUtils.getLerpedBox(e, partialTicks)
301325
.move(0, extraSize, 0).inflate(extraSize);
302326
boolean isSpecial = isSpecial(stack);
327+
// check traced override from ItemHandlerHack
328+
String id =
329+
BuiltInRegistries.ITEM.getKey(stack.getItem()).toString();
330+
net.wurstclient.hacks.itemhandler.ItemHandlerHack ih =
331+
net.wurstclient.WurstClient.INSTANCE.getHax().itemHandlerHack;
332+
boolean isTraced = ih != null && ih.isTraced(id);
303333
visibleDrops++;
304-
if(isSpecial)
334+
if(isTraced)
335+
{
336+
tracedBoxes.add(box);
337+
tracedEnds
338+
.add(EntityUtils.getLerpedBox(e, partialTicks).getCenter());
339+
}else if(isSpecial)
340+
{
305341
specialBoxes.add(box);
306-
else
342+
specialEnds
343+
.add(EntityUtils.getLerpedBox(e, partialTicks).getCenter());
344+
}else
345+
{
307346
normalBoxes.add(box);
308-
309-
Vec3 center = EntityUtils.getLerpedBox(e, partialTicks).getCenter();
310-
if(isSpecial)
311-
specialEnds.add(center);
312-
else
313-
normalEnds.add(center);
347+
normalEnds
348+
.add(EntityUtils.getLerpedBox(e, partialTicks).getCenter());
349+
}
314350
}
315351
foundCount = Math.min(visibleDrops, 999);
316352

@@ -436,6 +472,18 @@ && isSpecial(head))
436472
specialLines, false);
437473
}
438474
}
475+
476+
// Traced items: always rainbow-highlight (override)
477+
if(!tracedBoxes.isEmpty())
478+
{
479+
float[] rf = RenderUtils.getRainbowColor();
480+
int tracedLines = RenderUtils.toIntColor(rf, 0x80 / 255f);
481+
int tracedQuads = RenderUtils.toIntColor(rf, 0.4f);
482+
RenderUtils.drawSolidBoxes(matrixStack, tracedBoxes,
483+
tracedQuads, false);
484+
RenderUtils.drawOutlinedBoxes(matrixStack, tracedBoxes,
485+
tracedLines, false);
486+
}
439487
}
440488

441489
if(style.hasLines())
@@ -446,6 +494,14 @@ && isSpecial(head))
446494
if(!specialEnds.isEmpty())
447495
RenderUtils.drawTracers(matrixStack, partialTicks, specialEnds,
448496
specialLines, false);
497+
// draw traced lines last with rainbow color
498+
if(!tracedEnds.isEmpty())
499+
{
500+
float[] rf = RenderUtils.getRainbowColor();
501+
int tracedLines = RenderUtils.toIntColor(rf, 0x80 / 255f);
502+
RenderUtils.drawTracers(matrixStack, partialTicks, tracedEnds,
503+
tracedLines, false);
504+
}
449505
}
450506
}
451507

0 commit comments

Comments
 (0)