Search in sources :

Example 1 with Offhand

use of me.earth.earthhack.impl.modules.combat.offhand.Offhand in project 3arthh4ck by 3arthqu4ke.

the class ListenerMotion method doObby.

private void doObby(MotionUpdateEvent event, Vec3i[] offsets) {
    if (event.getStage() == Stage.PRE) {
        // TODO: this looks very similar to AutoTrap,
        // maybe its possible to abstract this even further?
        module.rotations = null;
        module.blocksPlaced = 0;
        for (BlockPos confirmed : module.confirmed) {
            module.placed.remove(confirmed);
        }
        module.placed.entrySet().removeIf(entry -> System.currentTimeMillis() - entry.getValue() >= module.confirm.getValue());
        BlockPos playerPos = PositionUtil.getPosition();
        BlockPos[] positions = new BlockPos[offsets.length];
        for (int i = 0; i < offsets.length; i++) {
            Vec3i offset = offsets[i];
            if (module.mode.getValue() == AntiTrapMode.Fill) {
                if (mc.world.getBlockState(playerPos.add(offset.getX() / 2, 0, offset.getZ() / 2)).getBlock() == Blocks.BEDROCK) {
                    continue;
                }
            }
            positions[i] = playerPos.add(offset);
        }
        if (module.offhand.getValue()) {
            if (!InventoryUtil.isHolding(Blocks.OBSIDIAN)) {
                module.previous = OFFHAND.returnIfPresent(Offhand::getMode, null);
                OFFHAND.computeIfPresent(o -> o.setMode(OffhandMode.CRYSTAL));
                return;
            }
        } else {
            module.slot = InventoryUtil.findHotbarBlock(Blocks.OBSIDIAN);
            if (module.slot == -1) {
                ModuleUtil.disable(module, TextColor.RED + "No Obsidian found.");
                return;
            }
        }
        boolean done = true;
        List<BlockPos> toPlace = new LinkedList<>();
        for (BlockPos pos : positions) {
            if (pos == null) {
                continue;
            }
            if (module.mode.getValue() == AntiTrapMode.Fill && !module.highFill.getValue() && pos.getY() > playerPos.getY()) {
                continue;
            }
            if (mc.world.getBlockState(pos).getMaterial().isReplaceable()) {
                toPlace.add(pos);
                done = false;
            }
        }
        if (done) {
            module.disable();
            return;
        }
        boolean hasPlaced = false;
        Optional<BlockPos> crystalPos = toPlace.stream().filter(pos -> !mc.world.getEntitiesWithinAABB(EntityEnderCrystal.class, new AxisAlignedBB(pos)).isEmpty() && mc.world.getBlockState(pos).getMaterial().isReplaceable()).findFirst();
        if (crystalPos.isPresent()) {
            BlockPos pos = crystalPos.get();
            hasPlaced = module.placeBlock(pos);
        }
        // Only after here we need to use the Helper to get the BlockStates.
        if (!hasPlaced) {
            for (BlockPos pos : toPlace) {
                if (!module.placed.containsKey(pos) && HELPER.getBlockState(pos).getMaterial().isReplaceable()) {
                    module.confirmed.remove(pos);
                    if (module.placeBlock(pos)) {
                        break;
                    }
                }
            }
        }
        if (module.rotate.getValue() != Rotate.None) {
            if (module.rotations != null) {
                event.setYaw(module.rotations[0]);
                event.setPitch(module.rotations[1]);
            }
        } else {
            Locks.acquire(Locks.PLACE_SWITCH_LOCK, module::execute);
        }
    } else {
        Locks.acquire(Locks.PLACE_SWITCH_LOCK, module::execute);
    }
}
Also used : RayTraceUtil(me.earth.earthhack.impl.util.math.RayTraceUtil) Blocks(net.minecraft.init.Blocks) EntityEnderCrystal(net.minecraft.entity.item.EntityEnderCrystal) Rotate(me.earth.earthhack.impl.util.helpers.blocks.modes.Rotate) AxisAlignedBB(net.minecraft.util.math.AxisAlignedBB) ModuleCache(me.earth.earthhack.api.cache.ModuleCache) RotationUtil(me.earth.earthhack.impl.util.math.rotation.RotationUtil) BlockUtil(me.earth.earthhack.impl.util.minecraft.blocks.BlockUtil) EnumHand(net.minecraft.util.EnumHand) MotionUpdateEvent(me.earth.earthhack.impl.event.events.network.MotionUpdateEvent) PositionUtil(me.earth.earthhack.impl.util.math.position.PositionUtil) CPacketPlayerTryUseItemOnBlock(net.minecraft.network.play.client.CPacketPlayerTryUseItemOnBlock) Vec3i(net.minecraft.util.math.Vec3i) CPacketAnimation(net.minecraft.network.play.client.CPacketAnimation) Stage(me.earth.earthhack.api.event.events.Stage) AntiTrapMode(me.earth.earthhack.impl.modules.combat.antitrap.util.AntiTrapMode) Caches(me.earth.earthhack.impl.modules.Caches) InventoryUtil(me.earth.earthhack.impl.util.minecraft.InventoryUtil) ModuleUtil(me.earth.earthhack.impl.util.client.ModuleUtil) LinkedList(java.util.LinkedList) HELPER(me.earth.earthhack.impl.util.helpers.blocks.ObbyModule.HELPER) ModuleListener(me.earth.earthhack.impl.event.listeners.ModuleListener) TextColor(me.earth.earthhack.impl.util.text.TextColor) Items(net.minecraft.init.Items) BlockPos(net.minecraft.util.math.BlockPos) OffhandMode(me.earth.earthhack.impl.modules.combat.offhand.modes.OffhandMode) List(java.util.List) Swing(me.earth.earthhack.impl.util.minecraft.Swing) Offhand(me.earth.earthhack.impl.modules.combat.offhand.Offhand) EntityPlayer(net.minecraft.entity.player.EntityPlayer) Optional(java.util.Optional) CPacketPlayer(net.minecraft.network.play.client.CPacketPlayer) Comparator(java.util.Comparator) EntityUtil(me.earth.earthhack.impl.util.minecraft.entity.EntityUtil) Locks(me.earth.earthhack.impl.util.thread.Locks) AxisAlignedBB(net.minecraft.util.math.AxisAlignedBB) Vec3i(net.minecraft.util.math.Vec3i) EntityEnderCrystal(net.minecraft.entity.item.EntityEnderCrystal) BlockPos(net.minecraft.util.math.BlockPos) LinkedList(java.util.LinkedList)

Example 2 with Offhand

use of me.earth.earthhack.impl.modules.combat.offhand.Offhand in project 3arthh4ck by 3arthqu4ke.

the class ListenerKeyboard method invoke.

@Override
public void invoke(KeyboardEvent event) {
    if (event.getEventState() && event.getKey() == module.switchBind.getValue().getKey()) {
        if (module.useAsOffhand.getValue() || module.isPingBypass()) {
            OffhandMode m = OFFHAND.returnIfPresent(Offhand::getMode, null);
            if (m != null) {
                if (m.equals(OffhandMode.CRYSTAL)) {
                    OFFHAND.computeIfPresent(o -> o.setMode(OffhandMode.TOTEM));
                } else {
                    OFFHAND.computeIfPresent(o -> o.setMode(OffhandMode.CRYSTAL));
                }
            }
            module.switching = false;
        } else if (module.autoSwitch.getValue() == AutoSwitch.Bind) {
            module.switching = !module.switching;
        }
    }
}
Also used : Offhand(me.earth.earthhack.impl.modules.combat.offhand.Offhand) OffhandMode(me.earth.earthhack.impl.modules.combat.offhand.modes.OffhandMode)

Example 3 with Offhand

use of me.earth.earthhack.impl.modules.combat.offhand.Offhand 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 4 with Offhand

use of me.earth.earthhack.impl.modules.combat.offhand.Offhand in project 3arthh4ck by 3arthqu4ke.

the class ListenerSetSlot method invoke.

@Override
public void invoke(PacketEvent.Receive<SPacketSetSlot> event) {
    if (module.getParent().isEnabled() && mc.player != null) {
        SPacketSetSlot packet = event.getPacket();
        if (packet.getSlot() == -1337) {
            ((IContainer) mc.player.openContainer).setTransactionID((short) packet.getWindowId());
            // make NetHandlerPlayClient set mouse slot.
            ((ISPacketSetSlot) packet).setWindowId(-1);
        } else if (packet.getWindowId() == -128) {
            event.setCancelled(true);
            mc.addScheduledTask(() -> {
                OffhandMode recovery = OFFHAND.returnIfPresent(Offhand::getMode, null);
                OFFHAND.computeIfPresent(offhand -> {
                    offhand.setMode(OffhandMode.TOTEM);
                    offhand.postWindowClick();
                });
                OFFHAND.computeIfPresent(offhand -> offhand.setRecovery(recovery));
                Slot slot = mc.player.inventoryContainer.inventorySlots.get(packet.getSlot());
                slot.putStack(packet.getStack());
            });
        }
    }
}
Also used : ModuleListener(me.earth.earthhack.impl.event.listeners.ModuleListener) OffhandMode(me.earth.earthhack.impl.modules.combat.offhand.modes.OffhandMode) IContainer(me.earth.earthhack.impl.core.ducks.util.IContainer) Offhand(me.earth.earthhack.impl.modules.combat.offhand.Offhand) ModuleCache(me.earth.earthhack.api.cache.ModuleCache) Caches(me.earth.earthhack.impl.modules.Caches) Slot(net.minecraft.inventory.Slot) SPacketSetSlot(net.minecraft.network.play.server.SPacketSetSlot) PacketEvent(me.earth.earthhack.impl.event.events.network.PacketEvent) ISPacketSetSlot(me.earth.earthhack.impl.core.mixins.network.server.ISPacketSetSlot) ISPacketSetSlot(me.earth.earthhack.impl.core.mixins.network.server.ISPacketSetSlot) Slot(net.minecraft.inventory.Slot) SPacketSetSlot(net.minecraft.network.play.server.SPacketSetSlot) ISPacketSetSlot(me.earth.earthhack.impl.core.mixins.network.server.ISPacketSetSlot) SPacketSetSlot(net.minecraft.network.play.server.SPacketSetSlot) ISPacketSetSlot(me.earth.earthhack.impl.core.mixins.network.server.ISPacketSetSlot) IContainer(me.earth.earthhack.impl.core.ducks.util.IContainer) OffhandMode(me.earth.earthhack.impl.modules.combat.offhand.modes.OffhandMode)

Example 5 with Offhand

use of me.earth.earthhack.impl.modules.combat.offhand.Offhand in project 3arthh4ck by 3arthqu4ke.

the class ListenerMotion method doCrystal.

private void doCrystal(MotionUpdateEvent event) {
    if (event.getStage() == Stage.PRE) {
        List<BlockPos> positions = module.getCrystalPositions();
        if (positions.isEmpty() || !module.isEnabled()) {
            if (!module.empty.getValue()) {
                module.disable();
            }
            return;
        }
        if (module.offhand.getValue()) {
            if (!InventoryUtil.isHolding(Items.END_CRYSTAL)) {
                module.previous = OFFHAND.returnIfPresent(Offhand::getMode, null);
                OFFHAND.computeIfPresent(o -> o.setMode(OffhandMode.CRYSTAL));
                return;
            }
        } else {
            module.slot = InventoryUtil.findHotbarItem(Items.END_CRYSTAL);
            if (module.slot == -1) {
                ModuleUtil.disable(module, TextColor.RED + "No crystals found.");
                return;
            }
        }
        EntityPlayer closest = EntityUtil.getClosestEnemy();
        if (closest != null) {
            positions.sort(Comparator.comparingDouble(pos -> BlockUtil.getDistanceSq(closest, pos)));
        }
        // get last, furthest away, pos.
        module.pos = positions.get(positions.size() - 1);
        module.rotations = RotationUtil.getRotationsToTopMiddle(module.pos.up());
        module.result = RayTraceUtil.getRayTraceResult(module.rotations[0], module.rotations[1], 3.0f);
        if (module.rotate.getValue() == Rotate.Normal) {
            event.setYaw(module.rotations[0]);
            event.setPitch(module.rotations[1]);
        } else {
            executeCrystal();
        }
    } else {
        executeCrystal();
    }
}
Also used : RayTraceUtil(me.earth.earthhack.impl.util.math.RayTraceUtil) Blocks(net.minecraft.init.Blocks) EntityEnderCrystal(net.minecraft.entity.item.EntityEnderCrystal) Rotate(me.earth.earthhack.impl.util.helpers.blocks.modes.Rotate) AxisAlignedBB(net.minecraft.util.math.AxisAlignedBB) ModuleCache(me.earth.earthhack.api.cache.ModuleCache) RotationUtil(me.earth.earthhack.impl.util.math.rotation.RotationUtil) BlockUtil(me.earth.earthhack.impl.util.minecraft.blocks.BlockUtil) EnumHand(net.minecraft.util.EnumHand) MotionUpdateEvent(me.earth.earthhack.impl.event.events.network.MotionUpdateEvent) PositionUtil(me.earth.earthhack.impl.util.math.position.PositionUtil) CPacketPlayerTryUseItemOnBlock(net.minecraft.network.play.client.CPacketPlayerTryUseItemOnBlock) Vec3i(net.minecraft.util.math.Vec3i) CPacketAnimation(net.minecraft.network.play.client.CPacketAnimation) Stage(me.earth.earthhack.api.event.events.Stage) AntiTrapMode(me.earth.earthhack.impl.modules.combat.antitrap.util.AntiTrapMode) Caches(me.earth.earthhack.impl.modules.Caches) InventoryUtil(me.earth.earthhack.impl.util.minecraft.InventoryUtil) ModuleUtil(me.earth.earthhack.impl.util.client.ModuleUtil) LinkedList(java.util.LinkedList) HELPER(me.earth.earthhack.impl.util.helpers.blocks.ObbyModule.HELPER) ModuleListener(me.earth.earthhack.impl.event.listeners.ModuleListener) TextColor(me.earth.earthhack.impl.util.text.TextColor) Items(net.minecraft.init.Items) BlockPos(net.minecraft.util.math.BlockPos) OffhandMode(me.earth.earthhack.impl.modules.combat.offhand.modes.OffhandMode) List(java.util.List) Swing(me.earth.earthhack.impl.util.minecraft.Swing) Offhand(me.earth.earthhack.impl.modules.combat.offhand.Offhand) EntityPlayer(net.minecraft.entity.player.EntityPlayer) Optional(java.util.Optional) CPacketPlayer(net.minecraft.network.play.client.CPacketPlayer) Comparator(java.util.Comparator) EntityUtil(me.earth.earthhack.impl.util.minecraft.entity.EntityUtil) Locks(me.earth.earthhack.impl.util.thread.Locks) EntityPlayer(net.minecraft.entity.player.EntityPlayer) BlockPos(net.minecraft.util.math.BlockPos)

Aggregations

Offhand (me.earth.earthhack.impl.modules.combat.offhand.Offhand)5 OffhandMode (me.earth.earthhack.impl.modules.combat.offhand.modes.OffhandMode)4 ModuleCache (me.earth.earthhack.api.cache.ModuleCache)3 ModuleListener (me.earth.earthhack.impl.event.listeners.ModuleListener)3 Caches (me.earth.earthhack.impl.modules.Caches)3 Comparator (java.util.Comparator)2 LinkedList (java.util.LinkedList)2 List (java.util.List)2 Optional (java.util.Optional)2 Stage (me.earth.earthhack.api.event.events.Stage)2 MotionUpdateEvent (me.earth.earthhack.impl.event.events.network.MotionUpdateEvent)2 AntiTrapMode (me.earth.earthhack.impl.modules.combat.antitrap.util.AntiTrapMode)2 IContainer (me.earth.earthhack.impl.core.ducks.util.IContainer)1 ISPacketSetSlot (me.earth.earthhack.impl.core.mixins.network.server.ISPacketSetSlot)1 PostInitEvent (me.earth.earthhack.impl.event.events.client.PostInitEvent)1 PacketEvent (me.earth.earthhack.impl.event.events.network.PacketEvent)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 Commands (me.earth.earthhack.impl.modules.client.commands.Commands)1