Search in sources :

Example 6 with SpecItemSwitchItem

use of me.wallhacks.spark.util.player.itemswitcher.itemswitchers.SpecItemSwitchItem in project Spark-Client by Spark-Client-Development.

the class FastUse method useXp.

void useXp() {
    if (findExpInHotbar() == -1)
        return;
    didshit = true;
    ItemSwitcher.SwitchResult res = Spark.switchManager.getCalculateAction(new SpecItemSwitchItem(Items.EXPERIENCE_BOTTLE), ItemSwitcher.usedHand.Both, Spark.switchManager.getModeFromString(switchMode.getValue()));
    if (res != null && takeArmorOff()) {
        Spark.rotationManager.setFakePitch(90, 2);
        Spark.switchManager.Switch(res, Spark.switchManager.getModeFromString(switchMode.getValue()), 7);
        for (int i = 0; i < packets.getValue(); i++) {
            mc.player.connection.sendPacket(new CPacketPlayerTryUseItem(EnumHand.MAIN_HAND));
        }
    }
}
Also used : CPacketPlayerTryUseItem(net.minecraft.network.play.client.CPacketPlayerTryUseItem) SpecItemSwitchItem(me.wallhacks.spark.util.player.itemswitcher.itemswitchers.SpecItemSwitchItem) ItemSwitcher(me.wallhacks.spark.util.player.itemswitcher.ItemSwitcher)

Aggregations

SpecItemSwitchItem (me.wallhacks.spark.util.player.itemswitcher.itemswitchers.SpecItemSwitchItem)6 EnumHand (net.minecraft.util.EnumHand)4 CPacketAnimation (net.minecraft.network.play.client.CPacketAnimation)3 CPacketPlayerTryUseItemOnBlock (net.minecraft.network.play.client.CPacketPlayerTryUseItemOnBlock)3 EnumFacing (net.minecraft.util.EnumFacing)3 Vec3d (net.minecraft.util.math.Vec3d)3 FadePos (me.wallhacks.spark.util.objects.FadePos)2 RayTraceResult (net.minecraft.util.math.RayTraceResult)2 SubscribeEvent (net.minecraftforge.fml.common.eventhandler.SubscribeEvent)2 MBlockPos (com.github.lunatrius.core.util.math.MBlockPos)1 BlockInteractUtil (me.wallhacks.spark.util.player.BlockInteractUtil)1 ItemSwitcher (me.wallhacks.spark.util.player.itemswitcher.ItemSwitcher)1 SpecBlockSwitchItem (me.wallhacks.spark.util.player.itemswitcher.itemswitchers.SpecBlockSwitchItem)1 Entity (net.minecraft.entity.Entity)1 EntityWither (net.minecraft.entity.boss.EntityWither)1 CPacketPlayer (net.minecraft.network.play.client.CPacketPlayer)1 CPacketPlayerDigging (net.minecraft.network.play.client.CPacketPlayerDigging)1 CPacketPlayerTryUseItem (net.minecraft.network.play.client.CPacketPlayerTryUseItem)1 BlockPos (net.minecraft.util.math.BlockPos)1