diff --git a/README.md b/README.md index 95ef96e..d58a2c4 100644 --- a/README.md +++ b/README.md @@ -31,8 +31,7 @@ # Features ## Modules -- AntiBot (Removed from Meteor in [166fc](https://github.com/MeteorDevelopment/meteor-client/commit/166fccc73e53de6cfdbe41ea58dc593a2f5011f6#diff-05896d5a7f735a14ee8da5d12fbd24585862ca68efdf32b9401b3f4329d17c73)) -- Insta Mine (Removed from Meteor in [62cd0](https://github.com/MeteorDevelopment/meteor-client/commit/62cd0461e48a6c50f040bf48de25be1fa4eba77e)) +- AntiBot (Removed from Meteor in [166fc](https://github.com/MeteorDevelopment/meteor-client/commit/166fccc73e53de6cfdbe41ea58dc593a2f5011f6)) - AntiSpawnpoint - AntiVanish - AutoBedTrap (Ported from [BleachHack-CupEdition](https://github.com/CUPZYY/BleachHack-CupEdition/blob/master/CupEdition-1.17/src/main/java/bleach/hack/module/mods/AutoBedtrap.java)) @@ -52,8 +51,10 @@ - Confuse - Coord Logger (World events from [JexClient](https://github.com/DustinRepo/JexClient-main/blob/main/src/main/java/me/dustin/jex/feature/mod/impl/misc/CoordFinder.java)) - Custom Packets +- Extra Elytra (Ported from [Wurst](https://github.com/Wurst-Imperium/Wurst7/tree)) - Ghost Mode (Taken from an [unmerged PR](https://github.com/MeteorDevelopment/meteor-client/pull/1932)) - Glide (Ported from [Wurst](https://github.com/Wurst-Imperium/Wurst7/tree)) +- Insta Mine (Removed from Meteor in [62cd0](https://github.com/MeteorDevelopment/meteor-client/commit/62cd0461e48a6c50f040bf48de25be1fa4eba77e)) - InteractionMenu (Ported from [BleachHack](https://github.com/BleachDrinker420/BleachHack/pull/211)) - Lavacast - NewChunks (Ported from [BleackHack](https://github.com/BleachDrinker420/BleachHack/blob/master/BleachHack-Fabric-1.17/src/main/java/bleach/hack/module/mods/NewChunks.java)) diff --git a/src/main/java/anticope/rejects/MeteorRejectsAddon.java b/src/main/java/anticope/rejects/MeteorRejectsAddon.java index cd26fd8..a095fbe 100644 --- a/src/main/java/anticope/rejects/MeteorRejectsAddon.java +++ b/src/main/java/anticope/rejects/MeteorRejectsAddon.java @@ -53,6 +53,7 @@ public class MeteorRejectsAddon extends MeteorAddon { modules.add(new Confuse()); modules.add(new CoordLogger()); modules.add(new CustomPackets()); + modules.add(new ExtraElytra()); modules.add(new GhostMode()); modules.add(new Glide()); modules.add(new InstaMine()); diff --git a/src/main/java/anticope/rejects/modules/ExtraElytra.java b/src/main/java/anticope/rejects/modules/ExtraElytra.java new file mode 100644 index 0000000..91dc464 --- /dev/null +++ b/src/main/java/anticope/rejects/modules/ExtraElytra.java @@ -0,0 +1,144 @@ +package anticope.rejects.modules; + +import anticope.rejects.MeteorRejectsAddon; +import meteordevelopment.meteorclient.MeteorClient; +import meteordevelopment.meteorclient.events.world.TickEvent; +import meteordevelopment.meteorclient.settings.BoolSetting; +import meteordevelopment.meteorclient.settings.Setting; +import meteordevelopment.meteorclient.settings.SettingGroup; +import meteordevelopment.meteorclient.systems.modules.Module; +import meteordevelopment.orbit.EventHandler; +import net.minecraft.entity.EquipmentSlot; +import net.minecraft.item.ElytraItem; +import net.minecraft.item.ItemStack; +import net.minecraft.item.Items; +import net.minecraft.network.packet.c2s.play.ClientCommandC2SPacket; +import net.minecraft.util.math.MathHelper; +import net.minecraft.util.math.Vec3d; + +public class ExtraElytra extends Module { + private final SettingGroup sgGeneral = settings.getDefaultGroup(); + + private final Setting instantFly = sgGeneral.add(new BoolSetting.Builder() + .name("instant-fly") + .description("Jump to fly, no weird double-jump needed!") + .defaultValue(true) + .build() + ); + + private final Setting speedCtrl = sgGeneral.add(new BoolSetting.Builder() + .name("speed-ctrl") + .description(""" + Control your speed with the Forward and Back keys. + (default: W and S) + No fireworks needed!""") + .defaultValue(true) + .build() + ); + + private final Setting heightCtrl = sgGeneral.add(new BoolSetting.Builder() + .name("height-ctrl") + .description(""" + Control your height with the Jump and Sneak keys. + (default: Spacebar and Shift) + No fireworks needed!""") + .defaultValue(false) + .build() + ); + + private final Setting stopInWater = sgGeneral.add(new BoolSetting.Builder() + .name("stop-in-water") + .description("Stop flying in water") + .defaultValue(true) + .build() + ); + + private int jumpTimer; + + @Override + public void onActivate() { + jumpTimer = 0; + MeteorClient.EVENT_BUS.subscribe(this); + } + + @Override + public void onDeactivate() { + MeteorClient.EVENT_BUS.unsubscribe(this); + } + + public ExtraElytra() { + super(MeteorRejectsAddon.CATEGORY, "extra-elytra", "Easier elytra"); + } + + @EventHandler + private void onTick(TickEvent.Post event) { + if (jumpTimer > 0) + jumpTimer--; + + ItemStack chest = mc.player.getEquippedStack(EquipmentSlot.CHEST); + if (chest.getItem() != Items.ELYTRA) + return; + + if (mc.player.isFallFlying()) { + if (stopInWater.get() && mc.player.isTouchingWater()) { + sendStartStopPacket(); + return; + } + + controlSpeed(); + controlHeight(); + return; + } + + if (ElytraItem.isUsable(chest) && mc.options.jumpKey.isPressed()) + doInstantFly(); + } + + private void sendStartStopPacket() { + ClientCommandC2SPacket packet = new ClientCommandC2SPacket(mc.player, + ClientCommandC2SPacket.Mode.START_FALL_FLYING); + mc.player.networkHandler.sendPacket(packet); + } + + private void controlHeight() { + if (!heightCtrl.get()) + return; + + Vec3d v = mc.player.getVelocity(); + + if (mc.options.jumpKey.isPressed()) + mc.player.setVelocity(v.x, v.y + 0.08, v.z); + else if (mc.options.sneakKey.isPressed()) + mc.player.setVelocity(v.x, v.y - 0.04, v.z); + } + + private void controlSpeed() { + if (!speedCtrl.get()) + return; + + float yaw = (float) Math.toRadians(mc.player.getYaw()); + Vec3d forward = new Vec3d(-MathHelper.sin(yaw) * 0.05, 0, + MathHelper.cos(yaw) * 0.05); + + Vec3d v = mc.player.getVelocity(); + + if (mc.options.forwardKey.isPressed()) + mc.player.setVelocity(v.add(forward)); + else if (mc.options.backKey.isPressed()) + mc.player.setVelocity(v.subtract(forward)); + } + + private void doInstantFly() { + if (!instantFly.get()) + return; + + if (jumpTimer <= 0) { + jumpTimer = 20; + mc.player.setJumping(false); + mc.player.setSprinting(true); + mc.player.jump(); + } + + sendStartStopPacket(); + } +}