From 09b58d17828d475103069dc795977264b6725803 Mon Sep 17 00:00:00 2001 From: Jay Sullivan Date: Sat, 20 Jun 2026 00:47:01 -0700 Subject: [PATCH] BoatFly can now descend BoatFly now has a new option: "Sneak Descends Downward". If you enable it, then, when you are flying in a boat, press sneak, and youll descend (instead of the default "jump out of boat and probably die" behavior) --- .../mixin/ClientPlayerEntityMixin.java | 22 +++++++++++++++++++ .../systems/modules/movement/BoatFly.java | 18 ++++++++++++++- 2 files changed, 39 insertions(+), 1 deletion(-) diff --git a/src/main/java/meteordevelopment/meteorclient/mixin/ClientPlayerEntityMixin.java b/src/main/java/meteordevelopment/meteorclient/mixin/ClientPlayerEntityMixin.java index afa19d988c..27075a0e64 100644 --- a/src/main/java/meteordevelopment/meteorclient/mixin/ClientPlayerEntityMixin.java +++ b/src/main/java/meteordevelopment/meteorclient/mixin/ClientPlayerEntityMixin.java @@ -21,10 +21,13 @@ import net.minecraft.client.network.AbstractClientPlayerEntity; import net.minecraft.client.network.ClientPlayerEntity; import net.minecraft.client.world.ClientWorld; +import net.minecraft.entity.vehicle.AbstractBoatEntity; +import net.minecraft.util.PlayerInput; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.Shadow; import org.spongepowered.asm.mixin.injection.At; import org.spongepowered.asm.mixin.injection.Inject; +import org.spongepowered.asm.mixin.injection.ModifyArg; import org.spongepowered.asm.mixin.injection.Redirect; import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; @@ -130,6 +133,25 @@ private void onTickHasVehicleBeforeSendPackets(CallbackInfo info) { MeteorClient.EVENT_BUS.post(SendMovementPacketsEvent.Pre.get()); } + @ModifyArg(method = "tick", at = @At(value = "INVOKE", target = "Lnet/minecraft/network/packet/c2s/play/PlayerInputC2SPacket;(Lnet/minecraft/util/PlayerInput;)V"), index = 0) + private PlayerInput onCreateVehicleInputPacket(PlayerInput input) { + BoatFly boatFly = Modules.get().get(BoatFly.class); + if (!boatFly.sneakDescendsDownward()) return input; + if (!input.sneak()) return input; + if (!(getVehicle() instanceof AbstractBoatEntity boat)) return input; + if (boat.getControllingPassenger() != (Object) this) return input; + + return new PlayerInput( + input.forward(), + input.backward(), + input.left(), + input.right(), + input.jump(), + false, + input.sprint() + ); + } + @Inject(method = "sendMovementPackets", at = @At("TAIL")) private void onSendMovementPacketsTail(CallbackInfo info) { MeteorClient.EVENT_BUS.post(SendMovementPacketsEvent.Post.get()); diff --git a/src/main/java/meteordevelopment/meteorclient/systems/modules/movement/BoatFly.java b/src/main/java/meteordevelopment/meteorclient/systems/modules/movement/BoatFly.java index 3183381bcd..e726480626 100644 --- a/src/main/java/meteordevelopment/meteorclient/systems/modules/movement/BoatFly.java +++ b/src/main/java/meteordevelopment/meteorclient/systems/modules/movement/BoatFly.java @@ -55,6 +55,13 @@ public class BoatFly extends Module { .build() ); + private final Setting sneakDescendsDownward = sgGeneral.add(new BoolSetting.Builder() + .name("sneak-descends-downward") + .description("Uses the sneak key to descend instead of sprint.") + .defaultValue(false) + .build() + ); + public BoatFly() { super(Categories.Movement, "boat-fly", "Transforms your boat into a plane."); } @@ -73,7 +80,12 @@ private void onBoatMove(BoatMoveEvent event) { // Vertical movement if (mc.options.jumpKey.isPressed()) velY += verticalSpeed.get() / 20; - if (mc.options.sprintKey.isPressed()) velY -= verticalSpeed.get() / 20; + + boolean descending = sneakDescendsDownward.get() + ? mc.options.sneakKey.isPressed() + : mc.options.sprintKey.isPressed(); + + if (descending) velY -= verticalSpeed.get() / 20; else velY -= fallSpeed.get() / 20; // Apply velocity @@ -86,4 +98,8 @@ private void onReceivePacket(PacketEvent.Receive event) { event.cancel(); } } + + public boolean sneakDescendsDownward() { + return isActive() && sneakDescendsDownward.get(); + } }