diff --git a/src/main/java/cloudburst/rejects/MeteorRejectsAddon.java b/src/main/java/cloudburst/rejects/MeteorRejectsAddon.java index 0bd4d35..362314f 100644 --- a/src/main/java/cloudburst/rejects/MeteorRejectsAddon.java +++ b/src/main/java/cloudburst/rejects/MeteorRejectsAddon.java @@ -33,6 +33,8 @@ public class MeteorRejectsAddon extends MeteorAddon { modules.add(new AutoPot()); modules.add(new AutoTNT()); modules.add(new AutoWither()); + modules.add(new BoatGlitch()); + modules.add(new BoatPhase()); modules.add(new ColorSigns()); modules.add(new Confuse()); modules.add(new Gravity()); diff --git a/src/main/java/cloudburst/rejects/modules/BoatGlitch.java b/src/main/java/cloudburst/rejects/modules/BoatGlitch.java new file mode 100644 index 0000000..10b4aa2 --- /dev/null +++ b/src/main/java/cloudburst/rejects/modules/BoatGlitch.java @@ -0,0 +1,131 @@ +package cloudburst.rejects.modules; + +import meteordevelopment.orbit.EventHandler; +import minegame159.meteorclient.events.entity.BoatMoveEvent; +import minegame159.meteorclient.events.meteor.KeyEvent; +import minegame159.meteorclient.events.world.TickEvent; +import minegame159.meteorclient.settings.BoolSetting; +import minegame159.meteorclient.settings.Setting; +import minegame159.meteorclient.settings.SettingGroup; +import minegame159.meteorclient.systems.modules.Module; +import minegame159.meteorclient.systems.modules.Modules; +import minegame159.meteorclient.utils.misc.input.KeyAction; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityType; +import net.minecraft.network.packet.c2s.play.PlayerInteractEntityC2SPacket; +import net.minecraft.util.Hand; + +import cloudburst.rejects.MeteorRejectsAddon; + +public class BoatGlitch extends Module { + private final SettingGroup sgGeneral = settings.getDefaultGroup(); + + private final Setting toggleAfter = sgGeneral.add(new BoolSetting.Builder() + .name("toggle-after") + .description("Disables the module when finished.") + .defaultValue(true) + .build() + ); + + private final Setting remount = sgGeneral.add(new BoolSetting.Builder() + .name("remount") + .description("Remounts the boat when finished.") + .defaultValue(true) + .build() + ); + + private Entity boat = null; + private int dismountTicks = 0; + private int remountTicks = 0; + private boolean dontPhase = true; + private boolean boatPhaseEnabled; + + public BoatGlitch() { + super(MeteorRejectsAddon.CATEGORY, "boat-glitch", "Glitches your boat into the block beneath you. Dismount to trigger."); + } + + @Override + public void onActivate() { + dontPhase = true; + dismountTicks = 0; + remountTicks = 0; + boat = null; + if (Modules.get().isActive(BoatPhase.class)) { + boatPhaseEnabled = true; + Modules.get().get(BoatPhase.class).toggle(); + } + else { + boatPhaseEnabled = false; + } + } + + @Override + public void onDeactivate() { + if (boat != null) { + boat.noClip = false; + boat = null; + } + if (boatPhaseEnabled && !(Modules.get().isActive(BoatPhase.class))) { + Modules.get().get(BoatPhase.class).toggle(); + } + } + + @EventHandler + private void onBoatMove(BoatMoveEvent event) { + if (dismountTicks == 0 && !dontPhase) { + if (boat != event.boat) { + if (boat != null) { + boat.noClip = false; + } + if (mc.player.getVehicle() != null && event.boat == mc.player.getVehicle()) { + boat = event.boat; + } + else { + boat = null; + } + } + if (boat != null) { + boat.noClip = true; + boat.pushSpeedReduction = 1; + dismountTicks = 5; + } + } + } + + @EventHandler + private void onTick(TickEvent.Post event) { + if (dismountTicks > 0) { + dismountTicks--; + if (dismountTicks == 0) { + if (boat != null) { + boat.noClip = false; + if (toggleAfter.get() && !remount.get()) { + toggle(); + } + else if (remount.get()) { + remountTicks = 5; + } + } + dontPhase = true; + } + } + if (remountTicks > 0) { + remountTicks--; + if (remountTicks == 0) { + mc.getNetworkHandler().sendPacket(new PlayerInteractEntityC2SPacket(boat, Hand.MAIN_HAND, false)); + if (toggleAfter.get()) { + toggle(); + } + } + } + } + @EventHandler + private void onKey(KeyEvent event) { + if (event.key == mc.options.keySneak.getDefaultKey().getCode() && event.action == KeyAction.Press) { + if (mc.player.getVehicle() != null && mc.player.getVehicle().getType().equals(EntityType.BOAT)) { + dontPhase = false; + boat = null; + } + } + } +} \ No newline at end of file diff --git a/src/main/java/cloudburst/rejects/modules/BoatPhase.java b/src/main/java/cloudburst/rejects/modules/BoatPhase.java new file mode 100644 index 0000000..2569bb8 --- /dev/null +++ b/src/main/java/cloudburst/rejects/modules/BoatPhase.java @@ -0,0 +1,138 @@ +package cloudburst.rejects.modules; + +import meteordevelopment.orbit.EventHandler; +import minegame159.meteorclient.events.entity.BoatMoveEvent; +import minegame159.meteorclient.mixininterface.IVec3d; +import minegame159.meteorclient.settings.BoolSetting; +import minegame159.meteorclient.settings.DoubleSetting; +import minegame159.meteorclient.settings.Setting; +import minegame159.meteorclient.settings.SettingGroup; +import minegame159.meteorclient.systems.modules.Module; +import minegame159.meteorclient.systems.modules.Modules; +import minegame159.meteorclient.utils.player.PlayerUtils; +import net.minecraft.entity.EntityType; +import net.minecraft.entity.vehicle.BoatEntity; +import net.minecraft.util.math.Vec3d; + +import cloudburst.rejects.MeteorRejectsAddon; + +public class BoatPhase extends Module { + private final SettingGroup sgGeneral = settings.getDefaultGroup(); + private final SettingGroup sgSpeeds = settings.createGroup("Speeds"); + + private final Setting lockYaw = sgGeneral.add(new BoolSetting.Builder() + .name("lock-boat-yaw") + .description("Locks boat yaw to the direction you're facing.") + .defaultValue(true) + .build() + ); + + private final Setting verticalControl = sgGeneral.add(new BoolSetting.Builder() + .name("vertical-control") + .description("Whether or not space/ctrl can be used to move vertically.") + .defaultValue(true) + .build() + ); + + private final Setting adjustHorizontalSpeed = sgGeneral.add(new BoolSetting.Builder() + .name("adjust-horizontal-speed") + .description("Whether or not horizontal speed is modified.") + .defaultValue(false) + .build() + ); + + private final Setting fall = sgGeneral.add(new BoolSetting.Builder() + .name("fall") + .description("Toggles vertical glide.") + .defaultValue(false) + .build() + ); + + private final Setting horizontalSpeed = sgSpeeds.add(new DoubleSetting.Builder() + .name("horizontal-speed") + .description("Horizontal speed in blocks per second.") + .defaultValue(10) + .min(0) + .sliderMax(50) + .build() + ); + + private final Setting verticalSpeed = sgSpeeds.add(new DoubleSetting.Builder() + .name("vertical-speed") + .description("Vertical speed in blocks per second.") + .defaultValue(5) + .min(0) + .sliderMax(20) + .build() + ); + + private final Setting fallSpeed = sgSpeeds.add(new DoubleSetting.Builder() + .name("fall-speed") + .description("How fast you fall in blocks per second.") + .defaultValue(0.625) + .min(0) + .sliderMax(10) + .build() + ); + + private BoatEntity boat = null; + + public BoatPhase() { + super(MeteorRejectsAddon.CATEGORY, "boat-phase", "Phase through blocks using a boat."); + } + + @Override + public void onActivate() { + boat = null; + if (Modules.get().isActive(BoatGlitch.class)) Modules.get().get(BoatGlitch.class).toggle(); + } + + @Override + public void onDeactivate() { + if (boat != null) { + boat.noClip = false; + } + } + + @EventHandler + private void onBoatMove(BoatMoveEvent event) { + if (mc.player.getVehicle() != null && mc.player.getVehicle().getType().equals(EntityType.BOAT)) { + if (boat != mc.player.getVehicle()) { + if (boat != null) { + boat.noClip = false; + } + boat = (BoatEntity) mc.player.getVehicle(); + } + } else boat = null; + + if (boat != null) { + boat.noClip = true; + boat.pushSpeedReduction = 1; + + if (lockYaw.get()) { + boat.yaw = mc.player.yaw; + } + + Vec3d vel; + + if (adjustHorizontalSpeed.get()) { + vel = PlayerUtils.getHorizontalVelocity(horizontalSpeed.get()); + } + else { + vel = boat.getVelocity(); + } + + double velX = vel.x; + double velY = 0; + double velZ = vel.z; + + if (verticalControl.get()) { + if (mc.options.keyJump.isPressed()) velY += verticalSpeed.get() / 20; + if (mc.options.keySprint.isPressed()) velY -= verticalSpeed.get() / 20; + else if (fall.get()) velY -= fallSpeed.get() / 20; + } else if (fall.get()) velY -= fallSpeed.get() / 20; + + ((IVec3d) boat.getVelocity()).set(velX,velY,velZ); + } + } +} \ No newline at end of file