Search in sources :

Example 1 with EventTarget

use of net.ccbluex.liquidbounce.event.EventTarget in project LiquidBouncePlus by WYSI-Foundation.

the class ForceUnicodeChat method onPacket.

@EventTarget
public void onPacket(final PacketEvent event) {
    if (event.getPacket() instanceof C01PacketChatMessage) {
        final C01PacketChatMessage chatMessage = (C01PacketChatMessage) event.getPacket();
        final String message = chatMessage.getMessage();
        final StringBuilder stringBuilder = new StringBuilder();
        // prevent from wtf did i just done xD
        if (message.startsWith("/") || message.startsWith(LiquidBounce.commandManager.getPrefix() + ""))
            return;
        for (char c : message.toCharArray()) if (c >= 33 && c <= 128 && (!randomAssignValue.get() || RandomUtils.nextBoolean()))
            stringBuilder.append(Character.toChars(c + 65248));
        else
            stringBuilder.append(c);
        chatMessage.message = stringBuilder.toString();
    }
}
Also used : C01PacketChatMessage(net.minecraft.network.play.client.C01PacketChatMessage) EventTarget(net.ccbluex.liquidbounce.event.EventTarget)

Example 2 with EventTarget

use of net.ccbluex.liquidbounce.event.EventTarget in project LiquidBouncePlus by WYSI-Foundation.

the class Plugins method onPacket.

@EventTarget
public void onPacket(PacketEvent event) {
    if (event.getPacket() instanceof S3APacketTabComplete) {
        final S3APacketTabComplete s3APacketTabComplete = (S3APacketTabComplete) event.getPacket();
        final List<String> plugins = new ArrayList<>();
        final String[] commands = s3APacketTabComplete.func_149630_c();
        for (final String command1 : commands) {
            final String[] command = command1.split(":");
            if (command.length > 1) {
                final String pluginName = command[0].replace("/", "");
                if (!plugins.contains(pluginName))
                    plugins.add(pluginName);
            }
        }
        Collections.sort(plugins);
        if (!plugins.isEmpty())
            ClientUtils.displayChatMessage("§aPlugins §7(§8" + plugins.size() + "§7): §c" + Strings.join(plugins.toArray(new String[0]), "§7, §c"));
        else
            ClientUtils.displayChatMessage("§cNo plugins found.");
        setState(false);
        tickTimer.reset();
    }
}
Also used : S3APacketTabComplete(net.minecraft.network.play.server.S3APacketTabComplete) ArrayList(java.util.ArrayList) EventTarget(net.ccbluex.liquidbounce.event.EventTarget)

Example 3 with EventTarget

use of net.ccbluex.liquidbounce.event.EventTarget in project LiquidBouncePlus by WYSI-Foundation.

the class ItemTeleport method onUpdate.

@EventTarget
public void onUpdate(final UpdateEvent event) {
    if (mc.currentScreen == null && Mouse.isButtonDown(Arrays.asList(buttonValue.getValues()).indexOf(buttonValue.get())) && delay <= 0) {
        endPos = objectPosition.getBlockPos();
        if (BlockUtils.getBlock(endPos).getMaterial() == Material.air) {
            endPos = null;
            return;
        }
        ClientUtils.displayChatMessage("§7[§8§lItemTeleport§7] §3Position was set to §8" + endPos.getX() + "§3, §8" + endPos.getY() + "§3, §8" + endPos.getZ());
        delay = 6;
    }
    if (delay > 0)
        --delay;
    if (endPos != null && mc.thePlayer.isSneaking()) {
        if (!mc.thePlayer.onGround) {
            final double endX = (double) endPos.getX() + 0.5D;
            final double endY = (double) endPos.getY() + 1D;
            final double endZ = (double) endPos.getZ() + 0.5D;
            switch(modeValue.get().toLowerCase()) {
                case "old":
                    for (final Vector3f vector3f : vanillaTeleportPositions(endX, endY, endZ, 4D)) mc.getNetHandler().addToSendQueue(new C03PacketPlayer.C04PacketPlayerPosition(vector3f.getX(), vector3f.getY(), vector3f.getZ(), false));
                    break;
                case "new":
                    for (final Vector3f vector3f : vanillaTeleportPositions(endX, endY, endZ, 5D)) {
                        mc.getNetHandler().addToSendQueue(new C03PacketPlayer.C04PacketPlayerPosition(mc.thePlayer.posX, mc.thePlayer.posY, mc.thePlayer.posZ, true));
                        mc.getNetHandler().addToSendQueue(new C03PacketPlayer.C04PacketPlayerPosition(vector3f.x, vector3f.y, vector3f.z, true));
                        mc.getNetHandler().addToSendQueue(new C03PacketPlayer.C04PacketPlayerPosition(mc.thePlayer.posX, mc.thePlayer.posY, mc.thePlayer.posZ, true));
                        mc.getNetHandler().addToSendQueue(new C03PacketPlayer.C04PacketPlayerPosition(mc.thePlayer.posX, mc.thePlayer.posY + 4.0, mc.thePlayer.posZ, true));
                        mc.getNetHandler().addToSendQueue(new C03PacketPlayer.C04PacketPlayerPosition(vector3f.x, vector3f.y, vector3f.z, true));
                        MovementUtils.forward(0.04);
                    }
                    break;
            }
            if (resetAfterTp.get())
                endPos = null;
            ClientUtils.displayChatMessage("§7[§8§lItemTeleport§7] §3Tried to collect items");
        } else
            mc.thePlayer.jump();
    }
}
Also used : Vector3f(javax.vecmath.Vector3f) C03PacketPlayer(net.minecraft.network.play.client.C03PacketPlayer) EventTarget(net.ccbluex.liquidbounce.event.EventTarget)

Example 4 with EventTarget

use of net.ccbluex.liquidbounce.event.EventTarget in project LiquidBouncePlus by WYSI-Foundation.

the class AutoHypixel method onRender2D.

@EventTarget
public void onRender2D(Render2DEvent event) {
    if (checkValue.get() && !gameMode.toLowerCase().contains("skywars"))
        return;
    ScaledResolution sc = new ScaledResolution(mc);
    float middleX = sc.getScaledWidth() / 2F;
    String detail = "Next game in " + dFormat.format((float) timer.hasTimeLeft(delayValue.get()) / 1000F) + "s...";
    float middleWidth = Fonts.font40.getStringWidth(detail) / 2F;
    float strength = MathHelper.clamp_float((float) timer.hasTimeLeft(delayValue.get()) / delayValue.get(), 0F, 1F);
    float wid = strength * (5F + middleWidth) * 2F;
    posY = AnimationUtils.animate(shouldChangeGame ? 10F : -20F, posY, 0.25F * 0.05F * RenderUtils.deltaTime);
    if (!renderValue.get() || posY < -15)
        return;
    Stencil.write(true);
    RenderUtils.drawRoundedRect(middleX - 5F - middleWidth, posY, middleX + 5F + middleWidth, posY + 15F, 3F, 0xA0000000);
    Stencil.erase(true);
    RenderUtils.drawRect(middleX - 5F - middleWidth, posY, middleX - 5F - middleWidth + wid, posY + 15F, new Color(0.4F, 0.8F, 0.4F, 0.35F).getRGB());
    Stencil.dispose();
    GlStateManager.resetColor();
    Fonts.fontSFUI40.drawString(detail, middleX - middleWidth - 1F, posY + 4F, -1);
}
Also used : ScaledResolution(net.minecraft.client.gui.ScaledResolution) Color(java.awt.Color) EventTarget(net.ccbluex.liquidbounce.event.EventTarget)

Example 5 with EventTarget

use of net.ccbluex.liquidbounce.event.EventTarget in project LiquidBouncePlus by WYSI-Foundation.

the class AutoHypixel method onMotion.

@EventTarget
public void onMotion(MotionEvent event) {
    if ((!checkValue.get() || gameMode.toLowerCase().contains("skywars")) && shouldChangeGame && timer.hasTimePassed(delayValue.get())) {
        if (antiAtlasValue.get()) {
            for (EntityPlayer entity : (List<EntityPlayer>) mc.theWorld.playerEntities) {
                if (entity == null && (mc.thePlayer.ticksExisted % 10 == 0 || entity == mc.thePlayer))
                    continue;
                if (!LiquidBounce.moduleManager.getModule(AntiBot.class).getState() || !AntiBot.isBot(entity)) {
                    mc.thePlayer.sendChatMessage("/wdr " + entity.getName() + (useOtherWord ? " ka,speed,velocity" : " aimbot,safewalk"));
                    useOtherWord = !useOtherWord;
                }
            }
        }
        mc.thePlayer.sendChatMessage("/play " + modeValue.get().toLowerCase() + (modeValue.get().equalsIgnoreCase("ranked") ? "_normal" : modeValue.get().equalsIgnoreCase("mega") ? "_" + megaValue.get().toLowerCase() : "_" + soloTeamsValue.get().toLowerCase()));
        shouldChangeGame = false;
    }
    if (!shouldChangeGame)
        timer.reset();
}
Also used : EntityPlayer(net.minecraft.entity.player.EntityPlayer) List(java.util.List) EventTarget(net.ccbluex.liquidbounce.event.EventTarget)

Aggregations

EventTarget (net.ccbluex.liquidbounce.event.EventTarget)39 Entity (net.minecraft.entity.Entity)12 BlockPos (net.minecraft.util.BlockPos)7 Color (java.awt.Color)5 Notification (net.ccbluex.liquidbounce.ui.client.hud.element.elements.Notification)5 EntityLivingBase (net.minecraft.entity.EntityLivingBase)5 EntityPlayer (net.minecraft.entity.player.EntityPlayer)5 List (java.util.List)4 ScaledResolution (net.minecraft.client.gui.ScaledResolution)4 ItemStack (net.minecraft.item.ItemStack)4 Map (java.util.Map)3 BlockAir (net.minecraft.block.BlockAir)3 RenderManager (net.minecraft.client.renderer.entity.RenderManager)3 C03PacketPlayer (net.minecraft.network.play.client.C03PacketPlayer)3 AxisAlignedBB (net.minecraft.util.AxisAlignedBB)3 ArrayList (java.util.ArrayList)2 FramebufferShader (net.ccbluex.liquidbounce.utils.render.shader.FramebufferShader)2 Block (net.minecraft.block.Block)2 EntityMinecartChest (net.minecraft.entity.item.EntityMinecartChest)2 C01PacketChatMessage (net.minecraft.network.play.client.C01PacketChatMessage)2