Skip to content

Commit 0e7491e

Browse files
committed
Small Fixes
1 parent adad904 commit 0e7491e

6 files changed

Lines changed: 640 additions & 18 deletions

File tree

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ public final class HackList implements UpdateListener
8989
public final AutoToolHack autoToolHack = new AutoToolHack();
9090
public final AutoTotemHack autoTotemHack = new AutoTotemHack();
9191
public final SoulChaliceHack soulChaliceHack = new SoulChaliceHack();
92+
public final SkyBuildEspHack skyBuildEspHack = new SkyBuildEspHack();
9293
public final AutoWalkHack autoWalkHack = new AutoWalkHack();
9394
public final WindChargeKeyHack windChargeKeyHack = new WindChargeKeyHack();
9495
public final XCarryHack xCarryHack = new XCarryHack();

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

Lines changed: 23 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,16 @@
1515

1616
// use internal SliderSetting.ValueDisplay; external GUI class not available
1717

18-
import net.minecraft.core.BlockPos;
19-
import net.minecraft.core.registries.BuiltInRegistries;
20-
import net.minecraft.network.protocol.Packet;
21-
import net.minecraft.network.protocol.game.ClientboundLevelEventPacket;
22-
import net.minecraft.network.protocol.game.ClientboundSoundPacket;
23-
import net.minecraft.network.protocol.game.ClientboundTeleportEntityPacket;
24-
import net.minecraft.world.entity.Entity;
25-
import net.minecraft.world.entity.player.Player;
26-
import net.minecraft.world.phys.Vec3;
18+
import net.minecraft.core.BlockPos;
19+
import net.minecraft.core.registries.BuiltInRegistries;
20+
import net.minecraft.network.protocol.Packet;
21+
import net.minecraft.network.protocol.game.ClientboundLevelEventPacket;
22+
import net.minecraft.network.protocol.game.ClientboundSoundPacket;
23+
import net.minecraft.network.protocol.game.ClientboundTeleportEntityPacket;
24+
import net.minecraft.resources.Identifier;
25+
import net.minecraft.world.entity.Entity;
26+
import net.minecraft.world.entity.player.Player;
27+
import net.minecraft.world.phys.Vec3;
2728

2829
import net.wurstclient.Category;
2930
import com.mojang.blaze3d.vertex.PoseStack;
@@ -435,15 +436,19 @@ private void handleLevelEvent(ClientboundLevelEventPacket packet)
435436
}
436437
}
437438

438-
private void handleSoundPacket(ClientboundSoundPacket packet)
439-
{
440-
if(packet == null || !logMobs.isChecked())
441-
return;
442-
443-
String soundId = BuiltInRegistries.SOUND_EVENT
444-
.getKey(packet.getSound().value()).toString();
445-
if(!soundId.contains("wither") || !soundId.contains("spawn"))
446-
return;
439+
private void handleSoundPacket(ClientboundSoundPacket packet)
440+
{
441+
if(packet == null || !logMobs.isChecked())
442+
return;
443+
444+
Identifier soundKey =
445+
BuiltInRegistries.SOUND_EVENT.getKey(packet.getSound().value());
446+
if(soundKey == null)
447+
return;
448+
449+
String soundId = soundKey.toString();
450+
if(!soundId.contains("wither") || !soundId.contains("spawn"))
451+
return;
447452

448453
Vec3 soundPos = new Vec3(packet.getX(), packet.getY(), packet.getZ());
449454
if(shouldSkipWitherSpawnByDedupe(soundPos))

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

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,18 @@ public final class EnchantmentHandlerHack extends Hack
124124
private final SliderSetting slotHighlightOpacity =
125125
new SliderSetting("Slot highlight opacity", 45, 5, 100, 1,
126126
ValueDisplay.INTEGER.withSuffix("%"));
127+
private final CheckboxSetting savedContainerPosition =
128+
new CheckboxSetting("Saved container position", false);
129+
private final SliderSetting savedContainerX = new SliderSetting(
130+
"Saved container X", 0, -4000, 4000, 1, ValueDisplay.INTEGER);
131+
private final SliderSetting savedContainerY = new SliderSetting(
132+
"Saved container Y", 0, -4000, 4000, 1, ValueDisplay.INTEGER);
133+
private final CheckboxSetting savedInventoryPosition =
134+
new CheckboxSetting("Saved inventory position", false);
135+
private final SliderSetting savedInventoryX = new SliderSetting(
136+
"Saved inventory X", 0, -4000, 4000, 1, ValueDisplay.INTEGER);
137+
private final SliderSetting savedInventoryY = new SliderSetting(
138+
"Saved inventory Y", 0, -4000, 4000, 1, ValueDisplay.INTEGER);
127139

128140
private double scrollOffset;
129141
private double maxScroll;
@@ -166,6 +178,12 @@ public EnchantmentHandlerHack()
166178
addSetting(slotHighlightEnabled);
167179
addSetting(slotHighlightColor);
168180
addSetting(slotHighlightOpacity);
181+
addHiddenPositionSetting(savedContainerPosition);
182+
addHiddenPositionSetting(savedContainerX);
183+
addHiddenPositionSetting(savedContainerY);
184+
addHiddenPositionSetting(savedInventoryPosition);
185+
addHiddenPositionSetting(savedInventoryX);
186+
addHiddenPositionSetting(savedInventoryY);
169187

170188
for(GearCategory cat : GearCategory.ORDERED)
171189
{
@@ -223,6 +241,13 @@ protected void onDisable()
223241
public void renderOnHandledScreen(AbstractContainerScreen<?> screen,
224242
GuiGraphicsExtractor context, float partialTicks)
225243
{
244+
customPosition = savedContainerPosition.isChecked();
245+
containerPanelX = savedContainerX.getValueI();
246+
containerPanelY = savedContainerY.getValueI();
247+
inventoryCustomPosition = savedInventoryPosition.isChecked();
248+
inventoryPanelX = savedInventoryX.getValueI();
249+
inventoryPanelY = savedInventoryY.getValueI();
250+
226251
if(screen == lastRenderedScreen && context == lastRenderContext)
227252
return;
228253
lastRenderedScreen = screen;
@@ -406,6 +431,7 @@ public boolean handleMouseRelease(AbstractContainerScreen<?> screen,
406431
if(panelDragging && button == 0)
407432
{
408433
panelDragging = false;
434+
savePanelPosition();
409435
return true;
410436
}
411437

@@ -467,6 +493,28 @@ private void startPanelDrag(double mouseX, double mouseY)
467493
customPosition = true;
468494
}
469495

496+
private void savePanelPosition()
497+
{
498+
if(renderingInventoryScreen)
499+
{
500+
savedInventoryPosition.setChecked(inventoryCustomPosition);
501+
savedInventoryX.setValue(inventoryPanelX);
502+
savedInventoryY.setValue(inventoryPanelY);
503+
return;
504+
}
505+
506+
savedContainerPosition.setChecked(customPosition);
507+
savedContainerX.setValue(containerPanelX);
508+
savedContainerY.setValue(containerPanelY);
509+
}
510+
511+
private void addHiddenPositionSetting(
512+
net.wurstclient.settings.Setting setting)
513+
{
514+
setting.setVisibleInGui(false);
515+
addSetting(setting);
516+
}
517+
470518
private void renderOverlay(GuiGraphicsExtractor context)
471519
{
472520
hitboxes.clear();

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

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,12 @@ private enum SizeUnit
9191
1, 32768, 1, ValueDisplay.INTEGER);
9292
private final EnumSetting<SizeUnit> chunkLimitUnit =
9393
new EnumSetting<>("Chunk limit unit", SizeUnit.values(), SizeUnit.KB);
94+
private final CheckboxSetting savedOverlayPosition =
95+
new CheckboxSetting("Saved overlay position", false);
96+
private final SliderSetting savedOverlayX = new SliderSetting(
97+
"Saved overlay X", 0, -4000, 4000, 1, ValueDisplay.INTEGER);
98+
private final SliderSetting savedOverlayY = new SliderSetting(
99+
"Saved overlay Y", 0, -4000, 4000, 1, ValueDisplay.INTEGER);
94100

95101
private long currentInventoryBytes;
96102
private int currentContainerId = -1;
@@ -130,6 +136,9 @@ public NbtSizeCounterHack()
130136
addSetting(preventChunkEntry);
131137
addSetting(chunkLimitValue);
132138
addSetting(chunkLimitUnit);
139+
addHiddenPositionSetting(savedOverlayPosition);
140+
addHiddenPositionSetting(savedOverlayX);
141+
addHiddenPositionSetting(savedOverlayY);
133142
}
134143

135144
@Override
@@ -265,6 +274,15 @@ public void renderOnHandledScreen(AbstractContainerScreen<?> screen,
265274
if(!showScreenOverlay.isChecked())
266275
return;
267276

277+
if(overlayX == Integer.MIN_VALUE || overlayY == Integer.MIN_VALUE)
278+
{
279+
if(savedOverlayPosition.isChecked())
280+
{
281+
overlayX = savedOverlayX.getValueI();
282+
overlayY = savedOverlayY.getValueI();
283+
}
284+
}
285+
268286
updateCurrentContainer(screen);
269287

270288
HandledScreenAccessor accessor = (HandledScreenAccessor)screen;
@@ -342,9 +360,19 @@ public boolean handleMouseRelease()
342360
return false;
343361

344362
dragging = false;
363+
savedOverlayPosition.setChecked(true);
364+
savedOverlayX.setValue(overlayX);
365+
savedOverlayY.setValue(overlayY);
345366
return true;
346367
}
347368

369+
private void addHiddenPositionSetting(
370+
net.wurstclient.settings.Setting setting)
371+
{
372+
setting.setVisibleInGui(false);
373+
addSetting(setting);
374+
}
375+
348376
private void updateCurrentContainer(AbstractContainerScreen<?> screen)
349377
{
350378
AbstractContainerMenu menu = screen.getMenu();

0 commit comments

Comments
 (0)