Skip to content

Commit

Permalink
Some code formatting and VehicleOneHit (#258)
Browse files Browse the repository at this point in the history
  • Loading branch information
hexadecimal233 authored Jun 22, 2023
1 parent 89832a6 commit 950dece
Show file tree
Hide file tree
Showing 14 changed files with 157 additions and 225 deletions.
9 changes: 5 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,16 +58,20 @@
- 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))
- FullNoClip
- FullFlight (Antikick bypasses by [CCblueX](https://github.com/CCblueX) and [LiveOverflow](https://github.com/LiveOverflow))
- Gamemode notifier
- 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))
- Item generator (Ported from [Wurst](https://github.com/Wurst-Imperium/Wurst7/tree))
- InteractionMenu (Ported from [BleachHack](https://github.com/BleachDrinker420/BleachHack/pull/211))
- Jetpack
- KnockbackPlus
- Lavacast
- MossBot (Ported from [BleachHack](https://github.com/BleachDrinker420/BleachHack/pull/211))
- NewChunks (Ported from [BleachHack](https://github.com/BleachDrinker420/BleachHack/blob/master/BleachHack-Fabric-1.17/src/main/java/bleach/hack/module/mods/NewChunks.java))
- NoJumpDelay
- ObsidianFarm (Taken from [Meteor ObsidianFarm Addon](https://github.com/VoidCyborg/meteor-obsidian-farm))
- Oresim (Ported from [Atomic](https://gitlab.com/0x151/atomic))
- PacketFly (Taken from an [unmerged PR](https://github.com/MeteorDevelopment/meteor-client/pull/813))
Expand All @@ -80,10 +84,7 @@
- SoundLocator
- Server Finder (Ported from [MeteorAdditions](https://github.com/JFronny/MeteorAdditions))
- TreeAura (Taken from an [unmerged PR](https://github.com/MeteorDevelopment/meteor-client/pull/2138))
- FullNoClip
- FullFlight (Antikick bypasses by [CCblueX](https://github.com/CCblueX) and [LiveOverflow](https://github.com/LiveOverflow))
- NoJumpDelay
- KnockbackPlus
- VehicleOneHit (Taken from an [unmerged PR](https://github.com/MeteorDevelopment/meteor-client/pull/3539))

### Modifications
- NoRender
Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ dependencies {
}

loom {
accessWidenerPath = file("src/main/resources/meteor-client.accesswidener")
accessWidenerPath = file("src/main/resources/meteor-rejects.accesswidener")
}

processResources {
Expand Down
9 changes: 5 additions & 4 deletions src/main/java/anticope/rejects/MeteorRejectsAddon.java
Original file line number Diff line number Diff line change
Expand Up @@ -57,16 +57,20 @@ public void onInitialize() {
modules.add(new CoordLogger());
modules.add(new CustomPackets());
modules.add(new ExtraElytra());
modules.add(new FullNoClip());
modules.add(new FullFlight());
modules.add(new GamemodeNotifier());
modules.add(new GhostMode());
modules.add(new Glide());
modules.add(new InstaMine());
modules.add(new ItemGenerator());
modules.add(new InteractionMenu());
modules.add(new Jetpack());
modules.add(new KnockbackPlus());
modules.add(new Lavacast());
modules.add(new MossBot());
modules.add(new NewChunks());
modules.add(new NoJumpDelay());
modules.add(new ObsidianFarm());
modules.add(new OreSim());
modules.add(new PacketFly());
Expand All @@ -78,10 +82,7 @@ public void onInitialize() {
modules.add(new SkeletonESP());
modules.add(new SoundLocator());
modules.add(new TreeAura());
modules.add(new FullNoClip());
modules.add(new FullFlight());
modules.add(new NoJumpDelay());
modules.add(new KnockbackPlus());
modules.add(new VehicleOneHit());

// Commands
Commands.add(new CenterCommand());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,15 @@
import anticope.rejects.modules.FullFlight;
import anticope.rejects.modules.FullNoClip;
import net.minecraft.entity.Entity;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
import net.minecraft.util.math.Vec3d;
import net.minecraft.block.BlockState;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;

import static meteordevelopment.meteorclient.MeteorClient.mc;

@Mixin(Entity.class)
public abstract class MixinEntity {
public abstract class EntityMixin {
@Inject(method = "slowMovement", at = @At("HEAD"), cancellable = true)
public void slowMovement(BlockState blockState, Vec3d multiplier, CallbackInfo ci) {
if (Modules.get().isActive(FullFlight.class) || Modules.get().isActive(FullNoClip.class)) ci.cancel();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
import meteordevelopment.meteorclient.systems.modules.Module;
import meteordevelopment.meteorclient.systems.modules.combat.KillAura;
import net.minecraft.entity.Entity;
import net.minecraft.util.math.Box;
import org.spongepowered.asm.mixin.Final;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Shadow;
Expand Down Expand Up @@ -112,7 +111,7 @@ private void onAttack(Entity entity, CallbackInfo info) {
}

@Inject(method = "onTick", at = @At("TAIL"), locals = LocalCapture.CAPTURE_FAILSOFT)
private void onTick(TickEvent.Pre event, CallbackInfo info, Entity primary, Box hitbox) {
private void onTick(TickEvent.Pre event, CallbackInfo ci, Entity primary) {
if (randomTeleport.get() && !onlyOnLook.get()) {
mc.player.setPosition(primary.getX() + randomOffset(), primary.getY(), primary.getZ() + randomOffset());
}
Expand Down
77 changes: 19 additions & 58 deletions src/main/java/anticope/rejects/modules/FullFlight.java
Original file line number Diff line number Diff line change
@@ -1,24 +1,23 @@
package anticope.rejects.modules;

import anticope.rejects.MeteorRejectsAddon;
import anticope.rejects.utils.RejectsUtils;
import com.google.common.collect.Streams;
import java.util.stream.Stream;
import meteordevelopment.meteorclient.events.entity.player.PlayerMoveEvent;
import meteordevelopment.meteorclient.events.packets.PacketEvent;
import meteordevelopment.meteorclient.mixininterface.IVec3d;
import meteordevelopment.meteorclient.mixin.PlayerMoveC2SPacketAccessor;
import meteordevelopment.meteorclient.mixin.ClientPlayerEntityAccessor;
import meteordevelopment.meteorclient.systems.modules.Module;
import meteordevelopment.meteorclient.mixin.PlayerMoveC2SPacketAccessor;
import meteordevelopment.meteorclient.settings.*;
import meteordevelopment.meteorclient.utils.Utils;
import meteordevelopment.meteorclient.utils.player.PlayerUtils;
import meteordevelopment.meteorclient.systems.modules.Module;
import meteordevelopment.orbit.EventHandler;
import net.minecraft.network.packet.c2s.play.PlayerMoveC2SPacket;
import net.minecraft.entity.Entity;
import net.minecraft.block.AbstractBlock;
import net.minecraft.entity.Entity;
import net.minecraft.network.packet.c2s.play.PlayerMoveC2SPacket;
import net.minecraft.util.math.Box;
import net.minecraft.util.shape.VoxelShape;

import java.util.stream.Stream;

public class FullFlight extends Module {
private final SettingGroup sgGeneral = settings.getDefaultGroup();
private final SettingGroup sgAntiKick = settings.createGroup("Anti Kick");
Expand Down Expand Up @@ -50,29 +49,14 @@ public FullFlight() {
super(MeteorRejectsAddon.CATEGORY, "fullflight", "FullFlight.");
}

private double getDir() {
double dir = 0;

if (Utils.canUpdate()) {
dir = mc.player.getYaw() + ((mc.player.forwardSpeed < 0) ? 180 : 0);

if (mc.player.sidewaysSpeed > 0) {
dir += -90F * ((mc.player.forwardSpeed < 0) ? -0.5F : ((mc.player.forwardSpeed > 0) ? 0.5F : 1F));
} else if (mc.player.sidewaysSpeed < 0) {
dir += 90F * ((mc.player.forwardSpeed < 0) ? -0.5F : ((mc.player.forwardSpeed > 0) ? 0.5F : 1F));
}
}
return dir;
}

private double calculateGround() {
for(double ground = mc.player.getY(); ground > 0D; ground -= 0.05) {
for (double ground = mc.player.getY(); ground > 0D; ground -= 0.05) {
Box box = mc.player.getBoundingBox();
Box adjustedBox = box.offset(0, ground - mc.player.getY(), 0);

Stream<VoxelShape> blockCollisions = Streams.stream(mc.world.getBlockCollisions(mc.player, adjustedBox));

if(blockCollisions.findAny().isPresent()) return ground + 0.05;
if (blockCollisions.findAny().isPresent()) return ground + 0.05;
}

return 0F;
Expand Down Expand Up @@ -111,7 +95,8 @@ private void antiKickPacket(PlayerMoveC2SPacket packet, double currentY) {

@EventHandler
private void onSendPacket(PacketEvent.Send event) {
if (mc.player.getVehicle() == null || !(event.packet instanceof PlayerMoveC2SPacket packet) || antiKickMode.get() != AntiKickMode.PaperNew) return;
if (mc.player.getVehicle() == null || !(event.packet instanceof PlayerMoveC2SPacket packet) || antiKickMode.get() != AntiKickMode.PaperNew)
return;

double currentY = packet.getY(Double.MAX_VALUE);
if (currentY != Double.MAX_VALUE) {
Expand Down Expand Up @@ -151,75 +136,52 @@ private void onPlayerMove(PlayerMoveEvent event) {
// Resend movement packets
((ClientPlayerEntityAccessor) mc.player).setTicksSinceLastPositionPacketSent(20);
}
if (floatingTicks >= 20)
{
if (floatingTicks >= 20) {
switch (antiKickMode.get()) {
case New -> {
Box box = mc.player.getBoundingBox();
Box adjustedBox = box.offset(0, -0.4, 0);

Stream<VoxelShape> blockCollisions = Streams.stream(mc.world.getBlockCollisions(mc.player, adjustedBox));

if(blockCollisions.findAny().isPresent()) break;
if (blockCollisions.findAny().isPresent()) break;

mc.getNetworkHandler().sendPacket(new PlayerMoveC2SPacket.PositionAndOnGround(mc.player.getX(), mc.player.getY() - 0.4, mc.player.getZ(), mc.player.isOnGround()));
mc.getNetworkHandler().sendPacket(new PlayerMoveC2SPacket.PositionAndOnGround(mc.player.getX(), mc.player.getY(), mc.player.getZ(), mc.player.isOnGround()));

break;
}
case Old -> {
Box box = mc.player.getBoundingBox();
Box adjustedBox = box.offset(0, -0.4, 0);

Stream<VoxelShape> blockCollisions = Streams.stream(mc.world.getBlockCollisions(mc.player, adjustedBox));

if(blockCollisions.findAny().isPresent()) break;
if (blockCollisions.findAny().isPresent()) break;

double ground = calculateGround();
double groundExtra = ground + 0.1D;

for(double posY = mc.player.getY(); posY > groundExtra; posY -= 4D) {
for (double posY = mc.player.getY(); posY > groundExtra; posY -= 4D) {
mc.getNetworkHandler().sendPacket(new PlayerMoveC2SPacket.PositionAndOnGround(mc.player.getX(), posY, mc.player.getZ(), true));

if(posY - 4D < groundExtra) break; // Prevent next step
if (posY - 4D < groundExtra) break; // Prevent next step
}

mc.getNetworkHandler().sendPacket(new PlayerMoveC2SPacket.PositionAndOnGround(mc.player.getX(), groundExtra, mc.player.getZ(), true));


for(double posY = groundExtra; posY < mc.player.getY(); posY += 4D) {
for (double posY = groundExtra; posY < mc.player.getY(); posY += 4D) {
mc.getNetworkHandler().sendPacket(new PlayerMoveC2SPacket.PositionAndOnGround(mc.player.getX(), posY, mc.player.getZ(), mc.player.isOnGround()));

if(posY + 4D > mc.player.getY()) break; // Prevent next step
if (posY + 4D > mc.player.getY()) break; // Prevent next step
}

mc.getNetworkHandler().sendPacket(new PlayerMoveC2SPacket.PositionAndOnGround(mc.player.getX(), mc.player.getY(), mc.player.getZ(), mc.player.isOnGround()));

break;
}
}
floatingTicks = 0;
}

if (PlayerUtils.isMoving()) {
double dir = getDir();

double xDir = Math.cos(Math.toRadians(dir + 90));
double zDir = Math.sin(Math.toRadians(dir + 90));

((IVec3d) event.movement).setXZ(xDir * speed.get(), zDir * speed.get());
}
else {
((IVec3d) event.movement).setXZ(0, 0);
}

float ySpeed = 0;

if (mc.options.jumpKey.isPressed())
ySpeed += speed.get();
if (mc.options.sneakKey.isPressed())
ySpeed -= speed.get();
((IVec3d) event.movement).setY(verticalSpeedMatch.get() ? ySpeed : ySpeed/2);
float ySpeed = RejectsUtils.fullFlightMove(event, speed.get(), verticalSpeedMatch.get());

if (floatingTicks < 20)
if (ySpeed >= -0.1)
Expand All @@ -234,5 +196,4 @@ public enum AntiKickMode {
PaperNew,
None
}

}
76 changes: 21 additions & 55 deletions src/main/java/anticope/rejects/modules/FullNoClip.java
Original file line number Diff line number Diff line change
@@ -1,73 +1,39 @@
package anticope.rejects.modules;

import anticope.rejects.MeteorRejectsAddon;
import anticope.rejects.utils.RejectsUtils;
import meteordevelopment.meteorclient.events.entity.player.PlayerMoveEvent;
import meteordevelopment.meteorclient.mixininterface.IVec3d;
import meteordevelopment.meteorclient.settings.BoolSetting;
import meteordevelopment.meteorclient.settings.DoubleSetting;
import meteordevelopment.meteorclient.settings.Setting;
import meteordevelopment.meteorclient.settings.SettingGroup;
import meteordevelopment.meteorclient.systems.modules.Module;
import meteordevelopment.meteorclient.settings.*;
import meteordevelopment.meteorclient.utils.Utils;
import meteordevelopment.meteorclient.utils.player.PlayerUtils;
import meteordevelopment.orbit.EventHandler;
import net.minecraft.util.shape.VoxelShapes;

public class FullNoClip extends Module {
private final SettingGroup sgGeneral = settings.getDefaultGroup();
private final Setting<Double> speed = sgGeneral.add(new DoubleSetting.Builder()
.name("speed")
.description("Your speed when noclipping.")
.defaultValue(0.3)
.min(0.0)
.sliderMax(10)
.build()
.name("speed")
.description("Your speed when noclipping.")
.defaultValue(0.3)
.min(0.0)
.sliderMax(10)
.build()
);

private final Setting<Boolean> verticalSpeedMatch = sgGeneral.add(new BoolSetting.Builder()
.name("vertical-speed-match")
.description("Matches your vertical speed to your horizontal speed, otherwise uses vanilla ratio.")
.defaultValue(false)
.build()
.name("vertical-speed-match")
.description("Matches your vertical speed to your horizontal speed, otherwise uses vanilla ratio.")
.defaultValue(false)
.build()
);

public FullNoClip() {
super(MeteorRejectsAddon.CATEGORY, "fullnoclip", "FullNoClip.");
}

private double getDir() {
double dir = 0;

if (Utils.canUpdate()) {
dir = mc.player.getYaw() + ((mc.player.forwardSpeed < 0) ? 180 : 0);

if (mc.player.sidewaysSpeed > 0) {
dir += -90F * ((mc.player.forwardSpeed < 0) ? -0.5F : ((mc.player.forwardSpeed > 0) ? 0.5F : 1F));
} else if (mc.player.sidewaysSpeed < 0) {
dir += 90F * ((mc.player.forwardSpeed < 0) ? -0.5F : ((mc.player.forwardSpeed > 0) ? 0.5F : 1F));
}
}
return dir;
public FullNoClip() {
super(MeteorRejectsAddon.CATEGORY, "fullnoclip", "FullNoClip.");
}

@EventHandler
private void onPlayerMove(PlayerMoveEvent event) {
if (PlayerUtils.isMoving()) {
double dir = getDir();

double xDir = Math.cos(Math.toRadians(dir + 90));
double zDir = Math.sin(Math.toRadians(dir + 90));

((IVec3d) event.movement).setXZ(xDir * speed.get(), zDir * speed.get());
}
else {
((IVec3d) event.movement).setXZ(0, 0);
}

float ySpeed = 0;

if (mc.options.jumpKey.isPressed())
ySpeed += speed.get();
if (mc.options.sneakKey.isPressed())
ySpeed -= speed.get();
((IVec3d) event.movement).setY(verticalSpeedMatch.get() ? ySpeed : ySpeed/2);
}

RejectsUtils.fullFlightMove(event, speed.get(), verticalSpeedMatch.get());
}
}
Loading

0 comments on commit 950dece

Please sign in to comment.