Some code formatting and VehicleOneHit (#258)
This commit is contained in:
@@ -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");
|
||||
@@ -50,29 +49,14 @@ public class FullFlight extends Module {
|
||||
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;
|
||||
@@ -111,7 +95,8 @@ public class FullFlight extends Module {
|
||||
|
||||
@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) {
|
||||
@@ -151,8 +136,7 @@ public class FullFlight extends Module {
|
||||
// Resend movement packets
|
||||
((ClientPlayerEntityAccessor) mc.player).setTicksSinceLastPositionPacketSent(20);
|
||||
}
|
||||
if (floatingTicks >= 20)
|
||||
{
|
||||
if (floatingTicks >= 20) {
|
||||
switch (antiKickMode.get()) {
|
||||
case New -> {
|
||||
Box box = mc.player.getBoundingBox();
|
||||
@@ -160,12 +144,10 @@ public class FullFlight extends Module {
|
||||
|
||||
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();
|
||||
@@ -173,53 +155,33 @@ public class FullFlight extends Module {
|
||||
|
||||
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)
|
||||
@@ -234,5 +196,4 @@ public class FullFlight extends Module {
|
||||
PaperNew,
|
||||
None
|
||||
}
|
||||
|
||||
}
|
||||
@@ -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());
|
||||
}
|
||||
}
|
||||
@@ -3,34 +3,28 @@ package anticope.rejects.modules;
|
||||
import anticope.rejects.MeteorRejectsAddon;
|
||||
import meteordevelopment.meteorclient.events.packets.PacketEvent;
|
||||
import meteordevelopment.meteorclient.mixininterface.IPlayerInteractEntityC2SPacket;
|
||||
import meteordevelopment.meteorclient.mixininterface.IVec3d;
|
||||
import meteordevelopment.meteorclient.settings.BoolSetting;
|
||||
import meteordevelopment.meteorclient.settings.Setting;
|
||||
import meteordevelopment.meteorclient.settings.SettingGroup;
|
||||
import meteordevelopment.meteorclient.systems.modules.Categories;
|
||||
import meteordevelopment.meteorclient.systems.modules.Module;
|
||||
import meteordevelopment.meteorclient.systems.modules.Modules;
|
||||
import meteordevelopment.meteorclient.systems.modules.combat.KillAura;
|
||||
import meteordevelopment.orbit.EventHandler;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.LivingEntity;
|
||||
import net.minecraft.network.packet.c2s.play.PlayerInteractEntityC2SPacket;
|
||||
import net.minecraft.network.packet.c2s.play.ClientCommandC2SPacket;
|
||||
import net.minecraft.network.packet.c2s.play.PlayerInteractEntityC2SPacket;
|
||||
|
||||
public class KnockbackPlus extends Module {
|
||||
|
||||
private final SettingGroup sgGeneral = settings.getDefaultGroup();
|
||||
|
||||
private final Setting<Boolean> ka = sgGeneral.add(new BoolSetting.Builder()
|
||||
.name("only-killaura")
|
||||
.description("Only perform more KB when using killaura.")
|
||||
.defaultValue(false)
|
||||
.build()
|
||||
.name("only-killaura")
|
||||
.description("Only perform more KB when using killaura.")
|
||||
.defaultValue(false)
|
||||
.build()
|
||||
);
|
||||
|
||||
private PlayerInteractEntityC2SPacket attackPacket;
|
||||
private boolean sendPackets;
|
||||
private int sendTimer;
|
||||
public KnockbackPlus() {
|
||||
super(MeteorRejectsAddon.CATEGORY, "knockback-plus", "Performs more KB when you hit your target.");
|
||||
}
|
||||
@@ -38,17 +32,12 @@ public class KnockbackPlus extends Module {
|
||||
@EventHandler
|
||||
private void onSendPacket(PacketEvent.Send event) {
|
||||
if (event.packet instanceof IPlayerInteractEntityC2SPacket packet && packet.getType() == PlayerInteractEntityC2SPacket.InteractType.ATTACK) {
|
||||
|
||||
Entity entity = packet.getEntity();
|
||||
|
||||
if (!(entity instanceof LivingEntity) || (entity != Modules.get().get(KillAura.class).getTarget() && ka.get())) return;
|
||||
sendPacket();
|
||||
if (!(entity instanceof LivingEntity) || (entity != Modules.get().get(KillAura.class).getTarget() && ka.get()))
|
||||
return;
|
||||
|
||||
mc.player.networkHandler.sendPacket(new ClientCommandC2SPacket(mc.player, ClientCommandC2SPacket.Mode.START_SPRINTING));
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
private void sendPacket() {
|
||||
ClientCommandC2SPacket packet = new ClientCommandC2SPacket(mc.player, ClientCommandC2SPacket.Mode.START_SPRINTING);
|
||||
mc.player.networkHandler.sendPacket(packet);
|
||||
}
|
||||
}
|
||||
|
||||
48
src/main/java/anticope/rejects/modules/VehicleOneHit.java
Normal file
48
src/main/java/anticope/rejects/modules/VehicleOneHit.java
Normal file
@@ -0,0 +1,48 @@
|
||||
package anticope.rejects.modules;
|
||||
|
||||
|
||||
import meteordevelopment.meteorclient.events.packets.PacketEvent;
|
||||
import meteordevelopment.meteorclient.settings.IntSetting;
|
||||
import meteordevelopment.meteorclient.settings.Setting;
|
||||
import meteordevelopment.meteorclient.settings.SettingGroup;
|
||||
import meteordevelopment.meteorclient.systems.modules.Categories;
|
||||
import meteordevelopment.meteorclient.systems.modules.Module;
|
||||
import meteordevelopment.orbit.EventHandler;
|
||||
import net.minecraft.entity.vehicle.AbstractMinecartEntity;
|
||||
import net.minecraft.entity.vehicle.BoatEntity;
|
||||
import net.minecraft.network.packet.c2s.play.PlayerInteractEntityC2SPacket;
|
||||
import net.minecraft.util.hit.EntityHitResult;
|
||||
|
||||
public class VehicleOneHit extends Module {
|
||||
private final SettingGroup sgGeneral = settings.getDefaultGroup();
|
||||
|
||||
private final Setting<Integer> amount = sgGeneral.add(new IntSetting.Builder()
|
||||
.name("amount")
|
||||
.description("The number of packets to send.")
|
||||
.defaultValue(16)
|
||||
.range(1, 100)
|
||||
.sliderRange(1, 20)
|
||||
.build()
|
||||
);
|
||||
|
||||
private boolean ignorePackets;
|
||||
|
||||
public VehicleOneHit() {
|
||||
super(Categories.Player, "vehicle-one-hit", "Destroy vehicles with one hit.");
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
private void onPacketSend(PacketEvent.Send event) {
|
||||
if (ignorePackets
|
||||
|| !(event.packet instanceof PlayerInteractEntityC2SPacket)
|
||||
|| !(mc.crosshairTarget instanceof EntityHitResult ehr)
|
||||
|| (!(ehr.getEntity() instanceof AbstractMinecartEntity) && !(ehr.getEntity() instanceof BoatEntity))
|
||||
) return;
|
||||
|
||||
ignorePackets = true;
|
||||
for (int i = 0; i < amount.get() - 1; i++) {
|
||||
mc.player.networkHandler.sendPacket(event.packet);
|
||||
}
|
||||
ignorePackets = false;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user