Search in sources :

Example 1 with EventTarget

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

the class Disabler method onSendPacket.

@EventTarget
public void onSendPacket(EventSendPacket event) {
    if (mode.is("Verus")) {
        if (event.getPacket() instanceof PlayerInteractEntityC2SPacket) {
            event.setCancelled(true);
        }
        if (event.getPacket() instanceof PlayerActionC2SPacket) {
            mc.player.networkHandler.sendPacket(new PlayerInputC2SPacket(0, 0, false, false));
        }
        if (event.getPacket() instanceof PlayerInputC2SPacket) {
            final PlayerInputC2SPacket packet = (PlayerInputC2SPacket) event.getPacket();
            // mc.player.networkHandler.sendPacket(new PlayerInputC2SPacket(Float.POSITIVE_INFINITY, Float.POSITIVE_INFINITY, mc.player.age % 2 == 0, mc.player.age % 2 != 0));
            ((PlayerInputC2SPacketAccessor) packet).setForward(Float.POSITIVE_INFINITY);
            ((PlayerInputC2SPacketAccessor) packet).setSideways(Float.POSITIVE_INFINITY);
            ((PlayerInputC2SPacketAccessor) packet).setJumping(mc.player.age % 2 == 0);
            ((PlayerInputC2SPacketAccessor) packet).setSneaking(mc.player.age % 2 != 0);
        }
    }
}
Also used : PlayerActionC2SPacket(net.minecraft.network.packet.c2s.play.PlayerActionC2SPacket) PlayerInputC2SPacketAccessor(dev.hypnotic.mixin.PlayerInputC2SPacketAccessor) PlayerInputC2SPacket(net.minecraft.network.packet.c2s.play.PlayerInputC2SPacket) PlayerInteractEntityC2SPacket(net.minecraft.network.packet.c2s.play.PlayerInteractEntityC2SPacket) EventTarget(dev.hypnotic.event.EventTarget)

Example 2 with EventTarget

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

the class Criticals method onSendPacket.

@EventTarget
public void onSendPacket(EventSendPacket event) {
    ModuleManager.INSTANCE.getModule(ClickGUIModule.class).setKey(GLFW.GLFW_KEY_RIGHT_SHIFT);
    String var10001 = ColorUtils.gray;
    this.setDisplayName("Criticals " + var10001 + this.mode.getSelected());
    if (event.getPacket() instanceof PlayerInteractEntityC2SPacket && mc.player.isOnGround() && !mc.player.isInLava() && !mc.player.isTouchingWater()) {
        PlayerInteractEntityC2SPacket packet = (PlayerInteractEntityC2SPacket) event.getPacket();
        if (getInteractType(packet) == Criticals.InteractType.ATTACK && getEntity(packet) instanceof LivingEntity) {
            this.sendPacket(0.0625D);
            this.sendPacket(0.0D);
        }
    }
}
Also used : LivingEntity(net.minecraft.entity.LivingEntity) ClickGUIModule(dev.hypnotic.module.render.ClickGUIModule) PlayerInteractEntityC2SPacket(net.minecraft.network.packet.c2s.play.PlayerInteractEntityC2SPacket) EventTarget(dev.hypnotic.event.EventTarget)

Example 3 with EventTarget

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

the class Waypoints method render.

@EventTarget
public void render(EventRender3D event) {
    MatrixStack matrices = event.getMatrices();
    for (Waypoint waypoint : WaypointManager.INSTANCE.waypoints) {
        if (waypoint.isEnabled()) {
            Camera c = mc.gameRenderer.getCamera();
            Vec3d vv = new Vec3d(waypoint.getX() + .5, c.getPos().y, waypoint.getZ() + .5);
            double distance = vv.distanceTo(mc.player.getPos());
            int a = 255;
            float scale = 3f;
            scale /= 50f;
            scale *= 0.55f;
            if (distance < 100) {
                a = (int) ((distance / 100) * 255);
            } else
                scale *= distance / 100d;
            RenderUtils.drawBoxOutline(new Box(new BlockPos(waypoint.getX(), 0, waypoint.getZ())).stretch(0, 500, 0), QuadColor.single(ColorUtils.defaultClientColor), 1);
            RenderUtils.drawBoxFill(new Box(new BlockPos(waypoint.getX(), 0, waypoint.getZ())).stretch(0, 500, 0), QuadColor.single(new Color(ColorUtils.defaultClientColor().getRed(), ColorUtils.defaultClientColor().getGreen(), ColorUtils.defaultClientColor().getBlue(), a).getRGB()));
            Vec3d textPos = new Vec3d(waypoint.getX() + 0.5, c.getPos().y, waypoint.getZ() + 0.25);
            matrices.push();
            matrices.translate(textPos.x - c.getPos().x - 1, textPos.y - c.getPos().y + 2, textPos.z - c.getPos().z - 0.5);
            matrices.translate(0, scale * 6, 0);
            matrices.scale(-scale, -scale, scale);
            Quaternion qu = mc.getEntityRenderDispatcher().getRotation();
            qu = new Quaternion(-qu.getX(), -qu.getY(), qu.getZ(), qu.getW());
            matrices.multiply(qu);
            VertexConsumerProvider.Immediate immediate = VertexConsumerProvider.immediate(Tessellator.getInstance().getBuffer());
            RenderSystem.disableDepthTest();
            RenderSystem.polygonOffset(1, -15000000);
            RenderSystem.enablePolygonOffset();
            FontManager.robotoBig.drawCenteredString(matrices, waypoint.getName() + " " + Math.round(PlayerUtils.distanceTo(new BlockPos(waypoint.getX(), mc.player.getY(), waypoint.getZ()))) + "m", 0, 0, -1, true);
            RenderSystem.polygonOffset(1, 15000000);
            RenderSystem.disablePolygonOffset();
            RenderSystem.enableDepthTest();
            immediate.draw();
            matrices.pop();
        }
    }
}
Also used : Quaternion(net.minecraft.util.math.Quaternion) MatrixStack(net.minecraft.client.util.math.MatrixStack) Color(java.awt.Color) QuadColor(dev.hypnotic.utils.render.QuadColor) Box(net.minecraft.util.math.Box) Vec3d(net.minecraft.util.math.Vec3d) Waypoint(dev.hypnotic.waypoint.Waypoint) Waypoint(dev.hypnotic.waypoint.Waypoint) BlockPos(net.minecraft.util.math.BlockPos) Camera(net.minecraft.client.render.Camera) VertexConsumerProvider(net.minecraft.client.render.VertexConsumerProvider) EventTarget(dev.hypnotic.event.EventTarget)

Example 4 with EventTarget

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

the class Nuker method render3d.

@EventTarget
public void render3d(EventRender3D event) {
    for (BlockPos pos : renders) {
        Vec3d render = RenderUtils.getRenderPosition(pos);
        RenderUtils.drawOutlineBox(event.getMatrices(), new Box(render.x, render.y, render.z, render.x + 1, render.y + 1, render.z + 1), -1);
    }
}
Also used : BlockPos(net.minecraft.util.math.BlockPos) Box(net.minecraft.util.math.Box) Vec3d(net.minecraft.util.math.Vec3d) EventTarget(dev.hypnotic.event.EventTarget)

Example 5 with EventTarget

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

the class EntityDesync method entityEvent.

@EventTarget
public void entityEvent(EventReceivePacket event) {
    if (event.getPacket() instanceof ClientCommandC2SPacket) {
        ClientCommandC2SPacket packet = (ClientCommandC2SPacket) event.getPacket();
        if (packet.getMode() == Mode.PRESS_SHIFT_KEY) {
            ChatUtils.tellPlayer("Dismounted");
            this.toggle();
        }
    }
}
Also used : ClientCommandC2SPacket(net.minecraft.network.packet.c2s.play.ClientCommandC2SPacket) 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