Search in sources :

Example 1 with AutoArmor

use of me.earth.earthhack.impl.modules.combat.autoarmor.AutoArmor in project 3arthh4ck by 3arthqu4ke.

the class ListenerMotion method invoke.

@Override
public void invoke(MotionUpdateEvent event) {
    if (!module.timer.passed(module.delay.getValue()) || !module.sort.getValue() || event.getStage() != Stage.PRE || !Managers.NCP.getClickTimer().passed(module.globalDelay.getValue()) || mc.player.isCreative() || !InventoryUtil.validScreen() || AUTO_ARMOR.returnIfPresent(AutoArmor::isActive, false) || !module.sortInInv.getValue() && mc.currentScreen instanceof GuiInventory || !module.sortInLoot.getValue() && !mc.world.getEntitiesWithinAABB(EntityItem.class, RotationUtil.getRotationPlayer().getEntityBoundingBox()).isEmpty() || CLEANER.isEnabled() && !CLEANER.get().getTimer().passed(CLEANER.get().getDelay() * 3L)) {
        return;
    }
    InventoryLayout layout = module.current;
    if (layout == null) {
        return;
    }
    Item fallbackItem = null;
    Item otherFallbackItem = null;
    int fallback = -1;
    int otherFallback = -1;
    boolean emptyFallback = false;
    Set<Item> missing = new HashSet<>();
    for (int i = 44; i > 8; i--) {
        ItemStack s = InventoryUtil.get(i);
        Item shouldBeHere = layout.getItem(i);
        if (shouldBeHere == s.getItem() || shouldBeHere == Items.AIR || missing.contains(shouldBeHere)) {
            continue;
        }
        int slot = getSlot(shouldBeHere, s.getItem(), i, missing, layout);
        if (slot == -2) {
            return;
        } else if (slot != -1 && (fallback == -1 || !emptyFallback && s.isEmpty())) {
            fallback = slot;
            otherFallback = i;
            emptyFallback = s.isEmpty();
            fallbackItem = InventoryUtil.get(i).getItem();
            otherFallbackItem = shouldBeHere;
        }
    }
    if (fallback != -1) {
        click(fallback, otherFallback, fallbackItem, otherFallbackItem);
        module.timer.reset();
    }
}
Also used : EntityItem(net.minecraft.entity.item.EntityItem) Item(net.minecraft.item.Item) ItemStack(net.minecraft.item.ItemStack) GuiInventory(net.minecraft.client.gui.inventory.GuiInventory) EntityItem(net.minecraft.entity.item.EntityItem) AutoArmor(me.earth.earthhack.impl.modules.combat.autoarmor.AutoArmor) HashSet(java.util.HashSet)

Example 2 with AutoArmor

use of me.earth.earthhack.impl.modules.combat.autoarmor.AutoArmor in project 3arthh4ck by 3arthqu4ke.

the class ModuleManager method init.

public void init() {
    Earthhack.getLogger().info("Initializing Modules.");
    this.forceRegister(new AutoConfig());
    this.forceRegister(new ClickGui());
    this.forceRegister(new Colors());
    this.forceRegister(new Commands());
    this.forceRegister(new Debug());
    this.forceRegister(new FontMod());
    this.forceRegister(new HUD());
    this.forceRegister(new Management());
    this.forceRegister(new Notifications());
    this.forceRegister(new Compatibility());
    this.forceRegister(new Safety());
    this.forceRegister(new ServerModule());
    this.forceRegister(new TabModule());
    this.forceRegister(new Media());
    this.forceRegister(new HudEditor());
    this.forceRegister(new AntiSurround());
    this.forceRegister(new AntiTrap());
    this.forceRegister(new Auto32k());
    this.forceRegister(new AnvilAura());
    this.forceRegister(new AutoArmor());
    this.forceRegister(new AutoCrystal());
    this.forceRegister(new AutoTrap());
    this.forceRegister(new BedBomb());
    this.forceRegister(new BowSpam());
    this.forceRegister(new BowKiller());
    this.forceRegister(new Criticals());
    this.forceRegister(new CrystalBomber());
    this.forceRegister(new HoleFiller());
    this.forceRegister(new KillAura());
    this.forceRegister(new LegSwitch());
    this.forceRegister(new Offhand());
    this.forceRegister(new PistonAura());
    this.forceRegister(new Surround());
    this.forceRegister(new Snowballer());
    this.forceRegister(new SelfTrap());
    this.forceRegister(new WebAura());
    this.forceRegister(new Announcer());
    this.forceRegister(new AntiAim());
    this.forceRegister(new AntiPackets());
    this.forceRegister(new AntiPotion());
    this.forceRegister(new AntiVanish());
    this.forceRegister(new AutoEat());
    this.forceRegister(new AutoFish());
    this.forceRegister(new AutoLog());
    this.forceRegister(new AutoReconnect());
    this.forceRegister(new AutoRespawn());
    this.forceRegister(new BuildHeight());
    this.forceRegister(new Chat());
    this.forceRegister(new ExtraTab());
    this.forceRegister(new Logger());
    this.forceRegister(new MCF());
    this.forceRegister(new MobOwner());
    this.forceRegister(new NoAFK());
    this.forceRegister(new NoHandShake());
    this.forceRegister(new NoInteract());
    this.forceRegister(new NoInterp());
    this.forceRegister(new NoSoundLag());
    this.forceRegister(new Nuker());
    this.forceRegister(new Packets());
    this.forceRegister(new PingSpoof());
    this.forceRegister(new Portals());
    this.forceRegister(new SettingSpoof());
    this.forceRegister(new SkinBlink());
    this.forceRegister(new Spammer());
    this.forceRegister(new ToolTips());
    this.forceRegister(new TpsSync());
    this.forceRegister(new Tracker());
    this.forceRegister(new TrueDurability());
    this.forceRegister(new AutoCraft());
    this.forceRegister(new AutoRegear());
    this.forceRegister(new PacketDelay());
    this.forceRegister(new RPC());
    this.forceRegister(new Anchor());
    this.forceRegister(new AutoSprint());
    this.forceRegister(new BlockLag());
    this.forceRegister(new BoatFly());
    this.forceRegister(new ElytraFlight());
    this.forceRegister(new EntityControl());
    this.forceRegister(new EntitySpeed());
    this.forceRegister(new FastSwim());
    this.forceRegister(new Flight());
    this.forceRegister(new HighJump());
    this.forceRegister(new ReverseStep());
    this.forceRegister(new IceSpeed());
    this.forceRegister(new Jesus());
    this.forceRegister(new LongJump());
    this.forceRegister(new NoFall());
    this.forceRegister(new NoMove());
    this.forceRegister(new NoSlowDown());
    this.forceRegister(new PacketFly());
    this.forceRegister(new Phase());
    this.forceRegister(new SafeWalk());
    this.forceRegister(new Speed());
    this.forceRegister(new Step());
    this.forceRegister(new Velocity());
    this.forceRegister(new AutoMine());
    this.forceRegister(new AutoTool());
    this.forceRegister(new Blink());
    this.forceRegister(new BlockTweaks());
    this.forceRegister(new Cleaner());
    this.forceRegister(new ExpTweaks());
    this.forceRegister(new FakePlayer());
    this.forceRegister(new FastPlace());
    this.forceRegister(new FastEat());
    this.forceRegister(new Freecam());
    this.forceRegister(new LiquidInteract());
    this.forceRegister(new MiddleClickPearl());
    this.forceRegister(new MultiTask());
    this.forceRegister(new NCPTweaks());
    this.forceRegister(new NoGlitchBlocks());
    this.forceRegister(new NoHunger());
    this.forceRegister(new InventorySync());
    this.forceRegister(new NoRotate());
    this.forceRegister(new Arrows());
    this.forceRegister(new RayTrace());
    this.forceRegister(new Reach());
    this.forceRegister(new Replenish());
    this.forceRegister(new Scaffold());
    this.forceRegister(new Sorter());
    this.forceRegister(new Spectate());
    this.forceRegister(new Speedmine());
    this.forceRegister(new Suicide());
    this.forceRegister(new Timer());
    this.forceRegister(new XCarry());
    this.forceRegister(new BlockHighlight());
    this.forceRegister(new BreadCrumbs());
    this.forceRegister(new Chams());
    this.forceRegister(new ESP());
    this.forceRegister(new Fullbright());
    this.forceRegister(new HoleESP());
    this.forceRegister(new LagOMeter());
    this.forceRegister(new LogoutSpots());
    this.forceRegister(new VoidESP());
    this.forceRegister(new Nametags());
    this.forceRegister(new NewChunks());
    this.forceRegister(new NoRender());
    this.forceRegister(new Search());
    this.forceRegister(new Skeleton());
    this.forceRegister(new Sounds());
    this.forceRegister(new Tracers());
    this.forceRegister(new CameraClip());
    this.forceRegister(new ViewModel());
    this.forceRegister(new XRay());
    this.forceRegister(new CrystalScale());
    this.forceRegister(new Trails());
    this.forceRegister(new Trajectories());
    this.forceRegister(new Penis());
    this.forceRegister(new WayPoints());
    this.forceRegister(new Weather());
    this.forceRegister(new HandChams());
    this.forceRegister(new CrystalChams());
    this.forceRegister(new RainbowEnchant());
    this.forceRegister(new Crosshair());
    this.forceRegister(new PopChams());
    this.forceRegister(new ItemChams());
    this.forceRegister(new Ambience());
    this.forceRegister(new PingBypass());
    Bus.EVENT_BUS.post(new PostInitEvent());
}
Also used : NoSlowDown(me.earth.earthhack.impl.modules.movement.noslowdown.NoSlowDown) AutoSprint(me.earth.earthhack.impl.modules.movement.autosprint.AutoSprint) NoHunger(me.earth.earthhack.impl.modules.player.nohunger.NoHunger) ElytraFlight(me.earth.earthhack.impl.modules.movement.elytraflight.ElytraFlight) Flight(me.earth.earthhack.impl.modules.movement.flight.Flight) AutoTrap(me.earth.earthhack.impl.modules.combat.autotrap.AutoTrap) NoMove(me.earth.earthhack.impl.modules.movement.antimove.NoMove) Auto32k(me.earth.earthhack.impl.modules.combat.autothirtytwok.Auto32k) NoInterp(me.earth.earthhack.impl.modules.misc.nointerp.NoInterp) Criticals(me.earth.earthhack.impl.modules.combat.criticals.Criticals) AntiPackets(me.earth.earthhack.impl.modules.misc.antipackets.AntiPackets) SafeWalk(me.earth.earthhack.impl.modules.movement.safewalk.SafeWalk) Announcer(me.earth.earthhack.impl.modules.misc.announcer.Announcer) AntiSurround(me.earth.earthhack.impl.modules.combat.antisurround.AntiSurround) Sorter(me.earth.earthhack.impl.modules.player.sorter.Sorter) EntityControl(me.earth.earthhack.impl.modules.movement.entitycontrol.EntityControl) EntitySpeed(me.earth.earthhack.impl.modules.movement.entityspeed.EntitySpeed) ToolTips(me.earth.earthhack.impl.modules.misc.tooltips.ToolTips) AutoReconnect(me.earth.earthhack.impl.modules.misc.autoreconnect.AutoReconnect) PacketDelay(me.earth.earthhack.impl.modules.misc.packetdelay.PacketDelay) FakePlayer(me.earth.earthhack.impl.modules.player.fakeplayer.FakePlayer) PostInitEvent(me.earth.earthhack.impl.event.events.client.PostInitEvent) Colors(me.earth.earthhack.impl.modules.client.colors.Colors) NoRotate(me.earth.earthhack.impl.modules.player.norotate.NoRotate) AntiTrap(me.earth.earthhack.impl.modules.combat.antitrap.AntiTrap) BuildHeight(me.earth.earthhack.impl.modules.misc.buildheight.BuildHeight) FastEat(me.earth.earthhack.impl.modules.player.fasteat.FastEat) NoAFK(me.earth.earthhack.impl.modules.misc.noafk.NoAFK) NoGlitchBlocks(me.earth.earthhack.impl.modules.player.noglitchblocks.NoGlitchBlocks) Compatibility(me.earth.earthhack.impl.modules.client.rotationbypass.Compatibility) InventorySync(me.earth.earthhack.impl.modules.player.noinventorydesync.InventorySync) AutoLog(me.earth.earthhack.impl.modules.misc.autolog.AutoLog) Spectate(me.earth.earthhack.impl.modules.player.spectate.Spectate) Fullbright(me.earth.earthhack.impl.modules.render.fullbright.Fullbright) Scaffold(me.earth.earthhack.impl.modules.player.scaffold.Scaffold) Logger(me.earth.earthhack.impl.modules.misc.logger.Logger) Suicide(me.earth.earthhack.impl.modules.player.suicide.Suicide) RainbowEnchant(me.earth.earthhack.impl.modules.render.rainbowenchant.RainbowEnchant) AnvilAura(me.earth.earthhack.impl.modules.combat.anvilaura.AnvilAura) ClickGui(me.earth.earthhack.impl.modules.client.clickgui.ClickGui) AntiVanish(me.earth.earthhack.impl.modules.misc.antivanish.AntiVanish) AutoFish(me.earth.earthhack.impl.modules.misc.autofish.AutoFish) Jesus(me.earth.earthhack.impl.modules.movement.jesus.Jesus) SettingSpoof(me.earth.earthhack.impl.modules.misc.settingspoof.SettingSpoof) Commands(me.earth.earthhack.impl.modules.client.commands.Commands) Chat(me.earth.earthhack.impl.modules.misc.chat.Chat) AutoMine(me.earth.earthhack.impl.modules.player.automine.AutoMine) TrueDurability(me.earth.earthhack.impl.modules.misc.truedurability.TrueDurability) SelfTrap(me.earth.earthhack.impl.modules.combat.selftrap.SelfTrap) Surround(me.earth.earthhack.impl.modules.combat.surround.Surround) AntiSurround(me.earth.earthhack.impl.modules.combat.antisurround.AntiSurround) ESP(me.earth.earthhack.impl.modules.render.esp.ESP) HoleESP(me.earth.earthhack.impl.modules.render.holeesp.HoleESP) VoidESP(me.earth.earthhack.impl.modules.render.voidesp.VoidESP) CrystalBomber(me.earth.earthhack.impl.modules.combat.bomber.CrystalBomber) BowSpam(me.earth.earthhack.impl.modules.combat.bowspam.BowSpam) Speedmine(me.earth.earthhack.impl.modules.player.speedmine.Speedmine) BreadCrumbs(me.earth.earthhack.impl.modules.render.breadcrumbs.BreadCrumbs) MCF(me.earth.earthhack.impl.modules.misc.mcf.MCF) HighJump(me.earth.earthhack.impl.modules.movement.highjump.HighJump) Penis(me.earth.earthhack.impl.modules.render.penis.Penis) AutoCraft(me.earth.earthhack.impl.modules.misc.autocraft.AutoCraft) AutoArmor(me.earth.earthhack.impl.modules.combat.autoarmor.AutoArmor) Tracker(me.earth.earthhack.impl.modules.misc.tracker.Tracker) AutoRegear(me.earth.earthhack.impl.modules.misc.autoregear.AutoRegear) Trails(me.earth.earthhack.impl.modules.render.trails.Trails) ExtraTab(me.earth.earthhack.impl.modules.misc.extratab.ExtraTab) AutoCrystal(me.earth.earthhack.impl.modules.combat.autocrystal.AutoCrystal) PistonAura(me.earth.earthhack.impl.modules.combat.pistonaura.PistonAura) LiquidInteract(me.earth.earthhack.impl.modules.player.liquids.LiquidInteract) Replenish(me.earth.earthhack.impl.modules.player.replenish.Replenish) ItemChams(me.earth.earthhack.impl.modules.render.itemchams.ItemChams) ServerModule(me.earth.earthhack.impl.modules.client.server.ServerModule) ElytraFlight(me.earth.earthhack.impl.modules.movement.elytraflight.ElytraFlight) Nuker(me.earth.earthhack.impl.modules.misc.nuker.Nuker) Sounds(me.earth.earthhack.impl.modules.render.sounds.Sounds) BowKiller(me.earth.earthhack.impl.modules.combat.bowkill.BowKiller) Search(me.earth.earthhack.impl.modules.render.search.Search) VoidESP(me.earth.earthhack.impl.modules.render.voidesp.VoidESP) NoHandShake(me.earth.earthhack.impl.modules.misc.nohandshake.NoHandShake) XRay(me.earth.earthhack.impl.modules.render.xray.XRay) AutoTool(me.earth.earthhack.impl.modules.player.autotool.AutoTool) AutoConfig(me.earth.earthhack.impl.modules.client.autoconfig.AutoConfig) Spammer(me.earth.earthhack.impl.modules.misc.spammer.Spammer) PopChams(me.earth.earthhack.impl.modules.render.popchams.PopChams) BoatFly(me.earth.earthhack.impl.modules.movement.boatfly.BoatFly) PingSpoof(me.earth.earthhack.impl.modules.misc.pingspoof.PingSpoof) WayPoints(me.earth.earthhack.impl.modules.render.waypoints.WayPoints) Media(me.earth.earthhack.impl.modules.client.media.Media) ExpTweaks(me.earth.earthhack.impl.modules.player.exptweaks.ExpTweaks) NoFall(me.earth.earthhack.impl.modules.movement.nofall.NoFall) XCarry(me.earth.earthhack.impl.modules.player.xcarry.XCarry) HudEditor(me.earth.earthhack.impl.modules.client.editor.HudEditor) WebAura(me.earth.earthhack.impl.modules.combat.webaura.WebAura) FontMod(me.earth.earthhack.impl.modules.client.customfont.FontMod) AutoRespawn(me.earth.earthhack.impl.modules.misc.autorespawn.AutoRespawn) BlockHighlight(me.earth.earthhack.impl.modules.render.blockhighlight.BlockHighlight) FastSwim(me.earth.earthhack.impl.modules.movement.fastswim.FastSwim) PacketFly(me.earth.earthhack.impl.modules.movement.packetfly.PacketFly) TpsSync(me.earth.earthhack.impl.modules.misc.tpssync.TpsSync) MiddleClickPearl(me.earth.earthhack.impl.modules.player.mcp.MiddleClickPearl) ReverseStep(me.earth.earthhack.impl.modules.movement.reversestep.ReverseStep) AutoEat(me.earth.earthhack.impl.modules.misc.autoeat.AutoEat) Ambience(me.earth.earthhack.impl.modules.render.ambience.Ambience) Notifications(me.earth.earthhack.impl.modules.client.notifications.Notifications) NewChunks(me.earth.earthhack.impl.modules.render.newchunks.NewChunks) Portals(me.earth.earthhack.impl.modules.misc.portals.Portals) MultiTask(me.earth.earthhack.impl.modules.player.multitask.MultiTask) Tracers(me.earth.earthhack.impl.modules.render.tracers.Tracers) NoSoundLag(me.earth.earthhack.impl.modules.misc.nosoundlag.NoSoundLag) KillAura(me.earth.earthhack.impl.modules.combat.killaura.KillAura) IceSpeed(me.earth.earthhack.impl.modules.movement.icespeed.IceSpeed) Chams(me.earth.earthhack.impl.modules.render.chams.Chams) CrystalChams(me.earth.earthhack.impl.modules.render.crystalchams.CrystalChams) PopChams(me.earth.earthhack.impl.modules.render.popchams.PopChams) ItemChams(me.earth.earthhack.impl.modules.render.itemchams.ItemChams) HandChams(me.earth.earthhack.impl.modules.render.handchams.HandChams) Phase(me.earth.earthhack.impl.modules.movement.phase.Phase) RPC(me.earth.earthhack.impl.modules.misc.rpc.RPC) Crosshair(me.earth.earthhack.impl.modules.render.crosshair.Crosshair) NoRender(me.earth.earthhack.impl.modules.render.norender.NoRender) HoleESP(me.earth.earthhack.impl.modules.render.holeesp.HoleESP) Step(me.earth.earthhack.impl.modules.movement.step.Step) ReverseStep(me.earth.earthhack.impl.modules.movement.reversestep.ReverseStep) ViewModel(me.earth.earthhack.impl.modules.render.viewmodel.ViewModel) Arrows(me.earth.earthhack.impl.modules.player.arrows.Arrows) CrystalScale(me.earth.earthhack.impl.modules.render.crystalscale.CrystalScale) NoInteract(me.earth.earthhack.impl.modules.misc.nointeract.NoInteract) BlockTweaks(me.earth.earthhack.impl.modules.player.blocktweaks.BlockTweaks) HUD(me.earth.earthhack.impl.modules.client.hud.HUD) Offhand(me.earth.earthhack.impl.modules.combat.offhand.Offhand) AntiPackets(me.earth.earthhack.impl.modules.misc.antipackets.AntiPackets) Packets(me.earth.earthhack.impl.modules.misc.packets.Packets) TabModule(me.earth.earthhack.impl.modules.client.tab.TabModule) BlockLag(me.earth.earthhack.impl.modules.movement.blocklag.BlockLag) Nametags(me.earth.earthhack.impl.modules.render.nametags.Nametags) LongJump(me.earth.earthhack.impl.modules.movement.longjump.LongJump) Skeleton(me.earth.earthhack.impl.modules.render.skeleton.Skeleton) Safety(me.earth.earthhack.impl.modules.client.safety.Safety) Debug(me.earth.earthhack.impl.modules.client.debug.Debug) AntiAim(me.earth.earthhack.impl.modules.misc.antiaim.AntiAim) Cleaner(me.earth.earthhack.impl.modules.player.cleaner.Cleaner) Speed(me.earth.earthhack.impl.modules.movement.speed.Speed) IceSpeed(me.earth.earthhack.impl.modules.movement.icespeed.IceSpeed) EntitySpeed(me.earth.earthhack.impl.modules.movement.entityspeed.EntitySpeed) Reach(me.earth.earthhack.impl.modules.player.reach.Reach) HoleFiller(me.earth.earthhack.impl.modules.combat.holefiller.HoleFiller) LegSwitch(me.earth.earthhack.impl.modules.combat.legswitch.LegSwitch) Blink(me.earth.earthhack.impl.modules.player.blink.Blink) SkinBlink(me.earth.earthhack.impl.modules.misc.skinblink.SkinBlink) MobOwner(me.earth.earthhack.impl.modules.misc.mobowner.MobOwner) FastPlace(me.earth.earthhack.impl.modules.player.fastplace.FastPlace) Trajectories(me.earth.earthhack.impl.modules.render.trajectories.Trajectories) Management(me.earth.earthhack.impl.modules.client.management.Management) Snowballer(me.earth.earthhack.impl.modules.combat.snowballer.Snowballer) NCPTweaks(me.earth.earthhack.impl.modules.player.ncptweaks.NCPTweaks) LagOMeter(me.earth.earthhack.impl.modules.render.lagometer.LagOMeter) Velocity(me.earth.earthhack.impl.modules.movement.velocity.Velocity) CameraClip(me.earth.earthhack.impl.modules.render.viewclip.CameraClip) AntiPotion(me.earth.earthhack.impl.modules.misc.antipotion.AntiPotion) Weather(me.earth.earthhack.impl.modules.render.weather.Weather) Anchor(me.earth.earthhack.impl.modules.movement.anchor.Anchor) Timer(me.earth.earthhack.impl.modules.player.timer.Timer) BedBomb(me.earth.earthhack.impl.modules.combat.bedbomb.BedBomb) RayTrace(me.earth.earthhack.impl.modules.player.raytrace.RayTrace) HandChams(me.earth.earthhack.impl.modules.render.handchams.HandChams) CrystalChams(me.earth.earthhack.impl.modules.render.crystalchams.CrystalChams) Freecam(me.earth.earthhack.impl.modules.player.freecam.Freecam) SkinBlink(me.earth.earthhack.impl.modules.misc.skinblink.SkinBlink) LogoutSpots(me.earth.earthhack.impl.modules.render.logoutspots.LogoutSpots) PingBypass(me.earth.earthhack.impl.modules.client.pingbypass.PingBypass)

Example 3 with AutoArmor

use of me.earth.earthhack.impl.modules.combat.autoarmor.AutoArmor in project 3arthh4ck by 3arthqu4ke.

the class ListenerMotion method invoke.

@Override
public void invoke(MotionUpdateEvent event) {
    if (module.action == null && !module.timer.passed(module.delay.getValue()) || !Managers.NCP.getClickTimer().passed(module.globalDelay.getValue()) || mc.player.isCreative() || !InventoryUtil.validScreen() || AUTO_ARMOR.returnIfPresent(AutoArmor::isActive, false) || !module.inInventory.getValue() && mc.currentScreen instanceof GuiInventory || !module.cleanInLoot.getValue() && !mc.world.getEntitiesWithinAABB(EntityItem.class, RotationUtil.getRotationPlayer().getEntityBoundingBox()).isEmpty() && (!module.cleanWithFull.getValue() || !isInvFull())) {
        return;
    }
    if (event.getStage() == Stage.PRE) {
        // TODO: use invalidate thingy to only calc when necessary?
        if (module.stack.getValue() && stack() || module.xCarry.getValue() && doXCarry()) {
            return;
        }
        Map<Item, ItemToDrop> items = new HashMap<>();
        boolean prio = module.prioHotbar.getValue();
        Item drag = null;
        ItemStack draggedStack = mc.player.inventory.getItemStack();
        if (check(draggedStack, -2, items)) {
            drag = draggedStack.getItem();
        } else if (!draggedStack.isEmpty()) {
            return;
        }
        for (int i = prio ? 44 : 9; prio ? i > 8 : i <= 44; // noinspection ConstantConditions (??? am i stupid ???)
        i = (prio ? --i : ++i)) {
            ItemStack stack = InventoryUtil.get(i);
            check(stack, i, items);
        }
        WindowClick action = null;
        if (drag != null) {
            ItemToDrop dragged = items.get(drag);
            if (dragged != null && dragged.shouldDrop()) {
                action = new WindowClick(-999, ItemStack.EMPTY, mc.player.inventory.getItemStack());
            }
        } else {
            for (ItemToDrop toDrop : items.values()) {
                if (toDrop.shouldDrop()) {
                    int s = toDrop.getSlot();
                    action = new WindowClick(-1, ItemStack.EMPTY, s, InventoryUtil.get(s), -1, p -> p.windowClick(0, s, 1, ClickType.THROW, mc.player));
                    break;
                }
            }
        }
        if (action != null) {
            if (module.rotate.getValue()) {
                if (MovementUtil.isMoving()) {
                    // behind us
                    event.setYaw(event.getYaw() - 180.0f);
                } else {
                    event.setYaw(getYaw(event.getYaw()));
                }
                // slightly up so we throw further
                event.setPitch(-5.0f);
                module.action = action;
            } else {
                module.action = action;
                module.runAction();
            }
        }
    } else {
        module.runAction();
    }
}
Also used : WindowClick(me.earth.earthhack.impl.modules.combat.autoarmor.util.WindowClick) Managers(me.earth.earthhack.impl.managers.Managers) Item(net.minecraft.item.Item) ModuleCache(me.earth.earthhack.api.cache.ModuleCache) RotationUtil(me.earth.earthhack.impl.util.math.rotation.RotationUtil) Setting(me.earth.earthhack.api.setting.Setting) HashMap(java.util.HashMap) MotionUpdateEvent(me.earth.earthhack.impl.event.events.network.MotionUpdateEvent) ArrayList(java.util.ArrayList) HashSet(java.util.HashSet) ItemStack(net.minecraft.item.ItemStack) PositionUtil(me.earth.earthhack.impl.util.math.position.PositionUtil) Stage(me.earth.earthhack.api.event.events.Stage) Map(java.util.Map) Caches(me.earth.earthhack.impl.modules.Caches) InventoryUtil(me.earth.earthhack.impl.util.minecraft.InventoryUtil) AutoArmor(me.earth.earthhack.impl.modules.combat.autoarmor.AutoArmor) ModuleListener(me.earth.earthhack.impl.event.listeners.ModuleListener) EntityItem(net.minecraft.entity.item.EntityItem) GuiInventory(net.minecraft.client.gui.inventory.GuiInventory) Items(net.minecraft.init.Items) CollectionUtil(me.earth.earthhack.impl.util.misc.collections.CollectionUtil) EnumFacing(net.minecraft.util.EnumFacing) Set(java.util.Set) BlockPos(net.minecraft.util.math.BlockPos) AbstractMap(java.util.AbstractMap) List(java.util.List) TreeMap(java.util.TreeMap) MovementUtil(me.earth.earthhack.impl.util.minecraft.MovementUtil) ClickType(net.minecraft.inventory.ClickType) Locks(me.earth.earthhack.impl.util.thread.Locks) Item(net.minecraft.item.Item) EntityItem(net.minecraft.entity.item.EntityItem) WindowClick(me.earth.earthhack.impl.modules.combat.autoarmor.util.WindowClick) HashMap(java.util.HashMap) ItemStack(net.minecraft.item.ItemStack) GuiInventory(net.minecraft.client.gui.inventory.GuiInventory) EntityItem(net.minecraft.entity.item.EntityItem)

Aggregations

AutoArmor (me.earth.earthhack.impl.modules.combat.autoarmor.AutoArmor)3 HashSet (java.util.HashSet)2 AbstractMap (java.util.AbstractMap)1 ArrayList (java.util.ArrayList)1 HashMap (java.util.HashMap)1 List (java.util.List)1 Map (java.util.Map)1 Set (java.util.Set)1 TreeMap (java.util.TreeMap)1 ModuleCache (me.earth.earthhack.api.cache.ModuleCache)1 Stage (me.earth.earthhack.api.event.events.Stage)1 Setting (me.earth.earthhack.api.setting.Setting)1 PostInitEvent (me.earth.earthhack.impl.event.events.client.PostInitEvent)1 MotionUpdateEvent (me.earth.earthhack.impl.event.events.network.MotionUpdateEvent)1 ModuleListener (me.earth.earthhack.impl.event.listeners.ModuleListener)1 Managers (me.earth.earthhack.impl.managers.Managers)1 Caches (me.earth.earthhack.impl.modules.Caches)1 AutoConfig (me.earth.earthhack.impl.modules.client.autoconfig.AutoConfig)1 ClickGui (me.earth.earthhack.impl.modules.client.clickgui.ClickGui)1 Colors (me.earth.earthhack.impl.modules.client.colors.Colors)1