Skip to content

Commit dccadb4

Browse files
author
Kenzo101 Studios
committed
RELEASE!
1 parent 36168eb commit dccadb4

40 files changed

Lines changed: 1719 additions & 247 deletions
Lines changed: 61 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,57 +1,87 @@
11
package com.wurstclient_v7.feature;
22

33
import net.minecraft.client.Minecraft;
4+
import net.minecraft.client.KeyMapping;
45
import net.minecraft.core.BlockPos;
5-
import net.minecraft.core.Direction;
6+
import net.minecraft.world.phys.Vec3;
67
import net.minecraft.world.InteractionHand;
7-
import net.minecraft.world.item.BlockItem;
8-
import net.minecraft.world.item.ItemStack;
98
import net.minecraft.world.phys.BlockHitResult;
10-
import net.minecraft.world.phys.Vec3;
9+
import net.minecraft.core.Direction;
10+
import com.mojang.blaze3d.platform.InputConstants;
11+
import org.lwjgl.glfw.GLFW;
1112

1213
public final class AndromedaBridge {
13-
private static volatile boolean enabled = false;
14+
private static boolean enabled = false;
15+
private static float startYaw;
16+
private static float startPitch;
1417

1518
public static boolean isEnabled() { return enabled; }
16-
public static void toggle() { enabled = !enabled; }
19+
20+
public static void toggle() {
21+
enabled = !enabled;
22+
Minecraft mc = Minecraft.getInstance();
23+
if (enabled && mc.player != null) {
24+
// Lock the angles when we start
25+
startYaw = mc.player.getYRot();
26+
startPitch = 80.0f; // Standard Andromeda pitch
27+
} else {
28+
stopInput(mc);
29+
}
30+
}
1731

1832
public static void onClientTick() {
1933
if (!enabled) return;
2034
Minecraft mc = Minecraft.getInstance();
21-
if (mc.player == null || mc.level == null || mc.gameMode == null) return;
35+
if (mc.player == null || mc.level == null) return;
2236

23-
ItemStack heldItem = mc.player.getMainHandItem();
24-
if (!(heldItem.getItem() instanceof BlockItem)) return;
37+
// 1. Lock Rotation (Pitch 90 or close to it helps with specific reach)
38+
mc.player.setYRot(startYaw);
39+
mc.player.setXRot(startPitch);
2540

26-
// Position directly under player feet
27-
BlockPos belowPos = mc.player.blockPosition().below();
41+
// 2. Movement Inputs
42+
net.minecraft.client.KeyMapping.set(InputConstants.getKey(GLFW.GLFW_KEY_W, -1), true);
43+
net.minecraft.client.KeyMapping.set(InputConstants.getKey(GLFW.GLFW_KEY_LEFT_CONTROL, -1), true);
2844

29-
// Andromeda specific: Also target the block in front of the belowPos
30-
// based on where the player is looking/moving.
31-
placeBlockAt(mc, belowPos);
45+
// 3. Jumping
46+
if (mc.player.onGround()) {
47+
mc.player.jumpFromGround();
48+
}
49+
50+
// 4. Placement Logic
51+
BlockPos playerPos = mc.player.blockPosition();
52+
BlockPos underPlayer = playerPos.below();
53+
BlockPos aboveHead = playerPos.above(2);
54+
55+
// Place Floor
56+
if (mc.level.getBlockState(underPlayer).isAir()) {
57+
placeBlock(mc, underPlayer, Direction.UP);
58+
}
3259

33-
// To get that "Andromeda" high-speed look, we often place
34-
// a second block slightly in front
35-
BlockPos frontPos = belowPos.relative(mc.player.getDirection());
36-
placeBlockAt(mc, frontPos);
60+
// Place Ceiling (The "Andromeda" part)
61+
// We check if it's air to avoid double-placing and wasting blocks
62+
if (mc.level.getBlockState(aboveHead).isAir()) {
63+
// We place against the BOTTOM face of the imaginary ceiling
64+
placeBlock(mc, aboveHead, Direction.DOWN);
65+
}
3766
}
3867

39-
private static void placeBlockAt(Minecraft mc, BlockPos pos) {
40-
if (!mc.level.getBlockState(pos).isAir()) return;
68+
private static void placeBlock(Minecraft mc, BlockPos pos, Direction side) {
69+
// Determine the vector based on which side we are clicking
70+
Vec3 hitVec = new Vec3(pos.getX() + 0.5, pos.getY(), pos.getZ() + 0.5);
4171

42-
for (Direction dir : Direction.values()) {
43-
BlockPos neighbor = pos.relative(dir);
44-
if (mc.level.getBlockState(neighbor).isAir()) continue;
72+
// In a real Andromeda bridge, you're usually clicking the side of an existing block.
73+
// For this automation, we simulate clicking the target position directly.
74+
BlockHitResult hit = new BlockHitResult(hitVec, side, pos, false);
4575

46-
// Calculate hit vector
47-
Vec3 hitVec = Vec3.atCenterOf(neighbor).add(Vec3.atLowerCornerOf(dir.getOpposite().getNormal()).scale(0.5));
76+
mc.gameMode.useItemOn(mc.player, InteractionHand.MAIN_HAND, hit);
77+
mc.player.swing(InteractionHand.MAIN_HAND);
78+
}
4879

49-
BlockHitResult hitResult = new BlockHitResult(hitVec, dir.getOpposite(), neighbor, false);
5080

51-
// Send placement to server
52-
mc.gameMode.useItemOn(mc.player, InteractionHand.MAIN_HAND, hitResult);
53-
mc.player.swing(InteractionHand.MAIN_HAND);
54-
break;
55-
}
81+
private static void stopInput(Minecraft mc) {
82+
if (mc.options == null) return;
83+
net.minecraft.client.KeyMapping.set(InputConstants.getKey(GLFW.GLFW_KEY_W, -1), false);
84+
net.minecraft.client.KeyMapping.set(InputConstants.getKey(GLFW.GLFW_KEY_LEFT_CONTROL, -1), false);
85+
net.minecraft.client.KeyMapping.set(InputConstants.getKey(GLFW.GLFW_KEY_SPACE, -1), false);
5686
}
5787
}

common/src/main/java/com/wurstclient_v7/feature/NoFall.java

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,18 @@ private NoFall() { }
1515
public static void onClientTick() {
1616
if (!enabled) return;
1717
Minecraft mc = Minecraft.getInstance();
18-
if (mc == null || mc.player == null) return;
18+
if (mc.player == null || mc.getConnection() == null) return;
1919

20-
if (mc.player.fallDistance > 2.5f) {
21-
// Send a packet saying we are on the ground
22-
mc.player.connection.send(new ServerboundMovePlayerPacket.StatusOnly(true));
23-
// Reset fall distance client-side
20+
if (mc.player.fallDistance > 2.0f) {
21+
// In 1.21.1, getNetHandler() is now getConnection()
22+
mc.getConnection().send(new ServerboundMovePlayerPacket.PosRot(
23+
mc.player.getX(),
24+
mc.player.getY(),
25+
mc.player.getZ(),
26+
mc.player.getYRot(),
27+
mc.player.getXRot(),
28+
true // Tells the server we are 'on ground' to reset fall damage
29+
));
2430
mc.player.fallDistance = 0;
2531
}
2632
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
package com.wurstclient_v7.feature;
2+
3+
public final class SafeWalk {
4+
private static boolean enabled = false;
5+
6+
public static boolean isEnabled() { return enabled; }
7+
8+
public static void toggle() {
9+
enabled = !enabled;
10+
System.out.println("SafeWalk: " + (enabled ? "ON" : "OFF"));
11+
}
12+
}
Lines changed: 61 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,67 @@
11
package com.wurstclient_v7.feature;
22

3-
// This class is a placeholder in the common module.
4-
// The actual implementation is in the neoforge module.
3+
import com.mojang.blaze3d.systems.RenderSystem;
4+
import com.mojang.blaze3d.vertex.*;
5+
import net.minecraft.client.Minecraft;
6+
import net.minecraft.client.renderer.GameRenderer;
7+
import net.minecraft.world.entity.Entity;
8+
import net.minecraft.world.entity.player.Player;
9+
import net.minecraft.world.phys.Vec3;
10+
import org.joml.Matrix4f;
11+
512
public final class Tracers {
6-
private static boolean enabled = false;
13+
private static volatile boolean enabled = false;
14+
15+
private Tracers() {}
16+
717
public static boolean isEnabled() { return enabled; }
8-
public static void toggle() {
9-
// The toggle logic is handled in the neoforge-specific implementation
10-
// by checking the keybinds. This placeholder allows other common code
11-
// to compile, but the real toggle happens in ClientTickMixin.
18+
19+
public static void toggle() {
20+
enabled = !enabled;
21+
System.out.println("Tracers is now " + (enabled ? "ENABLED" : "DISABLED"));
22+
}
23+
24+
public static void render(Matrix4f matrix, float partialTicks) {
25+
if (!enabled) return;
26+
Minecraft mc = Minecraft.getInstance();
27+
if (mc.player == null || mc.level == null) return;
28+
29+
// Setup rendering state for 1.21.1
30+
RenderSystem.enableBlend();
31+
RenderSystem.defaultBlendFunc();
32+
RenderSystem.disableDepthTest();
33+
RenderSystem.setShader(GameRenderer::getPositionColorShader);
34+
35+
Tesselator tesselator = Tesselator.getInstance();
36+
// In 1.21.1, begin() returns the BufferBuilder
37+
BufferBuilder buffer = tesselator.begin(VertexFormat.Mode.DEBUG_LINES, DefaultVertexFormat.POSITION_COLOR);
38+
39+
Vec3 cameraPos = mc.gameRenderer.getMainCamera().getPosition();
40+
// Calculate start point (relative to camera)
41+
Vec3 start = mc.player.getEyePosition(partialTicks).subtract(cameraPos);
42+
43+
for (Entity entity : mc.level.entitiesForRendering()) {
44+
if (entity == mc.player || !(entity instanceof Player)) continue;
45+
46+
// Get target position relative to camera
47+
Vec3 pos = entity.getPosition(partialTicks)
48+
.add(0, entity.getBbHeight() / 2, 0)
49+
.subtract(cameraPos);
50+
51+
// Add vertices (Start -> End)
52+
buffer.addVertex(matrix, (float) start.x, (float) start.y, (float) start.z)
53+
.setColor(0.0f, 1.0f, 0.0f, 1.0f); // Green
54+
55+
buffer.addVertex(matrix, (float) pos.x, (float) pos.y, (float) pos.z)
56+
.setColor(0.0f, 1.0f, 0.0f, 1.0f);
57+
}
58+
59+
MeshData meshData = buffer.build();
60+
if (meshData != null) {
61+
BufferUploader.drawWithShader(meshData);
62+
}
63+
64+
RenderSystem.enableDepthTest();
65+
RenderSystem.disableBlend();
1266
}
1367
}

0 commit comments

Comments
 (0)