Skip to content

Commit 5253272

Browse files
committed
feat: add fuzzy list matching, clear buttons, search/mobsearch modes, X-Ray live updates, and expanded natural blocks
1 parent 884dd8f commit 5253272

File tree

12 files changed

+975
-108
lines changed

12 files changed

+975
-108
lines changed

README.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ All credit for the original client goes to Wurst‑Imperium and its contributors
2626

2727
### MobSearch
2828
- Search mobs by fuzzy name/ID or exact type (e.g., `minecraft:zombie` or `zombie`).
29+
- Added list mode (with mode switcher) with visual list of mobs to search for.
2930
- Multi-term queries: separate with commas (e.g., `skeleton, zombie`).
3031
- Rendering: Boxes, Lines, or Both. Rainbow or fixed color (default red). Box size configurable.
3132

@@ -92,14 +93,25 @@ Visualizes where players logged out.
9293
- Name scale
9394
- Show tracers (on/off)
9495

96+
### Added keyword matches for all lists (Search, MobSearch, Nuker, SpeedNuker, NoHandClip AutoDrop, Xray etc)
97+
- Type a keyword (eg., "diamond") to populate the list with all matching blocks/mobs.
98+
- Clear list button added.
99+
95100
### Search improvements
96101
- Keyword field accepts plain-text terms (e.g., `diamond`). Falls back to the block picker when empty.
102+
- Added list mode (with mode switcher) with visual list of items to search for.
97103
- Multi-term queries supported: comma-separated terms (e.g., `diamond, ancient`) to match both diamond ores and ancient debris.
98104
- Rendering style: Boxes, Lines, or Both (tracers). View-bobbing is canceled when lines are enabled.
99105
- Color mode for lines: “Use fixed color” toggle (default off → rainbow). When enabled, pick a fixed color.
100106
- Safer update cycle: query/radius changes trigger proper rescans; shared normalization and predicate helpers.
101107
- Tracer safety: falls back to block center when the outline shape is empty (prevents crashes on empty VoxelShapes).
102108

109+
### Xray improvements
110+
- Opacity and block types apply live with no toggling of the hack required.
111+
112+
### BaseFinder improvements
113+
- Updated the list of natural world generated blocks to latest minecraft blocks/biomes.
114+
103115
### MobESP improvements
104116
- Added color options like MobSearch:
105117
- Rainbow or fixed color for boxes/lines (configurable).
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
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.clickgui.components;
9+
10+
import java.util.Objects;
11+
12+
import net.wurstclient.settings.EntityTypeListSetting;
13+
import net.wurstclient.settings.Setting;
14+
15+
public final class EntityTypeListEditButton extends AbstractListEditButton
16+
{
17+
private final EntityTypeListSetting setting;
18+
19+
public EntityTypeListEditButton(EntityTypeListSetting setting)
20+
{
21+
this.setting = Objects.requireNonNull(setting);
22+
setWidth(getDefaultWidth());
23+
setHeight(getDefaultHeight());
24+
}
25+
26+
@Override
27+
protected void openScreen()
28+
{
29+
MC.setScreen(
30+
new net.wurstclient.clickgui.screens.EditEntityTypeListScreen(
31+
MC.currentScreen, setting));
32+
}
33+
34+
@Override
35+
protected String getText()
36+
{
37+
return setting.getName() + ": " + setting.getTypeNames().size();
38+
}
39+
40+
@Override
41+
protected Setting getSetting()
42+
{
43+
return setting;
44+
}
45+
}

src/main/java/net/wurstclient/clickgui/screens/EditBlockListScreen.java

Lines changed: 75 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,8 @@ public final class EditBlockListScreen extends Screen
4343
private ButtonWidget doneButton;
4444

4545
private Block blockToAdd;
46+
private java.util.List<net.minecraft.block.Block> fuzzyMatches =
47+
java.util.Collections.emptyList();
4648

4749
public EditBlockListScreen(Screen prevScreen, BlockListSetting blockList)
4850
{
@@ -58,22 +60,30 @@ public void init()
5860
addSelectableChild(listGui);
5961

6062
blockNameField = new TextFieldWidget(client.textRenderer,
61-
width / 2 - 152, height - 56, 150, 20, Text.literal(""));
63+
width / 2 - 152, height - 56, 140, 20, Text.literal(""));
6264
addSelectableChild(blockNameField);
6365
blockNameField.setMaxLength(256);
6466

6567
addDrawableChild(
6668
addButton = ButtonWidget.builder(Text.literal("Add"), b -> {
67-
blockList.add(blockToAdd);
69+
if(blockToAdd != null)
70+
{
71+
blockList.add(blockToAdd);
72+
}else if(fuzzyMatches != null && !fuzzyMatches.isEmpty())
73+
{
74+
for(net.minecraft.block.Block bk : fuzzyMatches)
75+
blockList.add(bk);
76+
}
6877
client.setScreen(EditBlockListScreen.this);
69-
}).dimensions(width / 2 - 2, height - 56, 30, 20).build());
78+
}).dimensions(width / 2 + 40, height - 56, 80, 20).build());
7079

80+
// Shift remove to the right to make room for wider Add
7181
addDrawableChild(removeButton =
7282
ButtonWidget.builder(Text.literal("Remove Selected"), b -> {
7383
blockList
7484
.remove(blockList.indexOf(listGui.getSelectedBlockName()));
7585
client.setScreen(EditBlockListScreen.this);
76-
}).dimensions(width / 2 + 52, height - 56, 100, 20).build());
86+
}).dimensions(width / 2 + 124, height - 56, 120, 20).build());
7787

7888
addDrawableChild(ButtonWidget.builder(Text.literal("Reset to Defaults"),
7989
b -> client.setScreen(new ConfirmScreen(b2 -> {
@@ -82,7 +92,12 @@ public void init()
8292
client.setScreen(EditBlockListScreen.this);
8393
}, Text.literal("Reset to Defaults"),
8494
Text.literal("Are you sure?"))))
85-
.dimensions(width - 108, 8, 100, 20).build());
95+
.dimensions(width - 328, 8, 150, 20).build());
96+
97+
addDrawableChild(ButtonWidget.builder(Text.literal("Clear List"), b -> {
98+
blockList.clear();
99+
client.setScreen(EditBlockListScreen.this);
100+
}).dimensions(width - 168, 8, 150, 20).build());
86101

87102
addDrawableChild(doneButton = ButtonWidget
88103
.builder(Text.literal("Done"), b -> client.setScreen(prevScreen))
@@ -126,8 +141,46 @@ public boolean keyPressed(int keyCode, int scanCode, int int_3)
126141
public void tick()
127142
{
128143
String nameOrId = blockNameField.getText();
129-
blockToAdd = BlockUtils.getBlockFromNameOrID(nameOrId);
130-
addButton.active = blockToAdd != null;
144+
blockToAdd =
145+
net.wurstclient.util.BlockUtils.getBlockFromNameOrID(nameOrId);
146+
// Build fuzzy matches if no exact block found
147+
if(blockToAdd == null)
148+
{
149+
String q = nameOrId == null ? ""
150+
: nameOrId.trim().toLowerCase(java.util.Locale.ROOT);
151+
if(q.isEmpty())
152+
{
153+
fuzzyMatches = java.util.Collections.emptyList();
154+
}else
155+
{
156+
java.util.ArrayList<net.minecraft.block.Block> list =
157+
new java.util.ArrayList<>();
158+
for(net.minecraft.util.Identifier id : net.minecraft.registry.Registries.BLOCK
159+
.getIds())
160+
{
161+
String s = id.toString().toLowerCase(java.util.Locale.ROOT);
162+
if(s.contains(q))
163+
list.add(
164+
net.minecraft.registry.Registries.BLOCK.get(id));
165+
}
166+
// Deduplicate and sort by identifier
167+
java.util.LinkedHashMap<String, net.minecraft.block.Block> map =
168+
new java.util.LinkedHashMap<>();
169+
for(net.minecraft.block.Block b : list)
170+
map.put(net.wurstclient.util.BlockUtils.getName(b), b);
171+
fuzzyMatches = new java.util.ArrayList<>(map.values());
172+
fuzzyMatches.sort(java.util.Comparator
173+
.comparing(net.wurstclient.util.BlockUtils::getName));
174+
}
175+
addButton.active = !fuzzyMatches.isEmpty();
176+
addButton.setMessage(Text.literal(fuzzyMatches.isEmpty() ? "Add"
177+
: ("Add Matches (" + fuzzyMatches.size() + ")")));
178+
}else
179+
{
180+
fuzzyMatches = java.util.Collections.emptyList();
181+
addButton.active = true;
182+
addButton.setMessage(Text.literal("Add"));
183+
}
131184

132185
removeButton.active = listGui.getSelectedOrNull() != null;
133186
}
@@ -150,34 +203,33 @@ public void render(DrawContext context, int mouseX, int mouseY,
150203

151204
for(Drawable drawable : drawables)
152205
drawable.render(context, mouseX, mouseY, partialTicks);
153-
206+
207+
// Draw placeholder + decorative left icon frame using ABSOLUTE
208+
// coordinates
209+
// derived from the actual TextFieldWidget position/size (no matrix
210+
// translate).
154211
context.state.goUpLayer();
155-
matrixStack.pushMatrix();
156-
matrixStack.translate(-64 + width / 2 - 152, 0);
212+
213+
int x0 = blockNameField.getX();
214+
int y0 = blockNameField.getY();
215+
int x1 = x0 + blockNameField.getWidth();
216+
int y1 = y0 + blockNameField.getHeight();
157217

158218
if(blockNameField.getText().isEmpty() && !blockNameField.isFocused())
159219
context.drawTextWithShadow(client.textRenderer, "block name or ID",
160-
68, height - 50, Colors.GRAY);
220+
x0 + 6, y0 + 6, Colors.GRAY);
161221

162222
int border =
163223
blockNameField.isFocused() ? Colors.WHITE : Colors.LIGHT_GRAY;
164224
int black = Colors.BLACK;
165225

166-
context.fill(48, height - 56, 64, height - 36, border);
167-
context.fill(49, height - 55, 65, height - 37, black);
168-
context.fill(214, height - 56, 244, height - 55, border);
169-
context.fill(214, height - 37, 244, height - 36, border);
170-
context.fill(244, height - 56, 246, height - 36, border);
171-
context.fill(213, height - 55, 243, height - 52, black);
172-
context.fill(213, height - 40, 243, height - 37, black);
173-
context.fill(213, height - 55, 216, height - 37, black);
174-
context.fill(242, height - 55, 245, height - 37, black);
175-
176-
matrixStack.popMatrix();
226+
// Left decoration for the item icon, anchored to the field.
227+
context.fill(x0 - 16, y0, x0, y1, border);
228+
context.fill(x0 - 15, y0 + 1, x0 - 1, y1 - 1, black);
177229

178230
RenderUtils.drawItem(context,
179231
blockToAdd == null ? ItemStack.EMPTY : new ItemStack(blockToAdd),
180-
width / 2 - 164, height - 52, false);
232+
x0 - 28, y0 + 4, false);
181233

182234
context.state.goDownLayer();
183235
matrixStack.popMatrix();

0 commit comments

Comments
 (0)