net.minecraft.network.play.client.C03PacketPlayer Java Examples

The following examples show how to use net.minecraft.network.play.client.C03PacketPlayer. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: RotationUtils.java    From LiquidBounce with GNU General Public License v3.0 7 votes vote down vote up
/**
 * Handle packet
 *
 * @param event Packet Event
 */
@EventTarget
public void onPacket(final PacketEvent event) {
    final Packet<?> packet = event.getPacket();

    if(packet instanceof C03PacketPlayer) {
        final C03PacketPlayer packetPlayer = (C03PacketPlayer) packet;

        if(targetRotation != null && !keepCurrentRotation && (targetRotation.getYaw() != serverRotation.getYaw() || targetRotation.getPitch() != serverRotation.getPitch())) {
            packetPlayer.yaw = targetRotation.getYaw();
            packetPlayer.pitch = targetRotation.getPitch();
            packetPlayer.rotating = true;
        }

        if(packetPlayer.rotating) serverRotation = new Rotation(packetPlayer.yaw, packetPlayer.pitch);
    }
}
 
Example #2
Source File: NoFall.java    From LiquidBounce with GNU General Public License v3.0 7 votes vote down vote up
@EventTarget
public void onPacket(final PacketEvent event) {
    final Packet<?> packet = event.getPacket();
    final String mode = modeValue.get();

    if (packet instanceof C03PacketPlayer) {
        final C03PacketPlayer playerPacket = (C03PacketPlayer) packet;

        if (mode.equalsIgnoreCase("SpoofGround"))
            playerPacket.onGround = true;

        if (mode.equalsIgnoreCase("NoGround"))
            playerPacket.onGround = false;

        if (mode.equalsIgnoreCase("Hypixel")
                && mc.thePlayer != null && mc.thePlayer.fallDistance > 1.5)
            playerPacket.onGround = mc.thePlayer.ticksExisted % 2 == 0;
    }
}
 
Example #3
Source File: AACPort.java    From LiquidBounce with GNU General Public License v3.0 6 votes vote down vote up
@Override
public void onUpdate() {
    if(!MovementUtils.isMoving())
        return;

    final float f = mc.thePlayer.rotationYaw * 0.017453292F;
    for (double d = 0.2; d <= ((Speed) LiquidBounce.moduleManager.getModule(Speed.class)).portMax.get(); d += 0.2) {
        final double x = mc.thePlayer.posX - MathHelper.sin(f) * d;
        final double z = mc.thePlayer.posZ + MathHelper.cos(f) * d;

        if(mc.thePlayer.posY < (int) mc.thePlayer.posY + 0.5 && !(BlockUtils.getBlock(new BlockPos(x, mc.thePlayer.posY, z)) instanceof BlockAir))
            break;

        mc.thePlayer.sendQueue.addToSendQueue(new C03PacketPlayer.C04PacketPlayerPosition(x, mc.thePlayer.posY, z, true));
    }
}
 
Example #4
Source File: WallClimb.java    From LiquidBounce with GNU General Public License v3.0 6 votes vote down vote up
@EventTarget
public void onPacket(final PacketEvent event) {
    final Packet<?> packet = event.getPacket();

    if(packet instanceof C03PacketPlayer) {
        final C03PacketPlayer packetPlayer = (C03PacketPlayer) packet;

        if(glitch) {
            final float yaw = (float) MovementUtils.getDirection();

            packetPlayer.x = packetPlayer.x - MathHelper.sin(yaw) * 0.00000001D;
            packetPlayer.z = packetPlayer.z + MathHelper.cos(yaw) * 0.00000001D;

            glitch = false;
        }
    }
}
 
Example #5
Source File: FastEat.java    From ehacks-pro with GNU General Public License v3.0 6 votes vote down vote up
@Override
public void onTicks() {
    if (this.isActive() && Mouse.getEventButton() == 1 && Mouse.isButtonDown(1)) {
        if (this.mode == 1) {
            int[] ignoredBlockIds = new int[]{23, 25, 26, 54, 58, 61, 62, 64, 69, 71, 77, 84, 92, 96, 107, 116, 117, 118, 120, 130, 137, 143, 145, 146, 149, 150, 154, 158};
            for (int id : ignoredBlockIds) {
                if (Block.getIdFromBlock(Wrapper.INSTANCE.world().getBlock(Wrapper.INSTANCE.mc().objectMouseOver.blockX, Wrapper.INSTANCE.mc().objectMouseOver.blockY, Wrapper.INSTANCE.mc().objectMouseOver.blockZ)) != id) {
                    continue;
                }
                return;
            }
        }
        if (Wrapper.INSTANCE.player().inventory.getCurrentItem() == null) {
            return;
        }
        Item item = Wrapper.INSTANCE.player().inventory.getCurrentItem().getItem();
        if (Wrapper.INSTANCE.player().onGround && (item instanceof ItemFood || item instanceof ItemPotion) && (Wrapper.INSTANCE.player().getFoodStats().needFood() || item instanceof ItemPotion || item instanceof ItemAppleGold)) {
            Wrapper.INSTANCE.player().sendQueue.addToSendQueue(new C09PacketHeldItemChange(Wrapper.INSTANCE.player().inventory.currentItem));
            for (int i = 0; i < 1000; ++i) {
                Wrapper.INSTANCE.player().sendQueue.addToSendQueue(new C03PacketPlayer(false));
            }
            Wrapper.INSTANCE.player().sendQueue.addToSendQueue(new C07PacketPlayerDigging(5, 0, 0, 0, 255));
        }
    }
}
 
Example #6
Source File: AntiPotion.java    From ehacks-pro with GNU General Public License v3.0 5 votes vote down vote up
@Override
public void onTicks() {
    if (Wrapper.INSTANCE.player().isPotionActive(Potion.blindness)) {
        Wrapper.INSTANCE.player().removePotionEffect(Potion.blindness.id);
    }
    if (Wrapper.INSTANCE.player().isPotionActive(Potion.confusion)) {
        Wrapper.INSTANCE.player().removePotionEffect(Potion.confusion.id);
    }
    if (Wrapper.INSTANCE.player().isPotionActive(Potion.digSlowdown)) {
        Wrapper.INSTANCE.player().removePotionEffect(Potion.digSlowdown.id);
    }
    if (Wrapper.INSTANCE.player().onGround) {
        for (Potion effect : this.badEffects) {
            if (!Wrapper.INSTANCE.player().isPotionActive(effect)) {
                continue;
            }
            for (int a2 = 0; a2 <= 20; ++a2) {
                Wrapper.INSTANCE.player().sendQueue.addToSendQueue(new C03PacketPlayer.C05PacketPlayerLook(Wrapper.INSTANCE.player().rotationYaw, Wrapper.INSTANCE.player().rotationPitch, Wrapper.INSTANCE.player().onGround));
            }
        }
        if (Wrapper.INSTANCE.player().getHealth() <= 15.0f && Wrapper.INSTANCE.player().isPotionActive(Potion.regeneration)) {
            for (int a3 = 0; a3 <= 10; ++a3) {
                Wrapper.INSTANCE.player().sendQueue.addToSendQueue(new C03PacketPlayer.C05PacketPlayerLook(Wrapper.INSTANCE.player().rotationYaw, Wrapper.INSTANCE.player().rotationPitch, Wrapper.INSTANCE.player().onGround));
            }
        }
    }
}
 
Example #7
Source File: Phase.java    From LiquidBounce with GNU General Public License v3.0 5 votes vote down vote up
@EventTarget
public void onPacket(final PacketEvent event) {
    final Packet<?> packet = event.getPacket();

    if(packet instanceof C03PacketPlayer) {
        final C03PacketPlayer packetPlayer = (C03PacketPlayer) packet;

        if(modeValue.get().equalsIgnoreCase("AAC3.5.0")) {
            final float yaw = (float) MovementUtils.getDirection();

            packetPlayer.x = packetPlayer.x - MathHelper.sin(yaw) * 0.00000001D;
            packetPlayer.z = packetPlayer.z + MathHelper.cos(yaw) * 0.00000001D;
        }
    }
}
 
Example #8
Source File: Teleport.java    From LiquidBounce with GNU General Public License v3.0 5 votes vote down vote up
@EventTarget
public void onPacket(final PacketEvent event) {
    final Packet<?> packet = event.getPacket();

    if(disableLogger)
        return;

    if(packet instanceof C03PacketPlayer) {
        final C03PacketPlayer packetPlayer = (C03PacketPlayer) packet;

        switch(modeValue.get().toLowerCase()) {
            case "spoof":
                if(endPos == null)
                    break;

                packetPlayer.x = endPos.getX() + 0.5D;
                packetPlayer.y = endPos.getY() + 1;
                packetPlayer.z = endPos.getZ() + 0.5D;
                mc.thePlayer.setPosition(endPos.getX() + 0.5D, endPos.getY() + 1, endPos.getZ() + 0.5D);
                break;
            case "aac3.5.0":
                if(!flyTimer.hasTimePassed(60))
                    return;

                event.cancelEvent();

                if(!(packet instanceof C03PacketPlayer.C04PacketPlayerPosition) && !(packet instanceof C03PacketPlayer.C06PacketPlayerPosLook))
                    return;

                packets.add(packet);
                break;
        }
    }
}
 
Example #9
Source File: Regen.java    From ehacks-pro with GNU General Public License v3.0 5 votes vote down vote up
@Override
public void onTicks() {
    boolean shouldHeal;
    if (!Wrapper.INSTANCE.player().onGround) {
        return;
    }
    boolean canHeal = Wrapper.INSTANCE.player().onGround || Wrapper.INSTANCE.player().isInWater() || Wrapper.INSTANCE.player().isOnLadder();
    shouldHeal = Wrapper.INSTANCE.player().getHealth() <= 18.5f && Wrapper.INSTANCE.player().getFoodStats().getFoodLevel() > 8;
    if (canHeal && shouldHeal) {
        for (int i = 0; i < 1000; ++i) {
            Wrapper.INSTANCE.player().sendQueue.addToSendQueue(new C03PacketPlayer(false));
        }
    }
}
 
Example #10
Source File: WaterWalk.java    From ehacks-pro with GNU General Public License v3.0 5 votes vote down vote up
@Override
public void onTicks() {
    if (WaterWalk.isOnLiquid(Wrapper.INSTANCE.player().boundingBox)) {
        ++this.delay;
        if (this.delay == 4) {
            Wrapper.INSTANCE.player().sendQueue.addToSendQueue(new C03PacketPlayer.C04PacketPlayerPosition(Wrapper.INSTANCE.player().posX, Wrapper.INSTANCE.player().boundingBox.minY - 0.02, Wrapper.INSTANCE.player().posY - 0.02, Wrapper.INSTANCE.player().posZ, false));
            this.delay = 0;
        }
    }
    if (WaterWalk.isInLiquid()) {
        Wrapper.INSTANCE.player().motionY = 0.085;
    }
}
 
Example #11
Source File: LiquidWalk.java    From LiquidBounce with GNU General Public License v3.0 5 votes vote down vote up
@EventTarget
public void onPacket(final PacketEvent event) {
    if(mc.thePlayer == null || !modeValue.get().equalsIgnoreCase("NCP"))
        return;

    if(event.getPacket() instanceof C03PacketPlayer) {
        final C03PacketPlayer packetPlayer = (C03PacketPlayer) event.getPacket();

        if(BlockUtils.collideBlock(new AxisAlignedBB(mc.thePlayer.getEntityBoundingBox().maxX, mc.thePlayer.getEntityBoundingBox().maxY, mc.thePlayer.getEntityBoundingBox().maxZ, mc.thePlayer.getEntityBoundingBox().minX, mc.thePlayer.getEntityBoundingBox().minY - 0.01D, mc.thePlayer.getEntityBoundingBox().minZ), block -> block instanceof BlockLiquid)) {
            nextTick = !nextTick;

            if(nextTick) packetPlayer.y -= 0.001D;
        }
    }
}
 
Example #12
Source File: AACGround.java    From LiquidBounce with GNU General Public License v3.0 5 votes vote down vote up
@Override
public void onUpdate() {
    if(!MovementUtils.isMoving())
        return;

    mc.timer.timerSpeed = ((Speed) LiquidBounce.moduleManager.getModule(Speed.class)).aacGroundTimerValue.get();
    mc.getNetHandler().addToSendQueue(new C03PacketPlayer.C04PacketPlayerPosition(mc.thePlayer.posX, mc.thePlayer.posY, mc.thePlayer.posZ, true));
}
 
Example #13
Source File: AntiFire.java    From ehacks-pro with GNU General Public License v3.0 5 votes vote down vote up
@Override
public void onTicks() {
    if (!WaterWalk.isOnLiquid(Wrapper.INSTANCE.player().boundingBox) && Wrapper.INSTANCE.player().isBurning() && Wrapper.INSTANCE.player().onGround) {
        for (int i = 0; i < 10; ++i) {
            Wrapper.INSTANCE.player().sendQueue.addToSendQueue(new C03PacketPlayer(false));
        }
    }
}
 
Example #14
Source File: FreeCam.java    From LiquidBounce with GNU General Public License v3.0 5 votes vote down vote up
@EventTarget
public void onPacket(PacketEvent event) {
    final Packet<?> packet = event.getPacket();

    if(packet instanceof C03PacketPlayer || packet instanceof C0BPacketEntityAction)
        event.cancelEvent();
}
 
Example #15
Source File: TeleportHit.java    From LiquidBounce with GNU General Public License v3.0 5 votes vote down vote up
@EventTarget
public void onMotion(MotionEvent event) {
    if(event.getEventState() != EventState.PRE)
        return;

    final Entity facedEntity = RaycastUtils.raycastEntity(100D, raycastedEntity -> raycastedEntity instanceof EntityLivingBase);
    if(mc.gameSettings.keyBindAttack.isKeyDown() && EntityUtils.isSelected(facedEntity, true) && facedEntity.getDistanceSqToEntity(mc.thePlayer) >= 1D)
        targetEntity = (EntityLivingBase) facedEntity;

    if(targetEntity != null) {
        if(!shouldHit) {
            shouldHit = true;
            return;
        }

        if(mc.thePlayer.fallDistance > 0F) {
            final Vec3 rotationVector = RotationUtils.getVectorForRotation(new Rotation(mc.thePlayer.rotationYaw, 0F));
            final double x = mc.thePlayer.posX + rotationVector.xCoord * (mc.thePlayer.getDistanceToEntity(targetEntity) - 1.0F);
            final double z = mc.thePlayer.posZ + rotationVector.zCoord * (mc.thePlayer.getDistanceToEntity(targetEntity) - 1.0F);
            final double y = targetEntity.getPosition().getY() + 0.25D;

            PathUtils.findPath(x, y + 1.0D, z, 4D).forEach(pos -> mc.getNetHandler().addToSendQueue(new C03PacketPlayer.C04PacketPlayerPosition(pos.getX(), pos.getY(), pos.getZ(), false)));

            mc.thePlayer.swingItem();
            mc.thePlayer.sendQueue.addToSendQueue(new C02PacketUseEntity(targetEntity, C02PacketUseEntity.Action.ATTACK));
            mc.thePlayer.onCriticalHit(targetEntity);
            shouldHit = false;
            targetEntity = null;
        }else if(mc.thePlayer.onGround)
            mc.thePlayer.jump();
    }else
        shouldHit = false;
}
 
Example #16
Source File: NoFall.java    From ehacks-pro with GNU General Public License v3.0 4 votes vote down vote up
@Override
public void onTicks() {
    if (Wrapper.INSTANCE.player().fallDistance > 2.0f) {
        Wrapper.INSTANCE.player().sendQueue.addToSendQueue(new C03PacketPlayer.C04PacketPlayerPosition(Wrapper.INSTANCE.player().motionX, -999.0, -999.0, Wrapper.INSTANCE.player().motionZ, !Wrapper.INSTANCE.player().onGround));
    }
}
 
Example #17
Source File: FakeNetServerHandler.java    From Gadomancy with GNU Lesser General Public License v3.0 4 votes vote down vote up
@Override
public void processPlayer(C03PacketPlayer p_147347_1_) {
}
 
Example #18
Source File: ServerCrasher.java    From LiquidBounce with GNU General Public License v3.0 4 votes vote down vote up
@EventTarget
public void onMotion(final MotionEvent event) {
    if(event.getEventState() == EventState.POST)
        return;

    switch(modeValue.get().toLowerCase()) {
        case "book":
            final ItemStack bookStack = new ItemStack(Items.writable_book);
            final NBTTagCompound bookCompound = new NBTTagCompound();

            bookCompound.setString("author", RandomUtils.randomNumber(20));
            bookCompound.setString("title", RandomUtils.randomNumber(20));

            final NBTTagList pageList = new NBTTagList();
            final String pageText = RandomUtils.randomNumber(600);

            for(int page = 0; page < 50; page++)
                pageList.appendTag(new NBTTagString(pageText));

            bookCompound.setTag("pages", pageList);
            bookStack.setTagCompound(bookCompound);

            for(int packets = 0; packets < 100; packets++) {
                final PacketBuffer packetBuffer = new PacketBuffer(Unpooled.buffer());
                packetBuffer.writeItemStackToBuffer(bookStack);
                mc.getNetHandler().addToSendQueue(new C17PacketCustomPayload(new Random().nextBoolean() ? "MC|BSign" : "MC|BEdit", packetBuffer));
            }
            break;
        case "cubecraft":
            final double x = mc.thePlayer.posX;
            final double y = mc.thePlayer.posY;
            final double z = mc.thePlayer.posZ;

            for(int i = 0; i < 3000; ++i) {
                mc.getNetHandler().addToSendQueue(new C03PacketPlayer.C04PacketPlayerPosition(x,
                        y + 0.09999999999999D, z, false));
                mc.getNetHandler().addToSendQueue(new C03PacketPlayer.C04PacketPlayerPosition(x, y, z, true));
            }
            mc.thePlayer.motionY = 0;
            break;
        case "pex":
            if(pexTimer.hasTimePassed(2000)) {
                // Send crash command
                mc.thePlayer.sendChatMessage(new Random().nextBoolean() ? "/pex promote a a" : "/pex demote a a");
                pexTimer.reset();
            }
            break;
        case "swing":
            for (int i = 0; i < 5000; i++)
                mc.getNetHandler().addToSendQueue(new C0APacketAnimation());
            break;
        default:
            setState(false); // Disable module when mode is just a one run crasher
            break;
    }
}
 
Example #19
Source File: WaterFall.java    From ehacks-pro with GNU General Public License v3.0 4 votes vote down vote up
private void useItem() {
    ItemStack item = Wrapper.INSTANCE.player().inventory.getCurrentItem();
    Wrapper.INSTANCE.player().sendQueue.addToSendQueue(new C03PacketPlayer.C05PacketPlayerLook(90.0f, 90.0f, false));
    Wrapper.INSTANCE.mc().playerController.sendUseItem(Wrapper.INSTANCE.player(), Wrapper.INSTANCE.world(), item);
    Wrapper.INSTANCE.player().sendQueue.addToSendQueue(new C08PacketPlayerBlockPlacement((int) Wrapper.INSTANCE.player().posX, Wrapper.INSTANCE.world().getHeightValue((int) Wrapper.INSTANCE.player().posX, (int) Wrapper.INSTANCE.player().posZ), (int) Wrapper.INSTANCE.player().posZ, -1, item, 0.0f, 0.0f, 0.0f));
}
 
Example #20
Source File: MixinEntityPlayerSP.java    From LiquidBounce with GNU General Public License v3.0 4 votes vote down vote up
/**
 * @author CCBlueX
 */
@Overwrite
public void onUpdateWalkingPlayer() {
    try {
        LiquidBounce.eventManager.callEvent(new MotionEvent(EventState.PRE));

        final InventoryMove inventoryMove = (InventoryMove) LiquidBounce.moduleManager.getModule(InventoryMove.class);
        final Sneak sneak = (Sneak) LiquidBounce.moduleManager.getModule(Sneak.class);
        final boolean fakeSprint = (inventoryMove.getState() && inventoryMove.getAacAdditionProValue().get()) || LiquidBounce.moduleManager.getModule(AntiHunger.class).getState() || (sneak.getState() && (!MovementUtils.isMoving() || !sneak.stopMoveValue.get()) && sneak.modeValue.get().equalsIgnoreCase("MineSecure"));

        boolean sprinting = this.isSprinting() && !fakeSprint;

        if (sprinting != this.serverSprintState) {
            if (sprinting)
                this.sendQueue.addToSendQueue(new C0BPacketEntityAction((EntityPlayerSP) (Object) this, C0BPacketEntityAction.Action.START_SPRINTING));
            else
                this.sendQueue.addToSendQueue(new C0BPacketEntityAction((EntityPlayerSP) (Object) this, C0BPacketEntityAction.Action.STOP_SPRINTING));

            this.serverSprintState = sprinting;
        }

        boolean sneaking = this.isSneaking();

        if (sneaking != this.serverSneakState && (!sneak.getState() || sneak.modeValue.get().equalsIgnoreCase("Legit"))) {
            if (sneaking)
                this.sendQueue.addToSendQueue(new C0BPacketEntityAction((EntityPlayerSP) (Object) this, C0BPacketEntityAction.Action.START_SNEAKING));
            else
                this.sendQueue.addToSendQueue(new C0BPacketEntityAction((EntityPlayerSP) (Object) this, C0BPacketEntityAction.Action.STOP_SNEAKING));

            this.serverSneakState = sneaking;
        }

        if (this.isCurrentViewEntity()) {
            float yaw = rotationYaw;
            float pitch = rotationPitch;
            float lastReportedYaw = RotationUtils.serverRotation.getYaw();
            float lastReportedPitch = RotationUtils.serverRotation.getPitch();

            final Derp derp = (Derp) LiquidBounce.moduleManager.getModule(Derp.class);
            if (derp.getState()) {
                float[] rot = derp.getRotation();
                yaw = rot[0];
                pitch = rot[1];
            }

            if (RotationUtils.targetRotation != null) {
                yaw = RotationUtils.targetRotation.getYaw();
                pitch = RotationUtils.targetRotation.getPitch();
            }

            double xDiff = this.posX - this.lastReportedPosX;
            double yDiff = this.getEntityBoundingBox().minY - this.lastReportedPosY;
            double zDiff = this.posZ - this.lastReportedPosZ;
            double yawDiff = (double) (yaw - lastReportedYaw);
            double pitchDiff = (double) (pitch - lastReportedPitch);
            boolean moved = xDiff * xDiff + yDiff * yDiff + zDiff * zDiff > 9.0E-4D || this.positionUpdateTicks >= 20;
            boolean rotated = yawDiff != 0.0D || pitchDiff != 0.0D;

            if (this.ridingEntity == null) {
                if (moved && rotated) {
                    this.sendQueue.addToSendQueue(new C03PacketPlayer.C06PacketPlayerPosLook(this.posX, this.getEntityBoundingBox().minY, this.posZ, yaw, pitch, this.onGround));
                } else if (moved) {
                    this.sendQueue.addToSendQueue(new C03PacketPlayer.C04PacketPlayerPosition(this.posX, this.getEntityBoundingBox().minY, this.posZ, this.onGround));
                } else if (rotated) {
                    this.sendQueue.addToSendQueue(new C03PacketPlayer.C05PacketPlayerLook(yaw, pitch, this.onGround));
                } else {
                    this.sendQueue.addToSendQueue(new C03PacketPlayer(this.onGround));
                }
            } else {
                this.sendQueue.addToSendQueue(new C03PacketPlayer.C06PacketPlayerPosLook(this.motionX, -999.0D, this.motionZ, yaw, pitch, this.onGround));
                moved = false;
            }

            ++this.positionUpdateTicks;

            if (moved) {
                this.lastReportedPosX = this.posX;
                this.lastReportedPosY = this.getEntityBoundingBox().minY;
                this.lastReportedPosZ = this.posZ;
                this.positionUpdateTicks = 0;
            }

            if (rotated) {
                this.lastReportedYaw = this.rotationYaw;
                this.lastReportedPitch = this.rotationPitch;
            }
        }

        LiquidBounce.eventManager.callEvent(new MotionEvent(EventState.POST));
    } catch (final Exception e) {
        e.printStackTrace();
    }
}
 
Example #21
Source File: MixinEntityPlayerSP.java    From LiquidBounce with GNU General Public License v3.0 4 votes vote down vote up
/**
 * @author CCBlueX
 */
@Overwrite
public void onUpdateWalkingPlayer() {
    try {
        LiquidBounce.eventManager.callEvent(new MotionEvent(EventState.PRE));

        final InventoryMove inventoryMove = (InventoryMove) LiquidBounce.moduleManager.getModule(InventoryMove.class);
        final Sneak sneak = (Sneak) LiquidBounce.moduleManager.getModule(Sneak.class);
        final boolean fakeSprint = (inventoryMove.getState() && inventoryMove.getAacAdditionProValue().get()) || LiquidBounce.moduleManager.getModule(AntiHunger.class).getState() || (sneak.getState() && (!MovementUtils.isMoving() || !sneak.stopMoveValue.get()) && sneak.modeValue.get().equalsIgnoreCase("MineSecure"));

        boolean sprinting = this.isSprinting() && !fakeSprint;

        if (sprinting != this.serverSprintState) {
            if (sprinting)
                this.sendQueue.addToSendQueue(new C0BPacketEntityAction((EntityPlayerSP) (Object) this, C0BPacketEntityAction.Action.START_SPRINTING));
            else
                this.sendQueue.addToSendQueue(new C0BPacketEntityAction((EntityPlayerSP) (Object) this, C0BPacketEntityAction.Action.STOP_SPRINTING));

            this.serverSprintState = sprinting;
        }

        boolean sneaking = this.isSneaking();

        if (sneaking != this.serverSneakState && (!sneak.getState() || sneak.modeValue.get().equalsIgnoreCase("Legit"))) {
            if (sneaking)
                this.sendQueue.addToSendQueue(new C0BPacketEntityAction((EntityPlayerSP) (Object) this, C0BPacketEntityAction.Action.START_SNEAKING));
            else
                this.sendQueue.addToSendQueue(new C0BPacketEntityAction((EntityPlayerSP) (Object) this, C0BPacketEntityAction.Action.STOP_SNEAKING));

            this.serverSneakState = sneaking;
        }

        if (this.isCurrentViewEntity()) {
            float yaw = rotationYaw;
            float pitch = rotationPitch;
            float lastReportedYaw = RotationUtils.serverRotation.getYaw();
            float lastReportedPitch = RotationUtils.serverRotation.getPitch();

            final Derp derp = (Derp) LiquidBounce.moduleManager.getModule(Derp.class);
            if (derp.getState()) {
                float[] rot = derp.getRotation();
                yaw = rot[0];
                pitch = rot[1];
            }

            if (RotationUtils.targetRotation != null) {
                yaw = RotationUtils.targetRotation.getYaw();
                pitch = RotationUtils.targetRotation.getPitch();
            }

            double xDiff = this.posX - this.lastReportedPosX;
            double yDiff = this.getEntityBoundingBox().minY - this.lastReportedPosY;
            double zDiff = this.posZ - this.lastReportedPosZ;
            double yawDiff = (double) (yaw - lastReportedYaw);
            double pitchDiff = (double) (pitch - lastReportedPitch);
            boolean moved = xDiff * xDiff + yDiff * yDiff + zDiff * zDiff > 9.0E-4D || this.positionUpdateTicks >= 20;
            boolean rotated = yawDiff != 0.0D || pitchDiff != 0.0D;

            if (this.ridingEntity == null) {
                if (moved && rotated) {
                    this.sendQueue.addToSendQueue(new C03PacketPlayer.C06PacketPlayerPosLook(this.posX, this.getEntityBoundingBox().minY, this.posZ, yaw, pitch, this.onGround));
                } else if (moved) {
                    this.sendQueue.addToSendQueue(new C03PacketPlayer.C04PacketPlayerPosition(this.posX, this.getEntityBoundingBox().minY, this.posZ, this.onGround));
                } else if (rotated) {
                    this.sendQueue.addToSendQueue(new C03PacketPlayer.C05PacketPlayerLook(yaw, pitch, this.onGround));
                } else {
                    this.sendQueue.addToSendQueue(new C03PacketPlayer(this.onGround));
                }
            } else {
                this.sendQueue.addToSendQueue(new C03PacketPlayer.C06PacketPlayerPosLook(this.motionX, -999.0D, this.motionZ, yaw, pitch, this.onGround));
                moved = false;
            }

            ++this.positionUpdateTicks;

            if (moved) {
                this.lastReportedPosX = this.posX;
                this.lastReportedPosY = this.getEntityBoundingBox().minY;
                this.lastReportedPosZ = this.posZ;
                this.positionUpdateTicks = 0;
            }

            if (rotated) {
                this.lastReportedYaw = this.rotationYaw;
                this.lastReportedPitch = this.rotationPitch;
            }
        }

        LiquidBounce.eventManager.callEvent(new MotionEvent(EventState.POST));
    } catch (final Exception e) {
        e.printStackTrace();
    }
}
 
Example #22
Source File: ServerCrasher.java    From LiquidBounce with GNU General Public License v3.0 4 votes vote down vote up
@Override
public void onEnable() {
    if(mc.thePlayer == null)
        return;

    switch(modeValue.get().toLowerCase()) {
        case "aacnew":
            // Spam positions
            for(int index = 0; index < 9999; ++index)
                mc.getNetHandler().addToSendQueue(new C03PacketPlayer.C04PacketPlayerPosition(
                        mc.thePlayer.posX + 9412 * index,
                        mc.thePlayer.getEntityBoundingBox().minY + 9412 * index,
                        mc.thePlayer.posZ + 9412 * index,
                        true
                ));
            break;
        case "aacother":
            // Spam positions
            for(int index = 0; index < 9999; ++index)
                mc.getNetHandler().addToSendQueue(new C03PacketPlayer.C04PacketPlayerPosition(
                        mc.thePlayer.posX + 500000 * index,
                        mc.thePlayer.getEntityBoundingBox().minY + 500000 * index,
                        mc.thePlayer.posZ + 500000 * index,
                        true
                ));
            break;
        case "aacold":
            // Send negative infinity position
            mc.getNetHandler().addToSendQueue(new C03PacketPlayer.C04PacketPlayerPosition(Double.NEGATIVE_INFINITY,
                    Double.NEGATIVE_INFINITY, Double.NEGATIVE_INFINITY, true));
            break;
        case "worldedit":
            // Send crash command
            mc.thePlayer.sendChatMessage("//calc for(i=0;i<256;i++){for(a=0;a<256;a++){for(b=0;b<256;b++){for(c=0;c<256;c++){}}}}");
            break;
        case "cubecraft":
            // Not really needed but doesn't matter
            mc.thePlayer.setPosition(mc.thePlayer.posX, mc.thePlayer.posY + 0.3D, mc.thePlayer.posZ);
            break;
        case "massivechunkloading":
            // Fly up into sky
            for(double yPos = mc.thePlayer.posY; yPos < 255; yPos += 5)
                mc.getNetHandler().addToSendQueue(new C03PacketPlayer.C04PacketPlayerPosition(mc.thePlayer.posX,
                        yPos, mc.thePlayer.posZ, true));

            // Fly over world
            for(int i = 0; i < (1337 * 5); i += 5) {
                mc.getNetHandler().addToSendQueue(new C03PacketPlayer.C04PacketPlayerPosition(
                        mc.thePlayer.posX + i, 255, mc.thePlayer.posZ + i, true
                ));
            }
            break;
    }
}
 
Example #23
Source File: Fly.java    From LiquidBounce with GNU General Public License v3.0 4 votes vote down vote up
private void handleVanillaKickBypass() {
    if(!vanillaKickBypassValue.get() || !groundTimer.hasTimePassed(1000)) return;

    final double ground = calculateGround();

    for(double posY = mc.thePlayer.posY; posY > ground; posY -= 8D) {
        mc.getNetHandler().addToSendQueue(new C03PacketPlayer.C04PacketPlayerPosition(mc.thePlayer.posX, posY, mc.thePlayer.posZ, true));

        if(posY - 8D < ground) break; // Prevent next step
    }

    mc.getNetHandler().addToSendQueue(new C03PacketPlayer.C04PacketPlayerPosition(mc.thePlayer.posX, ground, mc.thePlayer.posZ, true));


    for(double posY = ground; posY < mc.thePlayer.posY; posY += 8D) {
        mc.getNetHandler().addToSendQueue(new C03PacketPlayer.C04PacketPlayerPosition(mc.thePlayer.posX, posY, mc.thePlayer.posZ, true));

        if(posY + 8D > mc.thePlayer.posY) break; // Prevent next step
    }

    mc.getNetHandler().addToSendQueue(new C03PacketPlayer.C04PacketPlayerPosition(mc.thePlayer.posX, mc.thePlayer.posY, mc.thePlayer.posZ, true));

    groundTimer.reset();
}
 
Example #24
Source File: Fly.java    From LiquidBounce with GNU General Public License v3.0 4 votes vote down vote up
@Override
public void onEnable() {
    if(mc.thePlayer == null)
        return;

    flyTimer.reset();

    noPacketModify = true;

    double x = mc.thePlayer.posX;
    double y = mc.thePlayer.posY;
    double z = mc.thePlayer.posZ;

    final String mode = modeValue.get();

    switch(mode.toLowerCase()) {
        case "ncp":
            if(!mc.thePlayer.onGround)
                break;

            for(int i = 0; i < 65; ++i) {
                mc.getNetHandler().addToSendQueue(new C03PacketPlayer.C04PacketPlayerPosition(x, y + 0.049D, z, false));
                mc.getNetHandler().addToSendQueue(new C03PacketPlayer.C04PacketPlayerPosition(x, y, z, false));
            }
            mc.getNetHandler().addToSendQueue(new C03PacketPlayer.C04PacketPlayerPosition(x, y + 0.1D, z, true));

            mc.thePlayer.motionX *= 0.1D;
            mc.thePlayer.motionZ *= 0.1D;
            mc.thePlayer.swingItem();
            break;
        case "oldncp":
            if(!mc.thePlayer.onGround)
                break;

            for(int i = 0; i < 4; i++) {
                mc.getNetHandler().addToSendQueue(new C03PacketPlayer.C04PacketPlayerPosition(x, y + 1.01, z, false));
                mc.getNetHandler().addToSendQueue(new C03PacketPlayer.C04PacketPlayerPosition(x, y, z, false));
            }
            mc.thePlayer.jump();
            mc.thePlayer.swingItem();
            break;
        case "bugspartan":
            for(int i = 0; i < 65; ++i) {
                mc.getNetHandler().addToSendQueue(new C03PacketPlayer.C04PacketPlayerPosition(x, y + 0.049D, z, false));
                mc.getNetHandler().addToSendQueue(new C03PacketPlayer.C04PacketPlayerPosition(x, y, z, false));
            }
            mc.getNetHandler().addToSendQueue(new C03PacketPlayer.C04PacketPlayerPosition(x, y + 0.1D, z, true));

            mc.thePlayer.motionX *= 0.1D;
            mc.thePlayer.motionZ *= 0.1D;
            mc.thePlayer.swingItem();
            break;
        case "infinitycubecraft":
            ClientUtils.displayChatMessage("§8[§c§lCubeCraft-§a§lFly§8] §aPlace a block before landing.");
            break;
        case "infinityvcubecraft":
            ClientUtils.displayChatMessage("§8[§c§lCubeCraft-§a§lFly§8] §aPlace a block before landing.");

            mc.thePlayer.setPosition(mc.thePlayer.posX, mc.thePlayer.posY + 2, mc.thePlayer.posZ);
            break;
        case "boosthypixel":
            if(!mc.thePlayer.onGround) break;

            for (int i = 0; i < 10; i++) //Imagine flagging to NCP.
                mc.getNetHandler().addToSendQueue(new C03PacketPlayer.C04PacketPlayerPosition(mc.thePlayer.posX, mc.thePlayer.posY, mc.thePlayer.posZ, true));
            
            double fallDistance = 3.0125; //add 0.0125 to ensure we get the fall dmg
            while (fallDistance > 0) {
                mc.getNetHandler().addToSendQueue(new C03PacketPlayer.C04PacketPlayerPosition(mc.thePlayer.posX, mc.thePlayer.posY + 0.0624986421, mc.thePlayer.posZ, false));
                mc.getNetHandler().addToSendQueue(new C03PacketPlayer.C04PacketPlayerPosition(mc.thePlayer.posX, mc.thePlayer.posY + 0.0625      , mc.thePlayer.posZ, false));
                mc.getNetHandler().addToSendQueue(new C03PacketPlayer.C04PacketPlayerPosition(mc.thePlayer.posX, mc.thePlayer.posY + 0.0624986421, mc.thePlayer.posZ, false));
                mc.getNetHandler().addToSendQueue(new C03PacketPlayer.C04PacketPlayerPosition(mc.thePlayer.posX, mc.thePlayer.posY + 0.0000013579, mc.thePlayer.posZ, false));
                fallDistance -= 0.0624986421;
            }
            mc.getNetHandler().addToSendQueue(new C03PacketPlayer.C04PacketPlayerPosition(mc.thePlayer.posX, mc.thePlayer.posY, mc.thePlayer.posZ, true));
            
            mc.thePlayer.jump();
            mc.thePlayer.posY += 0.42F; // Visual
            boostHypixelState = 1;
            moveSpeed = 0.1D;
            lastDistance = 0D;
            failedStart = false;
            break;
    }

    startY = mc.thePlayer.posY;
    aacJump = -3.8D;
    noPacketModify = false;

    if(mode.equalsIgnoreCase("freehypixel")) {
        freeHypixelTimer.reset();
        mc.thePlayer.setPositionAndUpdate(mc.thePlayer.posX, mc.thePlayer.posY + 0.42D, mc.thePlayer.posZ);
        freeHypixelYaw = mc.thePlayer.rotationYaw;
        freeHypixelPitch = mc.thePlayer.rotationPitch;
    }
    super.onEnable();
}
 
Example #25
Source File: NoFall.java    From LiquidBounce with GNU General Public License v3.0 4 votes vote down vote up
@EventTarget(ignoreCondition = true)
public void onUpdate(UpdateEvent event) {
    if (mc.thePlayer.onGround)
        jumped = false;

    if (mc.thePlayer.motionY > 0)
        jumped = true;

    if (!getState() || LiquidBounce.moduleManager.getModule(FreeCam.class).getState())
        return;

    if (BlockUtils.collideBlock(mc.thePlayer.getEntityBoundingBox(), block -> block instanceof BlockLiquid) ||
            BlockUtils.collideBlock(new AxisAlignedBB(mc.thePlayer.getEntityBoundingBox().maxX, mc.thePlayer.getEntityBoundingBox().maxY, mc.thePlayer.getEntityBoundingBox().maxZ, mc.thePlayer.getEntityBoundingBox().minX, mc.thePlayer.getEntityBoundingBox().minY - 0.01D, mc.thePlayer.getEntityBoundingBox().minZ), block -> block instanceof BlockLiquid))
        return;

    switch (modeValue.get().toLowerCase()) {
        case "packet":
            if (mc.thePlayer.fallDistance > 2F)
                mc.getNetHandler().addToSendQueue(new C03PacketPlayer(true));
            break;
        case "cubecraft":
            if (mc.thePlayer.fallDistance > 2F) {
                mc.thePlayer.onGround = false;
                mc.thePlayer.sendQueue.addToSendQueue(new C03PacketPlayer(true));
            }
            break;
        case "aac":
            if (mc.thePlayer.fallDistance > 2F) {
                mc.getNetHandler().addToSendQueue(new C03PacketPlayer(true));
                state = 2;
            } else if (state == 2 && mc.thePlayer.fallDistance < 2) {
                mc.thePlayer.motionY = 0.1D;
                state = 3;
                return;
            }

            switch (state) {
                case 3:
                    mc.thePlayer.motionY = 0.1D;
                    state = 4;
                    break;
                case 4:
                    mc.thePlayer.motionY = 0.1D;
                    state = 5;
                    break;
                case 5:
                    mc.thePlayer.motionY = 0.1D;
                    state = 1;
                    break;
            }
            break;
        case "laac":
            if (!jumped && mc.thePlayer.onGround && !mc.thePlayer.isOnLadder() && !mc.thePlayer.isInWater()
                    && !mc.thePlayer.isInWeb)
                mc.thePlayer.motionY = -6;
            break;
        case "aac3.3.11":
            if (mc.thePlayer.fallDistance > 2) {
                mc.thePlayer.motionX = mc.thePlayer.motionZ = 0;
                mc.getNetHandler().addToSendQueue(new C03PacketPlayer.C04PacketPlayerPosition(mc.thePlayer.posX,
                        mc.thePlayer.posY - 10E-4D, mc.thePlayer.posZ, mc.thePlayer.onGround));
                mc.getNetHandler().addToSendQueue(new C03PacketPlayer(true));
            }
            break;
        case "aac3.3.15":
            if (mc.thePlayer.fallDistance > 2) {
                if (!mc.isIntegratedServerRunning())
                    mc.getNetHandler().addToSendQueue(new C03PacketPlayer.C04PacketPlayerPosition(mc.thePlayer.posX,
                            Double.NaN, mc.thePlayer.posZ, false));
                mc.thePlayer.fallDistance = -9999;
            }
            break;
        case "spartan":
            spartanTimer.update();

            if (mc.thePlayer.fallDistance > 1.5 && spartanTimer.hasTimePassed(10)) {
                mc.getNetHandler().addToSendQueue(new C03PacketPlayer.C04PacketPlayerPosition(mc.thePlayer.posX,
                        mc.thePlayer.posY + 10, mc.thePlayer.posZ, true));
                mc.getNetHandler().addToSendQueue(new C03PacketPlayer.C04PacketPlayerPosition(mc.thePlayer.posX,
                        mc.thePlayer.posY - 10, mc.thePlayer.posZ, true));
                spartanTimer.reset();
            }
            break;
    }
}
 
Example #26
Source File: Tower.java    From LiquidBounce with GNU General Public License v3.0 4 votes vote down vote up
/**
 * Move player
 */
private void move() {
    switch (modeValue.get().toLowerCase()) {
        case "jump":
            if (mc.thePlayer.onGround && timer.hasTimePassed(jumpDelayValue.get())) {
                fakeJump();
                mc.thePlayer.motionY = jumpMotionValue.get();
                timer.reset();
            }
            break;
        case "motion":
            if (mc.thePlayer.onGround) {
                fakeJump();
                mc.thePlayer.motionY = 0.42D;
            } else if (mc.thePlayer.motionY < 0.1D) mc.thePlayer.motionY = -0.3D;
            break;
        case "motiontp":
            if (mc.thePlayer.onGround) {
                fakeJump();
                mc.thePlayer.motionY = 0.42D;
            } else if (mc.thePlayer.motionY < 0.23D)
                mc.thePlayer.setPosition(mc.thePlayer.posX, (int) mc.thePlayer.posY, mc.thePlayer.posZ);
            break;
        case "packet":
            if (mc.thePlayer.onGround && timer.hasTimePassed(2)) {
                fakeJump();
                mc.getNetHandler().addToSendQueue(new C03PacketPlayer.C04PacketPlayerPosition(mc.thePlayer.posX,
                        mc.thePlayer.posY + 0.42D, mc.thePlayer.posZ, false));
                mc.getNetHandler().addToSendQueue(new C03PacketPlayer.C04PacketPlayerPosition(mc.thePlayer.posX,
                        mc.thePlayer.posY + 0.753D, mc.thePlayer.posZ, false));
                mc.thePlayer.setPosition(mc.thePlayer.posX, mc.thePlayer.posY + 1D, mc.thePlayer.posZ);
                timer.reset();
            }
            break;
        case "teleport":
            if (teleportNoMotionValue.get())
                mc.thePlayer.motionY = 0;

            if ((mc.thePlayer.onGround || !teleportGroundValue.get()) && timer.hasTimePassed(teleportDelayValue.get())) {
                fakeJump();
                mc.thePlayer.setPositionAndUpdate(mc.thePlayer.posX, mc.thePlayer.posY + teleportHeightValue.get(), mc.thePlayer.posZ);
                timer.reset();
            }
            break;
        case "constantmotion":
            if (mc.thePlayer.onGround) {
                fakeJump();
                jumpGround = mc.thePlayer.posY;
                mc.thePlayer.motionY = constantMotionValue.get();
            }

            if (mc.thePlayer.posY > jumpGround + constantMotionJumpGroundValue.get()) {
                fakeJump();
                mc.thePlayer.setPosition(mc.thePlayer.posX, (int) mc.thePlayer.posY, mc.thePlayer.posZ);
                mc.thePlayer.motionY = constantMotionValue.get();
                jumpGround = mc.thePlayer.posY;
            }
            break;
        case "aac3.3.9":
            if (mc.thePlayer.onGround) {
                fakeJump();
                mc.thePlayer.motionY = 0.4001;
            }
            mc.timer.timerSpeed = 1F;

            if (mc.thePlayer.motionY < 0) {
                mc.thePlayer.motionY -= 0.00000945;
                mc.timer.timerSpeed = 1.6F;
            }
            break;
        case "aac3.6.4":
            if (mc.thePlayer.ticksExisted % 4 == 1) {
                mc.thePlayer.motionY = 0.4195464;
                mc.thePlayer.setPosition(mc.thePlayer.posX - 0.035, mc.thePlayer.posY, mc.thePlayer.posZ);
            } else if (mc.thePlayer.ticksExisted % 4 == 0) {
                mc.thePlayer.motionY = -0.5;
                mc.thePlayer.setPosition(mc.thePlayer.posX + 0.035, mc.thePlayer.posY, mc.thePlayer.posZ);
            }
            break;
    }
}