From db81e773f8de029f0beba2c22b89b813180d8d1f Mon Sep 17 00:00:00 2001 From: blockparole <48992448+blockparole@users.noreply.github.com> Date: Thu, 21 Nov 2019 19:27:56 +0100 Subject: [PATCH] add seppukus fastbow --- .../kami/module/modules/combat/FastBow.java | 25 +++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 src/main/java/me/zeroeightsix/kami/module/modules/combat/FastBow.java diff --git a/src/main/java/me/zeroeightsix/kami/module/modules/combat/FastBow.java b/src/main/java/me/zeroeightsix/kami/module/modules/combat/FastBow.java new file mode 100644 index 00000000..75bc59f3 --- /dev/null +++ b/src/main/java/me/zeroeightsix/kami/module/modules/combat/FastBow.java @@ -0,0 +1,25 @@ +package me.zeroeightsix.kami.module.modules.combat; + +import me.zeroeightsix.kami.module.Module; +import net.minecraft.network.play.client.CPacketPlayerDigging; +import net.minecraft.network.play.client.CPacketPlayerTryUseItem; +import net.minecraft.util.math.BlockPos; + +/** + * Author Seth 4/30/2019 @ 4:27 AM. + *

+ * see github.com/seppukudevelopment/seppuku + */ +@Module.Info(name = "FastBow", description = "Fast Bow Release", category = Module.Category.COMBAT) +public class FastBow extends Module { + + @Override + public void onUpdate() { + if (mc.player.inventory.getCurrentItem().getItem() instanceof net.minecraft.item.ItemBow && + mc.player.isHandActive() && mc.player.getItemInUseMaxCount() >= 3) { + mc.player.connection.sendPacket(new CPacketPlayerDigging(CPacketPlayerDigging.Action.RELEASE_USE_ITEM, BlockPos.ORIGIN, mc.player.getHorizontalFacing())); + mc.player.connection.sendPacket(new CPacketPlayerTryUseItem(mc.player.getActiveHand())); + mc.player.stopActiveHand(); + } + } +}