Added Shield Bypass
This commit is contained in:
committed by
Cloudburst
parent
060bb68f30
commit
eec81e1025
@@ -72,6 +72,7 @@ public class MeteorRejectsAddon extends MeteorAddon {
|
||||
modules.add(new PacketFly());
|
||||
modules.add(new Painter());
|
||||
modules.add(new Rendering());
|
||||
modules.add(new ShieldBypass());
|
||||
modules.add(new SilentDisconnect());
|
||||
modules.add(new SkeletonESP());
|
||||
modules.add(new SoundLocator());
|
||||
|
||||
@@ -11,7 +11,7 @@ import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||
|
||||
@Mixin(ClientPlayerInteractionManager.class)
|
||||
public class ClientPlayerInteractionManagerMixin {
|
||||
@Inject(at = @At("HEAD"), method = "stopUsingItem")
|
||||
@Inject(method = "stopUsingItem", at = @At("HEAD"))
|
||||
public void onStopUsingItem(PlayerEntity player, CallbackInfo ci) {
|
||||
MeteorClient.EVENT_BUS.post(StopUsingItemEvent.get(player.getInventory().getMainHandStack()));
|
||||
}
|
||||
|
||||
71
src/main/java/anticope/rejects/modules/ShieldBypass.java
Normal file
71
src/main/java/anticope/rejects/modules/ShieldBypass.java
Normal file
@@ -0,0 +1,71 @@
|
||||
package anticope.rejects.modules;
|
||||
|
||||
import anticope.rejects.MeteorRejectsAddon;
|
||||
import meteordevelopment.meteorclient.events.entity.player.AttackEntityEvent;
|
||||
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.meteorclient.utils.player.Rotations;
|
||||
import meteordevelopment.orbit.EventHandler;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.LivingEntity;
|
||||
import net.minecraft.item.Items;
|
||||
import net.minecraft.util.math.Vec3d;
|
||||
|
||||
public class ShieldBypass extends Module {
|
||||
private final SettingGroup sgGeneral = settings.getDefaultGroup();
|
||||
|
||||
private final Setting<Boolean> rotate = sgGeneral.add(new BoolSetting.Builder()
|
||||
.name("rotate")
|
||||
.description("Rotate towards enemy. Disable if killaura enabled.")
|
||||
.defaultValue(true)
|
||||
.build()
|
||||
);
|
||||
|
||||
public ShieldBypass() {
|
||||
super(MeteorRejectsAddon.CATEGORY, "shield-bypass", "Attempts to teleport you behind enemies to bypass shields.");
|
||||
}
|
||||
|
||||
private Vec3d originalPos;
|
||||
private Entity target;
|
||||
|
||||
@Override
|
||||
public void onDeactivate() {
|
||||
originalPos = null;
|
||||
target = null;
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
private void onTick(TickEvent.Post event) {
|
||||
if (originalPos != null && target != null) {
|
||||
mc.interactionManager.attackEntity(mc.player, target);
|
||||
mc.player.setPosition(originalPos);
|
||||
if (rotate.get()) Rotations.rotate(-mc.player.getYaw(), mc.player.getPitch());
|
||||
}
|
||||
originalPos = null;
|
||||
target = null;
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
private void onAttackEntity(AttackEntityEvent event) {
|
||||
if (event.entity instanceof LivingEntity e && e.getMainHandStack().getItem() == Items.SHIELD && e.isBlocking()) {
|
||||
if (originalPos != null) return;
|
||||
|
||||
originalPos = mc.player.getPos();
|
||||
|
||||
Vec3d targetPos = e.getPos();
|
||||
|
||||
Vec3d vec3d3 = originalPos.relativize(targetPos).normalize();
|
||||
|
||||
if (new Vec3d(vec3d3.x, 0.0d, vec3d3.z).dotProduct(e.getRotationVec(1.0f)) >= 0.0d) return;
|
||||
|
||||
Vec3d tp = Vec3d.fromPolar(0, mc.player.getYaw()).normalize().multiply(mc.player.distanceTo(e));
|
||||
mc.player.setPosition(targetPos.x + tp.x, targetPos.y, targetPos.z + tp.z);
|
||||
if (rotate.get()) Rotations.rotate(-mc.player.getYaw(), mc.player.getPitch());
|
||||
target = e;
|
||||
event.cancel();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,12 +1,8 @@
|
||||
package anticope.rejects.settings;
|
||||
|
||||
import meteordevelopment.meteorclient.gui.DefaultSettingsWidgetFactory;
|
||||
import meteordevelopment.meteorclient.gui.GuiTheme;
|
||||
import meteordevelopment.meteorclient.gui.renderer.GuiRenderer;
|
||||
import meteordevelopment.meteorclient.gui.screens.settings.EntityTypeListSettingScreen;
|
||||
import meteordevelopment.meteorclient.gui.utils.SettingsWidgetFactory;
|
||||
import meteordevelopment.meteorclient.gui.widgets.containers.WContainer;
|
||||
import meteordevelopment.meteorclient.gui.widgets.containers.WHorizontalList;
|
||||
import meteordevelopment.meteorclient.gui.widgets.containers.WTable;
|
||||
import meteordevelopment.meteorclient.gui.widgets.pressable.WButton;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user