Search in sources :

Example 11 with EventTarget

use of dev.hypnotic.event.EventTarget in project Hypnotic-Client by Hypnotic-Development.

the class TargetStrafe method onRender3D.

@EventTarget
public final void onRender3D(EventRender3D event) {
    if (Killaura.target != null)
        this.setDisplayName("TargetStrafe " + ColorUtils.gray + Killaura.target.getName().getString());
    else
        this.setDisplayName("TargetStrafe " + ColorUtils.gray + "None");
    if (ModuleManager.INSTANCE.getModule(Killaura.class).isEnabled() && Killaura.target != null) {
        LivingEntity target = Killaura.target;
        drawCircle(event.getMatrices(), target, event.getTickDelta(), radius.getValue(), 0.1);
    }
}
Also used : LivingEntity(net.minecraft.entity.LivingEntity) EventTarget(dev.hypnotic.event.EventTarget)

Example 12 with EventTarget

use of dev.hypnotic.event.EventTarget in project Hypnotic-Client by Hypnotic-Development.

the class Velocity method onReceivePacket.

@EventTarget
public void onReceivePacket(EventReceivePacket event) {
    if (mc.world == null || mc.player == null)
        return;
    this.setDisplayName("Velocity " + ColorUtils.gray + "H:" + horizontal.getValue() + " V:" + vertical.getValue());
    if (event.getPacket() instanceof EntityVelocityUpdateS2CPacket) {
        EntityVelocityUpdateS2CPacket velocity = (EntityVelocityUpdateS2CPacket) event.getPacket();
        if (velocity.getId() == mc.player.getId() && !mc.player.isTouchingWater()) {
            ReflectionHelper.setPrivateValue(EntityVelocityUpdateS2CPacket.class, velocity, (int) (velocity.getVelocityX() * (horizontal.getValue() * 0.01)), "velocityX", "field_12561");
            ReflectionHelper.setPrivateValue(EntityVelocityUpdateS2CPacket.class, velocity, (int) (velocity.getVelocityY() * (vertical.getValue() * 0.01)), "velocityY", "field_12562");
            ReflectionHelper.setPrivateValue(EntityVelocityUpdateS2CPacket.class, velocity, (int) (velocity.getVelocityZ() * (horizontal.getValue() * 0.01)), "velocityZ", "field_12563");
        }
    } else if (event.getPacket() instanceof ExplosionS2CPacket) {
        ExplosionS2CPacket velocity = (ExplosionS2CPacket) event.getPacket();
        ReflectionHelper.setPrivateValue(ExplosionS2CPacket.class, velocity, (int) (velocity.getPlayerVelocityX() * (horizontal.getValue() * 0.01)), "playerVelocityX", "field_12176");
        ReflectionHelper.setPrivateValue(ExplosionS2CPacket.class, velocity, (int) (velocity.getPlayerVelocityY() * (vertical.getValue() * 0.01)), "playerVelocityY", "field_12183");
        ReflectionHelper.setPrivateValue(ExplosionS2CPacket.class, velocity, (int) (velocity.getPlayerVelocityZ() * (horizontal.getValue() * 0.01)), "playerVelocityZ", "field_12182");
    }
}
Also used : ExplosionS2CPacket(net.minecraft.network.packet.s2c.play.ExplosionS2CPacket) EntityVelocityUpdateS2CPacket(net.minecraft.network.packet.s2c.play.EntityVelocityUpdateS2CPacket) EventTarget(dev.hypnotic.event.EventTarget)

Example 13 with EventTarget

use of dev.hypnotic.event.EventTarget in project Hypnotic-Client by Hypnotic-Development.

the class ResourcePackSpoof method onReceivePacket.

@EventTarget
public void onReceivePacket(EventReceivePacket event) {
    if (mc.player != null && mc.player.networkHandler != null && event.getPacket() instanceof ResourcePackSendS2CPacket) {
        mc.player.networkHandler.sendPacket(new ResourcePackStatusC2SPacket(Status.ACCEPTED));
        mc.player.networkHandler.sendPacket(new ResourcePackStatusC2SPacket(Status.SUCCESSFULLY_LOADED));
    }
}
Also used : ResourcePackSendS2CPacket(net.minecraft.network.packet.s2c.play.ResourcePackSendS2CPacket) ResourcePackStatusC2SPacket(net.minecraft.network.packet.c2s.play.ResourcePackStatusC2SPacket) EventTarget(dev.hypnotic.event.EventTarget)

Example 14 with EventTarget

use of dev.hypnotic.event.EventTarget in project Hypnotic-Client by Hypnotic-Development.

the class ElytraFly method onMotion.

@EventTarget
public void onMotion(EventMove event) {
    this.setDisplayName("ElytraFly " + ColorUtils.gray + mode.getSelected());
    if (wearingElytra() && (autoElytra.isEnabled() && mc.player.fallDistance >= fallDistance.getValue() && !mc.player.isOnGround() && !mc.player.isFallFlying())) {
        if (mc.player.age % 5 == 0)
            mc.player.networkHandler.sendPacket(new ClientCommandC2SPacket(mc.player, ClientCommandC2SPacket.Mode.START_FALL_FLYING));
    }
    if (mc.player.isFallFlying()) {
        if (mode.is("Firework")) {
            Vec3d vec3d_1 = mc.player.getRotationVector();
            // double double_1 = 1.5D;
            Vec3d vec3d_2 = mc.player.getVelocity();
            mc.player.setVelocity(vec3d_2.add(vec3d_1.x * 0.1D + (vec3d_1.x * 1.5D - vec3d_2.x) * 0.5D, vec3d_1.y * 0.1D + (vec3d_1.y * 1.5D - vec3d_2.y) * 0.5D, vec3d_1.z * 0.1D + (vec3d_1.z * 1.5D - vec3d_2.z) * 0.5D));
        } else {
            if (mode.is("NCP") || mode.is("Vanilla")) {
                PlayerUtils.setMoveSpeed(event, flySpeed.getValue());
                if (event.getY() <= 0)
                    event.setY(mc.player.isSneaking() ? (float) -downSpeed.getValue() : (slowGlide.isEnabled() ? -0.01 : 0));
                if (mode.is("Vanilla")) {
                    if (mc.options.jumpKey.isPressed())
                        event.setY(flySpeed.getValue());
                    if (mc.options.sneakKey.isPressed())
                        event.setY(-flySpeed.getValue());
                }
            }
        }
    }
}
Also used : ClientCommandC2SPacket(net.minecraft.network.packet.c2s.play.ClientCommandC2SPacket) Vec3d(net.minecraft.util.math.Vec3d) EventTarget(dev.hypnotic.event.EventTarget)

Example 15 with EventTarget

use of dev.hypnotic.event.EventTarget in project Hypnotic-Client by Hypnotic-Development.

the class Search method receivePacket.

@EventTarget
public void receivePacket(EventReceivePacket event) {
    if (event.getPacket() instanceof DisconnectS2CPacket || event.getPacket() instanceof GameJoinS2CPacket || event.getPacket() instanceof PlayerRespawnS2CPacket) {
        reset();
    } else if (event.getPacket() instanceof BlockUpdateS2CPacket) {
        BlockUpdateS2CPacket packet = (BlockUpdateS2CPacket) event.getPacket();
        queuedBlocks.add(Pair.of(packet.getPos(), packet.getState()));
    } else if (event.getPacket() instanceof ExplosionS2CPacket) {
        ExplosionS2CPacket packet = (ExplosionS2CPacket) event.getPacket();
        for (BlockPos pos : packet.getAffectedBlocks()) {
            queuedBlocks.add(Pair.of(pos, Blocks.AIR.getDefaultState()));
        }
    } else if (event.getPacket() instanceof ChunkDeltaUpdateS2CPacket) {
        ChunkDeltaUpdateS2CPacket packet = (ChunkDeltaUpdateS2CPacket) event.getPacket();
        packet.visitUpdates((pos, state) -> queuedBlocks.add(Pair.of(pos.toImmutable(), state)));
    } else if (event.getPacket() instanceof ChunkDataS2CPacket) {
        ChunkDataS2CPacket packet = (ChunkDataS2CPacket) event.getPacket();
        ChunkPos cp = new ChunkPos(packet.getX(), packet.getZ());
        queuedChunks.add(cp);
        queuedUnloads.remove(cp);
    } else if (event.getPacket() instanceof UnloadChunkS2CPacket) {
        UnloadChunkS2CPacket packet = (UnloadChunkS2CPacket) event.getPacket();
        queuedUnloads.add(new ChunkPos(packet.getX(), packet.getZ()));
    }
}
Also used : Color(java.awt.Color) ExplosionS2CPacket(net.minecraft.network.packet.s2c.play.ExplosionS2CPacket) Category(dev.hypnotic.module.Category) HashMap(java.util.HashMap) Callable(java.util.concurrent.Callable) DisconnectS2CPacket(net.minecraft.network.packet.s2c.play.DisconnectS2CPacket) BlockUpdateS2CPacket(net.minecraft.network.packet.s2c.play.BlockUpdateS2CPacket) HashSet(java.util.HashSet) Future(java.util.concurrent.Future) Pair(org.apache.commons.lang3.tuple.Pair) EventTarget(dev.hypnotic.event.EventTarget) Block(net.minecraft.block.Block) Vec3d(net.minecraft.util.math.Vec3d) Map(java.util.Map) PlayerRespawnS2CPacket(net.minecraft.network.packet.s2c.play.PlayerRespawnS2CPacket) Chunk(net.minecraft.world.chunk.Chunk) BlockState(net.minecraft.block.BlockState) ExecutorService(java.util.concurrent.ExecutorService) ChunkDeltaUpdateS2CPacket(net.minecraft.network.packet.s2c.play.ChunkDeltaUpdateS2CPacket) EventRender3D(dev.hypnotic.event.events.EventRender3D) WorldUtils(dev.hypnotic.utils.world.WorldUtils) GameJoinS2CPacket(net.minecraft.network.packet.s2c.play.GameJoinS2CPacket) Set(java.util.Set) ChunkPos(net.minecraft.util.math.ChunkPos) VoxelShapes(net.minecraft.util.shape.VoxelShapes) BlockPos(net.minecraft.util.math.BlockPos) RenderUtils(dev.hypnotic.utils.render.RenderUtils) VoxelShape(net.minecraft.util.shape.VoxelShape) Executors(java.util.concurrent.Executors) Blocks(net.minecraft.block.Blocks) ExecutionException(java.util.concurrent.ExecutionException) UnloadChunkS2CPacket(net.minecraft.network.packet.s2c.play.UnloadChunkS2CPacket) EventReceivePacket(dev.hypnotic.event.events.EventReceivePacket) Entry(java.util.Map.Entry) Mod(dev.hypnotic.module.Mod) Queue(java.util.Queue) ArrayDeque(java.util.ArrayDeque) ChunkDataS2CPacket(net.minecraft.network.packet.s2c.play.ChunkDataS2CPacket) BlockUpdateS2CPacket(net.minecraft.network.packet.s2c.play.BlockUpdateS2CPacket) ExplosionS2CPacket(net.minecraft.network.packet.s2c.play.ExplosionS2CPacket) PlayerRespawnS2CPacket(net.minecraft.network.packet.s2c.play.PlayerRespawnS2CPacket) GameJoinS2CPacket(net.minecraft.network.packet.s2c.play.GameJoinS2CPacket) ChunkDataS2CPacket(net.minecraft.network.packet.s2c.play.ChunkDataS2CPacket) BlockPos(net.minecraft.util.math.BlockPos) ChunkPos(net.minecraft.util.math.ChunkPos) UnloadChunkS2CPacket(net.minecraft.network.packet.s2c.play.UnloadChunkS2CPacket) ChunkDeltaUpdateS2CPacket(net.minecraft.network.packet.s2c.play.ChunkDeltaUpdateS2CPacket) DisconnectS2CPacket(net.minecraft.network.packet.s2c.play.DisconnectS2CPacket) EventTarget(dev.hypnotic.event.EventTarget)

Aggregations

EventTarget (dev.hypnotic.event.EventTarget)29 Vec3d (net.minecraft.util.math.Vec3d)10 BlockPos (net.minecraft.util.math.BlockPos)9 Color (java.awt.Color)5 LivingEntity (net.minecraft.entity.LivingEntity)5 PlayerEntity (net.minecraft.entity.player.PlayerEntity)5 Box (net.minecraft.util.math.Box)5 Category (dev.hypnotic.module.Category)4 Mod (dev.hypnotic.module.Mod)4 Entity (net.minecraft.entity.Entity)4 JsonSyntaxException (com.google.gson.JsonSyntaxException)3 QuadColor (dev.hypnotic.utils.render.QuadColor)3 IOException (java.io.IOException)3 BlockState (net.minecraft.block.BlockState)3 MatrixStack (net.minecraft.client.util.math.MatrixStack)3 AnimalEntity (net.minecraft.entity.passive.AnimalEntity)3 PassiveEntity (net.minecraft.entity.passive.PassiveEntity)3 PlayerActionC2SPacket (net.minecraft.network.packet.c2s.play.PlayerActionC2SPacket)3 BlockHitResult (net.minecraft.util.hit.BlockHitResult)3 HitResult (net.minecraft.util.hit.HitResult)3