0% found this document useful (0 votes)
4 views

Message

Uploaded by

sasha5581.70.7
Copyright
© © All Rights Reserved
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views

Message

Uploaded by

sasha5581.70.7
Copyright
© © All Rights Reserved
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 7

package me.aristhena.client.module.modules.combat.

aura;

import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.Iterator;
import java.util.List;
import me.aristhena.client.module.Module;
import me.aristhena.client.module.modules.combat.Aura;
import me.aristhena.client.module.modules.combat.AutoPot;
import me.aristhena.client.module.modules.movement.NoSlowdown;
import me.aristhena.client.module.modules.movement.Speed;
import me.aristhena.client.module.modules.movement.speed.Bhop;
import me.aristhena.event.Event;
import me.aristhena.event.events.UpdateEvent;
import me.aristhena.utils.ClientUtils;
import me.aristhena.utils.RotationUtils;
import me.aristhena.utils.StateManager;
import me.aristhena.utils.Timer;
import net.minecraft.enchantment.EnchantmentHelper;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.item.ItemStack;
import net.minecraft.item.ItemSword;
import net.minecraft.network.play.client.C02PacketUseEntity;
import net.minecraft.network.play.client.C03PacketPlayer;
import net.minecraft.network.play.client.C07PacketPlayerDigging;
import net.minecraft.potion.Potion;
import net.minecraft.util.BlockPos;
import net.minecraft.util.EnumFacing;

public class Tick extends AuraMode {


private boolean setupTick;
private EntityLivingBase target;
private Timer timer = new Timer();
private boolean secondAttack;
private boolean swapTargetItTurnedIntoAMessyThingFUCK;
public static boolean cancelNext;
private UpdateEvent preUpdate;
// $FF: synthetic field
private static int[] $SWITCH_TABLE$me$chrest$event$Event$State;

public Tick(String name, boolean value, Module module) {


super(name, value, module);
}

public boolean enable() {


if (super.enable()) {
this.target = null;
}

return super.enable();
}

public boolean onUpdate(UpdateEvent event) {


if (super.onUpdate(event)) {
if (event.getState().equals(Event.State.PRE)) {
this.preUpdate = event;
}
Aura auraModule;
switch($SWITCH_TABLE$me$chrest$event$Event$State()
[event.getState().ordinal()]) {
case 1:
StateManager.setOffsetLastPacketAura(false);
auraModule = (Aura)this.getModule();
NoSlowdown noSlowdownModule = (NoSlowdown)(new
NoSlowdown()).getInstance();
if (this.target == null) {
this.timer.reset();
this.target = this.getTarget();
}

this.lowerTicks();
double oldRange = auraModule.range;
auraModule.range = auraModule.blockRange;
int nearbyEntitiesBlock = 0;
Iterator var8 = ClientUtils.loadedEntityList().iterator();

while(var8.hasNext()) {
Entity entity = (Entity)var8.next();
if (auraModule.isEntityValid(entity)) {
++nearbyEntitiesBlock;
}
}

auraModule.range = oldRange;
int nearbyEntities = 0;
Iterator var9 = ClientUtils.loadedEntityList().iterator();

while(var9.hasNext()) {
Entity entity2 = (Entity)var9.next();
if (auraModule.isEntityValid(entity2)) {
++nearbyEntities;
}
}

if (nearbyEntitiesBlock > 0 && auraModule.autoblock &&


ClientUtils.player().getCurrentEquippedItem() != null &&
ClientUtils.player().getCurrentEquippedItem().getItem() instanceof ItemSword) {

ClientUtils.playerController().sendUseItem(ClientUtils.player(),
ClientUtils.world(), ClientUtils.player().getCurrentEquippedItem());
if (!noSlowdownModule.isEnabled() && auraModule.noslowdown) {
ClientUtils.packet(new
C07PacketPlayerDigging(C07PacketPlayerDigging.Action.RELEASE_USE_ITEM,
BlockPos.ORIGIN, EnumFacing.DOWN));
}
}

if (this.target != null) {
float[] rotations = RotationUtils.getRotations(this.target);
event.setYaw(rotations[0]);
event.setPitch(rotations[1]);
}

boolean criticals = auraModule.criticals && !auraModule.dura;


if (this.setupTick) {
if (nearbyEntities > 0 && criticals &&
ClientUtils.player().isCollidedVertically && this.bhopCheck()) {
StateManager.setOffsetLastPacketAura(true);
event.setY(event.getY() + 0.07D);
event.setGround(false);
}
} else {
if (nearbyEntities > 0 && criticals &&
ClientUtils.player().isCollidedVertically && this.bhopCheck()) {
event.setGround(false);
event.setAlwaysSend(true);
}

if (ClientUtils.player().fallDistance > 0.0F &&


(double)ClientUtils.player().fallDistance < 0.66D) {
event.setGround(true);
}
}

this.setupTick = !this.setupTick;
break;
case 2:
auraModule = (Aura)this.getModule();
EntityLivingBase target2;
if (this.target != null && auraModule.isEntityValid(this.target)
&& this.secondAttack && AutoPot.timer.getDifference() >= 550L) {
if (!AutoPot.potting && this.preUpdate.getPitch() ==
RotationUtils.getRotations(this.target)[1]) {
if (!auraModule.dura && ClientUtils.player().isBlocking())
{
ClientUtils.packet(new
C07PacketPlayerDigging(C07PacketPlayerDigging.Action.RELEASE_USE_ITEM,
BlockPos.ORIGIN, EnumFacing.DOWN));
}

if (auraModule.dura &&
ClientUtils.player().inventory.getItemStack() == null) {
this.attack(this.target, false);
this.attack(this.target, true);
cancelNext = true;

ClientUtils.playerController().windowClick(ClientUtils.player().inventoryContainer.
windowId, -999, 0, 5, ClientUtils.player());

ClientUtils.playerController().windowClick(ClientUtils.player().inventoryContainer.
windowId, 36 + ClientUtils.player().inventory.currentItem, 1, 5,
ClientUtils.player());

ClientUtils.playerController().windowClick(ClientUtils.player().inventoryContainer.
windowId, -999, 2, 5, ClientUtils.player());
this.attack(this.target, false);
this.attack(this.target, true);
} else if (auraModule.dura) {
// Убираем выброс меча здесь
this.attack(this.target, false);
this.attack(this.target, true);
cancelNext = true;
} else {
auraModule.attack(this.target);
}

this.swapTargetItTurnedIntoAMessyThingFUCK = true;
AutoPot.potNextCompat = true;
} else {
target2 = this.target;
++target2.auraTicks;
}
}

if (this.secondAttack && AutoPot.timer.getDifference() >= 550L) {


this.secondAttack = false;
}

if (this.target != null && auraModule.isEntityValid(this.target)


&& (this.target.auraTicks <= 10 || this.target.auraTicks <= 0) && this.setupTick) {
if (AutoPot.potting) {
target2 = this.target;
++target2.auraTicks;
} else {
if (!auraModule.dura) {
auraModule.attack(this.target);
if (this.target.auraTicks <= 0) {
auraModule.attack(this.target);
this.swapTargetItTurnedIntoAMessyThingFUCK = true;
AutoPot.potNextCompat = true;
} else {
this.secondAttack = true;
}
} else {
this.secondAttack = true;
}

this.target.auraTicks = 20;
}
}

if (AutoPot.swapTarget && this.timer.delay(450.0F) ||


this.timer.delay(450.0F) && (this.swapTargetItTurnedIntoAMessyThingFUCK ||
this.target == null || !auraModule.isEntityValid(this.target)) && !
this.secondAttack) {
AutoPot.swapTarget = false;
this.timer.reset();
this.swapTargetItTurnedIntoAMessyThingFUCK = false;
this.target = this.getTarget();
}
}
}

return true;
}

private void attack(EntityLivingBase ent, boolean crit) {


Aura auraModule = (Aura)this.getModule();
auraModule.swingItem();
if (crit) {
this.crit();
} else {
ClientUtils.packet(new C03PacketPlayer(true));
}

float sharpLevel =
EnchantmentHelper.func_152377_a(ClientUtils.player().getHeldItem(),
ent.getCreatureAttribute());
boolean vanillaCrit = ClientUtils.player().fallDistance > 0.0F && !
ClientUtils.player().onGround && !ClientUtils.player().isOnLadder() && !
ClientUtils.player().isInWater() && !
ClientUtils.player().isPotionActive(Potion.blindness) &&
ClientUtils.player().ridingEntity == null;
ClientUtils.packet(new C02PacketUseEntity(ent,
C02PacketUseEntity.Action.ATTACK));
if (crit || vanillaCrit) {
ClientUtils.player().onCriticalHit(ent);
}

if (sharpLevel > 0.0F) {


ClientUtils.player().onEnchantmentCritical(ent);
}

private void crit() {


if (ClientUtils.player().isCollidedVertically) {
ClientUtils.packet(new
C03PacketPlayer.C04PacketPlayerPosition(ClientUtils.x(), ClientUtils.y() + 0.0624D,
ClientUtils.z(), true));
ClientUtils.packet(new
C03PacketPlayer.C04PacketPlayerPosition(ClientUtils.x(), ClientUtils.y(),
ClientUtils.z(), false));
ClientUtils.packet(new
C03PacketPlayer.C04PacketPlayerPosition(ClientUtils.x(), ClientUtils.y() + 1.11E-
4D, ClientUtils.z(), false));
ClientUtils.packet(new
C03PacketPlayer.C04PacketPlayerPosition(ClientUtils.x(), ClientUtils.y(),
ClientUtils.z(), false));
}

protected void swap(int slot, int hotbarNum) {

ClientUtils.playerController().windowClick(ClientUtils.player().inventoryContainer.
windowId, slot, hotbarNum, 2, ClientUtils.player());
}

private boolean bhopCheck() {


if ((new Speed()).getInstance().isEnabled() && (Boolean)((Speed)(new
Speed()).getInstance()).bhop.getValue()) {
if (ClientUtils.player().moveForward != 0.0F ||
ClientUtils.player().moveStrafing != 0.0F) {
return false;
}

Bhop.stage = -4;
}

return true;
}
private EntityLivingBase getTarget() {
List<EntityLivingBase> targets = new ArrayList();
Aura auraModule = (Aura)this.getModule();
Iterator var4 = ClientUtils.loadedEntityList().iterator();

while(true) {
EntityLivingBase entity;
do {
Entity ent;
do {
if (!var4.hasNext()) {
Collections.sort(targets, new
Comparator<EntityLivingBase>() {
public int compare(EntityLivingBase o1, EntityLivingBase
o2) {
return o1.auraTicks - o2.auraTicks;
}
});
if (targets.isEmpty()) {
return null;
}

return (EntityLivingBase)targets.get(0);
}

ent = (Entity)var4.next();
} while(!(ent instanceof EntityLivingBase));

entity = (EntityLivingBase)ent;
} while((entity.auraTicks > 11 || this.setupTick) &&
(entity.auraTicks > 10 || !this.setupTick) && entity.auraTicks > 0);

if (((Aura)this.getModule()).isEntityValid(entity)) {
targets.add(entity);
}
}
}

private void lowerTicks() {


Iterator var2 = ClientUtils.loadedEntityList().iterator();

while(var2.hasNext()) {
Entity ent = (Entity)var2.next();
if (ent instanceof EntityLivingBase) {
EntityLivingBase entityLivingBase = (EntityLivingBase)ent;
--entityLivingBase.auraTicks;
}
}

public boolean disable() {


cancelNext = false;
return super.enable();
}

// $FF: synthetic method


static int[] $SWITCH_TABLE$me$chrest$event$Event$State() {
int[] var10000 = $SWITCH_TABLE$me$chrest$event$Event$State;
if (var10000 != null) {
return var10000;
} else {
int[] var0 = new int[Event.State.values().length];

try {
var0[Event.State.POST.ordinal()] = 2;
} catch (NoSuchFieldError var2) {
}

try {
var0[Event.State.PRE.ordinal()] = 1;
} catch (NoSuchFieldError var1) {
}

$SWITCH_TABLE$me$chrest$event$Event$State = var0;
return var0;
}
}
}

You might also like