Skip to content

Commit 43b0c31

Browse files
committed
Updated ChestESP and BedESP
1 parent e6bf899 commit 43b0c31

File tree

4 files changed

+93
-8
lines changed

4 files changed

+93
-8
lines changed

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,7 @@ I did not, nor could I copy their code directly as most are Meteor based mods. S
121121
### BedESP
122122
- Finds all bed types.
123123
- Chunk-based scanning with configurable color and Box/Line style.
124+
- Adjustable tracer line thickness
124125
- Rendering: Boxes, Lines, or Both in a fixed color.
125126
- Filter for hiding Trial Chamber and or Villager beds.
126127

@@ -459,7 +460,8 @@ I did not, nor could I copy their code directly as most are Meteor based mods. S
459460
- Added ESP Y limit
460461
- Added HackList count
461462
- Added Buried chest highlighting including a filter to only find buried chests
462-
- Added filters for chests to not highlight them if near spawners, trial chambers and villages (Excluding double chests and shulkers)
463+
- Added filters for chests and barrels to not highlight them if near spawners, trial chambers and villages (Excluding double chests and shulkers)
464+
- Option to suppress single chests in favor of double
463465

464466
### ItemESP (Expanded)
465467
Highlights dropped, equipped, and framed items with powerful filters and customization.

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

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,10 @@ public final class BedEspHack extends Hack implements UpdateListener,
7878
"The area around the player to search in.\n"
7979
+ "Higher values require a faster computer.");
8080

81+
private final SliderSetting tracerThickness =
82+
new SliderSetting("Tracer thickness", 2, 0.5, 8, 0.1,
83+
SliderSetting.ValueDisplay.DECIMAL.withSuffix("px"));
84+
8185
// Above-ground filter
8286
private final net.wurstclient.settings.CheckboxSetting onlyAboveGround =
8387
new net.wurstclient.settings.CheckboxSetting("Above ground only",
@@ -120,6 +124,7 @@ public BedEspHack()
120124
addSetting(showCountInHackList);
121125
addSetting(area);
122126
addSetting(stickyArea);
127+
addSetting(tracerThickness);
123128
addSetting(onlyAboveGround);
124129
addSetting(aboveGroundY);
125130
addSetting(filterTrialChambers);
@@ -232,11 +237,14 @@ private void renderTracers(PoseStack matrixStack, float partialTicks)
232237
continue;
233238

234239
List<AABB> boxes = group.getBoxes();
235-
List<Vec3> ends = boxes.stream().map(AABB::getCenter).toList();
236240
int color = group.getColorI(0x80);
241+
List<RenderUtils.ColoredPoint> ends = boxes.stream()
242+
.map(
243+
box -> new RenderUtils.ColoredPoint(box.getCenter(), color))
244+
.toList();
237245

238-
RenderUtils.drawTracers(matrixStack, partialTicks, ends, color,
239-
false);
246+
RenderUtils.drawTracers(matrixStack, partialTicks, ends, false,
247+
tracerThickness.getValue());
240248
}
241249
}
242250

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

Lines changed: 76 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
import net.minecraft.world.level.block.state.BlockState;
3030
import net.minecraft.world.level.block.state.properties.ChestType;
3131
import net.minecraft.world.level.block.entity.BlockEntity;
32+
import net.minecraft.world.level.block.entity.ChestBlockEntity;
3233
import net.minecraft.world.level.block.entity.TrialSpawnerBlockEntity;
3334
import net.minecraft.world.phys.AABB;
3435
import net.minecraft.world.phys.Vec3;
@@ -100,9 +101,14 @@ public class ChestEspHack extends Hack implements UpdateListener,
100101

101102
private final CheckboxSetting filterTrialChambers = new CheckboxSetting(
102103
"Filter trial chambers",
103-
"Hides single chests that match common trial chamber layouts. Does not affect double chests or shulkers.",
104+
"Hides single chests and barrels that match common trial chamber layouts. Does not affect double chests or shulkers.",
104105
false);
105106

107+
private final CheckboxSetting doubleChestsOnly =
108+
new CheckboxSetting("Double chests only",
109+
"Only highlight/tracer double chests when searching for chests.",
110+
false);
111+
106112
private final CheckboxSetting filterVillages = new CheckboxSetting(
107113
"Filter villages",
108114
"Hides single chests that appear to belong to villages. Does not affect double chests or shulkers.",
@@ -129,6 +135,7 @@ public ChestEspHack()
129135
addSetting(onlyBuried);
130136
addSetting(filterNearSpawners);
131137
addSetting(filterTrialChambers);
138+
addSetting(doubleChestsOnly);
132139
addSetting(filterVillages);
133140
addSetting(showCountInHackList);
134141
groups.allGroups.stream().flatMap(ChestEspGroup::getSettings)
@@ -169,6 +176,9 @@ public void onUpdate()
169176
if(enforceAboveGround && be.getBlockPos().getY() < yLimit)
170177
return;
171178

179+
if(shouldSkipSingleChest(be))
180+
return;
181+
172182
groups.blockGroups.forEach(group -> group.addIfMatches(be));
173183
});
174184

@@ -771,6 +781,17 @@ private List<AABB> filterBoxesByEnvironment(List<AABB> boxes)
771781
BlockPos singleChestPos = getSingleChestPosIfApplicable(box);
772782
if(singleChestPos == null)
773783
{
784+
BlockPos barrelPos = getSingleBarrelPosIfApplicable(box);
785+
if(barrelPos == null)
786+
{
787+
out.add(box);
788+
continue;
789+
}
790+
791+
if(filterTrialChambers.isChecked()
792+
&& isTrialChamberChest(barrelPos))
793+
continue;
794+
774795
out.add(box);
775796
continue;
776797
}
@@ -846,6 +867,60 @@ private BlockPos getSingleChestPosIfApplicable(AABB box)
846867
return foundChest;
847868
}
848869

870+
private BlockPos getSingleBarrelPosIfApplicable(AABB box)
871+
{
872+
if(MC.level == null || box == null)
873+
return null;
874+
875+
int boxMinX = (int)Math.floor(box.minX + 1e-6);
876+
int boxMaxX = (int)Math.floor(box.maxX - 1e-6);
877+
int boxMinY = (int)Math.floor(box.minY + 1e-6);
878+
int boxMaxY = (int)Math.floor(box.maxY - 1e-6);
879+
int boxMinZ = (int)Math.floor(box.minZ + 1e-6);
880+
int boxMaxZ = (int)Math.floor(box.maxZ - 1e-6);
881+
882+
BlockPos foundBarrel = null;
883+
int barrelCount = 0;
884+
885+
for(int x = boxMinX; x <= boxMaxX; x++)
886+
{
887+
for(int y = boxMinY; y <= boxMaxY; y++)
888+
{
889+
for(int z = boxMinZ; z <= boxMaxZ; z++)
890+
{
891+
BlockPos pos = new BlockPos(x, y, z);
892+
BlockState state = MC.level.getBlockState(pos);
893+
if(state == null)
894+
continue;
895+
896+
if(state.getBlock() instanceof BarrelBlock)
897+
{
898+
barrelCount++;
899+
if(foundBarrel == null)
900+
foundBarrel = pos;
901+
902+
if(barrelCount > 1)
903+
return null;
904+
}
905+
}
906+
}
907+
}
908+
909+
return foundBarrel;
910+
}
911+
912+
private boolean shouldSkipSingleChest(BlockEntity be)
913+
{
914+
if(!doubleChestsOnly.isChecked() || !(be instanceof ChestBlockEntity))
915+
return false;
916+
917+
BlockState state = be.getBlockState();
918+
if(!state.hasProperty(ChestBlock.TYPE))
919+
return false;
920+
921+
return state.getValue(ChestBlock.TYPE) == ChestType.SINGLE;
922+
}
923+
849924
private boolean isNearSpawner(BlockPos center, int range)
850925
{
851926
return BlockUtils.getAllInBoxStream(center, range)

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1000,9 +1000,9 @@ private void applyWorldBorderLimit()
10001000
ChatUtils.error("World border limit must be a whole number.");
10011001
return;
10021002
}
1003-
runSimpleCommand("sm:config WorldBorder set " + limit,
1004-
"set WorldBorder to " + limit);
1005-
}
1003+
runSimpleCommand("sm:config WorldBorder set " + limit,
1004+
"set WorldBorder to " + limit);
1005+
}
10061006

10071007
private void applyManualWaypointCompassOverlay()
10081008
{

0 commit comments

Comments
 (0)