1
0
mirror of https://github.com/kami-blue/client synced 2025-02-14 19:27:01 +00:00

32k Auto Switch for Aura

This commit is contained in:
blockparole 2019-08-06 01:17:06 +02:00
parent 80577a7ce0
commit 43dd9c305b

View File

@ -13,6 +13,9 @@ import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Items;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.nbt.NBTTagList;
import net.minecraft.util.EnumHand;
import net.minecraft.util.math.Vec3d;
@ -20,6 +23,7 @@ import java.util.Iterator;
/**
* Created by 086 on 12/12/2017.
* Last Updated 5 August 2019 by hub
*/
@Module.Info(name = "Aura", category = Module.Category.COMBAT, description = "Hits entities around you")
public class Aura extends Module {
@ -30,33 +34,55 @@ public class Aura extends Module {
private Setting<Double> range = register(Settings.d("Range", 5.5d));
private Setting<Boolean> wait = register(Settings.b("Wait", true));
private Setting<Boolean> walls = register(Settings.b("Walls", false));
private Setting<Boolean> sharpness = register(Settings.b("32k Switch", false));
@Override
public void onUpdate() {
if (mc.player.isDead) return;
if (mc.player.isDead) {
return;
}
boolean shield = mc.player.getHeldItemOffhand().getItem().equals(Items.SHIELD) && mc.player.getActiveHand() == EnumHand.OFF_HAND;
if (mc.player.isHandActive() && !shield) return;
if (mc.player.isHandActive() && !shield) {
return;
}
if (wait.getValue())
if (mc.player.getCooledAttackStrength(getLagComp()) < 1) return;
else if (mc.player.ticksExisted % 2 != 0) return;
if (wait.getValue()) {
if (mc.player.getCooledAttackStrength(getLagComp()) < 1) {
return;
} else if (mc.player.ticksExisted % 2 != 0) {
return;
}
}
Iterator<Entity> entityIterator = Minecraft.getMinecraft().world.loadedEntityList.iterator();
while (entityIterator.hasNext()) {
Entity target = entityIterator.next();
if (!EntityUtil.isLiving(target)) continue;
if (target == mc.player) continue;
if (mc.player.getDistance(target) > range.getValue()) continue;
if (((EntityLivingBase) target).getHealth() <= 0) continue;
if (((EntityLivingBase) target).hurtTime != 0 && wait.getValue()) continue;
if (!walls.getValue() && (!mc.player.canEntityBeSeen(target) && !canEntityFeetBeSeen(target)))
if (!EntityUtil.isLiving(target)) {
continue;
}
if (target == mc.player) {
continue;
}
if (mc.player.getDistance(target) > range.getValue()) {
continue;
}
if (((EntityLivingBase) target).getHealth() <= 0) {
continue;
}
if (((EntityLivingBase) target).hurtTime != 0 && wait.getValue()) {
continue;
}
if (!walls.getValue() && (!mc.player.canEntityBeSeen(target) && !canEntityFeetBeSeen(target))) {
continue; // If walls is on & you can't see the feet or head of the target, skip. 2 raytraces needed
}
if (players.getValue() && target instanceof EntityPlayer && !Friends.isFriend(target.getName())) {
attack(target);
return;
} else {
if (EntityUtil.isPassive(target) ? animals.getValue() : (EntityUtil.isMobAggressive(target) && mobs.getValue())) {
if (ModuleManager.isModuleEnabled("AutoTool")) AutoTool.equipBestWeapon();
if (ModuleManager.isModuleEnabled("AutoTool")) {
AutoTool.equipBestWeapon();
}
attack(target);
return;
}
@ -64,14 +90,72 @@ public class Aura extends Module {
}
}
private boolean checkSharpness(ItemStack stack) {
if (stack.getTagCompound() == null) {
return false;
}
NBTTagList enchants = (NBTTagList) stack.getTagCompound().getTag("ench");
if (enchants == null) {
return false;
}
for (int i = 0; i < enchants.tagCount(); i++) {
NBTTagCompound enchant = ((NBTTagList) enchants).getCompoundTagAt(i);
if (enchant.getInteger("id") == 16) {
int lvl = enchant.getInteger("lvl");
if (lvl >= 16) {
return true;
}
break;
}
}
return false;
}
private void attack(Entity e) {
if (sharpness.getValue()) {
if (!checkSharpness(mc.player.getHeldItemMainhand())) {
int newSlot = -1;
for (int i = 0; i < 9; i++) {
ItemStack stack = mc.player.inventory.getStackInSlot(i);
if (stack == ItemStack.EMPTY) {
continue;
}
if (checkSharpness(stack)) {
newSlot = i;
break;
}
}
if (newSlot == -1) {
return;
}
mc.player.inventory.currentItem = newSlot;
}
}
mc.playerController.attackEntity(mc.player, e);
mc.player.swingArm(EnumHand.MAIN_HAND);
}
private float getLagComp() {
if (wait.getValue())
if (wait.getValue()) {
return -(20 - LagCompensator.INSTANCE.getTickRate());
}
return 0.0F;
}